mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
iio: adc: ad4851: add spi 3-wire support
Add support for 3-wire configuration within the driver. By default 4-wire configuration is used. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250626104024.8645-2-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
0fbd8017ab
commit
695b7c42d9
@@ -444,10 +444,12 @@ static int ad4851_setup(struct ad4851_state *st)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = regmap_write(st->regmap, AD4851_REG_INTERFACE_CONFIG_A,
|
||||
AD4851_SDO_ENABLE);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!(st->spi->mode & SPI_3WIRE)) {
|
||||
ret = regmap_write(st->regmap, AD4851_REG_INTERFACE_CONFIG_A,
|
||||
AD4851_SDO_ENABLE);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regmap_read(st->regmap, AD4851_REG_PRODUCT_ID_L, &product_id);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user