Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: elants - document some registers and values

Add information found in downstream kernels, to make the code less
magic.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/728fff020bc92be10d84cc2a7ea8af6fd99af96c.1607669375.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Michał Mirosław and committed by
Dmitry Torokhov
c18b443c 3d722dd4

+13 -5
+13 -5
drivers/input/touchscreen/elants_i2c.c
··· 82 82 83 83 #define HEADER_REPORT_10_FINGER 0x62 84 84 85 - /* Header (4 bytes) plus 3 fill 10-finger packets */ 85 + /* Header (4 bytes) plus 3 full 10-finger packets */ 86 86 #define MAX_PACKET_SIZE 169 87 87 88 88 #define BOOT_TIME_DELAY_MS 50 ··· 96 96 #define E_INFO_OSR 0xD6 97 97 #define E_INFO_PHY_SCAN 0xD7 98 98 #define E_INFO_PHY_DRIVER 0xD8 99 + 100 + /* FW write command, 0x54 0x?? 0x0, 0x01 */ 101 + #define E_POWER_STATE_SLEEP 0x50 102 + #define E_POWER_STATE_RESUME 0x58 99 103 100 104 #define MAX_RETRIES 3 101 105 #define MAX_FW_UPDATE_RETRIES 30 ··· 273 269 { 274 270 struct i2c_client *client = ts->client; 275 271 int ret, error; 276 - static const u8 w_flashkey[] = { 0x54, 0xC0, 0xE1, 0x5A }; 277 - static const u8 rek[] = { 0x54, 0x29, 0x00, 0x01 }; 272 + static const u8 w_flashkey[] = { CMD_HEADER_WRITE, 0xC0, 0xE1, 0x5A }; 273 + static const u8 rek[] = { CMD_HEADER_WRITE, 0x29, 0x00, 0x01 }; 278 274 static const u8 rek_resp[] = { CMD_HEADER_REK, 0x66, 0x66, 0x66 }; 279 275 280 276 disable_irq(client->irq); ··· 1392 1388 { 1393 1389 struct i2c_client *client = to_i2c_client(dev); 1394 1390 struct elants_data *ts = i2c_get_clientdata(client); 1395 - const u8 set_sleep_cmd[] = { 0x54, 0x50, 0x00, 0x01 }; 1391 + const u8 set_sleep_cmd[] = { 1392 + CMD_HEADER_WRITE, E_POWER_STATE_SLEEP, 0x00, 0x01 1393 + }; 1396 1394 int retry_cnt; 1397 1395 int error; 1398 1396 ··· 1431 1425 { 1432 1426 struct i2c_client *client = to_i2c_client(dev); 1433 1427 struct elants_data *ts = i2c_get_clientdata(client); 1434 - const u8 set_active_cmd[] = { 0x54, 0x58, 0x00, 0x01 }; 1428 + const u8 set_active_cmd[] = { 1429 + CMD_HEADER_WRITE, E_POWER_STATE_RESUME, 0x00, 0x01 1430 + }; 1435 1431 int retry_cnt; 1436 1432 int error; 1437 1433