Skip to content

Commit 261bfb3

Browse files
synavincentdtor
authored andcommitted
Input: synaptics-rmi4 - rename f30_data to gpio_data
f30_data in rmi_device_platform_data could be also referenced by RMI function 3A, so rename it and the structure name to avoid confusion. Signed-off-by: Vincent Huang <vincent.huang@tw.synaptics.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Link: https://lore.kernel.org/r/20200930094147.635556-2-vincent.huang@tw.synaptics.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2682265 commit 261bfb3

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

drivers/hid/hid-rmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
721721
}
722722

723723
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
724-
rmi_hid_pdata.f30_data.disable = true;
724+
rmi_hid_pdata.gpio_data.disable = true;
725725

726726
data->xport.dev = hdev->dev.parent;
727727
data->xport.pdata = rmi_hid_pdata;

drivers/input/mouse/synaptics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ static int synaptics_create_intertouch(struct psmouse *psmouse,
17521752
.kernel_tracking = false,
17531753
.topbuttonpad = topbuttonpad,
17541754
},
1755-
.f30_data = {
1755+
.gpio_data = {
17561756
.buttonpad = SYN_CAP_CLICKPAD(info->ext_cap_0c),
17571757
.trackstick_buttons =
17581758
!!SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10),

drivers/input/rmi4/rmi_f30.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ static int rmi_f30_config(struct rmi_function *fn)
168168
rmi_get_platform_data(fn->rmi_dev);
169169
int error;
170170

171-
/* can happen if f30_data.disable is set */
171+
/* can happen if gpio_data.disable is set */
172172
if (!f30)
173173
return 0;
174174

175-
if (pdata->f30_data.trackstick_buttons) {
175+
if (pdata->gpio_data.trackstick_buttons) {
176176
/* Try [re-]establish link to F03. */
177177
f30->f03 = rmi_find_function(fn->rmi_dev, 0x03);
178178
f30->trackstick_buttons = f30->f03 != NULL;
179179
}
180180

181-
if (pdata->f30_data.disable) {
181+
if (pdata->gpio_data.disable) {
182182
drv->clear_irq_bits(fn->rmi_dev, fn->irq_mask);
183183
} else {
184184
/* Write Control Register values back to device */
@@ -245,10 +245,10 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
245245
if (!rmi_f30_is_valid_button(i, f30->ctrl))
246246
continue;
247247

248-
if (pdata->f30_data.trackstick_buttons &&
248+
if (pdata->gpio_data.trackstick_buttons &&
249249
i >= TRACKSTICK_RANGE_START && i < TRACKSTICK_RANGE_END) {
250250
f30->gpioled_key_map[i] = trackstick_button++;
251-
} else if (!pdata->f30_data.buttonpad || !button_mapped) {
251+
} else if (!pdata->gpio_data.buttonpad || !button_mapped) {
252252
f30->gpioled_key_map[i] = button;
253253
input_set_capability(input, EV_KEY, button++);
254254
button_mapped = true;
@@ -264,7 +264,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
264264
* but I am not sure, so use only the pdata info and the number of
265265
* mapped buttons.
266266
*/
267-
if (pdata->f30_data.buttonpad || (button - BTN_LEFT == 1))
267+
if (pdata->gpio_data.buttonpad || (button - BTN_LEFT == 1))
268268
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
269269

270270
return 0;
@@ -372,7 +372,7 @@ static int rmi_f30_probe(struct rmi_function *fn)
372372
struct f30_data *f30;
373373
int error;
374374

375-
if (pdata->f30_data.disable)
375+
if (pdata->gpio_data.disable)
376376
return 0;
377377

378378
if (!drv_data->input) {

include/linux/rmi.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,16 @@ struct rmi_2d_sensor_platform_data {
102102
};
103103

104104
/**
105-
* struct rmi_f30_data - overrides defaults for a single F30 GPIOs/LED chip.
105+
* struct rmi_gpio_data - overrides defaults for a single F30/F3A GPIOs/LED
106+
* chip.
106107
* @buttonpad - the touchpad is a buttonpad, so enable only the first actual
107108
* button that is found.
108-
* @trackstick_buttons - Set when the function 30 is handling the physical
109+
* @trackstick_buttons - Set when the function 30 or 3a is handling the physical
109110
* buttons of the trackstick (as a PS/2 passthrough device).
110-
* @disable - the touchpad incorrectly reports F30 and it should be ignored.
111+
* @disable - the touchpad incorrectly reports F30/F3A and it should be ignored.
111112
* This is a special case which is due to misconfigured firmware.
112113
*/
113-
struct rmi_f30_data {
114+
struct rmi_gpio_data {
114115
bool buttonpad;
115116
bool trackstick_buttons;
116117
bool disable;
@@ -218,7 +219,7 @@ struct rmi_device_platform_data {
218219
/* function handler pdata */
219220
struct rmi_2d_sensor_platform_data sensor_pdata;
220221
struct rmi_f01_power_management power_management;
221-
struct rmi_f30_data f30_data;
222+
struct rmi_gpio_data gpio_data;
222223
};
223224

224225
/**

0 commit comments

Comments
 (0)