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

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>

authored by

Vincent Huang and committed by
Dmitry Torokhov
261bfb33 26822652

+15 -14
+1 -1
drivers/hid/hid-rmi.c
··· 721 721 } 722 722 723 723 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; 725 725 726 726 data->xport.dev = hdev->dev.parent; 727 727 data->xport.pdata = rmi_hid_pdata;
+1 -1
drivers/input/mouse/synaptics.c
··· 1752 1752 .kernel_tracking = false, 1753 1753 .topbuttonpad = topbuttonpad, 1754 1754 }, 1755 - .f30_data = { 1755 + .gpio_data = { 1756 1756 .buttonpad = SYN_CAP_CLICKPAD(info->ext_cap_0c), 1757 1757 .trackstick_buttons = 1758 1758 !!SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10),
+7 -7
drivers/input/rmi4/rmi_f30.c
··· 168 168 rmi_get_platform_data(fn->rmi_dev); 169 169 int error; 170 170 171 - /* can happen if f30_data.disable is set */ 171 + /* can happen if gpio_data.disable is set */ 172 172 if (!f30) 173 173 return 0; 174 174 175 - if (pdata->f30_data.trackstick_buttons) { 175 + if (pdata->gpio_data.trackstick_buttons) { 176 176 /* Try [re-]establish link to F03. */ 177 177 f30->f03 = rmi_find_function(fn->rmi_dev, 0x03); 178 178 f30->trackstick_buttons = f30->f03 != NULL; 179 179 } 180 180 181 - if (pdata->f30_data.disable) { 181 + if (pdata->gpio_data.disable) { 182 182 drv->clear_irq_bits(fn->rmi_dev, fn->irq_mask); 183 183 } else { 184 184 /* Write Control Register values back to device */ ··· 245 245 if (!rmi_f30_is_valid_button(i, f30->ctrl)) 246 246 continue; 247 247 248 - if (pdata->f30_data.trackstick_buttons && 248 + if (pdata->gpio_data.trackstick_buttons && 249 249 i >= TRACKSTICK_RANGE_START && i < TRACKSTICK_RANGE_END) { 250 250 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) { 252 252 f30->gpioled_key_map[i] = button; 253 253 input_set_capability(input, EV_KEY, button++); 254 254 button_mapped = true; ··· 264 264 * but I am not sure, so use only the pdata info and the number of 265 265 * mapped buttons. 266 266 */ 267 - if (pdata->f30_data.buttonpad || (button - BTN_LEFT == 1)) 267 + if (pdata->gpio_data.buttonpad || (button - BTN_LEFT == 1)) 268 268 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 269 269 270 270 return 0; ··· 372 372 struct f30_data *f30; 373 373 int error; 374 374 375 - if (pdata->f30_data.disable) 375 + if (pdata->gpio_data.disable) 376 376 return 0; 377 377 378 378 if (!drv_data->input) {
+6 -5
include/linux/rmi.h
··· 102 102 }; 103 103 104 104 /** 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. 106 107 * @buttonpad - the touchpad is a buttonpad, so enable only the first actual 107 108 * 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 109 110 * 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. 111 112 * This is a special case which is due to misconfigured firmware. 112 113 */ 113 - struct rmi_f30_data { 114 + struct rmi_gpio_data { 114 115 bool buttonpad; 115 116 bool trackstick_buttons; 116 117 bool disable; ··· 219 218 /* function handler pdata */ 220 219 struct rmi_2d_sensor_platform_data sensor_pdata; 221 220 struct rmi_f01_power_management power_management; 222 - struct rmi_f30_data f30_data; 221 + struct rmi_gpio_data gpio_data; 223 222 }; 224 223 225 224 /**