diff mbox

[RFC,1/1] ASoC: soc-dapm: warn if no avaiable path found for widget kcontrol

Message ID 1343387941-25266-1-git-send-email-b29396@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aisheng Dong July 27, 2012, 11:19 a.m. UTC
From: Dong Aisheng <dong.aisheng@linaro.org>

This could help people know what's wrong going on if the required
path is not registered.

Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
 sound/soc/soc-dapm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Mark Brown July 29, 2012, 8:22 p.m. UTC | #1
On Fri, Jul 27, 2012 at 07:19:01PM +0800, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This could help people know what's wrong going on if the required
> path is not registered.

This isn't a good idea, it's fairly common for widgets to have a "None"
option which isn't expected to have an input.
Aisheng Dong Aug. 1, 2012, 7:49 a.m. UTC | #2
On Mon, Jul 30, 2012 at 04:22:19AM +0800, Mark Brown wrote:
> On Fri, Jul 27, 2012 at 07:19:01PM +0800, Dong Aisheng wrote:
> > From: Dong Aisheng <dong.aisheng@linaro.org>
> > 
> > This could help people know what's wrong going on if the required
> > path is not registered.
> 
> This isn't a good idea, it's fairly common for widgets to have a "None"
> option which isn't expected to have an input.
> 

What i changed is mux widgets, i'm wondering is it possible or correct
the mux widget has no input path?
If i understand correct, we may need set correct input path
for mux widget, or why we still need a mux?

Or can you help give an example that no input needed for mux widget?

Regards
Dong Aisheng
Mark Brown Aug. 1, 2012, 12:15 p.m. UTC | #3
On Wed, Aug 01, 2012 at 03:49:53PM +0800, Dong Aisheng wrote:
> On Mon, Jul 30, 2012 at 04:22:19AM +0800, Mark Brown wrote:

> > This isn't a good idea, it's fairly common for widgets to have a "None"
> > option which isn't expected to have an input.

> What i changed is mux widgets, i'm wondering is it possible or correct
> the mux widget has no input path?
> If i understand correct, we may need set correct input path
> for mux widget, or why we still need a mux?

> Or can you help give an example that no input needed for mux widget?

The above is the most common example - one of the inputs to a mux being
a "no input" option which shouldn't be connected to anything.  A mux
with no inputs at all would be silly, but having one (or sometimes a
couple for various reasons) that isn't connected isn't unusual.
Aisheng Dong Aug. 2, 2012, 7:08 a.m. UTC | #4
On Wed, Aug 01, 2012 at 08:15:16PM +0800, Mark Brown wrote:
> On Wed, Aug 01, 2012 at 03:49:53PM +0800, Dong Aisheng wrote:
> > On Mon, Jul 30, 2012 at 04:22:19AM +0800, Mark Brown wrote:
> 
> > > This isn't a good idea, it's fairly common for widgets to have a "None"
> > > option which isn't expected to have an input.
> 
> > What i changed is mux widgets, i'm wondering is it possible or correct
> > the mux widget has no input path?
> > If i understand correct, we may need set correct input path
> > for mux widget, or why we still need a mux?
> 
> > Or can you help give an example that no input needed for mux widget?
> 
> The above is the most common example - one of the inputs to a mux being
> a "no input" option which shouldn't be connected to anything.  A mux
> with no inputs at all would be silly, but having one (or sometimes a
> couple for various reasons) that isn't connected isn't unusual.
> 

Understand.
Thanks for the info.

Regards
Dong Aisheng
diff mbox

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 4d181df..b9b94c5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1879,6 +1879,9 @@  static int soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
 		}
 	}
 
+	WARN(!found, "did not find dapm widget path associated with kcontrol %s\n",
+		kcontrol->id.name);
+
 	if (found) {
 		dapm_mark_dirty(widget, "mux change");
 		dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);