Unverified Commit 11817547 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: fix widget name comparisons (consider DAI name

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Some codec drivers compare widget names with strcmp, ignoring
the component name prefix.  If prefix is used, the comparisons start failing.

Except Qualcomm lpass-rx-macro, none of the patches were tested
on hardware.
parents 926f192f f82eb06a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -400,9 +400,9 @@ static int pm860x_dac_event(struct snd_soc_dapm_widget *w,
	unsigned int dac = 0;
	int data;

	if (!strcmp(w->name, "Left DAC"))
	if (!snd_soc_dapm_widget_name_cmp(w, "Left DAC"))
		dac = DAC_LEFT;
	if (!strcmp(w->name, "Right DAC"))
	if (!snd_soc_dapm_widget_name_cmp(w, "Right DAC"))
		dac = DAC_RIGHT;
	switch (event) {
	case SND_SOC_DAPM_PRE_PMU:
+1 −1
Original line number Diff line number Diff line
@@ -834,7 +834,7 @@ static int adau1373_check_aif_clk(struct snd_soc_dapm_widget *source,
	else
		clk = "SYSCLK2";

	return strcmp(source->name, clk) == 0;
	return snd_soc_dapm_widget_name_cmp(source, clk) == 0;
}

static int adau1373_check_src(struct snd_soc_dapm_widget *source,
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ static int adav80x_dapm_sysclk_check(struct snd_soc_dapm_widget *source,
		return 0;
	}

	return strcmp(source->name, clk) == 0;
	return snd_soc_dapm_widget_name_cmp(source, clk) == 0;
}

static int adav80x_dapm_pll_check(struct snd_soc_dapm_widget *source,
+3 −3
Original line number Diff line number Diff line
@@ -2906,14 +2906,14 @@ static int rx_macro_enable_echo(struct snd_soc_dapm_widget *w,

	val = snd_soc_component_read(component,
			CDC_RX_INP_MUX_RX_MIX_CFG4);
	if (!(strcmp(w->name, "RX MIX TX0 MUX")))
	if (!(snd_soc_dapm_widget_name_cmp(w, "RX MIX TX0 MUX")))
		ec_tx = ((val & 0xf0) >> 0x4) - 1;
	else if (!(strcmp(w->name, "RX MIX TX1 MUX")))
	else if (!(snd_soc_dapm_widget_name_cmp(w, "RX MIX TX1 MUX")))
		ec_tx = (val & 0x0f) - 1;

	val = snd_soc_component_read(component,
			CDC_RX_INP_MUX_RX_MIX_CFG5);
	if (!(strcmp(w->name, "RX MIX TX2 MUX")))
	if (!(snd_soc_dapm_widget_name_cmp(w, "RX MIX TX2 MUX")))
		ec_tx = (val & 0x0f) - 1;

	if (ec_tx < 0 || (ec_tx >= RX_MACRO_EC_MUX_MAX)) {
+4 −4
Original line number Diff line number Diff line
@@ -56,13 +56,13 @@ static int max9867_adc_dac_event(struct snd_soc_dapm_widget *w,
	struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component);
	enum max9867_adc_dac adc_dac;

	if (!strcmp(w->name, "ADCL"))
	if (!snd_soc_dapm_widget_name_cmp(w, "ADCL"))
		adc_dac = MAX9867_ADC_LEFT;
	else if (!strcmp(w->name, "ADCR"))
	else if (!snd_soc_dapm_widget_name_cmp(w, "ADCR"))
		adc_dac = MAX9867_ADC_RIGHT;
	else if (!strcmp(w->name, "DACL"))
	else if (!snd_soc_dapm_widget_name_cmp(w, "DACL"))
		adc_dac = MAX9867_DAC_LEFT;
	else if (!strcmp(w->name, "DACR"))
	else if (!snd_soc_dapm_widget_name_cmp(w, "DACR"))
		adc_dac = MAX9867_DAC_RIGHT;
	else
		return 0;
Loading