Message ID | 20231128123914.3986-1-peter.ujfalusi@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 3acc58f55edf786971898fdb6bc180bc77acb2a6 |
Headers | show |
Series | [v2] ASoC: hdac_hda: Conditionally register dais for HDMI and Analog | expand |
Hi, On Tue, 28 Nov 2023, Peter Ujfalusi wrote: > The current driver is registering the same dais for each hdev found in the > system which results duplicated widgets to be registered and the kernel > log contains similar prints: [...] > Changes since v1: > - Drop the patch for patch_hdmi to export a funtion to match the device > - Use the struct hdac_hda_priv.need_display_power boolean as indication that the > device is a HDMI/DP audio codec thanks, this works as well: Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Br, Kai
On 11/28/23 06:39, Peter Ujfalusi wrote: > The current driver is registering the same dais for each hdev found in the > system which results duplicated widgets to be registered and the kernel > log contains similar prints: > snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten > snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten > > To avoid such issue, split the dai array into HDMI and non HDMI array and > register them conditionally: > for HDMI hdev only register the dais needed for HDMI > for non HDMI hdev do not register the HDMI dais. > > Depends-on: 3d1dc8b1030d ("ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available") > Link: https://github.com/thesofproject/linux/issues/4509 > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> > --- > Hi, > > Changes since v1: > - Drop the patch for patch_hdmi to export a funtion to match the device > - Use the struct hdac_hda_priv.need_display_power boolean as indication that the > device is a HDMI/DP audio codec LGTM. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> > Regards, > Peter > > sound/soc/codecs/hdac_hda.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c > index 355f30779a34..b075689db2dc 100644 > --- a/sound/soc/codecs/hdac_hda.c > +++ b/sound/soc/codecs/hdac_hda.c > @@ -132,6 +132,9 @@ static struct snd_soc_dai_driver hdac_hda_dais[] = { > .sig_bits = 24, > }, > }, > +}; > + > +static struct snd_soc_dai_driver hdac_hda_hdmi_dais[] = { > { > .id = HDAC_HDMI_0_DAI_ID, > .name = "intel-hdmi-hifi1", > @@ -607,8 +610,16 @@ static const struct snd_soc_component_driver hdac_hda_codec = { > .endianness = 1, > }; > > +static const struct snd_soc_component_driver hdac_hda_hdmi_codec = { > + .probe = hdac_hda_codec_probe, > + .remove = hdac_hda_codec_remove, > + .idle_bias_on = false, > + .endianness = 1, > +}; > + > static int hdac_hda_dev_probe(struct hdac_device *hdev) > { > + struct hdac_hda_priv *hda_pvt = dev_get_drvdata(&hdev->dev); > struct hdac_ext_link *hlink; > int ret; > > @@ -621,9 +632,15 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev) > snd_hdac_ext_bus_link_get(hdev->bus, hlink); > > /* ASoC specific initialization */ > - ret = devm_snd_soc_register_component(&hdev->dev, > - &hdac_hda_codec, hdac_hda_dais, > - ARRAY_SIZE(hdac_hda_dais)); > + if (hda_pvt->need_display_power) > + ret = devm_snd_soc_register_component(&hdev->dev, > + &hdac_hda_hdmi_codec, hdac_hda_hdmi_dais, > + ARRAY_SIZE(hdac_hda_hdmi_dais)); > + else > + ret = devm_snd_soc_register_component(&hdev->dev, > + &hdac_hda_codec, hdac_hda_dais, > + ARRAY_SIZE(hdac_hda_dais)); > + > if (ret < 0) { > dev_err(&hdev->dev, "failed to register HDA codec %d\n", ret); > return ret;
On Tue, 28 Nov 2023 14:39:14 +0200, Peter Ujfalusi wrote: > The current driver is registering the same dais for each hdev found in the > system which results duplicated widgets to be registered and the kernel > log contains similar prints: > snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten > snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten > skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: hdac_hda: Conditionally register dais for HDMI and Analog commit: 3acc58f55edf786971898fdb6bc180bc77acb2a6 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c index 355f30779a34..b075689db2dc 100644 --- a/sound/soc/codecs/hdac_hda.c +++ b/sound/soc/codecs/hdac_hda.c @@ -132,6 +132,9 @@ static struct snd_soc_dai_driver hdac_hda_dais[] = { .sig_bits = 24, }, }, +}; + +static struct snd_soc_dai_driver hdac_hda_hdmi_dais[] = { { .id = HDAC_HDMI_0_DAI_ID, .name = "intel-hdmi-hifi1", @@ -607,8 +610,16 @@ static const struct snd_soc_component_driver hdac_hda_codec = { .endianness = 1, }; +static const struct snd_soc_component_driver hdac_hda_hdmi_codec = { + .probe = hdac_hda_codec_probe, + .remove = hdac_hda_codec_remove, + .idle_bias_on = false, + .endianness = 1, +}; + static int hdac_hda_dev_probe(struct hdac_device *hdev) { + struct hdac_hda_priv *hda_pvt = dev_get_drvdata(&hdev->dev); struct hdac_ext_link *hlink; int ret; @@ -621,9 +632,15 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev) snd_hdac_ext_bus_link_get(hdev->bus, hlink); /* ASoC specific initialization */ - ret = devm_snd_soc_register_component(&hdev->dev, - &hdac_hda_codec, hdac_hda_dais, - ARRAY_SIZE(hdac_hda_dais)); + if (hda_pvt->need_display_power) + ret = devm_snd_soc_register_component(&hdev->dev, + &hdac_hda_hdmi_codec, hdac_hda_hdmi_dais, + ARRAY_SIZE(hdac_hda_hdmi_dais)); + else + ret = devm_snd_soc_register_component(&hdev->dev, + &hdac_hda_codec, hdac_hda_dais, + ARRAY_SIZE(hdac_hda_dais)); + if (ret < 0) { dev_err(&hdev->dev, "failed to register HDA codec %d\n", ret); return ret;
The current driver is registering the same dais for each hdev found in the system which results duplicated widgets to be registered and the kernel log contains similar prints: snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten To avoid such issue, split the dai array into HDMI and non HDMI array and register them conditionally: for HDMI hdev only register the dais needed for HDMI for non HDMI hdev do not register the HDMI dais. Depends-on: 3d1dc8b1030d ("ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available") Link: https://github.com/thesofproject/linux/issues/4509 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> --- Hi, Changes since v1: - Drop the patch for patch_hdmi to export a funtion to match the device - Use the struct hdac_hda_priv.need_display_power boolean as indication that the device is a HDMI/DP audio codec Regards, Peter sound/soc/codecs/hdac_hda.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)