mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
HID: wacom: Use hdev->product in wacom_setup_touch_input_capabilities
Replace the lookup-dependent 'wacom_wac->shared->touch->product' references with 'hdev->product' inside wacom_setup_touch_input_capabilities() since 'hdev' is already available (via container_of) and represents the touch device itself. Cc: stable@vger.kernel.org Signed-off-by: Lee Jones <lee@kernel.org> Acked-by: Ping Cheng <ping.cheng@wacom.com> Tested-by: Ping Cheng <ping.cheng@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
986c24e0fe
commit
86472508a7
|
|
@ -3966,8 +3966,8 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
|
|||
int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
|
||||
struct wacom_wac *wacom_wac)
|
||||
{
|
||||
struct hid_device *hdev = container_of(wacom_wac, struct wacom, wacom_wac)->hdev;
|
||||
struct wacom_features *features = &wacom_wac->features;
|
||||
|
||||
if (!(features->device_type & WACOM_DEVICETYPE_TOUCH))
|
||||
return -ENODEV;
|
||||
|
||||
|
|
@ -3976,9 +3976,11 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
|
|||
else
|
||||
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
||||
|
||||
if (features->type == HID_GENERIC)
|
||||
if (features->type == HID_GENERIC) {
|
||||
hid_dbg(hdev, "generic touch setup\n");
|
||||
/* setup has already been done */
|
||||
return 0;
|
||||
}
|
||||
|
||||
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
|
||||
__set_bit(BTN_TOUCH, input_dev->keybit);
|
||||
|
|
@ -4010,19 +4012,17 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
|
|||
input_dev->evbit[0] |= BIT_MASK(EV_SW);
|
||||
__set_bit(SW_MUTE_DEVICE, input_dev->swbit);
|
||||
|
||||
if (wacom_wac->shared->touch->product == 0x361) {
|
||||
if (hdev->product == 0x361) {
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
|
||||
0, 12440, 4, 0);
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
|
||||
0, 8640, 4, 0);
|
||||
}
|
||||
else if (wacom_wac->shared->touch->product == 0x360) {
|
||||
} else if (hdev->product == 0x360) {
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
|
||||
0, 8960, 4, 0);
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
|
||||
0, 5920, 4, 0);
|
||||
}
|
||||
else if (wacom_wac->shared->touch->product == 0x393) {
|
||||
} else if (hdev->product == 0x393) {
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
|
||||
0, 6400, 4, 0);
|
||||
input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
|
||||
|
|
@ -4052,8 +4052,8 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
|
|||
fallthrough;
|
||||
|
||||
case WACOM_27QHDT:
|
||||
if (wacom_wac->shared->touch->product == 0x32C ||
|
||||
wacom_wac->shared->touch->product == 0xF6) {
|
||||
if (hdev->product == 0x32C ||
|
||||
hdev->product == 0xF6) {
|
||||
input_dev->evbit[0] |= BIT_MASK(EV_SW);
|
||||
__set_bit(SW_MUTE_DEVICE, input_dev->swbit);
|
||||
wacom_wac->has_mute_touch_switch = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user