我驱动DM9051NP的时候,需要用到INT引脚(PE2,下降沿中断),想在设备树中进行描述该中断。
参考了 https://whycan.cn/t_2393.html 和 https://whycan.cn/t_1261.html
设备树中这样写不知道对不对,
<code>
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_a>;
status = "okay";
spi-max-frequency = <25000000>;
dm9051@0 {
compatible = "davicom,dm9051";
reg = <0>;
spi-max-frequency = <25000000>;/*<109000000>;*/
status = "okay";
autorepeat;
dm9051_int {
label = "DM9051 INT IRQ";
linux,code = <DM9051 INT>;
interrupt-parent = <&pio>;
interrupts = <4 2 IRQ_TYPE_EDGE_FALLING> /* pe2 */
};
};
};
</code>
驱动中应该是使用platform_get_irq 还是of_xxx进行获取中断号呢?
离线