ASoC: Convert 7x9 write to use cpu_to_be16()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 May 2011 22:56:13 +0000 (00:56 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 27 May 2011 14:00:38 +0000 (22:00 +0800)
Run the data through cpu_to_be16() so it's at least clear what we're up to.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
sound/soc/soc-cache.c

index 6d6395fad486823d6a402d93351cb6797f929fce..dab109f2f47d1e553374d71a0855ef3b32309288 100644 (file)
@@ -133,12 +133,11 @@ static unsigned int snd_soc_7_9_read(struct snd_soc_codec *codec,
 static int snd_soc_7_9_write(struct snd_soc_codec *codec, unsigned int reg,
                             unsigned int value)
 {
-       u8 data[2];
+       u16 data;
 
-       data[0] = (reg << 1) | ((value >> 8) & 0x0001);
-       data[1] = value & 0x00ff;
+       data = cpu_to_be16((reg << 9) | (value & 0x1ff));
 
-       return do_hw_write(codec, reg, value, data, 2);
+       return do_hw_write(codec, reg, value, &data, 2);
 }
 
 #if defined(CONFIG_SPI_MASTER)