RK3328-CC 设备树与硬件不匹配

刚接触linux 不知道说的对不对,我想用ROC-RK3328-CC上40pin中的gpio引脚,看电路图应该给是连接到了GPIO0_A0,但是官方设备树里边这个引脚好像被usb3用了,不知道原因,还请各位达人指教。
而且leds相关的设备树有两个灯属于RK805 电源芯片,红外输入引脚也没有使能。

vcc_host_5v: vcc-host-5v-regulator {
	compatible = "regulator-fixed";
	enable-active-high;
	gpio = <&gpio0 0 GPIO_ACTIVE_HIGH>;
	pinctrl-names = "default";
	pinctrl-0 = <&usb30_host_drv>;
	regulator-name = "vcc_host_5v";
	regulator-always-on;
	vin-supply = <&vcc_sys>;
};

leds {
	compatible = "gpio-leds";
	power {
		label = "firefly:blue:power";
		linux,default-trigger = "ir-power-click";
		gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
		default-state = "on";
		mode = <0x23>;
	};

	user {
		label = "firefly:yellow:user";
        linux,default-trigger = "ir-user-click";
		gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
		default-state = "off";
		mode = <0x05>;
	};

	ir {
		status = "disabled";
		/* gpios = <&gpio2 GPIO_C2 GPIO_ACTIVE_HIGH>; */
		linux,default-trigger = "ir";
		default-state = "off";
		mode = <0x00>;
	};
};

本帖最后由 hiking 于 2019-1-4 19:34 编辑

我使用板载的GPIO也没有驱动成功,后来按照教程:http://www.t-firefly.com/doc/product/info/255.html,
使用引脚SDIO改成普通GPIO成功驱动LED。

另外上面的例程中,我在匹配设备树关键属性compatible时一直失败,
后来参考/kernel/drivers/leds/leds-gpio.c,使用of_match_ptr解决;

static struct platform_driver firefly_gpio_driver = {
        .driver = {
                .name = "firefly-gpio",
                .owner = THIS_MODULE,
                .of_match_table = of_match_ptr(firefly_match_table),
        },
    .remove =  gpio_remove,
        .probe = firefly_gpio_probe,
};

hiking 发表于 2019-1-4 19:32
我使用板载的GPIO也没有驱动成功,后来按照教程:http://www.t-firefly.com/doc/product/info/255.html,

好的,谢谢 我试试