Skip to content

Commit 5796f7d

Browse files
author
Waveshare_Team
committed
input: touchscreen: Add Sitronix ST7123 touchscreen driver
Add a new I2C touchscreen controller driver for the Sitronix ST7123 chip, organized as a multi-file module under drivers/input/touchscreen/sitronix_st7123/. The driver consists of: - sitronix_ts.c: core touchscreen handling and initialization - sitronix_ts_i2c.c: I2C bus interface layer - sitronix_ts_mt.c: multi-touch reporting - sitronix_ts_upgrade.c: firmware upgrade support - sitronix_ts_utility.c: configuration and mode control Supported features include multi-touch reporting, firmware upgrade, and various operating modes (glove, charge suppression, palm rejection, grip suppression). The driver is built as a module (sitronix-st7123) and depends on I2C and the input subsystem. Signed-off-by: Waveshare_Team <support@waveshare.com>
1 parent dcea86c commit 5796f7d

11 files changed

Lines changed: 9962 additions & 0 deletions

File tree

drivers/input/touchscreen/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,18 @@ config TOUCHSCREEN_SIS_I2C
12511251
To compile this driver as a module, choose M here: the
12521252
module will be called sis_i2c.
12531253

1254+
config TOUCHSCREEN_ST7123
1255+
tristate "Sitronix ST7123 touchscreen controllers"
1256+
depends on I2C
1257+
help
1258+
Say Y here if you want to support the Sitronix ST7123
1259+
touchscreen controller.
1260+
1261+
If unsure, say N.
1262+
1263+
To compile this driver as a module, choose M here: the
1264+
module will be called sitronix-st7123.
1265+
12541266
config TOUCHSCREEN_ST1232
12551267
tristate "Sitronix ST1232 or ST1633 touchscreen controllers"
12561268
depends on I2C

drivers/input/touchscreen/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ obj-$(CONFIG_TOUCHSCREEN_RM_TS) += raydium_i2c_ts.o
8383
obj-$(CONFIG_TOUCHSCREEN_S6SY761) += s6sy761.o
8484
obj-$(CONFIG_TOUCHSCREEN_SILEAD) += silead.o
8585
obj-$(CONFIG_TOUCHSCREEN_SIS_I2C) += sis_i2c.o
86+
obj-$(CONFIG_TOUCHSCREEN_ST7123) += sitronix_st7123/
8687
obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o
8788
obj-$(CONFIG_TOUCHSCREEN_STMFTS) += stmfts.o
8889
obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
sitronix-st7123-objs = sitronix_ts.o sitronix_ts_i2c.o sitronix_ts_utility.o sitronix_ts_mt.o sitronix_ts_upgrade.o
3+
obj-m += sitronix-st7123.o
4+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
3+
#define ST_CHIPID 0x83
4+
5+
6+
/* common */
7+
#define ST_DISPLAY_DUMP_OFF 0x1D7FE
8+
#define ST_DISPLAY_SIZE 0x800
9+
10+
/* flash */
11+
#define ST_FLASH_PAGE_SIZE 4096
12+
#define ST_FLASH_SIZE 0x20000
13+
#define ST_ICP_DISPLAY_FLASH_OFF 0x1D7FE
14+
15+
/* ICP */
16+
#define ST_ADDR_MODE_I2C_ADDR 0x28
17+
18+
/* HDL */
19+
#define ST_RAM_MODE_RETRY_MAX 3
20+
#define ST_FW_LEN 0x010000
21+
#define ST_HDL_PRAM_ADDR 0x7F0000
22+
#define ST_FW_LEN_PART2 0x002000
23+
#define ST_HDL_PRAM_ADDR_PART2 0x400000
24+
#define ST_HDL_URAM_ADDR 0x000000
25+
#define ST_HDL_DISPLAY_RAM_ADDR 0x030000
26+
27+
/* IC register */
28+
#define ST_MISC_INFO_PROX_FLAG 0x20
29+
#define ST_MISC_INFO_COORD_CHKSUM_FLAG 0x10
30+
31+
32+
typedef enum {
33+
ST_MODE_SWU = 1,
34+
ST_MODE_GLOVE = 2,
35+
ST_MODE_CHARGE = 3,
36+
ST_MODE_JITTERSUPPRESS = 4,
37+
ST_MODE_PALM = 5,
38+
ST_MODE_HEADPHONE = 6,
39+
ST_MODE_GRIP = 7,
40+
ST_MODE_SIZE = 8,
41+
ST_MODE_RESTORE_START = 2,
42+
ST_MODE_SWITCH_OFF = 0,
43+
ST_MODE_SWITCH_ON = 0x80
44+
} SITRONIX_MODE_SWITCH;
45+
46+
typedef enum {
47+
ST_MODE_GRIP_ROTATE_0 = 0,
48+
ST_MODE_GRIP_ROTATE_90 = 1,
49+
ST_MODE_GRIP_ROTATE_180 = 2,
50+
ST_MODE_GRIP_ROTATE_270 = 3,
51+
} ST_MODE_GRIP_ROTATE_VALUE;

0 commit comments

Comments
 (0)