Skip to content

Commit efe6f16

Browse files
committed
Merge branch 'next' into for-linus
Prepare input updates for 5.16 merge window.
2 parents a02dcde + 744d009 commit efe6f16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1833
-460
lines changed

Documentation/devicetree/bindings/input/cap11xx.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Required properties:
99
"microchip,cap1106"
1010
"microchip,cap1126"
1111
"microchip,cap1188"
12+
"microchip,cap1206"
1213

1314
reg: The I2C slave address of the device.
1415

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/cypress-sf.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Cypress StreetFighter touchkey controller
8+
9+
maintainers:
10+
- Yassine Oudjana <[email protected]>
11+
12+
allOf:
13+
- $ref: input.yaml#
14+
15+
properties:
16+
compatible:
17+
const: cypress,sf3155
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
avdd-supply:
26+
description: Regulator for AVDD analog voltage
27+
28+
vdd-supply:
29+
description: Regulator for VDD digital voltage
30+
31+
linux,keycodes:
32+
minItems: 1
33+
maxItems: 8
34+
35+
required:
36+
- compatible
37+
- reg
38+
- interrupts
39+
- avdd-supply
40+
- vdd-supply
41+
42+
additionalProperties: false
43+
44+
examples:
45+
- |
46+
#include <dt-bindings/input/input.h>
47+
#include <dt-bindings/interrupt-controller/irq.h>
48+
i2c {
49+
#address-cells = <1>;
50+
#size-cells = <0>;
51+
52+
touchkey@28 {
53+
compatible = "cypress,sf3155";
54+
reg = <0x28>;
55+
interrupt-parent = <&msmgpio>;
56+
interrupts = <77 IRQ_TYPE_EDGE_FALLING>;
57+
avdd-supply = <&vreg_l6a_1p8>;
58+
vdd-supply = <&vdd_3v2_tp>;
59+
linux,keycodes = <KEY_BACK KEY_MENU>;
60+
};
61+
};

MAINTAINERS

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4301,7 +4301,7 @@ CHIPONE ICN8318 I2C TOUCHSCREEN DRIVER
43014301
M: Hans de Goede <[email protected]>
43024302
43034303
S: Maintained
4304-
F: Documentation/devicetree/bindings/input/touchscreen/chipone_icn8318.txt
4304+
F: Documentation/devicetree/bindings/input/touchscreen/chipone,icn8318.yaml
43054305
F: drivers/input/touchscreen/chipone_icn8318.c
43064306

43074307
CHIPONE ICN8505 I2C TOUCHSCREEN DRIVER
@@ -5006,6 +5006,13 @@ L: [email protected]
50065006
S: Maintained
50075007
F: drivers/input/touchscreen/cy8ctma140.c
50085008

5009+
CYPRESS STREETFIGHTER TOUCHKEYS DRIVER
5010+
M: Yassine Oudjana <[email protected]>
5011+
5012+
S: Maintained
5013+
F: Documentation/devicetree/bindings/input/cypress-sf.yaml
5014+
F: drivers/input/keyboard/cypress-sf.c
5015+
50095016
CYTTSP TOUCHSCREEN DRIVER
50105017
M: Linus Walleij <[email protected]>
50115018
@@ -7709,9 +7716,10 @@ F: drivers/media/usb/go7007/
77097716

77107717
GOODIX TOUCHSCREEN
77117718
M: Bastien Nocera <[email protected]>
7719+
M: Hans de Goede <[email protected]>
77127720
77137721
S: Maintained
7714-
F: drivers/input/touchscreen/goodix.c
7722+
F: drivers/input/touchscreen/goodix*
77157723

77167724
GOOGLE ETHERNET DRIVERS
77177725
M: Catherine Sullivan <[email protected]>

drivers/input/joystick/analog.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/input.h>
2020
#include <linux/gameport.h>
2121
#include <linux/jiffies.h>
22+
#include <linux/seq_buf.h>
2223
#include <linux/timex.h>
2324
#include <linux/timekeeping.h>
2425

@@ -338,23 +339,24 @@ static void analog_calibrate_timer(struct analog_port *port)
338339

339340
static void analog_name(struct analog *analog)
340341
{
341-
snprintf(analog->name, sizeof(analog->name), "Analog %d-axis %d-button",
342+
struct seq_buf s;
343+
344+
seq_buf_init(&s, analog->name, sizeof(analog->name));
345+
seq_buf_printf(&s, "Analog %d-axis %d-button",
342346
hweight8(analog->mask & ANALOG_AXES_STD),
343347
hweight8(analog->mask & ANALOG_BTNS_STD) + !!(analog->mask & ANALOG_BTNS_CHF) * 2 +
344348
hweight16(analog->mask & ANALOG_BTNS_GAMEPAD) + !!(analog->mask & ANALOG_HBTN_CHF) * 4);
345349

346350
if (analog->mask & ANALOG_HATS_ALL)
347-
snprintf(analog->name, sizeof(analog->name), "%s %d-hat",
348-
analog->name, hweight16(analog->mask & ANALOG_HATS_ALL));
351+
seq_buf_printf(&s, " %d-hat",
352+
hweight16(analog->mask & ANALOG_HATS_ALL));
349353

350354
if (analog->mask & ANALOG_HAT_FCS)
351-
strlcat(analog->name, " FCS", sizeof(analog->name));
355+
seq_buf_printf(&s, " FCS");
352356
if (analog->mask & ANALOG_ANY_CHF)
353-
strlcat(analog->name, (analog->mask & ANALOG_SAITEK) ? " Saitek" : " CHF",
354-
sizeof(analog->name));
357+
seq_buf_printf(&s, (analog->mask & ANALOG_SAITEK) ? " Saitek" : " CHF");
355358

356-
strlcat(analog->name, (analog->mask & ANALOG_GAMEPAD) ? " gamepad": " joystick",
357-
sizeof(analog->name));
359+
seq_buf_printf(&s, (analog->mask & ANALOG_GAMEPAD) ? " gamepad" : " joystick");
358360
}
359361

360362
/*

drivers/input/joystick/iforce/iforce-usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int iforce_usb_get_id(struct iforce *iforce, u8 id,
9292
id,
9393
USB_TYPE_VENDOR | USB_DIR_IN |
9494
USB_RECIP_INTERFACE,
95-
0, 0, buf, IFORCE_MAX_LENGTH, HZ);
95+
0, 0, buf, IFORCE_MAX_LENGTH, 1000);
9696
if (status < 0) {
9797
dev_err(&iforce_usb->intf->dev,
9898
"usb_submit_urb failed: %d\n", status);

drivers/input/joystick/tmdc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static const struct tmdc_model {
8383
const signed char *axes;
8484
const short *buttons;
8585
} tmdc_models[] = {
86-
{ 1, "ThrustMaster Millenium 3D Inceptor", 6, 2, { 4, 2 }, { 4, 6 }, tmdc_abs, tmdc_btn_joy },
86+
{ 1, "ThrustMaster Millennium 3D Inceptor", 6, 2, { 4, 2 }, { 4, 6 }, tmdc_abs, tmdc_btn_joy },
8787
{ 3, "ThrustMaster Rage 3D Gamepad", 2, 0, { 8, 2 }, { 0, 0 }, tmdc_abs, tmdc_btn_pad },
8888
{ 4, "ThrustMaster Attack Throttle", 5, 2, { 4, 6 }, { 4, 2 }, tmdc_abs_at, tmdc_btn_at },
8989
{ 8, "ThrustMaster FragMaster", 4, 0, { 8, 2 }, { 0, 0 }, tmdc_abs_fm, tmdc_btn_fm },

drivers/input/keyboard/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,4 +791,14 @@ config KEYBOARD_MTK_PMIC
791791
To compile this driver as a module, choose M here: the
792792
module will be called pmic-keys.
793793

794+
config KEYBOARD_CYPRESS_SF
795+
tristate "Cypress StreetFighter touchkey support"
796+
depends on I2C
797+
help
798+
Say Y here if you want to enable support for Cypress StreetFighter
799+
touchkeys.
800+
801+
To compile this driver as a module, choose M here: the
802+
module will be called cypress-sf.
803+
794804
endif

drivers/input/keyboard/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ obj-$(CONFIG_KEYBOARD_BCM) += bcm-keypad.o
1717
obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
1818
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
1919
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
20+
obj-$(CONFIG_KEYBOARD_CYPRESS_SF) += cypress-sf.o
2021
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
2122
obj-$(CONFIG_KEYBOARD_DLINK_DIR685) += dlink-dir685-touchkeys.o
2223
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o

drivers/input/keyboard/cap11xx.c

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,21 @@ struct cap11xx_hw_model {
9191
u8 product_id;
9292
unsigned int num_channels;
9393
unsigned int num_leds;
94+
bool no_gain;
9495
};
9596

9697
enum {
9798
CAP1106,
9899
CAP1126,
99100
CAP1188,
101+
CAP1206,
100102
};
101103

102104
static const struct cap11xx_hw_model cap11xx_devices[] = {
103-
[CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0 },
104-
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2 },
105-
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8 },
105+
[CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false },
106+
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
107+
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
108+
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
106109
};
107110

108111
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -378,17 +381,24 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
378381
node = dev->of_node;
379382

380383
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
381-
if (is_power_of_2(gain32) && gain32 <= 8)
384+
if (cap->no_gain)
385+
dev_warn(dev,
386+
"This version doesn't support sensor gain\n");
387+
else if (is_power_of_2(gain32) && gain32 <= 8)
382388
gain = ilog2(gain32);
383389
else
384390
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
385391
}
386392

387-
if (of_property_read_bool(node, "microchip,irq-active-high")) {
388-
error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2,
389-
CAP11XX_REG_CONFIG2_ALT_POL, 0);
390-
if (error)
391-
return error;
393+
if (id->driver_data != CAP1206) {
394+
if (of_property_read_bool(node, "microchip,irq-active-high")) {
395+
error = regmap_update_bits(priv->regmap,
396+
CAP11XX_REG_CONFIG2,
397+
CAP11XX_REG_CONFIG2_ALT_POL,
398+
0);
399+
if (error)
400+
return error;
401+
}
392402
}
393403

394404
/* Provide some useful defaults */
@@ -398,11 +408,14 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
398408
of_property_read_u32_array(node, "linux,keycodes",
399409
priv->keycodes, cap->num_channels);
400410

401-
error = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL,
402-
CAP11XX_REG_MAIN_CONTROL_GAIN_MASK,
403-
gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT);
404-
if (error)
405-
return error;
411+
if (!cap->no_gain) {
412+
error = regmap_update_bits(priv->regmap,
413+
CAP11XX_REG_MAIN_CONTROL,
414+
CAP11XX_REG_MAIN_CONTROL_GAIN_MASK,
415+
gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT);
416+
if (error)
417+
return error;
418+
}
406419

407420
/* Disable autorepeat. The Linux input system has its own handling. */
408421
error = regmap_write(priv->regmap, CAP11XX_REG_REPEAT_RATE, 0);
@@ -470,6 +483,7 @@ static const struct of_device_id cap11xx_dt_ids[] = {
470483
{ .compatible = "microchip,cap1106", },
471484
{ .compatible = "microchip,cap1126", },
472485
{ .compatible = "microchip,cap1188", },
486+
{ .compatible = "microchip,cap1206", },
473487
{}
474488
};
475489
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
@@ -478,6 +492,7 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
478492
{ "cap1106", CAP1106 },
479493
{ "cap1126", CAP1126 },
480494
{ "cap1188", CAP1188 },
495+
{ "cap1206", CAP1206 },
481496
{}
482497
};
483498
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);

0 commit comments

Comments
 (0)