linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 13:37 Koro Chen
  2015-10-13 13:44 ` Lars-Peter Clausen
  0 siblings, 1 reply; 10+ messages in thread
From: Koro Chen @ 2015-10-13 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

The patch "ASoC: Prevent components from being bound to multiple cards"
adds check to prevent multiple cards from using the same component.
However, snd_soc_register_platform() or snd_soc_register_codec() will
also create components, and sharing the same platform by multiple cards
is then refused. This happens with a platform having multiple
independent DAIs that share the same DMA controller.

Relax the condition by checking component->registered_as_component,
which is only true in case of snd_soc_register_component() and
will be false for components created by snd_soc_register_platform()
or snd_soc_register_codec().

Signed-off-by: Koro Chen <koro.chen@mediatek.com>
---
 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 42575b0..eca169a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
 		return 0;
 
 	if (component->card) {
-		if (component->card != card) {
+		if (component->card != card &&
+		    component->registered_as_component) {
 			dev_err(component->dev,
 				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
 				card->name, component->card->name);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-16  2:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 13:37 [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen
2015-10-13 13:44 ` Lars-Peter Clausen
2015-10-13 14:18   ` [alsa-devel] " Koro Chen
2015-10-13 14:42     ` Lars-Peter Clausen
2015-10-14  1:19       ` Koro Chen
2015-10-14  9:00         ` Lars-Peter Clausen
2015-10-15 12:10           ` Mark Brown
2015-10-15 12:49             ` Koro Chen
2015-10-15 13:26             ` Lars-Peter Clausen
2015-10-16  2:31               ` Koro Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).