linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query about Open drain flag with active LOW
@ 2017-03-27 15:21 Laxman Dewangan
  2017-03-28  9:06 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Laxman Dewangan @ 2017-03-27 15:21 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio@vger.kernel.org

Hi Linus,
I need help to understand the open drain flag passing from the DT.
The DT binding header says: In the file include/dt-bindings/gpio/gpio.h

/*
* Open Drain/Collector is the combination of single-ended active low,
* Open Source/Emitter is the combination of single-ended active high.
*/
#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_ACTIVE_LOW)
#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_ACTIVE_HIGH)


I have the schematics, where I need to set it as
Pin state HIGH (by setting gpio-input mode) to enable the circuit.
Pin state LOW (by setting gpio-output mode with value to 0) to disable 
the circuit.


With this, I think the GPIO is active HIGH and open drain type.
If I set the active LOW from DT then I can not set pin to logical 1 
using the API gpiod_set_value() with “1”.
As this invert before calling _gpiod_set_raw_value() and so the value = 
0 and it set the pin in the gpio mode output-Low.

Shouldn'’t open drain pin are active HIGH?

Thanks,
Laxman

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

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

end of thread, other threads:[~2017-03-28 14:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27 15:21 Query about Open drain flag with active LOW Laxman Dewangan
2017-03-28  9:06 ` Linus Walleij
2017-03-28  9:03   ` Laxman Dewangan
2017-03-28 13:08     ` Linus Walleij
2017-03-28 13:58       ` Laxman Dewangan

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