Commit 72e341c4 authored by Adam Ward's avatar Adam Ward Committed by Lee Jones

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: default avatarAdam Ward <adam.ward.opensource@diasemi.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent c7f585fe
...@@ -32,7 +32,7 @@ static int da9052_spi_probe(struct spi_device *spi) ...@@ -32,7 +32,7 @@ static int da9052_spi_probe(struct spi_device *spi)
if (!da9052) if (!da9052)
return -ENOMEM; return -ENOMEM;
spi->mode = SPI_MODE_0 | SPI_CPOL; spi->mode = SPI_MODE_0;
spi->bits_per_word = 8; spi->bits_per_word = 8;
spi_setup(spi); spi_setup(spi);
...@@ -43,6 +43,10 @@ static int da9052_spi_probe(struct spi_device *spi) ...@@ -43,6 +43,10 @@ static int da9052_spi_probe(struct spi_device *spi)
config = da9052_regmap_config; config = da9052_regmap_config;
config.read_flag_mask = 1; 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); da9052->regmap = devm_regmap_init_spi(spi, &config);
if (IS_ERR(da9052->regmap)) { if (IS_ERR(da9052->regmap)) {
......
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