Merge branches 'ib-mfd-arm-i2c-4.14', 'ib-mfd-arm-usb-video-4.14', 'ib-mfd-hwmon-4.14', 'ib-mfd-iio-pwm-4.14', 'ib-mfd-input-rtc-4.14', 'ib-mfd-many-4.14' and 'ib-mfd-pinctrl-regulator-4.14' into ibs-for-mfd-merged
This commit is contained in:
@@ -476,10 +476,21 @@ static const u8 xboxone_hori_init[] = {
|
||||
};
|
||||
|
||||
/*
|
||||
* A rumble packet is required for some PowerA pads to start
|
||||
* A specific rumble packet is required for some PowerA pads to start
|
||||
* sending input reports. One of those pads is (0x24c6:0x543a).
|
||||
*/
|
||||
static const u8 xboxone_zerorumble_init[] = {
|
||||
static const u8 xboxone_rumblebegin_init[] = {
|
||||
0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
|
||||
0x1D, 0x1D, 0xFF, 0x00, 0x00
|
||||
};
|
||||
|
||||
/*
|
||||
* A rumble packet with zero FF intensity will immediately
|
||||
* terminate the rumbling required to init PowerA pads.
|
||||
* This should happen fast enough that the motors don't
|
||||
* spin up to enough speed to actually vibrate the gamepad.
|
||||
*/
|
||||
static const u8 xboxone_rumbleend_init[] = {
|
||||
0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -494,9 +505,12 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_zerorumble_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_zerorumble_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_zerorumble_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumbleend_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumbleend_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumbleend_init),
|
||||
};
|
||||
|
||||
struct xpad_output_packet {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/i2c/twl.h>
|
||||
#include <linux/mfd/twl.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include <linux/i2c/dm355evm_msp.h>
|
||||
#include <linux/mfd/dm355evm_msp.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ static int soc_button_probe(struct platform_device *pdev)
|
||||
error = gpiod_count(dev, NULL);
|
||||
if (error < 0) {
|
||||
dev_dbg(dev, "no GPIO attached, ignoring...\n");
|
||||
return error;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <linux/input.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/i2c/twl.h>
|
||||
#include <linux/mfd/twl.h>
|
||||
|
||||
#define PWR_PWRON_IRQ (1 << 0)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/i2c/twl.h>
|
||||
#include <linux/mfd/twl.h>
|
||||
#include <linux/mfd/twl4030-audio.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
@@ -1215,14 +1215,24 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
|
||||
|
||||
case SS4_PACKET_ID_TWO:
|
||||
if (priv->flags & ALPS_BUTTONPAD) {
|
||||
f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id)) {
|
||||
f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
|
||||
} else {
|
||||
f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
|
||||
}
|
||||
f->mt[0].y = SS4_BTL_MF_Y_V2(p, 0);
|
||||
f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
|
||||
f->mt[1].y = SS4_BTL_MF_Y_V2(p, 1);
|
||||
} else {
|
||||
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id)) {
|
||||
f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
|
||||
} else {
|
||||
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
|
||||
}
|
||||
f->mt[0].y = SS4_STD_MF_Y_V2(p, 0);
|
||||
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
|
||||
f->mt[1].y = SS4_STD_MF_Y_V2(p, 1);
|
||||
}
|
||||
f->pressure = SS4_MF_Z_V2(p, 0) ? 0x30 : 0;
|
||||
@@ -1239,16 +1249,27 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
|
||||
|
||||
case SS4_PACKET_ID_MULTI:
|
||||
if (priv->flags & ALPS_BUTTONPAD) {
|
||||
f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id)) {
|
||||
f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
|
||||
} else {
|
||||
f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
|
||||
f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
|
||||
}
|
||||
|
||||
f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0);
|
||||
f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
|
||||
f->mt[3].y = SS4_BTL_MF_Y_V2(p, 1);
|
||||
no_data_x = SS4_MFPACKET_NO_AX_BL;
|
||||
no_data_y = SS4_MFPACKET_NO_AY_BL;
|
||||
} else {
|
||||
f->mt[2].x = SS4_STD_MF_X_V2(p, 0);
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id)) {
|
||||
f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
|
||||
} else {
|
||||
f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
|
||||
f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
|
||||
}
|
||||
f->mt[2].y = SS4_STD_MF_Y_V2(p, 0);
|
||||
f->mt[3].x = SS4_STD_MF_X_V2(p, 1);
|
||||
f->mt[3].y = SS4_STD_MF_Y_V2(p, 1);
|
||||
no_data_x = SS4_MFPACKET_NO_AX;
|
||||
no_data_y = SS4_MFPACKET_NO_AY;
|
||||
@@ -2541,8 +2562,8 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
|
||||
|
||||
memset(otp, 0, sizeof(otp));
|
||||
|
||||
if (alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]) ||
|
||||
alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]))
|
||||
if (alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]) ||
|
||||
alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]))
|
||||
return -1;
|
||||
|
||||
alps_update_device_area_ss4_v2(otp, priv);
|
||||
|
||||
@@ -100,6 +100,10 @@ enum SS4_PACKET_ID {
|
||||
((_b[1 + _i * 3] << 5) & 0x1F00) \
|
||||
)
|
||||
|
||||
#define SS4_PLUS_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 4) & 0x0070) | \
|
||||
((_b[1 + (_i) * 3] << 4) & 0x0F80) \
|
||||
)
|
||||
|
||||
#define SS4_STD_MF_Y_V2(_b, _i) (((_b[1 + (_i) * 3] << 3) & 0x0010) | \
|
||||
((_b[2 + (_i) * 3] << 5) & 0x01E0) | \
|
||||
((_b[2 + (_i) * 3] << 4) & 0x0E00) \
|
||||
@@ -109,6 +113,10 @@ enum SS4_PACKET_ID {
|
||||
((_b[0 + (_i) * 3] >> 3) & 0x0010) \
|
||||
)
|
||||
|
||||
#define SS4_PLUS_BTL_MF_X_V2(_b, _i) (SS4_PLUS_STD_MF_X_V2(_b, _i) | \
|
||||
((_b[0 + (_i) * 3] >> 4) & 0x0008) \
|
||||
)
|
||||
|
||||
#define SS4_BTL_MF_Y_V2(_b, _i) (SS4_STD_MF_Y_V2(_b, _i) | \
|
||||
((_b[0 + (_i) * 3] >> 3) & 0x0008) \
|
||||
)
|
||||
|
||||
@@ -1247,7 +1247,12 @@ static const struct acpi_device_id elan_acpi_id[] = {
|
||||
{ "ELAN0000", 0 },
|
||||
{ "ELAN0100", 0 },
|
||||
{ "ELAN0600", 0 },
|
||||
{ "ELAN0602", 0 },
|
||||
{ "ELAN0605", 0 },
|
||||
{ "ELAN0608", 0 },
|
||||
{ "ELAN0605", 0 },
|
||||
{ "ELAN0609", 0 },
|
||||
{ "ELAN060B", 0 },
|
||||
{ "ELAN1000", 0 },
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -535,16 +535,17 @@ static void synaptics_apply_quirks(struct psmouse *psmouse,
|
||||
}
|
||||
}
|
||||
|
||||
static bool synaptics_has_agm(struct synaptics_data *priv)
|
||||
{
|
||||
return (SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
|
||||
SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c));
|
||||
}
|
||||
|
||||
static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
|
||||
{
|
||||
static u8 param = 0xc8;
|
||||
struct synaptics_data *priv = psmouse->private;
|
||||
int error;
|
||||
|
||||
if (!(SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
|
||||
SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)))
|
||||
return 0;
|
||||
|
||||
error = psmouse_sliced_command(psmouse, SYN_QUE_MODEL);
|
||||
if (error)
|
||||
return error;
|
||||
@@ -553,9 +554,6 @@ static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/* Advanced gesture mode also sends multi finger data */
|
||||
priv->info.capabilities |= BIT(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -578,7 +576,7 @@ static int synaptics_set_mode(struct psmouse *psmouse)
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (priv->absolute_mode) {
|
||||
if (priv->absolute_mode && synaptics_has_agm(priv)) {
|
||||
error = synaptics_set_advanced_gesture_mode(psmouse);
|
||||
if (error) {
|
||||
psmouse_err(psmouse,
|
||||
@@ -766,9 +764,7 @@ static int synaptics_parse_hw_state(const u8 buf[],
|
||||
((buf[0] & 0x04) >> 1) |
|
||||
((buf[3] & 0x04) >> 2));
|
||||
|
||||
if ((SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
|
||||
SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)) &&
|
||||
hw->w == 2) {
|
||||
if (synaptics_has_agm(priv) && hw->w == 2) {
|
||||
synaptics_parse_agm(buf, priv, hw);
|
||||
return 1;
|
||||
}
|
||||
@@ -1033,6 +1029,15 @@ static void synaptics_image_sensor_process(struct psmouse *psmouse,
|
||||
synaptics_report_mt_data(psmouse, sgm, num_fingers);
|
||||
}
|
||||
|
||||
static bool synaptics_has_multifinger(struct synaptics_data *priv)
|
||||
{
|
||||
if (SYN_CAP_MULTIFINGER(priv->info.capabilities))
|
||||
return true;
|
||||
|
||||
/* Advanced gesture mode also sends multi finger data */
|
||||
return synaptics_has_agm(priv);
|
||||
}
|
||||
|
||||
/*
|
||||
* called for each full received packet from the touchpad
|
||||
*/
|
||||
@@ -1079,7 +1084,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
|
||||
if (SYN_CAP_EXTENDED(info->capabilities)) {
|
||||
switch (hw.w) {
|
||||
case 0 ... 1:
|
||||
if (SYN_CAP_MULTIFINGER(info->capabilities))
|
||||
if (synaptics_has_multifinger(priv))
|
||||
num_fingers = hw.w + 2;
|
||||
break;
|
||||
case 2:
|
||||
@@ -1123,7 +1128,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
|
||||
input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
|
||||
|
||||
input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
|
||||
if (SYN_CAP_MULTIFINGER(info->capabilities)) {
|
||||
if (synaptics_has_multifinger(priv)) {
|
||||
input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
|
||||
input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
|
||||
}
|
||||
@@ -1283,7 +1288,7 @@ static void set_input_params(struct psmouse *psmouse,
|
||||
__set_bit(BTN_TOUCH, dev->keybit);
|
||||
__set_bit(BTN_TOOL_FINGER, dev->keybit);
|
||||
|
||||
if (SYN_CAP_MULTIFINGER(info->capabilities)) {
|
||||
if (synaptics_has_multifinger(priv)) {
|
||||
__set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
|
||||
__set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
|
||||
}
|
||||
|
||||
@@ -265,7 +265,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *fir
|
||||
if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
|
||||
return -1;
|
||||
|
||||
if (param[0] != TP_MAGIC_IDENT)
|
||||
/* add new TP ID. */
|
||||
if (!(param[0] & TP_MAGIC_IDENT))
|
||||
return -1;
|
||||
|
||||
if (firmware_id)
|
||||
@@ -380,8 +381,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
|
||||
return 0;
|
||||
|
||||
if (trackpoint_read(ps2dev, TP_EXT_BTN, &button_info)) {
|
||||
psmouse_warn(psmouse, "failed to get extended button data\n");
|
||||
button_info = 0;
|
||||
psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n");
|
||||
button_info = 0x33;
|
||||
}
|
||||
|
||||
psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
#define TP_COMMAND 0xE2 /* Commands start with this */
|
||||
|
||||
#define TP_READ_ID 0xE1 /* Sent for device identification */
|
||||
#define TP_MAGIC_IDENT 0x01 /* Sent after a TP_READ_ID followed */
|
||||
#define TP_MAGIC_IDENT 0x03 /* Sent after a TP_READ_ID followed */
|
||||
/* by the firmware ID */
|
||||
/* Firmware ID includes 0x1, 0x2, 0x3 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user