Skip to content

Commit 38dab9a

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer fixes from Dmitry Torokhov: - a change to the ALPS driver where we had limit the quirk for trackstick handling from being active on all Dells to just a few models - a fix for a build dependency issue in the sur40 driver - a small clock handling fixup in the LPC32xx touchscreen driver * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: alps - only the Dell Latitude D420/430/620/630 have separate stick button bits Input: sur40 - add dependency on VIDEO_V4L2 Input: lpc32xx_ts - fix warnings caused by enabling unprepared clock
2 parents f9793e3 + 1955621 commit 38dab9a

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

drivers/input/mouse/alps.c

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = {
100100
#define ALPS_FOUR_BUTTONS 0x40 /* 4 direction button present */
101101
#define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
102102
6-byte ALPS packet */
103-
#define ALPS_DELL 0x100 /* device is a Dell laptop */
103+
#define ALPS_STICK_BITS 0x100 /* separate stick button bits */
104104
#define ALPS_BUTTONPAD 0x200 /* device is a clickpad */
105105

106106
static const struct alps_model_info alps_model_data[] = {
@@ -159,6 +159,43 @@ static const struct alps_protocol_info alps_v8_protocol_data = {
159159
ALPS_PROTO_V8, 0x18, 0x18, 0
160160
};
161161

162+
/*
163+
* Some v2 models report the stick buttons in separate bits
164+
*/
165+
static const struct dmi_system_id alps_dmi_has_separate_stick_buttons[] = {
166+
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
167+
{
168+
/* Extrapolated from other entries */
169+
.matches = {
170+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
171+
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D420"),
172+
},
173+
},
174+
{
175+
/* Reported-by: Hans de Bruin <jmdebruin@xmsnet.nl> */
176+
.matches = {
177+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
178+
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D430"),
179+
},
180+
},
181+
{
182+
/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
183+
.matches = {
184+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
185+
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D620"),
186+
},
187+
},
188+
{
189+
/* Extrapolated from other entries */
190+
.matches = {
191+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
192+
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D630"),
193+
},
194+
},
195+
#endif
196+
{ }
197+
};
198+
162199
static void alps_set_abs_params_st(struct alps_data *priv,
163200
struct input_dev *dev1);
164201
static void alps_set_abs_params_semi_mt(struct alps_data *priv,
@@ -253,9 +290,8 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
253290
return;
254291
}
255292

256-
/* Dell non interleaved V2 dualpoint has separate stick button bits */
257-
if (priv->proto_version == ALPS_PROTO_V2 &&
258-
priv->flags == (ALPS_DELL | ALPS_PASS | ALPS_DUALPOINT)) {
293+
/* Some models have separate stick button bits */
294+
if (priv->flags & ALPS_STICK_BITS) {
259295
left |= packet[0] & 1;
260296
right |= packet[0] & 2;
261297
middle |= packet[0] & 4;
@@ -2552,8 +2588,6 @@ static int alps_set_protocol(struct psmouse *psmouse,
25522588
priv->byte0 = protocol->byte0;
25532589
priv->mask0 = protocol->mask0;
25542590
priv->flags = protocol->flags;
2555-
if (dmi_name_in_vendors("Dell"))
2556-
priv->flags |= ALPS_DELL;
25572591

25582592
priv->x_max = 2000;
25592593
priv->y_max = 1400;
@@ -2568,6 +2602,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
25682602
priv->set_abs_params = alps_set_abs_params_st;
25692603
priv->x_max = 1023;
25702604
priv->y_max = 767;
2605+
if (dmi_check_system(alps_dmi_has_separate_stick_buttons))
2606+
priv->flags |= ALPS_STICK_BITS;
25712607
break;
25722608

25732609
case ALPS_PROTO_V3:

drivers/input/touchscreen/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ config TOUCHSCREEN_SUN4I
10061006
config TOUCHSCREEN_SUR40
10071007
tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen"
10081008
depends on USB && MEDIA_USB_SUPPORT && HAS_DMA
1009+
depends on VIDEO_V4L2
10091010
select INPUT_POLLDEV
10101011
select VIDEOBUF2_DMA_SG
10111012
help

drivers/input/touchscreen/lpc32xx_ts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ static void lpc32xx_stop_tsc(struct lpc32xx_tsc *tsc)
139139
tsc_readl(tsc, LPC32XX_TSC_CON) &
140140
~LPC32XX_TSC_ADCCON_AUTO_EN);
141141

142-
clk_disable(tsc->clk);
142+
clk_disable_unprepare(tsc->clk);
143143
}
144144

145145
static void lpc32xx_setup_tsc(struct lpc32xx_tsc *tsc)
146146
{
147147
u32 tmp;
148148

149-
clk_enable(tsc->clk);
149+
clk_prepare_enable(tsc->clk);
150150

151151
tmp = tsc_readl(tsc, LPC32XX_TSC_CON) & ~LPC32XX_TSC_ADCCON_POWER_UP;
152152

0 commit comments

Comments
 (0)