新手入门
- 积分
- 10
- 金钱
- 10
- 注册时间
- 2023-6-2
- 在线时间
- 2 小时
|
楼主 |
发表于 2023-8-4 17:48:38
|
显示全部楼层
怎么发不了图片?那就直接给设备树的节点代码
49.3.1的设备树代码如下,没有添加中断相关属性,故不能申请中断
// ============示例代码 49.3.1.2 创建 KEY 节点 ==================
1 key {
2 #address-cells = <1>;
3 #size-cells = <1>;
4 compatible = "atkalpha-key";
5 pinctrl-names = "default";
6 pinctrl-0 = <&pinctrl_key>;
7 key-gpio = <&gpio1 18 GPIO_ACTIVE_LOW>; /* KEY0 */
8 status = "okay";
9 };
需要将其修改为:
key{
#address-cells = <1>;
#size-cells = <1>;
compatible = "alientek-key";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_key>;
key-gpio = <&gpio1 18 GPIO_ACTIVE_LOW>;
interrupt-parent = <&gpio1>;
interrupts = <18 IRQ_TYPE_EDGE_BOTH>; /* FALLING RISING */
status = "okay";
};
|
|