About libertas_spi: 16 bit data transfer

Ivan Li lijinlei1 at 163.com
Tue Feb 22 04:54:23 EST 2011


Hi guys,

I really hope someone can help me clarify this.
Since we specified the bits_per_word field, the i.MX SPI controller will send a u16 (2 bytes) at a time, so I think the "len" should be sizeof(buf) / 2. 
But in if_spi.c, all "length" are calculated by bytes. 

static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
{
 u16 buff;

 buff = cpu_to_le16(val);
 return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
}

I think this is why the libertas_spi can't work with i.MX31 SPI.

----- Original Message ----- 
From: "Ivan Li" <lijinlei1 at 163.com>
To: <libertas-dev at lists.infradead.org>
Sent: Wednesday, February 16, 2011 4:12 PM
Subject: About libertas_spi: 16 bit data transfer


> Hi guys,
> 
> I am using SD8686 on i.MX31 with SPI interface, and for now I can't make it work.
> 
> The i.MX31 supports 8, 16, 32bit for data transfer, and as I know the SD8686 transfers data in 16 bits.
> So I made below setup callback: 
> 
> static int mxc_libertas_setup(struct spi_device *spi)
> {
> spi->bits_per_word = 16;
> spi_setup(spi);
> return 0;
> }
> 
> But, in if_spi.c, I still see the "word" data is tranmitting in bytes.
> Can anybody explain a little bit? And is there anybody making sd8686 spi work on i.MX series?
> Thanks!
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev


More information about the libertas-dev mailing list