ts-7000
[Top] [All Lists]

Re: [ts-7000] Right way to set bits/word for SPI driver ts7260

To:
Subject: Re: [ts-7000] Right way to set bits/word for SPI driver ts7260
From: Matthieu Crapet <>
Date: Sun, 05 Oct 2008 12:59:06 +0200
Hi,

Are you talking about ep93xx.c & tmp124.c I wrote ?
If so,

The tmp24 is a slave device driver. I set at init "spi->bits_per_word = 
16". After each transfer will take this value.
But I could also add a field ".bits_per_word = 16," in the  "struct 
spi_transfer" structure.
In fact It just saves an extra register write.

Concerning spi_ep93xx. In "transfer" function, have a look to 
"spi->bits_per_word" and "xfer->bits_per_word".
Never tested with several slaves devices and bits_per_word != to 16. But 
the driver is able to change bpw on for each transfert. But sure there 
can be bugs or missing checks here.

About CS. Just do nothing in the cs_control (for example: 
tmp124_spi_cs(u32 command)) function and manage the CS by yourself.

Regards,
Matthieu


schveiguy wrote:
>
> Hi,
>
> I'm trying to write a protocol driver that uses the spi infrastructure
> of the 2.6.24.4 patched kernel.
>
> I'm trying to support multiple slave devices, which might have
> different values for bits/word. In reading the kerneldoc for spi, it
> appears that the spi_device is a proxy to the hardware for each slave
> driver.
>
> But in the spi_ep93xx.c file, the driver is not looking at the
> bits/word for each transfer from the spi_device, only at the bits/word
> of the transfer packet.
>
> Furthermore, the bits/word are being set when the slave loads, but if
> many slaves require different bits/word, is the correct method to set
> the bits/word for each transaction? The current code seems to suggest
> that, but it doesn't seem to make sense to me when reading the spi docs.
>
> I guess, what I'm asking is if the driver is handling changing of the
> bits/word correctly.
>
> My interpretation seems like the spi_device is a per-slave entity, and
> it dictates how to set up the bits/word per transaction, and this is
> set at the load of the slave device. But if multiple slaves are
> sharing the same hardware, then the bits/word should be set according
> to the slaves spi_device for each transaction.
>
> But on top of that, you can change the bits/word per transaction
> within a given slave. I guess this would be useful if a slave has
> some odd protocol which requires different bits/word in the same
> sequence without deasserting the CS line?
>
> In any case, I'm very confused, and hopefully the author of the driver
> can help me :)
>
>  


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU