Message ID | 877f1fosji.wl%kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, May 18, 2017 at 01:40:47AM +0000, Kuninori Morimoto wrote: > ALSA SoC needs to know connected DAI ID for probing. > It is not a big problem if device/driver was only for sound, > but getting DAI ID will be difficult if device includes both > Video/Sound, like HDMI. As far as I understand what's going on with the graph code this seems to make sense to me. How do we want to go about handling the patch?
Hi Mark Cc: DRM maintainer > > ALSA SoC needs to know connected DAI ID for probing. > > It is not a big problem if device/driver was only for sound, > > but getting DAI ID will be difficult if device includes both > > Video/Sound, like HDMI. > > As far as I understand what's going on with the graph code this seems to > make sense to me. How do we want to go about handling the patch? This is comment to me ? or DRM maintainer ? If to me, any case (pickup by Mark, or by DRM maintainer) is OK for me Best regards --- Kuninori Morimoto
Hi, On 05/25/2017 05:04 AM, Kuninori Morimoto wrote: > > Hi Mark > Cc: DRM maintainer > >>> ALSA SoC needs to know connected DAI ID for probing. >>> It is not a big problem if device/driver was only for sound, >>> but getting DAI ID will be difficult if device includes both >>> Video/Sound, like HDMI. >> >> As far as I understand what's going on with the graph code this seems to >> make sense to me. How do we want to go about handling the patch? > > This is comment to me ? or DRM maintainer ? > > If to me, any case (pickup by Mark, or by DRM maintainer) is OK for me I'll pick it up for drm-misc-next. Thanks, Archit > > Best regards > --- > Kuninori Morimoto >
On 05/26/2017 09:46 AM, Archit Taneja wrote: > Hi, > > On 05/25/2017 05:04 AM, Kuninori Morimoto wrote: >> >> Hi Mark >> Cc: DRM maintainer >> >>>> ALSA SoC needs to know connected DAI ID for probing. >>>> It is not a big problem if device/driver was only for sound, >>>> but getting DAI ID will be difficult if device includes both >>>> Video/Sound, like HDMI. >>> >>> As far as I understand what's going on with the graph code this seems to >>> make sense to me. How do we want to go about handling the patch? >> >> This is comment to me ? or DRM maintainer ? >> >> If to me, any case (pickup by Mark, or by DRM maintainer) is OK for me > > I'll pick it up for drm-misc-next. Ah, I just saw the dependence on the previous patches. Mark, Please feel free to pull this to the asoc tree. You can add my Ack: Acked-by: Archit Taneja <architt@codeaurora.org> Thanks, Archit > > Thanks, > Archit > >> >> Best regards >> --- >> Kuninori Morimoto >> >
On Wed, May 24, 2017 at 11:34:46PM +0000, Kuninori Morimoto wrote: > > As far as I understand what's going on with the graph code this seems to > > make sense to me. How do we want to go about handling the patch? > This is comment to me ? or DRM maintainer ? > If to me, any case (pickup by Mark, or by DRM maintainer) is OK for me The world in general - mainly the DRM people I guess.
diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt b/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt index f6b3f36..81b6858 100644 --- a/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt +++ b/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt @@ -25,7 +25,8 @@ Required properties: - clock-names: Shall contain "iahb" and "isfr" as defined in dw_hdmi.txt. - ports: See dw_hdmi.txt. The DWC HDMI shall have one port numbered 0 corresponding to the video input of the controller and one port numbered 1 - corresponding to its HDMI output. Each port shall have a single endpoint. + corresponding to its HDMI output, and one port numbered 2 corresponding to + sound input of the controller. Each port shall have a single endpoint. Optional properties: @@ -59,6 +60,12 @@ Example: remote-endpoint = <&hdmi0_con>; }; }; + port@2 { + reg = <2>; + rcar_dw_hdmi0_sound_in: endpoint { + remote-endpoint = <&hdmi_sound_out>; + }; + }; }; }; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c index aaf287d..b2cf59f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c @@ -82,9 +82,30 @@ static void dw_hdmi_i2s_audio_shutdown(struct device *dev, void *data) hdmi_write(audio, HDMI_AUD_CONF0_SW_RESET, HDMI_AUD_CONF0); } +static int dw_hdmi_i2s_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 as reg = <2> + * Then, it is sound port 0 + */ + if (of_ep.port == 2) + return 0; + + return -EINVAL; +} + static struct hdmi_codec_ops dw_hdmi_i2s_ops = { .hw_params = dw_hdmi_i2s_hw_params, .audio_shutdown = dw_hdmi_i2s_audio_shutdown, + .get_dai_id = dw_hdmi_i2s_get_dai_id, }; static int snd_dw_hdmi_probe(struct platform_device *pdev)