mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Signed-off-by: Lee Jones <[email protected]>
This commit is contained in:
parent
c29c2d4e6b
commit
fd792f8fbc
3 changed files with 12 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue