[firefly rk3288] [android5.1] hid-over-i2c 觸摸屏調適問題, [已解決]
本帖最后由 bnlinemily 于 2019-6-21 14:07 编辑hi, all:
目前在調適觸摸屏, goodix的 ...
第一次用 hid-over-i2c, 搞不定, 請各位幫幫忙
dts設定依供應商資料調整如下
&i2c1 {
status = "okay";
goodix-hid-over-i2c@5d {
compatible = "hid-over-i2c";
reg = <0x5d>;
interrupt-parent = <&gpio8>;
interrupts = <GPIO_A7 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = "default";
// pinctrl-0 = <&ts_int_input>;
pinctrl-0 = <&gpio8 GPIO_A7>;
}
make menuconfig添加了 hid-over-i2c
"Device Drivers" -> "HID support" -> "I2C HID support" -> "HID over I2C transport layer"
compile, reflash & reboot
getevent 未見到 hid-over-i2c?
觸摸無反應...
請各位幫幫忙 給點意見 与方向
HI~最近我也剛調整過,你可以看看如下論文參考!請注意在dts這邊寫的資料設定腳位與名稱~
http://dev.t-firefly.com/forum.php?mod=viewthread&tid=2427&highlight=I2C opster18 发表于 2019-6-5 09:29
HI~最近我也剛調整過,你可以看看如下論文參考!請注意在dts這邊寫的資料設定腳位與名稱~
http://dev.t- ...
hi, opster18:
謝謝你的資料提供
先前也有看過這篇文章, 也成功調適過 focal / goodix / synaptics/cypress / atmel /weida
如你提供的文件, 這個套路幫了好多次忙....
然而 在 goodix hid-over i2c這邊.... 卡了好久了...
如果有進一步的資料, 請再幫忙補充, 謝謝
bnlinemily 发表于 2019-6-12 18:21
hi, opster18:
謝謝你的資料提供
你好,请问您调试OK了吗?
最近也刚好拿到goodix的触摸屏在调试
用的是 hid over i2c 协议,一样没反应... hi, clare1942:
今天剛好可以touch了
但是.... 莫名其妙地完成...
原本goodix i2c address 0x5d
依據 gooodix 手冊填寫 dts
compile ==>
檢查 i2c1 address
==> 0x10?
與 i2c2 address 相同?? 也是 0x10
故修改dtsi2c1 goodix address to 0x10
然後就.... 突然可以touch了
一整個莫名其妙,
還在釐清中,
過程中 i2c_hid.c driver 有小修改...
還在釐清這幾天來做的事.....
你看要不要先確認 i2c1 ......
有清楚的結果再來報告. bnlinemily 发表于 2019-6-14 17:54
hi, clare1942:
今天剛好可以touch了
我也调试好了,主要问题是RK3288 的i2c-hid.c 版本比较旧
有几个地方需要修改,如果有需要我在整理贴上来吧
汇顶的i2c地址会和硬件配置有关系 本帖最后由 bnlinemily 于 2019-6-18 16:03 编辑
clare1942 发表于 2019-6-18 14:26
我也调试好了,主要问题是RK3288 的i2c-hid.c 版本比较旧
有几个地方需要修改,如果有需要我在整理贴上 ...
hi, clare1942:
非常需要你的幫忙....
可以麻煩你整理說明嗎?
我這邊雖然touch能動了... 但是 一頭霧水...
先謝謝你幫忙!
本帖最后由 bnlinemily 于 2019-6-18 15:49 编辑
我先拋磚引玉
我修改的部分. 兩個檔案 i2c-hid.c/ firefly_rk3288.dts
i2c-hid.c
ln 950 附近---
address抓不到... 故修改為
--------------------------------------------------------------------------
if (!platform_data) {
# if 0
ret = i2c_hid_acpi_pdata(client, &ihid->pdata);
if (ret) {
dev_err(&client->dev,
"HID register address not provided\n");
goto err;
#else //0
ihid->pdata.hid_descriptor_address = 0x0001;
#endif //0 }
--------------------------------------------------------------------------
1n 1079 附近 ....
for hid device 修改為
--------------------------------------------------------------------------
static const struct i2c_device_id i2c_hid_id_table[] = {
{ "hid", 0 },
{ "hid-over-i2c", 0 },
{ },
};
--------------------------------------------------------------------------
firefly_rk3288.dts 修改i2c1 部分
--------------------------------------------------------------------------
&i2c1 {
status = "okay";
goodix-hid-over-i2c@10 {
compatible = "hid-over-i2c";
reg = <0x10>;
hid-descr-addr = <0x0001>;
interrupt-parent = <&gpio8>;
interrupts = <GPIO_A7 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = "default";
};
};
--------------------------------------------------------------------------
1.i2c-hid.c
我是参考新版的驱动改的,
+#ifdef CONFIG_OF
+static int i2c_hid_of_probe(struct i2c_client *client,
+ struct i2c_hid_platform_data *pdata)
+{
+ struct device *dev = &client->dev;
+ u32 val;
+ int ret;
+
+ ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val);
+ if (ret) {
+ dev_err(&client->dev, "HID register address not provided\n");
+ return -ENODEV;
+ }
+ if (val >> 16) {
+ dev_err(&client->dev, "Bad HID register address: 0x%08x\n",
+ val);
+ return -EINVAL;
+ }
+ pdata->hid_descriptor_address = val;
+ return 0;
+}
+static const struct of_device_id i2c_hid_of_match[] = {
+ { .compatible = "hid-over-i2c" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, i2c_hid_of_match);
+#else
+static inline int i2c_hid_of_probe(struct i2c_client *client,
+ struct i2c_hid_platform_data *pdata)
+{
+ return -ENODEV;
+}
+#endif
static int i2c_hid_probe(struct i2c_client *client,
const struct i2c_device_id *dev_id)
{
int ret;
struct i2c_hid *ihid;
struct hid_device *hid;
__u16 hidRegister;
struct i2c_hid_platform_data *platform_data = client->dev.platform_data;
dbg_hid("HID probe called for i2c 0x%02x\n", client->addr);
if (!client->irq) {
dev_err(&client->dev,
"HID over i2c has not been provided an Int IRQ\n");
return -EINVAL;
}
ihid = kzalloc(sizeof(struct i2c_hid), GFP_KERNEL);
+ if (!ihid)
+ return -ENOMEM;
+
+ if (client->dev.of_node) {
+ ret = i2c_hid_of_probe(client, &ihid->pdata);
+ if (ret)
+ goto err;
+ } else if (!platform_data) {
+ ret = i2c_hid_acpi_pdata(client, &ihid->pdata);
+ if (ret) {
+ dev_err(&client->dev,
+ "HID register address not provided\n");
+ goto err;
+ }
} else {
ihid->pdata = *platform_data;
}
i2c_set_clientdata(client, ihid);
....................
...................
static struct i2c_driver i2c_hid_driver = {
.driver = {
.name = "i2c_hid",
.owner = THIS_MODULE,
.pm = &i2c_hid_pm,
.acpi_match_table = ACPI_PTR(i2c_hid_acpi_match),
+ .of_match_table = of_match_ptr(i2c_hid_of_match),
},
2.i2c address你必须看你的触摸屏的配置
如果是goodix 有0xBA/oxBB 地址使用0x5d, 0x28/0x29 地址使用0x14
3. firefly-rk3288_defconfig
增加 CONFIG_I2C_HID=y
4. firefly-rk3288.dts
&pinctrl 增加
gpio8_gpio {
gpio8_a7: gpio8-a7 {
rockchip,pins = <GPIO8_A7>;
rockchip,pull = <VALUE_PULL_UP>;
};
};
&i2c1 增加
i2c_hid@5d {
status = "okay";
compatible = "hid-over-i2c";
reg = <0x5d>;
hid-descr-addr = <0x0001>;
interrupt-parent = <&gpio8>;
interrupts = <GPIO_A7 IRQ_TYPE_EDGE_RISING>;
pinctrl-names = "default";
pinctrl-0 = <&gpio8_a7>;
};
应该就这些
clare1942 发表于 2019-6-19 15:19
1.i2c-hid.c
我是参考新版的驱动改的,
+#ifdef CONFIG_OF
hi, clare1942:
感謝幫忙,
因為你的資料, 也幫忙抓到問題了....
PS:確認供應商的address 是改成 0x10....
ps: 也謝謝 opster18 的回覆....
页:
[1]