Hello,
We are using am3352 in our design with kernel 4.14.67 and U-Boot version 2019.01 from TI SDK.
We have four leds we can control from linux system and we are using "gpio-leds" driver.
Now we also want to control these leds from U-boot and we are trying to use the same "gpio-leds" driver. For this we added to "our_board.dts"
leds {
pinctrl-names = "default";
pinctrl-0 = <&user_leds_sw>;
compatible = "gpio-leds";
yellow {
label = "ledsw0:yellow";
gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
green {
label = "ledsw1:green";
gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
red {
label = "ledsw2:red";
gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
orange {
label = "ledsw3:orange";
gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
};
user_leds_sw: user_leds_sw {
pinctrl-single,pins = <
0x03c (PIN_INPUT_PULLUP | MUX_MODE7) /* (U13) gpmc_ad15.gpio1_4 */
0x1e4 (PIN_INPUT_PULLUP | MUX_MODE7) /* (C14) emu0.gpio3_7 */
0x13c (PIN_INPUT_PULLUP | MUX_MODE7) /* (L15) gmii1_rxd1.gpio2_20 */
0x034 (PIN_INPUT_PULLUP | MUX_MODE7) /* (R12) gpmc_ad13.gpio1_13 */
>;
};
And also to "our_ defconfig_file"
CONFIG_CMD_LED=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
After this, leds seem to be defined:
=> led list
ledsw0:yellow <inactive>
ledsw1:green <inactive>
ledsw2:red <inactive>
ledsw3:orange <inactive>
But when I try to set/reset/toggle any of these LEDs none of them change the status:
=> led ledsw0:yellow on
ledsw0:yellow <inactive>
ledsw1:green <inactive>
ledsw2:red <inactive>
ledsw3:orange <inactive>
=> led ledsw0:yellow off
ledsw0:yellow <inactive>
ledsw1:green <inactive>
ledsw2:red <inactive>
ledsw3:orange <inactive>
=> led ledsw0:yellow toggle
ledsw0:yellow <inactive>
ledsw1:green <inactive>
ledsw2:red <inactive>
ledsw3:orange <inactive>
Could you please help us to solve this issue?
Best regards
Angel