RFC: extension of libi2c to support SPI aswell

Thomas Doerfler Thomas.Doerfler at embedded-brains.de
Wed Sep 5 18:04:51 UTC 2007


Till,

Till Straumann schrieb:
>> - An optional "setmode_op" call should be added to allow the setting of
>> baudrate and clock/data relationship (which may differ between different
>> attached devices)
>>   
> 
> How about a  'ioctl_op'? Performing a ioctl() on a fd would
>  a) call the high-level driver's ioctl() (just as it does now).
>  b) call the low-level/bus driver's ioctl_op if the ioctl was not
>      handled by a).
> This seems generic, flexible and in sync with common semantics.

yes you are right. I will change this in my current implementation.

> 
> It seems that if the low-level ioctl handles these then they would be
> stored in the
> low-level driver and used appropriately already. Unless I miss something...

My initial idea was, that each high level driver must announce its
requirements only once during startup, and then libi2c would set the
proper mode everytime it initialies a transaction on the low level
driver. Since multiple high-level drivers might need different settings
(especially for clock polarity etc), these settings must be changed for
each high-level driver.

But during my first implementation I found out that libi2c does not yet
maintain a per-high-level-device context. Therefore I pushed the
responsibility for the mode settings to th high-level driver as you
recommend.

Thank you for your feedback,

Thomas.


> 
> -- Till
> 
>> - The SPI extension should be documented properly :-)
>>
>> Any comments concerning my plans?
>>
>> wkr,
>> Thomas.
>>
>>
>>   
> 
> 


-- 
--------------------------------------------
Embedded Brains GmbH
Thomas Doerfler           Obere Lagerstr. 30
D-82178 Puchheim          Germany
email: Thomas.Doerfler at embedded-brains.de
Phone: +49-89-18908079-2
Fax:   +49-89-18908079-9



More information about the users mailing list