|
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
|
|
97 | 97 | #define E_INFO_PHY_SCAN 0xD7
|
98 | 98 | #define E_INFO_PHY_DRIVER 0xD8
|
99 | 99 |
|
| 100 | +/* FW write command, 0x54 0x?? 0x0, 0x01 */ |
| 101 | +#define E_POWER_STATE_SLEEP 0x50 |
| 102 | +#define E_POWER_STATE_RESUME 0x58 |
| 103 | + |
100 | 104 | #define MAX_RETRIES 3
|
101 | 105 | #define MAX_FW_UPDATE_RETRIES 30
|
102 | 106 |
|
@@ -269,8 +273,8 @@ static int elants_i2c_calibrate(struct elants_data *ts)
|
269 | 273 | {
|
270 | 274 | struct i2c_client *client = ts->client;
|
271 | 275 | int ret, error;
|
272 |
| - static const u8 w_flashkey[] = { 0x54, 0xC0, 0xE1, 0x5A }; |
273 |
| - static const u8 rek[] = { 0x54, 0x29, 0x00, 0x01 }; |
| 276 | + static const u8 w_flashkey[] = { CMD_HEADER_WRITE, 0xC0, 0xE1, 0x5A }; |
| 277 | + static const u8 rek[] = { CMD_HEADER_WRITE, 0x29, 0x00, 0x01 }; |
274 | 278 | static const u8 rek_resp[] = { CMD_HEADER_REK, 0x66, 0x66, 0x66 };
|
275 | 279 |
|
276 | 280 | disable_irq(client->irq);
|
@@ -1388,7 +1392,9 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev)
|
1388 | 1392 | {
|
1389 | 1393 | struct i2c_client *client = to_i2c_client(dev);
|
1390 | 1394 | struct elants_data *ts = i2c_get_clientdata(client);
|
1391 |
| - const u8 set_sleep_cmd[] = { 0x54, 0x50, 0x00, 0x01 }; |
| 1395 | + const u8 set_sleep_cmd[] = { |
| 1396 | + CMD_HEADER_WRITE, E_POWER_STATE_SLEEP, 0x00, 0x01 |
| 1397 | + }; |
1392 | 1398 | int retry_cnt;
|
1393 | 1399 | int error;
|
1394 | 1400 |
|
@@ -1425,7 +1431,9 @@ static int __maybe_unused elants_i2c_resume(struct device *dev)
|
1425 | 1431 | {
|
1426 | 1432 | struct i2c_client *client = to_i2c_client(dev);
|
1427 | 1433 | struct elants_data *ts = i2c_get_clientdata(client);
|
1428 |
| - const u8 set_active_cmd[] = { 0x54, 0x58, 0x00, 0x01 }; |
| 1434 | + const u8 set_active_cmd[] = { |
| 1435 | + CMD_HEADER_WRITE, E_POWER_STATE_RESUME, 0x00, 0x01 |
| 1436 | + }; |
1429 | 1437 | int retry_cnt;
|
1430 | 1438 | int error;
|
1431 | 1439 |
|
|
0 commit comments