Skip to content

Commit 1e48ee9

Browse files
Input: imagis - add supports for Imagis IST3038
Imagis IST3038 is another variant of Imagis IST3038 IC, which has a different register interface from IST3038C (possibly firmware defined). Unlike IST3038C/IST3032C, IST3038 has different registers for commands, which means IST3038 doesn't use protocol B. Similar to IST3032C and maybe the other variants, IST3038 has touch keys support, which provides KEY_APPSELECT and KEY_BACK. Add support for IST3038 with touch keys. Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com> Link: https://lore.kernel.org/r/20240613025631.5425-4-raymondhackley@protonmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 72d45b6 commit 1e48ee9

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

drivers/input/touchscreen/imagis.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@
1212
#include <linux/property.h>
1313
#include <linux/regulator/consumer.h>
1414

15+
#define IST30XX_REG_STATUS 0x20
16+
#define IST30XX_REG_CHIPID (0x40000000 | IST3038C_DIRECT_ACCESS)
17+
18+
#define IST30XX_WHOAMI 0x30003000
19+
#define IST30XXA_WHOAMI 0x300a300a
20+
#define IST30XXB_WHOAMI 0x300b300b
21+
#define IST3038_WHOAMI 0x30383038
22+
1523
#define IST3032C_WHOAMI 0x32c
24+
#define IST3038C_WHOAMI 0x38c
1625

17-
#define IST3038B_REG_STATUS 0x20
1826
#define IST3038B_REG_CHIPID 0x30
1927
#define IST3038B_WHOAMI 0x30380b
2028

@@ -25,7 +33,6 @@
2533
#define IST3038C_REG_TOUCH_STATUS (IST3038C_REG_HIB_BASE | IST3038C_HIB_ACCESS)
2634
#define IST3038C_REG_TOUCH_COORD (IST3038C_REG_HIB_BASE | IST3038C_HIB_ACCESS | 0x8)
2735
#define IST3038C_REG_INTR_MESSAGE (IST3038C_REG_HIB_BASE | IST3038C_HIB_ACCESS | 0x4)
28-
#define IST3038C_WHOAMI 0x38c
2936
#define IST3038C_CHIP_ON_DELAY_MS 60
3037
#define IST3038C_I2C_RETRY_COUNT 3
3138
#define IST3038C_MAX_FINGER_NUM 10
@@ -397,9 +404,17 @@ static const struct imagis_properties imagis_3032c_data = {
397404
.protocol_b = true,
398405
};
399406

407+
static const struct imagis_properties imagis_3038_data = {
408+
.interrupt_msg_cmd = IST30XX_REG_STATUS,
409+
.touch_coord_cmd = IST30XX_REG_STATUS,
410+
.whoami_cmd = IST30XX_REG_CHIPID,
411+
.whoami_val = IST3038_WHOAMI,
412+
.touch_keys_supported = true,
413+
};
414+
400415
static const struct imagis_properties imagis_3038b_data = {
401-
.interrupt_msg_cmd = IST3038B_REG_STATUS,
402-
.touch_coord_cmd = IST3038B_REG_STATUS,
416+
.interrupt_msg_cmd = IST30XX_REG_STATUS,
417+
.touch_coord_cmd = IST30XX_REG_STATUS,
403418
.whoami_cmd = IST3038B_REG_CHIPID,
404419
.whoami_val = IST3038B_WHOAMI,
405420
};
@@ -415,6 +430,7 @@ static const struct imagis_properties imagis_3038c_data = {
415430
#ifdef CONFIG_OF
416431
static const struct of_device_id imagis_of_match[] = {
417432
{ .compatible = "imagis,ist3032c", .data = &imagis_3032c_data },
433+
{ .compatible = "imagis,ist3038", .data = &imagis_3038_data },
418434
{ .compatible = "imagis,ist3038b", .data = &imagis_3038b_data },
419435
{ .compatible = "imagis,ist3038c", .data = &imagis_3038c_data },
420436
{ },

0 commit comments

Comments
 (0)