Part Number: AM625
Other Parts Discussed in Thread: LP5521
Tool/software:
we are trying to configure LED driver for RGB Indicator in AM625
we have configured RGB pin as GPIO and also configured I2C_2 on which it communicates. we have build LP5521 driver as module as well load after system boot manually.
Here are my changes:
SOM Datasheet: https://www.variscite.com/wp-content/uploads/2023/01/VAR-SOM-AM62_Datasheet.pdf
arch/arm/dts/k3-am625-var-som-symphony.dts
&main_pmx0 {
/* RGB Health Indicator */
lp5521_pins_default: lp5521-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x0020, PIN_OUTPUT, 7) /* (J25) OSPI0_D5.GPIO0_8 */
>;
};
rgb_health_i2c2_pins_default: rgb-health-i2c2-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x00b0, PIN_INPUT_PULLUP, 1) /* (K22) GPMC0_CSn2.I2C2_SCL */
AM62X_IOPAD(0x00b4, PIN_INPUT_PULLUP, 1) /* (K24) GPMC0_CSn3.I2C2_SDA */
>;
};
};
&main_i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&rgb_health_i2c2_pins_default>;
clock-frequency = <100000>;
status = "okay";
/* RGB health indicator @32 */
lp5521: led-controller@32 {
compatible = "ti,lp5521";
reg = <0x32>;
status = "okay";
pinctrl-names = "default";
label = "lp5521_pri";
pinctrl-0 = <&lp5521_pins_default>;
enable-gpios = <&main_gpio0 8 GPIO_ACTIVE_HIGH>;
// reset-gpio = <&main_gpio0 10 GPIO_ACTIVE_HIGH>;
// Define LED channels with default brightness
led@0 {
label = "lp5521:red";
reg = <0>; // Channel 0
default-state = "on"; // Can be "on", "off", or "keep"
max-brightness = <0x5f>; // Maximum value
brightness = <0x2f>; // Default brightness
};
led@1 {
label = "lp5521:green";
reg = <1>;
default-state = "on";
max-brightness = <0x5f>;
brightness = <0x2f>;
};
led@2 {
label = "lp5521:blue";
reg = <2>;
default-state = "on";
max-brightness = <0x5f>;
brightness = <0x2f>;
};
};
};
arch/arm64/configs/am62x_var_defconfig
CONFIG_LEDS_CLASS_MULTICOLOR=y CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LEDS_LP5521=m // Also try with 'y' option CONFIG_I2C=y CONFIG_I2C_CHARDEV=y
Console Output:
After setting GPIO0_8 set to HIGH, LP5521 device detect on I2C 2 bus as shown above but when we try to load driver it failed with error message:
lp5521: probe of 2-0032 failed with error -22
