diff options
author | Olivier Moysan <olivier.moysan@st.com> | 2019-07-03 10:04:12 +0200 |
---|---|---|
committer | Benjamin Gaignard <benjamin.gaignard@linaro.org> | 2019-07-25 14:20:02 +0200 |
commit | 17224cf29cbb5c496d08ffecc9db3c5e6cf09551 (patch) | |
tree | ec815121ceebb6ad0fe87b53ffde5b9923f42e62 /drivers/gpu/drm | |
parent | 6b72c7a98bd631533c4f4ab293c8082abbb42601 (diff) |
drm/bridge: sii902x: add audio graph card support
Implement get_dai_id callback of audio HDMI codec
to support ASoC audio graph card.
HDMI audio output has to be connected to sii902x port 3.
get_dai_id callback maps this port to ASoC DAI index 0.
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1562141052-26221-1-git-send-email-olivier.moysan@st.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/bridge/sii902x.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index a323815aa9b6..38f75ac580df 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -158,6 +158,8 @@ #define SII902X_I2C_BUS_ACQUISITION_TIMEOUT_MS 500 +#define SII902X_AUDIO_PORT_INDEX 3 + struct sii902x { struct i2c_client *i2c; struct regmap *regmap; @@ -692,11 +694,32 @@ static int sii902x_audio_get_eld(struct device *dev, void *data, return 0; } +static int sii902x_audio_get_dai_id(struct snd_soc_component *component, + struct device_node *endpoint) +{ + struct of_endpoint of_ep; + int ret; + + ret = of_graph_parse_endpoint(endpoint, &of_ep); + if (ret < 0) + return ret; + + /* + * HDMI sound should be located at reg = <3> + * Return expected DAI index 0. + */ + if (of_ep.port == SII902X_AUDIO_PORT_INDEX) + return 0; + + return -EINVAL; +} + static const struct hdmi_codec_ops sii902x_audio_codec_ops = { .hw_params = sii902x_audio_hw_params, .audio_shutdown = sii902x_audio_shutdown, .digital_mute = sii902x_audio_digital_mute, .get_eld = sii902x_audio_get_eld, + .get_dai_id = sii902x_audio_get_dai_id, }; static int sii902x_audio_codec_init(struct sii902x *sii902x, |