All of lore.kernel.org
 help / color / mirror / Atom feed
* cs_change for SPI transfers
@ 2011-01-10 14:22 Manuel Stahl
  2011-01-11 19:03 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel Stahl @ 2011-01-10 14:22 UTC (permalink / raw)
  To: linux-iio

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

Hi,

I think there's an error in most IIO devices that use SPI transfers.

Haavard Skinnemoen wrote:
> The normal behaviour is:
>   * After all transfers except the last: CS stays active
>   * After the last transfer: CS goes inactive
>
> The cs_change flag is used to invert this behaviour. So for the last
> transfer, cs_change indicates that CS should stay active after the
> transfer (though the driver may not actually be able to do so, e.g. if
> the message is followed by a message to a different device.)
>

The drivers in IIO set cs_change for all transfers (including the last 
in a message), which is not what we want. I can prepare a patch to 
correct this.

Regards,
-- 
Manuel Stahl
Fraunhofer-Institut IIS
Leistungsoptimierte Systeme

Nordostpark 93
D90411 Nürnberg
Telefon  +49 (0)911/58061-6419
Fax      +49 (0)911/58061-6398
E-Mail   manuel.stahl@iis.fraunhofer.de

http://www.iis.fraunhofer.de
http://www.smart-power.fraunhofer.de

[-- Attachment #2: manuel_stahl.vcf --]
[-- Type: text/x-vcard, Size: 170 bytes --]

begin:vcard
fn:Manuel Stahl
n:Stahl;Manuel
email;internet:manuel.stahl@iis.fraunhofer.de
tel;work:+49 911 58061-6419
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cs_change for SPI transfers
  2011-01-10 14:22 cs_change for SPI transfers Manuel Stahl
@ 2011-01-11 19:03 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2011-01-11 19:03 UTC (permalink / raw)
  To: Manuel Stahl; +Cc: linux-iio

On 01/10/11 14:22, Manuel Stahl wrote:
> Hi,
> 
> I think there's an error in most IIO devices that use SPI transfers.
> 
> Haavard Skinnemoen wrote:
>> The normal behaviour is:
>>   * After all transfers except the last: CS stays active
>>   * After the last transfer: CS goes inactive
>>
>> The cs_change flag is used to invert this behaviour. So for the last
>> transfer, cs_change indicates that CS should stay active after the
>> transfer (though the driver may not actually be able to do so, e.g. if
>> the message is followed by a message to a different device.)
>>
> 
> The drivers in IIO set cs_change for all transfers (including the
> last in a message), which is not what we want. I can prepare a patch
> to correct this.

Yikes.

They win for completely counter intuitive interface... I guess I can see why
they did it like that (to make 0 the default behaviour).
Clearer naming would have been nice. cs_change_non_default or something...

Please do submit a patch set for this.

Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-11 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 14:22 cs_change for SPI transfers Manuel Stahl
2011-01-11 19:03 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.