Re: [PATCH V1 1/2] gpio: inverter: Add virtual controller for gpio configuration

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

 



On 13.06.19 08:44, Linus Walleij wrote:

Hi,

>> When there is no kernel
>> driver using the gpio pin, it becomes necessary for the userspace
>> to configure the polarity of the gpio pin.
> 
> So sometimes this might be necessary also for kernelspace,
> it models the inverter on the PCB very well, and the fact
> that DTS files work around it by adding things like
> active low flags are really just hacks.

I wouldn't call this always just hacks. There're cases where some line
just is low-active by definition (or by external factors).

If we really wanna pricely model the actual hardware in DT, w/o writing
tons of special-purpose drivers, we'd need some kind of virtual device
composition in DT language - something i've been looking for quite
while. If that thing could even operate on other sources like ACPI,
DMI, etc (perhaps somehow mapping it DT), we could get rid of lots of
platform and mfd drivers ... but that's goona be a completely separate
topic :o

I'd like to summarize: both approaches have their place, depending on
the actual use case. It's good to have both, there i'm welcoming
this new driver, but like to keep the old approach, too.

>> +config GPIO_INVERTER
>> +       tristate "Virtual GPIO controller for configuring the gpio polarity"
> 
> "Inverter GPIO controller for handling hardware inverters"

I wouldn't like to limit this to actual hardware inverted on the board.
There're other use cases, too, eg. if the incoming signal is low-active,
but consumer shouldn't have to care about that.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@xxxxxxxxx -- +49-151-27565287



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux