Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: dw-hdmi-i2s: add .get_eld support

Provide the eld to the generic hdmi-codec driver.
This will let the driver enforce the maximum channel number and set the
channel allocation depending on the hdmi sink.

Cc: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190812125016.20169-1-jbrunet@baylibre.com

authored by

Jerome Brunet and committed by
Neil Armstrong
fc1ca6e0 43e88f67

+13
+1
drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h
··· 14 14 15 15 struct dw_hdmi_i2s_audio_data { 16 16 struct dw_hdmi *hdmi; 17 + u8 *eld; 17 18 18 19 void (*write)(struct dw_hdmi *hdmi, u8 val, int offset); 19 20 u8 (*read)(struct dw_hdmi *hdmi, int offset);
+11
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
··· 10 10 #include <linux/module.h> 11 11 12 12 #include <drm/bridge/dw_hdmi.h> 13 + #include <drm/drm_crtc.h> 13 14 14 15 #include <sound/hdmi-codec.h> 15 16 ··· 122 121 dw_hdmi_audio_disable(hdmi); 123 122 } 124 123 124 + static int dw_hdmi_i2s_get_eld(struct device *dev, void *data, uint8_t *buf, 125 + size_t len) 126 + { 127 + struct dw_hdmi_i2s_audio_data *audio = data; 128 + 129 + memcpy(buf, audio->eld, min_t(size_t, MAX_ELD_BYTES, len)); 130 + return 0; 131 + } 132 + 125 133 static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component, 126 134 struct device_node *endpoint) 127 135 { ··· 154 144 static struct hdmi_codec_ops dw_hdmi_i2s_ops = { 155 145 .hw_params = dw_hdmi_i2s_hw_params, 156 146 .audio_shutdown = dw_hdmi_i2s_audio_shutdown, 147 + .get_eld = dw_hdmi_i2s_get_eld, 157 148 .get_dai_id = dw_hdmi_i2s_get_dai_id, 158 149 }; 159 150
+1
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 2799 2799 struct dw_hdmi_i2s_audio_data audio; 2800 2800 2801 2801 audio.hdmi = hdmi; 2802 + audio.eld = hdmi->connector.eld; 2802 2803 audio.write = hdmi_writeb; 2803 2804 audio.read = hdmi_readb; 2804 2805 hdmi->enable_audio = dw_hdmi_i2s_audio_enable;