diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-10 18:56:13 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-27 10:00:38 -0400 |
commit | f06f136fe0217174657e325279672d4b73ed4d87 (patch) | |
tree | 16325cae64bb38fc0aebfe9bf616817d879bfa87 /sound/soc/soc-cache.c | |
parent | 2cdcd951c456fecbeb11fc42aa7d90f172dc58ef (diff) |
ASoC: Convert 7x9 write to use cpu_to_be16()
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>
Diffstat (limited to 'sound/soc/soc-cache.c')
-rw-r--r-- | sound/soc/soc-cache.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 6d6395fad486..dab109f2f47d 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
@@ -133,12 +133,11 @@ static unsigned int snd_soc_7_9_read(struct snd_soc_codec *codec, | |||
133 | static int snd_soc_7_9_write(struct snd_soc_codec *codec, unsigned int reg, | 133 | static int snd_soc_7_9_write(struct snd_soc_codec *codec, unsigned int reg, |
134 | unsigned int value) | 134 | unsigned int value) |
135 | { | 135 | { |
136 | u8 data[2]; | 136 | u16 data; |
137 | 137 | ||
138 | data[0] = (reg << 1) | ((value >> 8) & 0x0001); | 138 | data = cpu_to_be16((reg << 9) | (value & 0x1ff)); |
139 | data[1] = value & 0x00ff; | ||
140 | 139 | ||
141 | return do_hw_write(codec, reg, value, data, 2); | 140 | return do_hw_write(codec, reg, value, &data, 2); |
142 | } | 141 | } |
143 | 142 | ||
144 | #if defined(CONFIG_SPI_MASTER) | 143 | #if defined(CONFIG_SPI_MASTER) |