hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/input/mouse/elan_i2c.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Elan I2C/SMBus Touchpad driver
34 *
....@@ -8,10 +9,6 @@
89 * Based on cyapa driver:
910 * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
1011 * copyright (c) 2011-2012 Google, Inc.
11
- *
12
- * This program is free software; you can redistribute it and/or modify it
13
- * under the terms of the GNU General Public License version 2 as published
14
- * by the Free Software Foundation.
1512 *
1613 * Trademarks are the property of their respective owners.
1714 */
....@@ -29,6 +26,24 @@
2926
3027 #define ETP_CALIBRATE_MAX_LEN 3
3128
29
+#define ETP_FEATURE_REPORT_MK BIT(0)
30
+
31
+#define ETP_REPORT_ID 0x5D
32
+#define ETP_TP_REPORT_ID 0x5E
33
+#define ETP_TP_REPORT_ID2 0x5F
34
+#define ETP_REPORT_ID2 0x60 /* High precision report */
35
+
36
+#define ETP_REPORT_ID_OFFSET 2
37
+#define ETP_TOUCH_INFO_OFFSET 3
38
+#define ETP_FINGER_DATA_OFFSET 4
39
+#define ETP_HOVER_INFO_OFFSET 30
40
+#define ETP_MK_DATA_OFFSET 33 /* For high precision reports */
41
+
42
+#define ETP_MAX_REPORT_LEN 39
43
+
44
+#define ETP_MAX_FINGERS 5
45
+#define ETP_FINGER_DATA_LEN 5
46
+
3247 /* IAP Firmware handling */
3348 #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0"
3449 #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin"
....@@ -36,6 +51,8 @@
3651 #define ETP_FW_IAP_PAGE_ERR (1 << 5)
3752 #define ETP_FW_IAP_INTF_ERR (1 << 4)
3853 #define ETP_FW_PAGE_SIZE 64
54
+#define ETP_FW_PAGE_SIZE_128 128
55
+#define ETP_FW_PAGE_SIZE_512 512
3956 #define ETP_FW_SIGNATURE_SIZE 6
4057
4158 struct i2c_client;
....@@ -58,8 +75,9 @@
5875 int (*get_baseline_data)(struct i2c_client *client,
5976 bool max_baseliune, u8 *value);
6077
61
- int (*get_version)(struct i2c_client *client, bool iap, u8 *version);
62
- int (*get_sm_version)(struct i2c_client *client,
78
+ int (*get_version)(struct i2c_client *client, u8 pattern, bool iap,
79
+ u8 *version);
80
+ int (*get_sm_version)(struct i2c_client *client, u8 pattern,
6381 u16 *ic_type, u8 *version, u8 *clickpad);
6482 int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
6583 int (*get_product_id)(struct i2c_client *client, u16 *id);
....@@ -75,13 +93,18 @@
7593 int (*iap_get_mode)(struct i2c_client *client, enum tp_mode *mode);
7694 int (*iap_reset)(struct i2c_client *client);
7795
78
- int (*prepare_fw_update)(struct i2c_client *client);
79
- int (*write_fw_block)(struct i2c_client *client,
96
+ int (*prepare_fw_update)(struct i2c_client *client, u16 ic_type,
97
+ u8 iap_version, u16 fw_page_size);
98
+ int (*write_fw_block)(struct i2c_client *client, u16 fw_page_size,
8099 const u8 *page, u16 checksum, int idx);
81100 int (*finish_fw_update)(struct i2c_client *client,
82101 struct completion *reset_done);
83102
84
- int (*get_report)(struct i2c_client *client, u8 *report);
103
+ int (*get_report_features)(struct i2c_client *client, u8 pattern,
104
+ unsigned int *features,
105
+ unsigned int *report_len);
106
+ int (*get_report)(struct i2c_client *client, u8 *report,
107
+ unsigned int report_len);
85108 int (*get_pressure_adjustment)(struct i2c_client *client,
86109 int *adjustment);
87110 int (*get_pattern)(struct i2c_client *client, u8 *pattern);