• Kuninori Morimoto's avatar
    ASoC: hdmi-codec: enable multi probe for same device · 9731f82d
    Kuninori Morimoto authored
    hdmi-codec driver is common HDMI sound driver,
    but it doesn't care about multi sound ports.
    For example, hdmi-codec driver is supporting 1 I2S and 1 SPDIF ports,
    so, we can't use this driver if HDMI has 2 or more I2S ports.
    
    And we would like to use multi detection.
    For example, DesignWare HDMI driver is providing dw_hdmi_bind() to
    DRM/KMS driver, and it will setups HDMI video/sound.
    Note is that it will be called under for_each loop of ports.
    
    int dw_hdmi_bind(xxx)
    {
            /* register hdmi-codec driver here */
    }
    
    static int xxx_probe(struct platform_device *pdev)
    {
            for_each_xxx(xx) {
                    ...
                    dw_hdmi_bind(xxx);
                    ...
            }
    }
    
    This case, dw_hdmi_bind() would like to use hdmi-codec,
    and it will be called multiple times for each ports.
    
    Here, ASoC's CPU/Codec/Card bind will checks each "of_node" on DT,
    and hdmi-codec driver is assuming its parent device for it.
    But it doesn't care about case.
    Thus, ASoC never detect correct sound card in this case.
    
    To solve this issue, this patch checks each parent device,
    and names "hdmi-hifi.x" in order to each ports.
    And uses struct snd_soc_component_driver :: of_xlate_dai_name
    for snd_soc_get_dai_name().
    Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    9731f82d
hdmi-codec.c 12 KB