Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Jan 17, 2022
2 parents 4b37895 + 762f99f commit b520085
Show file tree
Hide file tree
Showing 14 changed files with 507 additions and 125 deletions.
115 changes: 115 additions & 0 deletions Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/zinitix,bt400.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Zinitix BT4xx and BT5xx series touchscreen controller bindings

description: The Zinitix BT4xx and BT5xx series of touchscreen controllers
are Korea-produced touchscreens with embedded microcontrollers. The
BT4xx series was produced 2010-2013 and the BT5xx series 2013-2014.

maintainers:
- Michael Srba <Michael.Srba@seznam.cz>
- Linus Walleij <linus.walleij@linaro.org>

allOf:
- $ref: touchscreen.yaml#

properties:
$nodename:
pattern: "^touchscreen(@.*)?$"

compatible:
enum:
- zinitix,bt402
- zinitix,bt403
- zinitix,bt404
- zinitix,bt412
- zinitix,bt413
- zinitix,bt431
- zinitix,bt432
- zinitix,bt531
- zinitix,bt532
- zinitix,bt538
- zinitix,bt541
- zinitix,bt548
- zinitix,bt554
- zinitix,at100

reg:
description: I2C address on the I2C bus

clock-frequency:
description: I2C client clock frequency, defined for host when using
the device on the I2C bus
minimum: 0
maximum: 400000

interrupts:
description: Interrupt to host
maxItems: 1

vcca-supply:
description: Analog power supply regulator on the VCCA pin

vdd-supply:
description: Digital power supply regulator on the VDD pin.
In older device trees this can be the accidental name for the analog
supply on the VCCA pin, and in that case the deprecated vddo-supply is
used for the digital power supply.

vddo-supply:
description: Deprecated name for the digital power supply, use vdd-supply
as this reflects the real name of the pin. If this supply is present,
the vdd-supply represents VCCA instead of VDD. Implementers should first
check for this property, and if it is present assume that the vdd-supply
represents the analog supply.
deprecated: true

reset-gpios:
description: Reset line for the touchscreen, should be tagged
as GPIO_ACTIVE_LOW

zinitix,mode:
description: Mode of reporting touch points. Some modes may not work
with a particular ts firmware for unknown reasons. Available modes are
1 and 2. Mode 2 is the default and preferred.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 2]

touchscreen-size-x: true
touchscreen-size-y: true
touchscreen-fuzz-x: true
touchscreen-fuzz-y: true

additionalProperties: false

required:
- compatible
- reg
- interrupts
- touchscreen-size-x
- touchscreen-size-y

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@20 {
compatible = "zinitix,bt541";
reg = <0x20>;
interrupt-parent = <&gpio>;
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
vcca-supply = <&reg_vcca_tsp>;
vdd-supply = <&reg_vdd_tsp>;
touchscreen-size-x = <540>;
touchscreen-size-y = <960>;
zinitix,mode = <2>;
};
};
40 changes: 0 additions & 40 deletions Documentation/devicetree/bindings/input/touchscreen/zinitix.txt

This file was deleted.

2 changes: 1 addition & 1 deletion drivers/input/ff-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int compat_effect(struct ff_device *ff, struct ff_effect *effect)
effect->type = FF_PERIODIC;
effect->u.periodic.waveform = FF_SINE;
effect->u.periodic.period = 50;
effect->u.periodic.magnitude = max(magnitude, 0x7fff);
effect->u.periodic.magnitude = magnitude;
effect->u.periodic.offset = 0;
effect->u.periodic.phase = 0;
effect->u.periodic.envelope.attack_length = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata,
ssize_t error;
int i;

bits = bitmap_zalloc(n_events, GFP_KERNEL);
bits = bitmap_alloc(n_events, GFP_KERNEL);
if (!bits)
return -ENOMEM;

Expand Down
72 changes: 35 additions & 37 deletions drivers/input/misc/axp20x-pek.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,8 @@ ATTRIBUTE_GROUPS(axp20x);

static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
{
struct axp20x_pek *axp20x_pek = pwr;
struct input_dev *idev = axp20x_pek->input;

if (!idev)
return IRQ_HANDLED;
struct input_dev *idev = pwr;
struct axp20x_pek *axp20x_pek = input_get_drvdata(idev);

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

axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
if (axp20x_pek->irq_dbr < 0)
return axp20x_pek->irq_dbr;
axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc,
axp20x_pek->irq_dbr);

axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
if (axp20x_pek->irq_dbf < 0)
return axp20x_pek->irq_dbf;
axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc,
axp20x_pek->irq_dbf);

axp20x_pek->input = devm_input_allocate_device(&pdev->dev);
if (!axp20x_pek->input)
return -ENOMEM;
Expand All @@ -246,13 +256,33 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,

input_set_drvdata(idev, axp20x_pek);

error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
axp20x_pek_irq, 0,
"axp20x-pek-dbr", idev);
if (error < 0) {
dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
axp20x_pek->irq_dbr, error);
return error;
}

error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
axp20x_pek_irq, 0,
"axp20x-pek-dbf", idev);
if (error < 0) {
dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
axp20x_pek->irq_dbf, error);
return error;
}

error = input_register_device(idev);
if (error) {
dev_err(&pdev->dev, "Can't register input device: %d\n",
error);
return error;
}

device_init_wakeup(&pdev->dev, true);

return 0;
}

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

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

axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
if (axp20x_pek->irq_dbr < 0)
return axp20x_pek->irq_dbr;
axp20x_pek->irq_dbr = regmap_irq_get_virq(
axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbr);

axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
if (axp20x_pek->irq_dbf < 0)
return axp20x_pek->irq_dbf;
axp20x_pek->irq_dbf = regmap_irq_get_virq(
axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbf);

if (axp20x_pek_should_register_input(axp20x_pek)) {
error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
if (error)
Expand All @@ -313,26 +331,6 @@ static int axp20x_pek_probe(struct platform_device *pdev)

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

error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
axp20x_pek_irq, 0,
"axp20x-pek-dbr", axp20x_pek);
if (error < 0) {
dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
axp20x_pek->irq_dbr, error);
return error;
}

error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
axp20x_pek_irq, 0,
"axp20x-pek-dbf", axp20x_pek);
if (error < 0) {
dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
axp20x_pek->irq_dbf, error);
return error;
}

device_init_wakeup(&pdev->dev, true);

platform_set_drvdata(pdev, axp20x_pek);

return 0;
Expand Down
9 changes: 5 additions & 4 deletions drivers/input/misc/palmas-pwrbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* GNU General Public License for more details.
*/

#include <linux/bitfield.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -115,8 +116,8 @@ static void palmas_pwron_params_ofinit(struct device *dev,
struct device_node *np;
u32 val;
int i, error;
u8 lpk_times[] = { 6, 8, 10, 12 };
int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };
static const u8 lpk_times[] = { 6, 8, 10, 12 };
static const int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };

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

Expand Down Expand Up @@ -192,8 +193,8 @@ static int palmas_pwron_probe(struct platform_device *pdev)
* Setup default hardware shutdown option (long key press)
* and debounce.
*/
val = config.long_press_time_val << __ffs(PALMAS_LPK_TIME_MASK);
val |= config.pwron_debounce_val << __ffs(PALMAS_PWRON_DEBOUNCE_MASK);
val = FIELD_PREP(PALMAS_LPK_TIME_MASK, config.long_press_time_val) |
FIELD_PREP(PALMAS_PWRON_DEBOUNCE_MASK, config.pwron_debounce_val);
error = palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
PALMAS_LONG_PRESS_KEY,
PALMAS_LPK_TIME_MASK |
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/mouse/byd.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

/*
* The touchpad generates a mixture of absolute and relative packets, indicated
* by the the last byte of each packet being set to one of the following:
* by the last byte of each packet being set to one of the following:
*/
#define BYD_PACKET_ABSOLUTE 0xf8
#define BYD_PACKET_RELATIVE 0x00
Expand Down
Loading

0 comments on commit b520085

Please sign in to comment.