mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-22 12:42:22 +07:00
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>
This commit is contained in:
parent
26822652c8
commit
261bfb3328
@ -721,7 +721,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
}
|
||||
|
||||
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
|
||||
rmi_hid_pdata.f30_data.disable = true;
|
||||
rmi_hid_pdata.gpio_data.disable = true;
|
||||
|
||||
data->xport.dev = hdev->dev.parent;
|
||||
data->xport.pdata = rmi_hid_pdata;
|
||||
|
@ -1752,7 +1752,7 @@ static int synaptics_create_intertouch(struct psmouse *psmouse,
|
||||
.kernel_tracking = false,
|
||||
.topbuttonpad = topbuttonpad,
|
||||
},
|
||||
.f30_data = {
|
||||
.gpio_data = {
|
||||
.buttonpad = SYN_CAP_CLICKPAD(info->ext_cap_0c),
|
||||
.trackstick_buttons =
|
||||
!!SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10),
|
||||
|
@ -168,17 +168,17 @@ static int rmi_f30_config(struct rmi_function *fn)
|
||||
rmi_get_platform_data(fn->rmi_dev);
|
||||
int error;
|
||||
|
||||
/* can happen if f30_data.disable is set */
|
||||
/* can happen if gpio_data.disable is set */
|
||||
if (!f30)
|
||||
return 0;
|
||||
|
||||
if (pdata->f30_data.trackstick_buttons) {
|
||||
if (pdata->gpio_data.trackstick_buttons) {
|
||||
/* Try [re-]establish link to F03. */
|
||||
f30->f03 = rmi_find_function(fn->rmi_dev, 0x03);
|
||||
f30->trackstick_buttons = f30->f03 != NULL;
|
||||
}
|
||||
|
||||
if (pdata->f30_data.disable) {
|
||||
if (pdata->gpio_data.disable) {
|
||||
drv->clear_irq_bits(fn->rmi_dev, fn->irq_mask);
|
||||
} else {
|
||||
/* Write Control Register values back to device */
|
||||
@ -245,10 +245,10 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
|
||||
if (!rmi_f30_is_valid_button(i, f30->ctrl))
|
||||
continue;
|
||||
|
||||
if (pdata->f30_data.trackstick_buttons &&
|
||||
if (pdata->gpio_data.trackstick_buttons &&
|
||||
i >= TRACKSTICK_RANGE_START && i < TRACKSTICK_RANGE_END) {
|
||||
f30->gpioled_key_map[i] = trackstick_button++;
|
||||
} else if (!pdata->f30_data.buttonpad || !button_mapped) {
|
||||
} else if (!pdata->gpio_data.buttonpad || !button_mapped) {
|
||||
f30->gpioled_key_map[i] = button;
|
||||
input_set_capability(input, EV_KEY, button++);
|
||||
button_mapped = true;
|
||||
@ -264,7 +264,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
|
||||
* but I am not sure, so use only the pdata info and the number of
|
||||
* mapped buttons.
|
||||
*/
|
||||
if (pdata->f30_data.buttonpad || (button - BTN_LEFT == 1))
|
||||
if (pdata->gpio_data.buttonpad || (button - BTN_LEFT == 1))
|
||||
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
|
||||
|
||||
return 0;
|
||||
@ -372,7 +372,7 @@ static int rmi_f30_probe(struct rmi_function *fn)
|
||||
struct f30_data *f30;
|
||||
int error;
|
||||
|
||||
if (pdata->f30_data.disable)
|
||||
if (pdata->gpio_data.disable)
|
||||
return 0;
|
||||
|
||||
if (!drv_data->input) {
|
||||
|
@ -102,15 +102,16 @@ struct rmi_2d_sensor_platform_data {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rmi_f30_data - overrides defaults for a single F30 GPIOs/LED chip.
|
||||
* struct rmi_gpio_data - overrides defaults for a single F30/F3A GPIOs/LED
|
||||
* chip.
|
||||
* @buttonpad - the touchpad is a buttonpad, so enable only the first actual
|
||||
* button that is found.
|
||||
* @trackstick_buttons - Set when the function 30 is handling the physical
|
||||
* @trackstick_buttons - Set when the function 30 or 3a is handling the physical
|
||||
* buttons of the trackstick (as a PS/2 passthrough device).
|
||||
* @disable - the touchpad incorrectly reports F30 and it should be ignored.
|
||||
* @disable - the touchpad incorrectly reports F30/F3A and it should be ignored.
|
||||
* This is a special case which is due to misconfigured firmware.
|
||||
*/
|
||||
struct rmi_f30_data {
|
||||
struct rmi_gpio_data {
|
||||
bool buttonpad;
|
||||
bool trackstick_buttons;
|
||||
bool disable;
|
||||
@ -218,7 +219,7 @@ struct rmi_device_platform_data {
|
||||
/* function handler pdata */
|
||||
struct rmi_2d_sensor_platform_data sensor_pdata;
|
||||
struct rmi_f01_power_management power_management;
|
||||
struct rmi_f30_data f30_data;
|
||||
struct rmi_gpio_data gpio_data;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user