Skip to content

Commit a61f9e4

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: asus: Add report_size to struct asus_touchpad_info
Add the report_size to struct asus_touchpad_info instead of calculating it. This is a preparation patch for adding support for the multi-touch touchpad found on the Medion Akoya E1239T's keyboard-dock, which uses the same custom multi-touch protocol as the Asus keyboard-docks (same chipset vendor, Integrated Technology Express / ITE). The only difference in that the Akoya E1239T keyboard-dock's input-reports have a 5 byte footer instead of a 1 byte footer, which requires the report_size to be configurable per touchpad-model. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4bc43a4 commit a61f9e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/hid/hid-asus.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct asus_touchpad_info {
102102
int res_y;
103103
int contact_size;
104104
int max_contacts;
105+
int report_size;
105106
};
106107

107108
struct asus_drvdata {
@@ -126,6 +127,7 @@ static const struct asus_touchpad_info asus_i2c_tp = {
126127
.max_y = 1758,
127128
.contact_size = 5,
128129
.max_contacts = 5,
130+
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
129131
};
130132

131133
static const struct asus_touchpad_info asus_t100ta_tp = {
@@ -135,6 +137,7 @@ static const struct asus_touchpad_info asus_t100ta_tp = {
135137
.res_y = 27, /* units/mm */
136138
.contact_size = 5,
137139
.max_contacts = 5,
140+
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
138141
};
139142

140143
static const struct asus_touchpad_info asus_t100ha_tp = {
@@ -144,6 +147,7 @@ static const struct asus_touchpad_info asus_t100ha_tp = {
144147
.res_y = 29, /* units/mm */
145148
.contact_size = 5,
146149
.max_contacts = 5,
150+
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
147151
};
148152

149153
static const struct asus_touchpad_info asus_t200ta_tp = {
@@ -153,6 +157,7 @@ static const struct asus_touchpad_info asus_t200ta_tp = {
153157
.res_y = 28, /* units/mm */
154158
.contact_size = 5,
155159
.max_contacts = 5,
160+
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
156161
};
157162

158163
static const struct asus_touchpad_info asus_t100chi_tp = {
@@ -162,6 +167,7 @@ static const struct asus_touchpad_info asus_t100chi_tp = {
162167
.res_y = 29, /* units/mm */
163168
.contact_size = 3,
164169
.max_contacts = 4,
170+
.report_size = 15 /* 2 byte header + 3 * 4 + 1 byte footer */,
165171
};
166172

167173
static void asus_report_contact_down(struct asus_drvdata *drvdat,
@@ -229,7 +235,7 @@ static int asus_report_input(struct asus_drvdata *drvdat, u8 *data, int size)
229235
int i, toolType = MT_TOOL_FINGER;
230236
u8 *contactData = data + 2;
231237

232-
if (size != 3 + drvdat->tp->contact_size * drvdat->tp->max_contacts)
238+
if (size != drvdat->tp->report_size)
233239
return 0;
234240

235241
for (i = 0; i < drvdat->tp->max_contacts; i++) {

0 commit comments

Comments
 (0)