Query on using leds-gpio driver on a. GPIO with ACTIVE_HIGH

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

 



Hello,

I have been a user of “leds-gpio” driver to manage the LEDs on IBM servers. So far, all these LEDs that were controlled by GPIO were ACTIVE_LOW.

Example from DTS.

        fan3 {
            retain-state-shutdown;
            default-state = "keep";
            gpios = <&pca0 3 GPIO_ACTIVE_LOW>;
        };

I wanted to know if it makes any difference to the user if the GPIO is ACTIVE_HIGH. I read through https://www.kernel.org/doc/Documentation/gpio/board.txt and it seemed we should be able to use it.

However, going through https://github.com/torvalds/linux/blob/master/drivers/leds/leds-pca955x.c, I am not quite sure if the ACTIVE_HIGH can be used same as ACTIVE_LOW since I saw these :


#define PCA955X_LS_LED_ON	0x0	/* Output LOW */
#define PCA955X_LS_LED_OFF	0x1	/* Output HI-Z */

#define PCA955X_GPIO_HIGH	LED_OFF
#define PCA955X_GPIO_LOW	LED_FULL


This will be my DT entry : 

        fan3 {
            retain-state-shutdown;
            default-state = "keep";
            gpios = <&pca0 3 GPIO_ACTIVE_HIGH>;
        };

Will I be able to use the same “leds-gpio” interfaces irrespective of GPIO_LOW / GPIO_HIGH ? 

I use these interfaces today:

echo 255 > brightness —> Turn Solid_ON
echo 0 > brightness —> Turn OFF
echo “timer” > trigger —> Initiate Blink
echo “none” > trigger —> Terminate Blink


Thank you,

!! Vishwa !



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux