RK3399 I2C使用问题请教
刚拿到板子,想添加一个I2C设备,但是怎么都进不去probe , 请教下各位是哪里的问题啊.板子是RK3399-JD4 , Kernel的编译参数是make -j8 ARCH=arm64 rk3399-firefly-aiojd4.img
在rk3399-firefly-port.dtsi 文件I2C1里面添加设备信息如下:
&i2c1 {
status = "okay";
i2c-scl-rising-time-ns = <300>;
i2c-scl-falling-time-ns = <15>;
rt5640: rt5640@1c {
#sound-dai-cells = <0>;
compatible = "realtek,rt5640";
reg = <0x1c>;
clocks = <&cru SCLK_I2S_8CH_OUT>;
clock-names = "mclk";
realtek,in1-differential;
pinctrl-names = "default";
pinctrl-0 = <&rt5640_hpcon &i2s_8ch_mclk>;
hp-con-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
//hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
io-channels = <&saradc 4>;
hp-det-adc-value = <500>;
};
cymbr3116@7A {
compatible = "cymbr3116";
reg = <0x7A>;
status = "okay";
};
};
其中cymbr3116是我添加的设备信息,I2C1我从/sys/bus/i2c/device看是已经挂在上了的.
然后设备驱动源码如下:
#if CONFIG_OF
static struct of_device_id cy311x_of_mach[] = {
{.compatible = "cymbr3116" , },
{},
};
MODULE_DEVICE_TABLE(of, cy311x_of_mach);
#endif
static intcy3x_tk_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
printk("cymbr311x into probe.\n");
return 0;
}
static int cy3x_tk_remove(struct i2c_client *client)
{
printk("cymbr311x into remove.\n");
return 0;
}
static const struct i2c_device_id cy3xctouch_id[] = {
{ "cymbr3116", 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, cy3xctouch_id);
static struct i2c_driver cy3xtouch_i2c_driver= {
.driver = {
.name= "cymbr3116",
#if CONFIG_OF
.of_match_table = of_match_ptr(cy311x_of_mach),
#endif
},
.probe = cy3x_tk_probe,
.remove = cy3x_tk_remove,
.id_table = cy3xctouch_id,
};
module_i2c_driver(cy3xtouch_i2c_driver);
但是怎么都进不去probe , 请教下是哪里有错误啊.
谢谢!!!!
补充下,I2C的驱动应该是成功了的, /sys/bus/i2c/drivers里面能看到驱动 我看官方WIKI 里面的DEMO , gslx680 , 也进不去probe , 我已经吧状态从disabled 修改为okay了. ,还是进不去.
&i2c4 {
gsl3680: gsl3680@41 {
status = "okay";
compatible = "gslX680";
reg = <0x41>;
screen_max_x = <1536>;
screen_max_y = <2048>;
touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
mpu6050:mpu@68{
status = "disabled";
compatible = "invensense,mpu6050";
reg = <0x68>;
mpu-int_config = <0x10>;
mpu-level_shifter = <0>;
mpu-orientation = <0 1 0 1 0 0 0 0 1>;
orientation-x= <1>;
orientation-y= <1>;
orientation-z= <1>;
irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>;
mpu-debug = <1>;
};
}; 我貌似找到问题了,编译kernel生成的resource.img ,我没有烧写。
所以dtb并没有更新。
小白伤不起, 晚上没板子, 明天验证下。
解决了吗? 111
页:
[1]