请教各位高手。我想用drivers/i2c/busses/i2c-gpio.c 模拟iic,硬件iic口没有使用,io被占用了。要怎么玩?
menuconfig配置如下
-*- I2C support
Enable compatibility bits for old user-space
<*> I2C device interface
<*> I2C bus multiplexing support
Multiplexer I2C Chip support --->
[**] Autoselect pertinent helper modules
I2C Hardware Bus support --->
*** I2C system bus drivers (mostly embedded / system-on-chip)
│ │ < > CBUS I2C driver
│ │ < > Synopsys DesignWare Platform
│ │ < > EMMA Mobile series I2C adapter
│ │ <*> GPIO-based bitbanging I2C
│ │ < > Marvell mv64xxx I2C Controller
│ │ < > OpenCores I2C Controller
│ │ < > PCA9564/PCA9665 as platform device
│ │ < > Rockchip RK3xxx I2C adapter
│ │ < > Simtec Generic I2C interface
dts如下
i2c0@0 {
compatible = "i2c-gpio";
gpios = <&pio 2 2 // sda
&pio 2 1 // scl
>;
i2c-gpio,sda-open-drain;
i2c-gpio,scl-open-drain;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
//rv3029c2@56 {
//compatible = "rv3029c2";
//reg = <0x56>;
//};
};
启动后报错, OF: /soc/i2c0@0: could not get #gpio-cells for /soc/clock@01c20000
是不是gpio配置不对,
&pio 2 2 /* sda */
&pio 2 1这两个口是串口,没有使用,应该不会被占用,
设备树怎么写?请教大家了
最近编辑记录 psst (2019-11-16 18:19:36)
离线