Unverified Commit d2355387 authored by Oder Chiou's avatar Oder Chiou Committed by Mark Brown
Browse files

ASoC: rt5660: Fix the dmic data source from GPIO2



The patch fixes an issue with the dmic data pin connected to GPIO2.

Signed-off-by: default avatarOder Chiou <oder_chiou@realtek.com>
Link: https://patch.msgid.link/20250711034813.3278989-1-oder_chiou@realtek.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a609bd74
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1315,15 +1315,18 @@ static int rt5660_i2c_probe(struct i2c_client *i2c)
		regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
			RT5660_GP1_PIN_MASK, RT5660_GP1_PIN_DMIC1_SCL);

		if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2)
		if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2) {
			regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
				RT5660_SEL_DMIC_DATA_MASK,
				RT5660_SEL_DMIC_DATA_GPIO2);
		else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P)
			regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
				RT5660_GP2_PIN_MASK, RT5660_GP2_PIN_DMIC1_SDA);
		} else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P) {
			regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
				RT5660_SEL_DMIC_DATA_MASK,
				RT5660_SEL_DMIC_DATA_IN1P);
		}
	}

	return devm_snd_soc_register_component(&i2c->dev,
				      &soc_component_dev_rt5660,