diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-23 19:14:32 +0100 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-10-23 16:21:24 +0100 |
commit | 0248b4bfe56f0545c051e6230939ca8b95f1b037 (patch) | |
tree | 7ffc3f6930b8ccf21a61b27bed03d48134bb88b9 /drivers/mfd | |
parent | b264a70eef880aff31652a10ffee9c03e949b69b (diff) | |
download | linux-0248b4bfe56f0545c051e6230939ca8b95f1b037.tar.bz2 |
mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
functions and avoiding the extra writes for I2C.
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mc13xxx-spi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 77189daadf1e..5f14ef6693c2 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count) { struct device *dev = context; struct spi_device *spi = to_spi_device(dev); + const char *reg = data; if (count != 4) return -ENOTSUPP; + /* include errata fix for spi audio problems */ + if (*reg == MC13783_AUDIO_CODEC || *reg == MC13783_AUDIO_DAC) + spi_write(spi, data, count); + return spi_write(spi, data, count); } |