patch "iio: filter: admv8818: Force initialization of SDO" added to char-misc-linus
This is a note to let you know that I've just added the patch titled
iio: filter: admv8818: Force initialization of SDO
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From cc2c3540d9477a9931fb0fd851fcaeba524a5b35 Mon Sep 17 00:00:00 2001
From: Sam Winchenbach <[email protected]>
Date: Mon, 3 Feb 2025 13:34:34 +0000
Subject: iio: filter: admv8818: Force initialization of SDO
When a weak pull-up is present on the SDO line, regmap_update_bits fails to write both the SOFTRESET and SDOACTIVE bits because it incorrectly reads them as already set.
Since the soft reset disables the SDO line, performing a read-modify-write operation on ADI_SPI_CONFIG_A to enable the SDO line doesn't make sense. This change directly writes to the register instead of using regmap_update_bits.
--- drivers/iio/filter/admv8818.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/iio/filter/admv8818.c +4 -10
@@ -574,21 +574,15 @@ static int admv8818_init(struct admv8818_state *st)struct spi_device *spi = st->spi;unsigned int chip_id; - ret =regmap_update_bits (st->regmap,ADMV8818_REG_SPI_CONFIG_A , -ADMV8818_SOFTRESET_N_MSK | -ADMV8818_SOFTRESET_MSK , -FIELD_PREP (ADMV8818_SOFTRESET_N_MSK ,1 ) | -FIELD_PREP (ADMV8818_SOFTRESET_MSK ,1 )); + ret =regmap_write (st->regmap,ADMV8818_REG_SPI_CONFIG_A , +ADMV8818_SOFTRESET_N_MSK |ADMV8818_SOFTRESET_MSK );if (ret) {dev_err (&spi->dev,"ADMV8818 Soft Reset failed.\n" );return ret; } - ret =regmap_update_bits (st->regmap,ADMV8818_REG_SPI_CONFIG_A , -ADMV8818_SDOACTIVE_N_MSK | -ADMV8818_SDOACTIVE_MSK , -FIELD_PREP (ADMV8818_SDOACTIVE_N_MSK ,1 ) | -FIELD_PREP (ADMV8818_SDOACTIVE_MSK ,1 )); + ret =regmap_write (st->regmap,ADMV8818_REG_SPI_CONFIG_A , +ADMV8818_SDOACTIVE_N_MSK |ADMV8818_SDOACTIVE_MSK );if (ret) {dev_err (&spi->dev,"ADMV8818 SDO Enable failed.\n" );return ret;
Signature · 1 line
2.48.1