Query about Open drain flag with active LOW

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

 



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.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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