diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..0eccee0 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/opt/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc", + "cStandard": "c17", + "cppStandard": "gnu++17", + "intelliSenseMode": "linux-gcc-arm64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..162f60b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "fb.h": "c" + } +} \ No newline at end of file diff --git a/src/cst816x.c b/src/cst816x.c index c844fd4..5410e3b 100644 --- a/src/cst816x.c +++ b/src/cst816x.c @@ -386,14 +386,16 @@ static int cst816d_probe(struct i2c_client *client, const struct i2c_device_id * printk(KERN_EMERG "cst816d = %d \n",io_cst816d_reset); - irq_gpio = devm_gpiod_get(&client->dev, "intirq", GPIOD_IN); - if (IS_ERR(irq_gpio)) - return -ENODEV; + /* 获取第一个 GPIO 引脚,并设置为输入 */ + irq_gpio = gpiod_get(&client->dev, "intirq", GPIOD_IN); + if (IS_ERR(irq_gpio)) + return -ENODEV; + printk(KERN_EMERG "gpio num intirq\n"); ret = alloc_chrdev_region(&cst816x_devno, 0, DEV_CNT, DEV_NAME); if (ret < 0) { - printk("fail to alloc cst816x_devno\n"); + printk(KERN_EMERG "fail to alloc cst816x_devno\n"); goto alloc_err; }