summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Ward <adam.ward.opensource@diasemi.com>2015-03-04 16:13:12 +0000
committerLee Jones <lee.jones@linaro.org>2015-03-12 09:06:40 +0000
commit72e341c48fbca142d767e97746e33a4becf890ea (patch)
treeed04943ff3aee78f0e8719202df184f7ee288576
parentc7f585fe46d834d5837db7fbe205c46b94f81dc2 (diff)
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>
-rw-r--r--drivers/mfd/da9052-spi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c
index 45ae0b7d13ef..b5de8a6856c0 100644
--- a/drivers/mfd/da9052-spi.c
+++ b/drivers/mfd/da9052-spi.c
@@ -32,7 +32,7 @@ static int da9052_spi_probe(struct spi_device *spi)
if (!da9052)
return -ENOMEM;
- spi->mode = SPI_MODE_0 | SPI_CPOL;
+ spi->mode = SPI_MODE_0;
spi->bits_per_word = 8;
spi_setup(spi);
@@ -43,6 +43,10 @@ static int da9052_spi_probe(struct spi_device *spi)
config = da9052_regmap_config;
config.read_flag_mask = 1;
+ config.reg_bits = 7;
+ config.pad_bits = 1;
+ config.val_bits = 8;
+ config.use_single_rw = 1;
da9052->regmap = devm_regmap_init_spi(spi, &config);
if (IS_ERR(da9052->regmap)) {