Skip to content

Commit

Permalink
sound: ASoC: Fix WM8731 SPI write
Browse files Browse the repository at this point in the history
Ensure wm8731_spi_write byte order is consistent regardless of
endianess.

Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
Alan Horstmann authored and Jaroslav Kysela committed Sep 23, 2008
1 parent 7407a2e commit 8569be3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/soc/codecs/wm8731.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,13 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
{
struct spi_transfer t;
struct spi_message m;
u16 msg[2];
u8 msg[2];

if (len <= 0)
return 0;

msg[0] = (data[0] << 8) + data[1];
msg[0] = data[0];
msg[1] = data[1];

spi_message_init(&m);
memset(&t, 0, (sizeof t));
Expand Down

0 comments on commit 8569be3

Please sign in to comment.