Commit f7d9e21d authored by Fabrizio Lamarque's avatar Fabrizio Lamarque Committed by Jonathan Cameron

iio: adc: ad7192: Fix internal/external clock selection

Fix wrong selection of internal clock when mclk is defined.

Resolve a logical inversion introduced in c9ec2cb3.

Fixes: c9ec2cb3 ("iio: adc: ad7192: use devm_clk_get_optional() for mclk")
Signed-off-by: default avatarFabrizio Lamarque <fl.scratchpad@gmail.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230530075311.400686-3-fl.scratchpad@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 9e58e3a6
......@@ -367,7 +367,7 @@ static int ad7192_of_clock_select(struct ad7192_state *st)
clock_sel = AD7192_CLK_INT;
/* use internal clock */
if (st->mclk) {
if (!st->mclk) {
if (of_property_read_bool(np, "adi,int-clock-output-enable"))
clock_sel = AD7192_CLK_INT_CO;
} else {
......
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