* [PATCH] ASoC: skip legacy dai naming if dai driver has all the information
@ 2015-05-15 9:38 Srinivas Kandagatla
2015-05-15 20:07 ` [alsa-devel] " Kenneth Westfield
2015-05-21 21:22 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2015-05-15 9:38 UTC (permalink / raw)
To: alsa-devel
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-kernel, Srinivas Kandagatla
Original issue is that the id field in the dai is not same as the id
in dai_driver when dai driver count == 1. This is due to the legacy
dai naming check, which could possibly cause issues if the audio drivers
written in assumption that dai->id would be always equal to dai_driver->id.
This assumption is true only if the dai driver count is greater than 1,
and false if dai driver count is 1. On Qcom Lpass driver we hit such
issue while adding support to apq8016.
The code path which falls back to legacy naming for cases where num_dai
== 1 does not check if there is any valid information in the dai_driver.
This patch fixes that by checking if the dai_driver has valid id and
name before falling back to legacy dai naming
Although the drivers can work around this issue by only using
dai->driver->id, but this patch attempts to fix the actual issue.
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
sound/soc/soc-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2373252..7d028e8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2599,7 +2599,8 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
* the same naming style even though those DAIs are not
* component-less anymore.
*/
- if (count == 1 && legacy_dai_naming) {
+ if (count == 1 && legacy_dai_naming &&
+ (dai_drv[i].id == 0 || dai_drv[i].name == NULL)) {
dai->name = fmt_single_name(dev, &dai->id);
} else {
dai->name = fmt_multiple_name(dev, &dai_drv[i]);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [alsa-devel] [PATCH] ASoC: skip legacy dai naming if dai driver has all the information
2015-05-15 9:38 [PATCH] ASoC: skip legacy dai naming if dai driver has all the information Srinivas Kandagatla
@ 2015-05-15 20:07 ` Kenneth Westfield
2015-05-21 21:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Kenneth Westfield @ 2015-05-15 20:07 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: alsa-devel, Takashi Iwai, linux-kernel, Liam Girdwood, Mark Brown
On Fri, May 15, 2015 at 02:38:27AM -0700, Srinivas Kandagatla wrote:
> Original issue is that the id field in the dai is not same as the id
> in dai_driver when dai driver count == 1. This is due to the legacy
> dai naming check, which could possibly cause issues if the audio drivers
> written in assumption that dai->id would be always equal to
> dai_driver->id.
> This assumption is true only if the dai driver count is greater than 1,
> and false if dai driver count is 1. On Qcom Lpass driver we hit such
> issue while adding support to apq8016.
>
> The code path which falls back to legacy naming for cases where num_dai
> == 1 does not check if there is any valid information in the dai_driver.
> This patch fixes that by checking if the dai_driver has valid id and
> name before falling back to legacy dai naming
> Although the drivers can work around this issue by only using
> dai->driver->id, but this patch attempts to fix the actual issue.
>
> Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>
--
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: skip legacy dai naming if dai driver has all the information
2015-05-15 9:38 [PATCH] ASoC: skip legacy dai naming if dai driver has all the information Srinivas Kandagatla
2015-05-15 20:07 ` [alsa-devel] " Kenneth Westfield
@ 2015-05-21 21:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-05-21 21:22 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: alsa-devel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
On Fri, May 15, 2015 at 10:38:27AM +0100, Srinivas Kandagatla wrote:
> Original issue is that the id field in the dai is not same as the id
> in dai_driver when dai driver count == 1. This is due to the legacy
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-21 21:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-15 9:38 [PATCH] ASoC: skip legacy dai naming if dai driver has all the information Srinivas Kandagatla
2015-05-15 20:07 ` [alsa-devel] " Kenneth Westfield
2015-05-21 21:22 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox