Re: [PATCH 7/8] ASoC: Add SPI support for WM8731

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 4, 2008 at 12:01 AM, Alan Horstmann <gineera@xxxxxxxxxxxxxxx> wrote:
> On Monday 01 September 2008 18:47, Mark Brown wrote:
>> From: Cliff Cai <cliff.cai@xxxxxxxxxx>
>>
>> [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@xxxxxxxxxx>
>> Signed-off-by: Bryan Wu <cooloney@xxxxxxxxxx>
>> Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
>> ---
>
> What architecture has this SPI code been tested on?  Specifically, what
> endianess?
>

We tested on Blackfin machine and it's little-endian.

-Bryan

>> --- 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
>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux