Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ MODULE_LICENSE("GPL");
#define MT_QUIRK_HAS_TYPE_COVER_BACKLIGHT BIT(24)
#define MT_QUIRK_HAS_TYPE_COVER_TABLET_MODE_SWITCH BIT(25)
#define MT_QUIRK_SKIP_MODESET_ON_HW_OPEN_CLOSE BIT(26)
#define MT_QUIRK_FORCE_BUTTONPAD BIT(27)

#define MT_INPUTMODE_TOUCHSCREEN 0x02
#define MT_INPUTMODE_TOUCHPAD 0x03
Expand Down Expand Up @@ -244,6 +245,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
#define MT_CLS_APPLE_TOUCHBAR 0x0114
#define MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER 0x0115
#define MT_CLS_SURFACE_TOUCHPAD 0x0116
#define MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER_11 0x0117
#define MT_CLS_SIS 0x0457

#define MT_DEFAULT_MAXCONTACT 10
Expand Down Expand Up @@ -455,6 +457,18 @@ static const struct mt_class mt_classes[] = {
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_SKIP_MODESET_ON_HW_OPEN_CLOSE
},
{ .name = MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER_11,
.quirks = MT_QUIRK_HAS_TYPE_COVER_BACKLIGHT |
MT_QUIRK_HAS_TYPE_COVER_TABLET_MODE_SWITCH |
MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_IGNORE_DUPLICATES |
MT_QUIRK_HOVERING |
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_STICKY_FINGERS |
MT_QUIRK_WIN8_PTP_BUTTONS |
MT_QUIRK_FORCE_BUTTONPAD,
.export_all_inputs = true
},
{ }
};

Expand Down Expand Up @@ -860,7 +874,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
if ((cls->name == MT_CLS_WIN_8 ||
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU ||
cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) &&
cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP ||
cls->name == MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER_11) &&
(field->application == HID_DG_TOUCHPAD ||
field->application == HID_DG_TOUCHSCREEN))
app->quirks |= MT_QUIRK_CONFIDENCE;
Expand Down Expand Up @@ -984,6 +999,16 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
case 0xff000000:
/* we do not want to map these: no input-oriented meaning */
return -1;

case HID_UP_SENSOR:
/* Microsoft Surface Type Cover: whole-pad force sensor */
if ((usage->hid & HID_USAGE) == 0x0494 &&
(app->quirks & MT_QUIRK_FORCE_BUTTONPAD)) {
hid_map_usage(hi, usage, bit, max, EV_ABS, ABS_PRESSURE);
set_abs(hi->input, ABS_PRESSURE, field, cls->sn_pressure);
return 1;
}
return -1;
}

return 0;
Expand Down Expand Up @@ -1421,6 +1446,9 @@ static int mt_touch_input_configured(struct hid_device *hdev,
(app->buttons_count == 1))
td->is_buttonpad = true;

if (app->quirks & MT_QUIRK_FORCE_BUTTONPAD)
td->is_buttonpad = true;

if (td->is_buttonpad)
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);

Expand Down Expand Up @@ -2651,6 +2679,11 @@ static const struct hid_device_id mt_devices[] = {
HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
USB_VENDOR_ID_MICROSOFT, 0x0C46) },

/* Microsoft Surface Pro 11 Type Cover touchpad */
{ .driver_data = MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER_11,
HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
USB_VENDOR_ID_MICROSOFT, 0x0C8D) },

/* Google MT devices */
{ .driver_data = MT_CLS_GOOGLE,
HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE,
Expand Down
22 changes: 22 additions & 0 deletions drivers/media/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ config VIDEO_IMX283
To compile this driver as a module, choose M here: the
module will be called imx283.

config VIDEO_IMX681
tristate "Sony IMX681 sensor support"
select V4L2_CCI_I2C
help
This is a V4L2 sensor driver for the Sony IMX681
CMOS image sensor (front camera on Surface Pro 11).

To compile this driver as a module, choose M here: the
module will be called imx681.

config VIDEO_IMX290
tristate "Sony IMX290 sensor support"
select REGMAP_I2C
Expand Down Expand Up @@ -745,6 +755,18 @@ config VIDEO_S5K6A3
This is a V4L2 sensor driver for Samsung S5K6A3 raw
camera sensor.

config VIDEO_VD55G0
tristate "ST VD55G0 IR sensor support"
select V4L2_CCI_I2C
depends on GPIOLIB
help
This is a Video4Linux2 sensor driver for the ST VD55G0
IR global shutter camera sensor, used in the Surface Pro 11
for Windows Hello face authentication.

To compile this driver as a module, choose M here: the
module will be called vd55g0.

config VIDEO_VD55G1
tristate "ST VD55G1 sensor support"
select V4L2_CCI_I2C
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ obj-$(CONFIG_VIDEO_IMX219) += imx219.o
obj-$(CONFIG_VIDEO_IMX258) += imx258.o
obj-$(CONFIG_VIDEO_IMX274) += imx274.o
obj-$(CONFIG_VIDEO_IMX283) += imx283.o
obj-$(CONFIG_VIDEO_IMX681) += imx681.o
obj-$(CONFIG_VIDEO_IMX290) += imx290.o
obj-$(CONFIG_VIDEO_IMX296) += imx296.o
obj-$(CONFIG_VIDEO_IMX319) += imx319.o
Expand Down Expand Up @@ -158,6 +159,7 @@ obj-$(CONFIG_VIDEO_TW9910) += tw9910.o
obj-$(CONFIG_VIDEO_UDA1342) += uda1342.o
obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
obj-$(CONFIG_VIDEO_VD55G0) += vd55g0.o
obj-$(CONFIG_VIDEO_VD55G1) += vd55g1.o
obj-$(CONFIG_VIDEO_VD56G3) += vd56g3.o
obj-$(CONFIG_VIDEO_VGXY61) += vgxy61.o
Expand Down
Loading