Commit fe1e7e8c authored by Alexey Firago's avatar Alexey Firago Committed by Mark Brown

ASoC: codecs: es8326: Fix DTS properties reading

Seems like properties parsing and reading was copy-pasted,
so "everest,interrupt-src" and "everest,interrupt-clk" are saved into
the es8326->jack_pol variable. This might lead to wrong settings
being saved into the reg 57 (ES8326_HP_DET).

Fix this by using proper variables while reading properties.
Signed-off-by: default avatarAlexey Firago <a.firago@yadro.com>
Reviewed-by: Yang Yingliang <yangyingliang@huawei.com
Link: https://lore.kernel.org/r/20230204195106.46539-1-a.firago@yadro.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e7c6652
...@@ -729,14 +729,16 @@ static int es8326_probe(struct snd_soc_component *component) ...@@ -729,14 +729,16 @@ static int es8326_probe(struct snd_soc_component *component)
} }
dev_dbg(component->dev, "jack-pol %x", es8326->jack_pol); dev_dbg(component->dev, "jack-pol %x", es8326->jack_pol);
ret = device_property_read_u8(component->dev, "everest,interrupt-src", &es8326->jack_pol); ret = device_property_read_u8(component->dev, "everest,interrupt-src",
&es8326->interrupt_src);
if (ret != 0) { if (ret != 0) {
dev_dbg(component->dev, "interrupt-src return %d", ret); dev_dbg(component->dev, "interrupt-src return %d", ret);
es8326->interrupt_src = ES8326_HP_DET_SRC_PIN9; es8326->interrupt_src = ES8326_HP_DET_SRC_PIN9;
} }
dev_dbg(component->dev, "interrupt-src %x", es8326->interrupt_src); dev_dbg(component->dev, "interrupt-src %x", es8326->interrupt_src);
ret = device_property_read_u8(component->dev, "everest,interrupt-clk", &es8326->jack_pol); ret = device_property_read_u8(component->dev, "everest,interrupt-clk",
&es8326->interrupt_clk);
if (ret != 0) { if (ret != 0) {
dev_dbg(component->dev, "interrupt-clk return %d", ret); dev_dbg(component->dev, "interrupt-clk return %d", ret);
es8326->interrupt_clk = 0x45; es8326->interrupt_clk = 0x45;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment