iTOP-IMX6Q开发板设备树-RFID驱动-修改手册

喜你入骨 提交于 2019-12-01 09:44:51

此文档基于迅为iTOP-iMX6开发板

1.内核
拷贝rc522驱动到iTOP-iMX6_android6.0.1/kernel_imx/drivers/spi目录下。
打开iTOP-iMX6_android6.0.1/kernel_imx/drivers/spi/Makefile
添加:
obj-$(CONFIG_SPI_RC522) += rc522.o

iTOP-iMX6_android6.0.1/kernel_imx/drivers/spi/Kconfig
在文件末尾添加:
config SPI_RC522
tristate "RC522 Module driver support"
help
This supports RC522 Module drivers.

2.修改设备树文件
iTOP-iMX6_android6.0.1/kernel_imx/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
(1)添加:
&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio2 27 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";

rfid: rc522@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "rc522";
spi-max-frequency = <10000000>;
reg = <0>;
};
};


pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX6QDL_PAD_EIM_OE__ECSPI2_MISO 0x100b1
MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI 0x100b1
MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK 0x100b1
MX6QDL_PAD_EIM_LBA__GPIO2_IO27 0x1b0b0
>;
};

(2) 注释语句

MX6QDL_PAD_EIM_CS1__GPIO2_IO24 0x80000000

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!