linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Correct meaning of the GPIO active low flag
@ 2014-02-10 14:33 Laurent Pinchart
  2014-02-10 14:50 ` Alexandre Courbot
  0 siblings, 1 reply; 16+ messages in thread
From: Laurent Pinchart @ 2014-02-10 14:33 UTC (permalink / raw)
  To: linux-gpio; +Cc: Linus Walleij, Alexandre Courbot, Stephen Warren

Hello everybody,

While working on Dt support for a driver that uses GPIO I came to ponder about 
the correct meaning of the GPIO active low flag. I'm bringing the question to 
the mailing list to get feedback.

When a device has an active low input, the fact that the input is active low 
is a property of the device, and thus known to the driver. On the other hand, 
if an inverter is present on the board, that information isn't known to device 
drivers and need to be expressed in DT.

Does the active low flag express the latter only, or both of them ? To ask the 
question differently, should the low flag model the inverter inside the 
device, known to the device driver, effectively moving handling of that 
inverter out of the device driver to the core code, or should it stop at the 
device boundary and only model the board ?

As an example, if my device datasheet states that the reset input is active 
low, an no inverter is present on the GPIO line, should I set the GPIO active 
low flag in DT and set the GPIO value to 1 in software (assuming I use the 
gpiod_* API) to make the reset signal active, or should I set the GPIO active 
high flag in DT and the the GPIO value to 0 in software ?

Let's also keep in mind that devices can have programmable polarities for 
inputs connected to GPIO-driven signals, in which case the internal polarity 
inversion is dynamic and can't be expressed in the GPIO propery in DT.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2014-02-19  0:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 14:33 Correct meaning of the GPIO active low flag Laurent Pinchart
2014-02-10 14:50 ` Alexandre Courbot
2014-02-10 15:13   ` Laurent Pinchart
2014-02-10 16:56     ` Stephen Warren
2014-02-10 16:57       ` Stephen Warren
2014-02-10 17:52         ` Laurent Pinchart
2014-02-10 23:04           ` Stephen Warren
2014-02-10 23:21             ` Laurent Pinchart
2014-02-12 16:50               ` Stephen Warren
2014-02-13 14:43                 ` Laurent Pinchart
2014-02-13 16:49                   ` Stephen Warren
2014-02-14 23:48                     ` Laurent Pinchart
2014-02-15  0:07                       ` Stephen Warren
2014-02-15  0:20                         ` Laurent Pinchart
2014-02-18 17:58                           ` Stephen Warren
2014-02-19  0:19                             ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).