[PATCH] GPIO output support for LM93 kernel driver

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

 



>> I have been using the LM93 kernel driver and I noticed that 'gpio'
>> file in sysfs is read-only and that the GPIO pins of the LM93 chip can
>> be used as input only.
>> I attached a patch that allows to also use GPIO pins as output, by
>> simply writing to 'gpio' in sysfs. The patch is against the current
>> git revision of the mainstream kernel.
>> I did not handle the case where the GPIO pins are used as inputs after
>> being used as output (in which case, according to the datasheet, 0s
>> should be written to the GPO register, and thus 1s should be written
>> to the 'gpio' sysfs file). Also, if some pins are used as inputs and
>> others as outputs, then, when writing to the 'gpio' file in sysfs, the
>> pins used as inputs should be set to 1 (so that the corresponding bits
>> in the GPO register are set to 0).
>>
>> Comments are welcome.
>
> IMO gpiolib would be better and more generic solution instead of creating
> some custom sysfs entry...

The sysfs entry already exists (and is present the mainstream kernel),
so that's why I preferred to use it. I don't think the sysfs entry
will be removed anyway, or will it ?

Olivier




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux