diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-10 19:02:35 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-24 06:41:09 -0400 |
commit | 60c655e62f1ee85b9144fa259b3d1064ddbbe847 (patch) | |
tree | 87d069e2b6492de4a3609264c98a9ed05338fbf1 /sound/soc/soc-cache.c | |
parent | 7e146b55866d1176f80439fdc2be2915147468b3 (diff) |
ASoC: Convert 16x16 write to use cpu_to_be16()
Make it clear what we're doing.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-cache.c')
-rw-r--r-- | sound/soc/soc-cache.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 5cd23daff4ad..6d6395fad486 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
@@ -366,14 +366,12 @@ static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec, | |||
366 | static int snd_soc_16_16_write(struct snd_soc_codec *codec, unsigned int reg, | 366 | static int snd_soc_16_16_write(struct snd_soc_codec *codec, unsigned int reg, |
367 | unsigned int value) | 367 | unsigned int value) |
368 | { | 368 | { |
369 | u8 data[4]; | 369 | u16 data[2]; |
370 | 370 | ||
371 | data[0] = (reg >> 8) & 0xff; | 371 | data[0] = cpu_to_be16(reg); |
372 | data[1] = reg & 0xff; | 372 | data[1] = cpu_to_be16(value); |
373 | data[2] = (value >> 8) & 0xff; | ||
374 | data[3] = value & 0xff; | ||
375 | 373 | ||
376 | return do_hw_write(codec, reg, value, data, 4); | 374 | return do_hw_write(codec, reg, value, data, sizeof(data)); |
377 | } | 375 | } |
378 | 376 | ||
379 | #if defined(CONFIG_SPI_MASTER) | 377 | #if defined(CONFIG_SPI_MASTER) |