Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: da9052: Fix register access via SPI

The range of registers used by this driver exceeds that available
via SPI with no paging (127), so we have to override the values
from the default config which is set-up for I2C access.
Also change SPI settings to match device's recommended OTP values.

Signed-off-by: Adam Ward <adam.ward.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Adam Ward and committed by
Lee Jones
72e341c4 c7f585fe

+5 -1
+5 -1
drivers/mfd/da9052-spi.c
··· 32 32 if (!da9052) 33 33 return -ENOMEM; 34 34 35 - spi->mode = SPI_MODE_0 | SPI_CPOL; 35 + spi->mode = SPI_MODE_0; 36 36 spi->bits_per_word = 8; 37 37 spi_setup(spi); 38 38 ··· 43 43 44 44 config = da9052_regmap_config; 45 45 config.read_flag_mask = 1; 46 + config.reg_bits = 7; 47 + config.pad_bits = 1; 48 + config.val_bits = 8; 49 + config.use_single_rw = 1; 46 50 47 51 da9052->regmap = devm_regmap_init_spi(spi, &config); 48 52 if (IS_ERR(da9052->regmap)) {