Skip to content

Commit b520085

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "Updates to Goodix touchscreen driver (addition of pen support) and Silead touchscreen driver (also addition of pen support and parsing of embedded firmware to determine screen size), along with assorted fixes for other drivers" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ti_am335x_tsc - fix a typo in a comment Input: zinitix - add compatible for bt532 Input: zinitix - handle proper supply names dt-bindings: input/ts/zinitix: Convert to YAML, fix and extend Input: axp20x-pek - revert "always register interrupt handlers" change Input: gpio-keys - avoid clearing twice some memory Input: byd - fix typo in a comment Input: ucb1400_ts - remove redundant variable penup Input: ti_am335x_tsc - lower the X and Y sampling time Input: ti_am335x_tsc - fix STEPCONFIG setup for Z2 Input: ti_am335x_tsc - set ADCREFM for X configuration Input: silead - add pen support Input: silead - add support for EFI-embedded fw using different min/max coordinates Input: goodix - 2 small fixes for pen support Input: goodix - improve gpiod_get() error logging Input: goodix - add pen support Input: ff-core - correct magnitude setting for rumble compatibility Input: palmas-pwrbutton - make a couple of arrays static const Input: wacom_i2c - clean up the query device fields Input: palmas-pwrbutton - use bitfield helpers
2 parents 4b37895 + 762f99f commit b520085

File tree

14 files changed

+507
-125
lines changed

14 files changed

+507
-125
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/touchscreen/zinitix,bt400.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Zinitix BT4xx and BT5xx series touchscreen controller bindings
8+
9+
description: The Zinitix BT4xx and BT5xx series of touchscreen controllers
10+
are Korea-produced touchscreens with embedded microcontrollers. The
11+
BT4xx series was produced 2010-2013 and the BT5xx series 2013-2014.
12+
13+
maintainers:
14+
- Michael Srba <[email protected]>
15+
- Linus Walleij <[email protected]>
16+
17+
allOf:
18+
- $ref: touchscreen.yaml#
19+
20+
properties:
21+
$nodename:
22+
pattern: "^touchscreen(@.*)?$"
23+
24+
compatible:
25+
enum:
26+
- zinitix,bt402
27+
- zinitix,bt403
28+
- zinitix,bt404
29+
- zinitix,bt412
30+
- zinitix,bt413
31+
- zinitix,bt431
32+
- zinitix,bt432
33+
- zinitix,bt531
34+
- zinitix,bt532
35+
- zinitix,bt538
36+
- zinitix,bt541
37+
- zinitix,bt548
38+
- zinitix,bt554
39+
- zinitix,at100
40+
41+
reg:
42+
description: I2C address on the I2C bus
43+
44+
clock-frequency:
45+
description: I2C client clock frequency, defined for host when using
46+
the device on the I2C bus
47+
minimum: 0
48+
maximum: 400000
49+
50+
interrupts:
51+
description: Interrupt to host
52+
maxItems: 1
53+
54+
vcca-supply:
55+
description: Analog power supply regulator on the VCCA pin
56+
57+
vdd-supply:
58+
description: Digital power supply regulator on the VDD pin.
59+
In older device trees this can be the accidental name for the analog
60+
supply on the VCCA pin, and in that case the deprecated vddo-supply is
61+
used for the digital power supply.
62+
63+
vddo-supply:
64+
description: Deprecated name for the digital power supply, use vdd-supply
65+
as this reflects the real name of the pin. If this supply is present,
66+
the vdd-supply represents VCCA instead of VDD. Implementers should first
67+
check for this property, and if it is present assume that the vdd-supply
68+
represents the analog supply.
69+
deprecated: true
70+
71+
reset-gpios:
72+
description: Reset line for the touchscreen, should be tagged
73+
as GPIO_ACTIVE_LOW
74+
75+
zinitix,mode:
76+
description: Mode of reporting touch points. Some modes may not work
77+
with a particular ts firmware for unknown reasons. Available modes are
78+
1 and 2. Mode 2 is the default and preferred.
79+
$ref: /schemas/types.yaml#/definitions/uint32
80+
enum: [1, 2]
81+
82+
touchscreen-size-x: true
83+
touchscreen-size-y: true
84+
touchscreen-fuzz-x: true
85+
touchscreen-fuzz-y: true
86+
87+
additionalProperties: false
88+
89+
required:
90+
- compatible
91+
- reg
92+
- interrupts
93+
- touchscreen-size-x
94+
- touchscreen-size-y
95+
96+
examples:
97+
- |
98+
#include <dt-bindings/interrupt-controller/irq.h>
99+
#include <dt-bindings/gpio/gpio.h>
100+
i2c {
101+
#address-cells = <1>;
102+
#size-cells = <0>;
103+
104+
touchscreen@20 {
105+
compatible = "zinitix,bt541";
106+
reg = <0x20>;
107+
interrupt-parent = <&gpio>;
108+
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
109+
vcca-supply = <&reg_vcca_tsp>;
110+
vdd-supply = <&reg_vdd_tsp>;
111+
touchscreen-size-x = <540>;
112+
touchscreen-size-y = <960>;
113+
zinitix,mode = <2>;
114+
};
115+
};

Documentation/devicetree/bindings/input/touchscreen/zinitix.txt

Lines changed: 0 additions & 40 deletions
This file was deleted.

drivers/input/ff-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int compat_effect(struct ff_device *ff, struct ff_effect *effect)
6767
effect->type = FF_PERIODIC;
6868
effect->u.periodic.waveform = FF_SINE;
6969
effect->u.periodic.period = 50;
70-
effect->u.periodic.magnitude = max(magnitude, 0x7fff);
70+
effect->u.periodic.magnitude = magnitude;
7171
effect->u.periodic.offset = 0;
7272
effect->u.periodic.phase = 0;
7373
effect->u.periodic.envelope.attack_length = 0;

drivers/input/keyboard/gpio_keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata,
247247
ssize_t error;
248248
int i;
249249

250-
bits = bitmap_zalloc(n_events, GFP_KERNEL);
250+
bits = bitmap_alloc(n_events, GFP_KERNEL);
251251
if (!bits)
252252
return -ENOMEM;
253253

drivers/input/misc/axp20x-pek.c

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,8 @@ ATTRIBUTE_GROUPS(axp20x);
206206

207207
static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
208208
{
209-
struct axp20x_pek *axp20x_pek = pwr;
210-
struct input_dev *idev = axp20x_pek->input;
211-
212-
if (!idev)
213-
return IRQ_HANDLED;
209+
struct input_dev *idev = pwr;
210+
struct axp20x_pek *axp20x_pek = input_get_drvdata(idev);
214211

215212
/*
216213
* The power-button is connected to ground so a falling edge (dbf)
@@ -229,9 +226,22 @@ static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
229226
static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
230227
struct platform_device *pdev)
231228
{
229+
struct axp20x_dev *axp20x = axp20x_pek->axp20x;
232230
struct input_dev *idev;
233231
int error;
234232

233+
axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
234+
if (axp20x_pek->irq_dbr < 0)
235+
return axp20x_pek->irq_dbr;
236+
axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc,
237+
axp20x_pek->irq_dbr);
238+
239+
axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
240+
if (axp20x_pek->irq_dbf < 0)
241+
return axp20x_pek->irq_dbf;
242+
axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc,
243+
axp20x_pek->irq_dbf);
244+
235245
axp20x_pek->input = devm_input_allocate_device(&pdev->dev);
236246
if (!axp20x_pek->input)
237247
return -ENOMEM;
@@ -246,13 +256,33 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
246256

247257
input_set_drvdata(idev, axp20x_pek);
248258

259+
error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
260+
axp20x_pek_irq, 0,
261+
"axp20x-pek-dbr", idev);
262+
if (error < 0) {
263+
dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
264+
axp20x_pek->irq_dbr, error);
265+
return error;
266+
}
267+
268+
error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
269+
axp20x_pek_irq, 0,
270+
"axp20x-pek-dbf", idev);
271+
if (error < 0) {
272+
dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
273+
axp20x_pek->irq_dbf, error);
274+
return error;
275+
}
276+
249277
error = input_register_device(idev);
250278
if (error) {
251279
dev_err(&pdev->dev, "Can't register input device: %d\n",
252280
error);
253281
return error;
254282
}
255283

284+
device_init_wakeup(&pdev->dev, true);
285+
256286
return 0;
257287
}
258288

@@ -293,18 +323,6 @@ static int axp20x_pek_probe(struct platform_device *pdev)
293323

294324
axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
295325

296-
axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
297-
if (axp20x_pek->irq_dbr < 0)
298-
return axp20x_pek->irq_dbr;
299-
axp20x_pek->irq_dbr = regmap_irq_get_virq(
300-
axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbr);
301-
302-
axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
303-
if (axp20x_pek->irq_dbf < 0)
304-
return axp20x_pek->irq_dbf;
305-
axp20x_pek->irq_dbf = regmap_irq_get_virq(
306-
axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbf);
307-
308326
if (axp20x_pek_should_register_input(axp20x_pek)) {
309327
error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
310328
if (error)
@@ -313,26 +331,6 @@ static int axp20x_pek_probe(struct platform_device *pdev)
313331

314332
axp20x_pek->info = (struct axp20x_info *)match->driver_data;
315333

316-
error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
317-
axp20x_pek_irq, 0,
318-
"axp20x-pek-dbr", axp20x_pek);
319-
if (error < 0) {
320-
dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
321-
axp20x_pek->irq_dbr, error);
322-
return error;
323-
}
324-
325-
error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
326-
axp20x_pek_irq, 0,
327-
"axp20x-pek-dbf", axp20x_pek);
328-
if (error < 0) {
329-
dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
330-
axp20x_pek->irq_dbf, error);
331-
return error;
332-
}
333-
334-
device_init_wakeup(&pdev->dev, true);
335-
336334
platform_set_drvdata(pdev, axp20x_pek);
337335

338336
return 0;

drivers/input/misc/palmas-pwrbutton.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
#include <linux/bitfield.h>
1819
#include <linux/init.h>
1920
#include <linux/input.h>
2021
#include <linux/interrupt.h>
@@ -115,8 +116,8 @@ static void palmas_pwron_params_ofinit(struct device *dev,
115116
struct device_node *np;
116117
u32 val;
117118
int i, error;
118-
u8 lpk_times[] = { 6, 8, 10, 12 };
119-
int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };
119+
static const u8 lpk_times[] = { 6, 8, 10, 12 };
120+
static const int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };
120121

121122
memset(config, 0, sizeof(*config));
122123

@@ -192,8 +193,8 @@ static int palmas_pwron_probe(struct platform_device *pdev)
192193
* Setup default hardware shutdown option (long key press)
193194
* and debounce.
194195
*/
195-
val = config.long_press_time_val << __ffs(PALMAS_LPK_TIME_MASK);
196-
val |= config.pwron_debounce_val << __ffs(PALMAS_PWRON_DEBOUNCE_MASK);
196+
val = FIELD_PREP(PALMAS_LPK_TIME_MASK, config.long_press_time_val) |
197+
FIELD_PREP(PALMAS_PWRON_DEBOUNCE_MASK, config.pwron_debounce_val);
197198
error = palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
198199
PALMAS_LONG_PRESS_KEY,
199200
PALMAS_LPK_TIME_MASK |

drivers/input/mouse/byd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191

192192
/*
193193
* The touchpad generates a mixture of absolute and relative packets, indicated
194-
* by the the last byte of each packet being set to one of the following:
194+
* by the last byte of each packet being set to one of the following:
195195
*/
196196
#define BYD_PACKET_ABSOLUTE 0xf8
197197
#define BYD_PACKET_RELATIVE 0x00

0 commit comments

Comments
 (0)