3 Sep
2008
3 Sep
'08
6:01 p.m.
On Monday 01 September 2008 18:47, Mark Brown wrote:
From: Cliff Cai cliff.cai@analog.com
[Modified to allow runtime selection between I2C and SPI and to select SPI_MASTER for all codecs build so this is included. -- broonie]
Signed-off-by: Cliff Cai cliff.cai@analog.com Signed-off-by: Bryan Wu cooloney@kernel.org Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com
What architecture has this SPI code been tested on? Specifically, what endianess?
--- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c
+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];
- if (len <= 0)
return 0;
- msg[0] = (data[0] << 8) + data[1];
- spi_message_init(&m);
- memset(&t, 0, (sizeof t));
- t.tx_buf = &msg[0];
- t.len = len;
- spi_message_add_tail(&t, &m);
- spi_sync(spi, &m);
- return len;
+}
Is this _spi_write arch BE/LE proof?
Alan