中级会员
- 积分
- 282
- 金钱
- 282
- 注册时间
- 2012-9-13
- 在线时间
- 32 小时
|
在学习 zynq-mp-3eg linux驱动的时候,
平台驱动这一块,系统已有leds-gpio 驱动,有点疑问。
首先这个驱动是系统自带的,
如下,设备树里仅仅描述ps侧的两个led,工作是正常的,也符合预期, sys/class/leds 里面也有设备文件。
但是一旦加上 pl 侧的led 描述。 从启动信息里看, gpio_led_probe 执行了多次,且都在 pl_led1 第三个这个描述里 出的错误。
问题:
1:为什么 系统已有leds-gpio 驱动在构建 gpio-led2 驱动的时候会失败, sys/class/leds 里没有任何led设备文件。
gpio-led2 {
label = "pl_led1";
gpios = <&axi_gpio_0 0 0 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "timer";
};
2:就算失败了,gpio_led_probe 为什么会执行多次呢。
我这边排查的方向是什么?
########## gpio_leds_create err1. 的打印位置如下。
led.gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, child,
GPIOD_ASIS,
NULL);
if (IS_ERR(led.gpiod)) {
printk(" ########## gpio_leds_create err1.\r\n");
fwnode_handle_put(child);
return ERR_CAST(led.gpiod);
}
部分启动信息
[ 3.703497] xilinx-video amba_pl@0:vcap_mipi_csi2_rx_v_proc_ss_scaler: DMA initialization failed
[ 3.704087] ########## gpio_leds_create led num[0] labs[ps_led1].
[ 3.706704] mmcblk0boot0: mmc0:0001 8GTF4R 4.00 MiB
[ 3.713045] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice= 5.20
[ 3.713054] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3.713060] usb 1-1: Product: USB2.0 Hub
[ 3.713065] usb 1-1: Manufacturer: GenesysLogic
[ 3.715134] ########## gpio_leds_create led num[1] labs[ps_led2].
[ 3.722204] mmcblk0boot1: mmc0:0001 8GTF4R 4.00 MiB
[ 3.726292] ########## gpio_leds_create err1.
[ 3.735181] mmcblk0rpmb: mmc0:0001 8GTF4R 512 KiB, chardev (242:0)
[ 3.741584] ########## gpio_led_probe2 err priv.
[ 3.777103] xlnx-pl-disp amba_pl@0:drm-pl-disp-mipi_dsi: failed to request dma channel
[ 3.778463] hub 1-1:1.0: USB hub found
[ 3.785171] xlnx-pl-disp amba_pl@0:drm_pl_disp_hdmi: failed to request dma channel
[ 3.789000] hub 1-1:1.0: 4 ports detected
[ 3.796495] xilinx-video amba_pl@0:vcap_mipi_csi2_rx_v_proc_ss_scaler: /amba_pl@0/vcap_mipi_csi2_rx_v_proc_ss_scaler/ports/port@0 initialization failed
[ 3.813871] xilinx-video amba_pl@0:vcap_mipi_csi2_rx_v_proc_ss_scaler: DMA initialization failed
[ 3.823219] ########## gpio_leds_create led num[0] labs[ps_led1].
[ 3.829539] ########## gpio_leds_create led num[1] labs[ps_led2].
[ 3.835812] ########## gpio_leds_create err1.
[ 3.840330] ########## gpio_led_probe2 err priv.
[ 3.845492] xlnx-pl-disp amba_pl@0:drm-pl-disp-mipi_dsi: failed to request dma channel
[ 3.853531] xlnx-pl-disp amba_pl@0:drm_pl_disp_hdmi: failed to request dma channel
[ 3.861260] xilinx-video amba_pl@0:vcap_mipi_csi2_rx_v_proc_ss_scaler: /amba_pl@0/vcap_mipi_csi2_rx_v_proc_ss_scaler/ports/port@0 initialization failed
[ 3.874827] xilinx-video amba_pl@0:vcap_mipi_csi2_rx_v_proc_ss_scaler: DMA initialization failed
[ 3.884138] ########## gpio_leds_create led num[0] labs[ps_led1].
[ 3.890454] ########## gpio_leds_create led num[1] labs[ps_led2].
[ 3.896728] ########## gpio_leds_create err1.
[ 3.901246] ########## gpio_led_probe2 err priv.
leds {
compatible = "gpio-leds";
gpio-led0 {
label = "ps_led1";
status="okay";
gpios = <&gpio 38 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat"; /// heartbeat default-on timer
};
gpio-led1 {
label = "ps_led2";
gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "default-on"; /// Documentation/devicetree/bindings/leds/common.txt
};
gpio-led2 {
label = "pl_led1";
gpios = <&axi_gpio_0 0 0 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "timer";
};
gpio-led3 {
label = "pl_led2";
gpios = <&axi_gpio_0 1 0 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "default-on";
};
}
|
|