Other Parts Discussed in Thread: AM4372
Tool/software: Linux
Hi,
I have the following GPIO defined in the device tree:
gpio5_mux_pins: gpio5_mux_pins {
pinctrl-single,pins = <
/* GPIO 5_8 to select LCD / HDMI */
AM4372_IOPAD(0xa38, PIN_OUTPUT_PULLUP | MUX_MODE7)
/* GPIO 5_4 to reset LCD */
AM4372_IOPAD(0xa50, PIN_OUTPUT_PULLUP | MUX_MODE7)
>;
};
&gpio5 {
pinctrl-names = "default";
pinctrl-0 = <&gpio5_mux_pins>;
status = "okay";
ti,no-reset-on-init;
p8 {
/*
* SelLCDorHDMI selects between display and audio paths:
* Low: HDMI display with audio via HDMI
* High: LCD display with analog audio via aic3111 codec
*/
gpio-hog;
gpios = <8 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "SelLCDorHDMI";
};
p4 {
/*
* LCD_Reset
*/
gpio-hog;
gpios = <4 GPIO_ACTIVE_LOW>;
output-high;
line-name = "lcdReset";
};
};
In the c code, the devm_gpiod_get function return error. Which means the lcdReset is not defined in device tree.
struct gpio_desc *gpio;
gpio = devm_gpiod_get(&spi->dev, "lcdReset", GPIOD_OUT_HIGH);
if (IS_ERR(gpio))
{
dev_err(&spi->dev, "Failed to get lcdReset GPIO\n");
printk("Start probe: **** lcdreset_gpios is NOT defind in device tree! ****\n");
printk("the spi dev is %x\n", &spi->dev);
return PTR_ERR(gpio);
}
What wrong with this approach?
On the other hand, I try to add the following line in am437x-gp-evm.dts file, I got syntax error on the line. why?
lcdReset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;