|
更新resource.img和kernel.img没变化
发表于 2015-11-15 23:54:38
浏览:11420
|
回复:7
打印
只看该作者
[复制链接]
楼主
按着这哩弄hello-led,http://developer.t-firefly.com/f ... &extra=page%3D1
1、在drivers文件夹下建文件夹sai
2、在sai下放好hello.c,makefile,kconfig
3、在dirvers下的makefile,kconfig添加好东西
4、在kernel下make menuconfig设置hello编译到内核
5、make
6、烧录resource.img和kernel.img
重启板子,发现led并没有闪
dts我是这样改的:
firefly-led{
compatible = "firefly,led";
led-work = <&gpio1 GPIO_C7 GPIO_ACTIVE_LOW>;
led-power = <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;
status = "disabled";
};
hello-led{
compatible = "firefly,hello_led";
led= <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;//这里我改成黄色的灯
status = "okay";
};
leds {
compatible = "gpio-leds";
power {
label = "firefly:blue:power";
linux,default-trigger = "ir-power-click";
default-state = "on";
gpios = <&gpio1 GPIO_C7 GPIO_ACTIVE_LOW>;
};
user {
label = "firefly:yellow:user";
linux,default-trigger = "ir-user-click";
default-state = "off";
gpios = <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;
};
};
hello.c里关键是这样的:
#ifdef CONFIG_OF
static const struct of_device_id of_firefly_hello_match[] = {
{ .compatible = "firefly,hello_led" },
{ /* Sentinel */ }
};
#endif
static struct platform_driver firefly_hello_driver = {
.probe = firefly_hello_probe,
.remove = firefly_hello_remove,
.driver = {
.name = "firefly_hello",
.owner = THIS_MODULE,
#ifdef CONFIG_OF
.of_match_table = of_firefly_hello_match,
#endif
},
};
查看板子的dmesg也没看到hello模块加载的printk,请问我哪里弄错了呢? |
|