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 18.06.19 13:42, Linus Walleij wrote:

Hi,

>>> For devicetree people mostly use the device tree cell flag
>>> GPIO_ACTIVE_LOW on these to work around it. But there
>>> are some cases where that isn't very readable.
>>
>> hmm, do you recall any such case where it isn't reliable ?
>> What are the problems here ?

ups, just seen i've misread your previous comment - you wrote:
"*read*able, not re*lia*able ... :o

> GPIO_ACTIVE_LOW is there to tell which way the consumer acts.
> If the line is counted as asserted when active low, it should be flagged
> as GPIO_ACTIVE_LOW, in the strict sense.

Right. But now some could argue: "the reset consumer contains an
inverter, there the inverter driver shall be used" ;-)

> So as is the case with regulators, device tree properties should
> describe the electronic semantics of the consuming devices, not how
> some random software in the operating system want to interpret
> things, it is not there for software fixes, it is just being abused for
> that sometimes.

Well, these electronic semantics can also have a some room for
interpretation. Even if there's some explicit interverter in the
schematics, one could count that part of the consumer and then
declare the line low active. OTOH, one could count all low active
lines "inverted" and demand an explicit inverter device here.

IMHO, it's often a matter of perspective, which approach is better.
It's good to have both options now.

By the way: I'm a great fan of modelling devices semantically (not
just electrically) correct for the whole machine (including external
peripherals - not just the stuff on the board itself). For example in
an embedded system w/ some gpio attached sensor, there should be a
driver for the actual sensor (eg. IIO) instead letting userland play
directly w/ the gpio. And if we have a line controlling some external
device's power, there should be an explicit regulutor, etc, etc.
(Actually, I'm pretty reluctant of handing out raw gpios to userland)

> The fact that many people use this flag as a workaround doesn't mean
> it doesn't have a valid semantic when used right.

I'm still not sure whether these really are workarounds or just a
different perspective. At least haven't had a case yet, where both
perspectives have been equally valid.


--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