This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x Standby Mode GPIO Outputs

I have an active-high LED connected to an AM335x running the 3.14 Linux kernel, and I'm having some issues with it in Standby mode.

Ideally, I'd like to latch the state of the LED when entering Standby, but currently the GPIO goes low. Checking the TRM, the Deepsleep0 power mode specifically mentions that the PD_PER power domain shuts down and that peripheral register data is cleared. However, the Standby mode doesn't mention any of this, and it actually says that the GPIO peripheral isn't even clock-gated, making me feel like it should have roughly the same behaviour in Standby mode as in Active mode. 

I'm setting the GPIO through the sysfs interface, so I'm not sure if this plays into it at all. Is there something specific that needs to be done to continue driving a GPIO in Standby mode? 

  • Hi Matthew,

    Can you share your dts? What is the gpio/led pins configuration?

    Best Regards,
    Yordan
  • 	leds {
    		pinctrl-names = "default";
    		pinctrl-0 = <&user_leds_default>;
    
    		compatible = "gpio-leds";
    
    		led@2 {
    			label = "Green";
    			gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
    			default-state = "on";
    		};
    
    		led@3 {
    			label = "Red";
    			gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};

    I didn't create this device tree myself, but this is the only reference I can find to the pins.

  • I took another look through the device tree, and also found this.

    	user_leds_default: user_leds_default {
    		pinctrl-single,pins = <
    			0x98 (PIN_OUTPUT | MUX_MODE7)	/* Green LED (gio2_4)*/
    			0x9C (PIN_OUTPUT | MUX_MODE7)	/* Red LED (gpio2_5)*/
    		>;
    	};

  • Have you tried adding:

        user_leds_sleep: user_leds_sleep {                                            //this dts node should keep pins pulled up during sleep

                     pinctrl-single,pins = <

                                   0x98       (PIN_OUTPUT_PULLUP  | MUX_MODE7)      /* Green LED (gio2_4)*/

                                   0x9C       (PIN_OUTPUT_PULLUP  | MUX_MODE7)      /* Red LED (gpio2_5)*/

                     >;

        };

    And then modify the leds dts node as follows:

      leds {

                pinctrl-names = "default", "sleep"

                pinctrl-0 = <&user_leds_default>;

                pinctrl-1 = <&user_leds_sleep>;

                compatible = "gpio-leds";

                led@2 {

                          label = "Green";

                          gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;

                          default-state = "on";

                 };

                 led@3 {

                           label = "Red";

                           gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;

                           default-state = "off";

                };

       };