* [PATCH AUTOSEL 4.14 06/27] Input: pwm-vibra - prevent unbalanced regulator
From: Sasha Levin @ 2019-03-11 19:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jonathan Bakker, Paweł Chmiel, Dmitry Torokhov, Sasha Levin,
linux-input
In-Reply-To: <20190311195824.139043-1-sashal@kernel.org>
From: Jonathan Bakker <xc-racer2@live.ca>
[ Upstream commit 3ca232df9921f083c3b37ba5fbc76f4d9046268b ]
pwm_vibrator_stop disables the regulator, but it can be called from
multiple places, even when the regulator is already disabled. Fix this
by using regulator_is_enabled check when starting and stopping device.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/misc/pwm-vibra.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 55da191ae550..9df87431d7d4 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -34,6 +34,7 @@ struct pwm_vibrator {
struct work_struct play_work;
u16 level;
u32 direction_duty_cycle;
+ bool vcc_on;
};
static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
@@ -42,10 +43,13 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
struct pwm_state state;
int err;
- err = regulator_enable(vibrator->vcc);
- if (err) {
- dev_err(pdev, "failed to enable regulator: %d", err);
- return err;
+ if (!vibrator->vcc_on) {
+ err = regulator_enable(vibrator->vcc);
+ if (err) {
+ dev_err(pdev, "failed to enable regulator: %d", err);
+ return err;
+ }
+ vibrator->vcc_on = true;
}
pwm_get_state(vibrator->pwm, &state);
@@ -76,7 +80,10 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
{
- regulator_disable(vibrator->vcc);
+ if (vibrator->vcc_on) {
+ regulator_disable(vibrator->vcc);
+ vibrator->vcc_on = false;
+ }
if (vibrator->pwm_dir)
pwm_disable(vibrator->pwm_dir);
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 44/44] Input: st-keyscan - fix potential zalloc NULL dereference
From: Sasha Levin @ 2019-03-11 19:57 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Gabriel Fernandez, Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Gabriel Fernandez <gabriel.fernandez@st.com>
[ Upstream commit 2439d37e1bf8a34d437573c086572abe0f3f1b15 ]
This patch fixes the following static checker warning:
drivers/input/keyboard/st-keyscan.c:156 keyscan_probe()
error: potential zalloc NULL dereference: 'keypad_data->input_dev'
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/st-keyscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index babcfb165e4f..3b85631fde91 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev)
input_dev->id.bustype = BUS_HOST;
+ keypad_data->input_dev = input_dev;
+
error = keypad_matrix_key_parse_dt(keypad_data);
if (error)
return error;
@@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)
input_set_drvdata(input_dev, keypad_data);
- keypad_data->input_dev = input_dev;
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(keypad_data->base))
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 25/44] Input: matrix_keypad - use flush_delayed_work()
From: Sasha Levin @ 2019-03-11 19:56 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit a342083abe576db43594a32d458a61fa81f7cb32 ]
We should be using flush_delayed_work() instead of flush_work() in
matrix_keypad_stop() to ensure that we are not missing work that is
scheduled but not yet put in the workqueue (i.e. its delay timer has not
expired yet).
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/matrix_keypad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 403452ef00e6..3d1cb7bf5e35 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -222,7 +222,7 @@ static void matrix_keypad_stop(struct input_dev *dev)
keypad->stopped = true;
spin_unlock_irq(&keypad->lock);
- flush_work(&keypad->work.work);
+ flush_delayed_work(&keypad->work);
/*
* matrix_keypad_scan() will leave IRQs enabled;
* we should disable them now.
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 24/44] Input: ps2-gpio - flush TX work when closing port
From: Sasha Levin @ 2019-03-11 19:56 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 33a841ce5cef4ca6c18ad333248b6d273f54c839 ]
To ensure that TX work is not running after serio port has been torn down,
let's flush it when closing the port.
Reported-by: Sven Van Asbroeck <thesven73@gmail.com>
Acked-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/serio/ps2-gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index c62cceb97bb1..5e8d8384aa2a 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -76,6 +76,7 @@ static void ps2_gpio_close(struct serio *serio)
{
struct ps2_gpio_data *drvdata = serio->port_data;
+ flush_delayed_work(&drvdata->tx_work);
disable_irq(drvdata->irq);
}
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 23/44] Input: cap11xx - switch to using set_brightness_blocking()
From: Sasha Levin @ 2019-03-11 19:56 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 628442880af8c201d307a45f3862a7a17df8a189 ]
Updating LED state requires access to regmap and therefore we may sleep,
so we could not do that directly form set_brightness() method.
Historically we used private work to adjust the brightness, but with the
introduction of set_brightness_blocking() we no longer need it.
As a bonus, not having our own work item means we do not have
use-after-free issue as we neglected to cancel outstanding work on
driver unbind.
Reported-by: Sven Van Asbroeck <thesven73@gmail.com>
Reviewed-by: Sven Van Asbroeck <TheSven73@googlemail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/cap11xx.c | 35 ++++++++++----------------------
1 file changed, 11 insertions(+), 24 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 312916f99597..73686c2460ce 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -75,9 +75,7 @@
struct cap11xx_led {
struct cap11xx_priv *priv;
struct led_classdev cdev;
- struct work_struct work;
u32 reg;
- enum led_brightness new_brightness;
};
#endif
@@ -233,30 +231,21 @@ static void cap11xx_input_close(struct input_dev *idev)
}
#ifdef CONFIG_LEDS_CLASS
-static void cap11xx_led_work(struct work_struct *work)
+static int cap11xx_led_set(struct led_classdev *cdev,
+ enum led_brightness value)
{
- struct cap11xx_led *led = container_of(work, struct cap11xx_led, work);
+ struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
struct cap11xx_priv *priv = led->priv;
- int value = led->new_brightness;
/*
- * All LEDs share the same duty cycle as this is a HW limitation.
- * Brightness levels per LED are either 0 (OFF) and 1 (ON).
+ * All LEDs share the same duty cycle as this is a HW
+ * limitation. Brightness levels per LED are either
+ * 0 (OFF) and 1 (ON).
*/
- regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL,
- BIT(led->reg), value ? BIT(led->reg) : 0);
-}
-
-static void cap11xx_led_set(struct led_classdev *cdev,
- enum led_brightness value)
-{
- struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
-
- if (led->new_brightness == value)
- return;
-
- led->new_brightness = value;
- schedule_work(&led->work);
+ return regmap_update_bits(priv->regmap,
+ CAP11XX_REG_LED_OUTPUT_CONTROL,
+ BIT(led->reg),
+ value ? BIT(led->reg) : 0);
}
static int cap11xx_init_leds(struct device *dev,
@@ -299,7 +288,7 @@ static int cap11xx_init_leds(struct device *dev,
led->cdev.default_trigger =
of_get_property(child, "linux,default-trigger", NULL);
led->cdev.flags = 0;
- led->cdev.brightness_set = cap11xx_led_set;
+ led->cdev.brightness_set_blocking = cap11xx_led_set;
led->cdev.max_brightness = 1;
led->cdev.brightness = LED_OFF;
@@ -312,8 +301,6 @@ static int cap11xx_init_leds(struct device *dev,
led->reg = reg;
led->priv = priv;
- INIT_WORK(&led->work, cap11xx_led_work);
-
error = devm_led_classdev_register(dev, &led->cdev);
if (error) {
of_node_put(child);
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 11/44] Input: pwm-vibra - stop regulator after disabling pwm, not before
From: Sasha Levin @ 2019-03-11 19:56 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Paweł Chmiel, Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
[ Upstream commit 94803aef3533676194c772383472636c453e3147 ]
This patch fixes order of disable calls in pwm_vibrator_stop.
Currently when starting device, we first enable vcc regulator and then
setup and enable pwm. When stopping, we should do this in oposite order,
so first disable pwm and then disable regulator.
Previously order was the same as in start.
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/misc/pwm-vibra.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 9df87431d7d4..dbb6d9e1b947 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -80,14 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
{
+ if (vibrator->pwm_dir)
+ pwm_disable(vibrator->pwm_dir);
+ pwm_disable(vibrator->pwm);
+
if (vibrator->vcc_on) {
regulator_disable(vibrator->vcc);
vibrator->vcc_on = false;
}
-
- if (vibrator->pwm_dir)
- pwm_disable(vibrator->pwm_dir);
- pwm_disable(vibrator->pwm);
}
static void pwm_vibrator_play_work(struct work_struct *work)
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 10/44] Input: pwm-vibra - prevent unbalanced regulator
From: Sasha Levin @ 2019-03-11 19:56 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jonathan Bakker, Paweł Chmiel, Dmitry Torokhov, Sasha Levin,
linux-input
In-Reply-To: <20190311195700.138462-1-sashal@kernel.org>
From: Jonathan Bakker <xc-racer2@live.ca>
[ Upstream commit 3ca232df9921f083c3b37ba5fbc76f4d9046268b ]
pwm_vibrator_stop disables the regulator, but it can be called from
multiple places, even when the regulator is already disabled. Fix this
by using regulator_is_enabled check when starting and stopping device.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/misc/pwm-vibra.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 55da191ae550..9df87431d7d4 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -34,6 +34,7 @@ struct pwm_vibrator {
struct work_struct play_work;
u16 level;
u32 direction_duty_cycle;
+ bool vcc_on;
};
static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
@@ -42,10 +43,13 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
struct pwm_state state;
int err;
- err = regulator_enable(vibrator->vcc);
- if (err) {
- dev_err(pdev, "failed to enable regulator: %d", err);
- return err;
+ if (!vibrator->vcc_on) {
+ err = regulator_enable(vibrator->vcc);
+ if (err) {
+ dev_err(pdev, "failed to enable regulator: %d", err);
+ return err;
+ }
+ vibrator->vcc_on = true;
}
pwm_get_state(vibrator->pwm, &state);
@@ -76,7 +80,10 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
{
- regulator_disable(vibrator->vcc);
+ if (vibrator->vcc_on) {
+ regulator_disable(vibrator->vcc);
+ vibrator->vcc_on = false;
+ }
if (vibrator->pwm_dir)
pwm_disable(vibrator->pwm_dir);
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 52/52] Input: st-keyscan - fix potential zalloc NULL dereference
From: Sasha Levin @ 2019-03-11 19:55 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Gabriel Fernandez, Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Gabriel Fernandez <gabriel.fernandez@st.com>
[ Upstream commit 2439d37e1bf8a34d437573c086572abe0f3f1b15 ]
This patch fixes the following static checker warning:
drivers/input/keyboard/st-keyscan.c:156 keyscan_probe()
error: potential zalloc NULL dereference: 'keypad_data->input_dev'
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/st-keyscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index babcfb165e4f..3b85631fde91 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev)
input_dev->id.bustype = BUS_HOST;
+ keypad_data->input_dev = input_dev;
+
error = keypad_matrix_key_parse_dt(keypad_data);
if (error)
return error;
@@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)
input_set_drvdata(input_dev, keypad_data);
- keypad_data->input_dev = input_dev;
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(keypad_data->base))
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 27/52] Input: matrix_keypad - use flush_delayed_work()
From: Sasha Levin @ 2019-03-11 19:54 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit a342083abe576db43594a32d458a61fa81f7cb32 ]
We should be using flush_delayed_work() instead of flush_work() in
matrix_keypad_stop() to ensure that we are not missing work that is
scheduled but not yet put in the workqueue (i.e. its delay timer has not
expired yet).
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/matrix_keypad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 403452ef00e6..3d1cb7bf5e35 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -222,7 +222,7 @@ static void matrix_keypad_stop(struct input_dev *dev)
keypad->stopped = true;
spin_unlock_irq(&keypad->lock);
- flush_work(&keypad->work.work);
+ flush_delayed_work(&keypad->work);
/*
* matrix_keypad_scan() will leave IRQs enabled;
* we should disable them now.
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 26/52] Input: ps2-gpio - flush TX work when closing port
From: Sasha Levin @ 2019-03-11 19:54 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 33a841ce5cef4ca6c18ad333248b6d273f54c839 ]
To ensure that TX work is not running after serio port has been torn down,
let's flush it when closing the port.
Reported-by: Sven Van Asbroeck <thesven73@gmail.com>
Acked-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/serio/ps2-gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index c62cceb97bb1..5e8d8384aa2a 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -76,6 +76,7 @@ static void ps2_gpio_close(struct serio *serio)
{
struct ps2_gpio_data *drvdata = serio->port_data;
+ flush_delayed_work(&drvdata->tx_work);
disable_irq(drvdata->irq);
}
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 25/52] Input: cap11xx - switch to using set_brightness_blocking()
From: Sasha Levin @ 2019-03-11 19:54 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 628442880af8c201d307a45f3862a7a17df8a189 ]
Updating LED state requires access to regmap and therefore we may sleep,
so we could not do that directly form set_brightness() method.
Historically we used private work to adjust the brightness, but with the
introduction of set_brightness_blocking() we no longer need it.
As a bonus, not having our own work item means we do not have
use-after-free issue as we neglected to cancel outstanding work on
driver unbind.
Reported-by: Sven Van Asbroeck <thesven73@gmail.com>
Reviewed-by: Sven Van Asbroeck <TheSven73@googlemail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/keyboard/cap11xx.c | 35 ++++++++++----------------------
1 file changed, 11 insertions(+), 24 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 312916f99597..73686c2460ce 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -75,9 +75,7 @@
struct cap11xx_led {
struct cap11xx_priv *priv;
struct led_classdev cdev;
- struct work_struct work;
u32 reg;
- enum led_brightness new_brightness;
};
#endif
@@ -233,30 +231,21 @@ static void cap11xx_input_close(struct input_dev *idev)
}
#ifdef CONFIG_LEDS_CLASS
-static void cap11xx_led_work(struct work_struct *work)
+static int cap11xx_led_set(struct led_classdev *cdev,
+ enum led_brightness value)
{
- struct cap11xx_led *led = container_of(work, struct cap11xx_led, work);
+ struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
struct cap11xx_priv *priv = led->priv;
- int value = led->new_brightness;
/*
- * All LEDs share the same duty cycle as this is a HW limitation.
- * Brightness levels per LED are either 0 (OFF) and 1 (ON).
+ * All LEDs share the same duty cycle as this is a HW
+ * limitation. Brightness levels per LED are either
+ * 0 (OFF) and 1 (ON).
*/
- regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL,
- BIT(led->reg), value ? BIT(led->reg) : 0);
-}
-
-static void cap11xx_led_set(struct led_classdev *cdev,
- enum led_brightness value)
-{
- struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
-
- if (led->new_brightness == value)
- return;
-
- led->new_brightness = value;
- schedule_work(&led->work);
+ return regmap_update_bits(priv->regmap,
+ CAP11XX_REG_LED_OUTPUT_CONTROL,
+ BIT(led->reg),
+ value ? BIT(led->reg) : 0);
}
static int cap11xx_init_leds(struct device *dev,
@@ -299,7 +288,7 @@ static int cap11xx_init_leds(struct device *dev,
led->cdev.default_trigger =
of_get_property(child, "linux,default-trigger", NULL);
led->cdev.flags = 0;
- led->cdev.brightness_set = cap11xx_led_set;
+ led->cdev.brightness_set_blocking = cap11xx_led_set;
led->cdev.max_brightness = 1;
led->cdev.brightness = LED_OFF;
@@ -312,8 +301,6 @@ static int cap11xx_init_leds(struct device *dev,
led->reg = reg;
led->priv = priv;
- INIT_WORK(&led->work, cap11xx_led_work);
-
error = devm_led_classdev_register(dev, &led->cdev);
if (error) {
of_node_put(child);
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 12/52] Input: pwm-vibra - stop regulator after disabling pwm, not before
From: Sasha Levin @ 2019-03-11 19:54 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Paweł Chmiel, Dmitry Torokhov, Sasha Levin, linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
[ Upstream commit 94803aef3533676194c772383472636c453e3147 ]
This patch fixes order of disable calls in pwm_vibrator_stop.
Currently when starting device, we first enable vcc regulator and then
setup and enable pwm. When stopping, we should do this in oposite order,
so first disable pwm and then disable regulator.
Previously order was the same as in start.
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/misc/pwm-vibra.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 9df87431d7d4..dbb6d9e1b947 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -80,14 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
{
+ if (vibrator->pwm_dir)
+ pwm_disable(vibrator->pwm_dir);
+ pwm_disable(vibrator->pwm);
+
if (vibrator->vcc_on) {
regulator_disable(vibrator->vcc);
vibrator->vcc_on = false;
}
-
- if (vibrator->pwm_dir)
- pwm_disable(vibrator->pwm_dir);
- pwm_disable(vibrator->pwm);
}
static void pwm_vibrator_play_work(struct work_struct *work)
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.20 11/52] Input: pwm-vibra - prevent unbalanced regulator
From: Sasha Levin @ 2019-03-11 19:54 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jonathan Bakker, Paweł Chmiel, Dmitry Torokhov, Sasha Levin,
linux-input
In-Reply-To: <20190311195516.137772-1-sashal@kernel.org>
From: Jonathan Bakker <xc-racer2@live.ca>
[ Upstream commit 3ca232df9921f083c3b37ba5fbc76f4d9046268b ]
pwm_vibrator_stop disables the regulator, but it can be called from
multiple places, even when the regulator is already disabled. Fix this
by using regulator_is_enabled check when starting and stopping device.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/misc/pwm-vibra.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 55da191ae550..9df87431d7d4 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -34,6 +34,7 @@ struct pwm_vibrator {
struct work_struct play_work;
u16 level;
u32 direction_duty_cycle;
+ bool vcc_on;
};
static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
@@ -42,10 +43,13 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
struct pwm_state state;
int err;
- err = regulator_enable(vibrator->vcc);
- if (err) {
- dev_err(pdev, "failed to enable regulator: %d", err);
- return err;
+ if (!vibrator->vcc_on) {
+ err = regulator_enable(vibrator->vcc);
+ if (err) {
+ dev_err(pdev, "failed to enable regulator: %d", err);
+ return err;
+ }
+ vibrator->vcc_on = true;
}
pwm_get_state(vibrator->pwm, &state);
@@ -76,7 +80,10 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
{
- regulator_disable(vibrator->vcc);
+ if (vibrator->vcc_on) {
+ regulator_disable(vibrator->vcc);
+ vibrator->vcc_on = false;
+ }
if (vibrator->pwm_dir)
pwm_disable(vibrator->pwm_dir);
--
2.19.1
^ permalink raw reply related
* Re: [git pull] Input updates for v5.1-rc0
From: pr-tracker-bot @ 2019-03-11 19:00 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Linus Torvalds, linux-kernel, linux-input
In-Reply-To: <20190310023427.GA68528@dtor-ws>
The pull request you sent on Sat, 9 Mar 2019 18:34:27 -0800:
> git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git for-linus
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4f0237062ca70c8e34e16e518aee4b84c30d1832
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker
^ permalink raw reply
* Re: [PATCH] hid: logitech: check the return value of create_singlethread_workqueue
From: Benjamin Tissoires @ 2019-03-11 15:08 UTC (permalink / raw)
To: Kangjie Lu; +Cc: pakki001, Jiri Kosina, open list:HID CORE LAYER, lkml
In-Reply-To: <20190309044345.7018-1-kjlu@umn.edu>
On Sat, Mar 9, 2019 at 5:43 AM Kangjie Lu <kjlu@umn.edu> wrote:
>
> create_singlethread_workqueue may fail and return NULL. The fix
> checks if it is NULL to avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/hid/hid-logitech-hidpp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index 15ed6177a7a3..efbc39b92aa2 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -2156,6 +2156,9 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
>
> /* init the hardware command queue */
> data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
> + if (!data->wq)
> + return -ENOMEM;
> +
I agree there is something wrong with the current code, but I think
you are not fixing the issue properly.
The code just above allocates data with kzalloc and stores it in the
hid_device and set up everything. If create_singlethread_workqueue()
fails now, then we are screwed and you need to reverse all of the FF
init.
I think we should move the thread creation above so we are not leaking
memory and not create the FF elements if there is something wrong.
Cheers,
Benjamin
> atomic_set(&data->workqueue_size, 0);
>
> /* initialize with zero autocenter to get wheel in usable state */
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH] HID: hid-asus: select CONFIG_POWER_SUPPLY
From: Benjamin Tissoires @ 2019-03-11 14:57 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jiri Kosina, NOGUCHI Hiroshi, open list:HID CORE LAYER, lkml
In-Reply-To: <20190304195536.1019650-1-arnd@arndb.de>
On Mon, Mar 4, 2019 at 8:55 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> The newly added power supply code fails to link when the power supply core
> code is disabled:
>
> drivers/hid/hid-asus.o: In function `asus_battery_get_property':
> hid-asus.c:(.text+0x11de): undefined reference to `power_supply_get_drvdata'
> drivers/hid/hid-asus.o: In function `asus_probe':
> hid-asus.c:(.text+0x170c): undefined reference to `devm_power_supply_register'
> hid-asus.c:(.text+0x1734): undefined reference to `power_supply_powers'
> drivers/hid/hid-asus.o: In function `asus_raw_event':
> hid-asus.c:(.text+0x1914): undefined reference to `power_supply_changed'
>
> Select the subsystem from Kconfig as we do for other hid drivers already.
>
> Fixes: 6311d329e12a ("HID: hid-asus: Add BT keyboard dock battery monitoring support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Applied to for-5.1/upstream-fixes
Cheers,
Benjamin
> drivers/hid/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 6ca8d322b487..4ca0cdfa6b33 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -150,6 +150,7 @@ config HID_ASUS
> tristate "Asus"
> depends on LEDS_CLASS
> depends on ASUS_WMI || ASUS_WMI=n
> + select POWER_SUPPLY
> ---help---
> Support for Asus notebook built-in keyboard and touchpad via i2c, and
> the Asus Republic of Gamers laptop keyboard special keys.
> --
> 2.20.0
>
^ permalink raw reply
* Re: [PATCH v2] HID: quirks: use correct format chars in dbg_hid
From: Benjamin Tissoires @ 2019-03-11 14:56 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Louis Taylor, Jiri Kosina, open list:HID CORE LAYER, LKML,
clang-built-linux
In-Reply-To: <CAKwvOd=RZ7E3MRo4dB6KEi5aw92kjZ63ij0jL4XJ0nKzDwcm=g@mail.gmail.com>
On Wed, Feb 27, 2019 at 8:43 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> On Wed, Feb 27, 2019 at 3:08 AM Louis Taylor <louis@kragniz.eu> wrote:
> >
> > When building with -Wformat, clang warns:
> >
> > drivers/hid/hid-quirks.c:1075:27: warning: format specifies type
> > 'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
> > [-Wformat]
> > bl_entry->driver_data, bl_entry->vendor,
> > ^~~~~~~~~~~~~~~~
> > ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
> > printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
> > ~~~~~~ ^~~
> > drivers/hid/hid-quirks.c:1076:4: warning: format specifies type
> > 'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
> > [-Wformat]
> > bl_entry->product);
> > ^~~~~~~~~~~~~~~~~
> > ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
> > printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
> > ~~~~~~ ^~~
> > drivers/hid/hid-quirks.c:1242:12: warning: format specifies type
> > 'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
> > [-Wformat]
> > quirks, hdev->vendor, hdev->product);
> > ^~~~~~~~~~~~
> > ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
> > printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
> > ~~~~~~ ^~~
> > drivers/hid/hid-quirks.c:1242:26: warning: format specifies type
> > 'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
> > [-Wformat]
> > quirks, hdev->vendor, hdev->product);
> > ^~~~~~~~~~~~~
> > ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
> > printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
> > ~~~~~~ ^~~
> > 4 warnings generated.
> >
> > This patch fixes the format strings to use the correct format type for unsigned
> > ints.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/378
> > Signed-off-by: Louis Taylor <louis@kragniz.eu>
>
> Thanks for following up on the feedback.
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Applied to for-5.1/upstream-fixes
Cheers,
Benjamin
>
> > ---
> >
> > v2: change format string to use %04x instead of %x
> >
> > drivers/hid/hid-quirks.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
> > index 94088c0ed68a..b608a57b7908 100644
> > --- a/drivers/hid/hid-quirks.c
> > +++ b/drivers/hid/hid-quirks.c
> > @@ -1071,7 +1071,7 @@ static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev)
> > }
> >
> > if (bl_entry != NULL)
> > - dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%hx:0x%hx\n",
> > + dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%04x:0x%04x\n",
> > bl_entry->driver_data, bl_entry->vendor,
> > bl_entry->product);
> >
> > @@ -1238,7 +1238,7 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev)
> > quirks |= bl_entry->driver_data;
> >
> > if (quirks)
> > - dbg_hid("Found squirk 0x%lx for HID device 0x%hx:0x%hx\n",
> > + dbg_hid("Found squirk 0x%lx for HID device 0x%04x:0x%04x\n",
> > quirks, hdev->vendor, hdev->product);
> > return quirks;
> > }
> > --
> > 2.20.1
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
^ permalink raw reply
* Re: [PATCH][next] HID: uclogic: remove redudant duplicated null check on ver_ptr
From: Benjamin Tissoires @ 2019-03-11 14:55 UTC (permalink / raw)
To: Colin King; +Cc: Jiri Kosina, open list:HID CORE LAYER, kernel-janitors, lkml
In-Reply-To: <20190302222338.8023-1-colin.king@canonical.com>
On Sat, Mar 2, 2019 at 11:23 PM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently ver_ptr is being null checked twice, once before calling
> usb_string and once afterwards. The second null check is redundant
> and can be removed, remove it.
>
> Detected by CoverityScan, CID#1477308 ("Logically dead code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
Applied to for-5.1/upstream-fixes
Cheers,
Benjamin
> drivers/hid/hid-uclogic-params.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
> index 7710d9f957da..0187c9f8fc22 100644
> --- a/drivers/hid/hid-uclogic-params.c
> +++ b/drivers/hid/hid-uclogic-params.c
> @@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
> goto cleanup;
> }
> rc = usb_string(udev, 201, ver_ptr, ver_len);
> - if (ver_ptr == NULL) {
> - rc = -ENOMEM;
> - goto cleanup;
> - }
> if (rc == -EPIPE) {
> *ver_ptr = '\0';
> } else if (rc < 0) {
> --
> 2.20.1
>
^ permalink raw reply
* Re: [PATCH v6 0/4] input: touchscreen: Add goodix GT5553 CTP support
From: Jagan Teki @ 2019-03-11 13:38 UTC (permalink / raw)
To: Dmitry Torokhov, Bastien Nocera, Rob Herring
Cc: Henrik Rydberg, linux-input, linux-kernel, devicetree,
Mark Rutland, linux-amarula, Michael Trimarchi
In-Reply-To: <CAMty3ZB3o1Np7_H7rmCgpUWPk7BRqHRm7gxRpgAq_YyeCUKgaw@mail.gmail.com>
On Wed, Mar 6, 2019 at 10:47 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Dmitry,
>
> On Tue, Feb 26, 2019 at 11:43 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Hi Dmitry,
> >
> > On Tue, Feb 19, 2019 at 3:46 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > This is v6 patchset for supporting goodix GT5553 CTP. Here is the
> > > previous version[1]
> > >
> > > Changes for v5:
> > > - document bindings for required regulators, which are need during
> > > power-on sequence
> > > - enable, disable required regulators as described in power-on sequence
> > > using normal regulator calls
> > > - update the proper commi messages
> > > Changes for v4:
> > > - document AVDD22, DVDD12, VDDIO as optional properties
> > > - use regulator bulk calls, for get, enable and disable functionalities
> > > Changes for v4:
> > > - devm_add_action_or_reset for disabling regulator
> > > Changes for v3:
> > > - add cover-letter
> > > - s/ADVV28/AVDD28 on commit head
> > > - fix few typo
> > > Changes for v2:
> > > - Rename vcc-supply with AVDD28-supply
> > > - disable regulator in remove
> > > - fix to setup regulator in probe code
> > > - add chipdata
> > > - drop example node in dt-bindings
> > >
> > > [1] https://patchwork.kernel.org/cover/10816901/
> > >
> > > Jagan Teki (4):
> > > dt-bindings: input: touchscreen: goodix: Document regulator properties
> > > Input: goodix - Add regulators suppot
> > > dt-bindings: input: touchscreen: goodix: Add GT5663 compatible
> > > Input: goodix - Add GT5663 CTP support
> > >
> > > .../bindings/input/touchscreen/goodix.txt | 3 +
> > > drivers/input/touchscreen/goodix.c | 60 +++++++++++++++++++
> > > 2 files changed, 63 insertions(+)
> >
> > Let me know if you have any further comments on regulator patch, fyi
> > Rob reviewed it already.
>
> Would you comment on this? few dts changes are pending for this to support.
Gentle remainder.
^ permalink raw reply
* [git pull] Input updates for v5.1-rc0
From: Dmitry Torokhov @ 2019-03-10 2:34 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, linux-input
Hi Linus,
Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git for-linus
to receive updates for the input subsystem. You will get:
- update to ili210x touchscreen driver, refreshing the code and adding
support for ILI251X line
- update to st1232 touchscreen driver adding support for st1633 model
- sx8654 touchscreen driver gained support for sx8650 model
- edt-ft5x06 touchscreen driver gained support for Evervision FT5726
- Goodix touchscreen driver can now support gt5688
- new vibrator driver for MSM SOCs
- miscellaneous fixes for the rest of input drivers
Thanks!
Changelog:
---------
Aditya Pakki (1):
Input: ad7879 - add check for read errors in interrupt
Arnd Bergmann (2):
Input: msm-vibrator - use correct gpio header
Input: raspberrypi-ts - select CONFIG_INPUT_POLLDEV
Brian Masney (1):
Input: add new vibrator driver for various MSM SOCs
Dan Carpenter (1):
Input: msm-vibrator - tweak an error message
Dmitry Torokhov (5):
Input: sx8654 - do not override interrupt trigger
Input: ili210x - switch to using devm_device_add_group()
Input: stmfts - acknowledge that setting brightness is a blocking call
Input: tm2-touchkey - acknowledge that setting brightness is a blocking call
Input: ims-pcu - switch to using brightness_set_blocking()
Florian Fainelli (1):
Input: gpio-keys - add shutdown callback
Guido Günther (3):
Input: goodix - support Goodix gt5688
Input: goodix - refer to touchscreen.txt in device tree bindings
Input: goodix - print values in case of inconsistencies
Gustavo A. R. Silva (3):
Input: tca6416-keypad - use struct_size() in kzalloc()
Input: mcs_touchkey - use struct_size() in kzalloc()
Input: db9 - mark expected switch fall-through
Hans de Goede (2):
Input: soc_button_array - add usage-page 0x01 usage-id 0xca mapping
Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device
Jason Gerecke (1):
Input: wacom_serial4 - add support for Wacom ArtPad II tablet
Jonathan Bakker (3):
Input: tm2-touchkey - correct initial brightness
Input: tm2-touchkey - allow specifying custom keycodes
Input: tm2-touchkey - add support for aries touchkey variant
Marco Felsch (3):
Input: edt-ft5x06 - add support for Evervision FT5726
Input: edt-ft5x06 - add support to update ev-ft5726 registers
Input: edt-ft5x06 - add offset support for ev-ft5726
Marek Vasut (11):
Input: ili210x - add DT binding document
Input: ili210x - drop platform data support
Input: ili210x - drop get_pendown_state
Input: ili210x - convert to devm_ functions
Input: ili210x - add reset GPIO support
Input: ili210x - convert to devm IRQ
Input: ili210x - rework the touchscreen sample processing
Input: ili210x - reorder probe
Input: ili210x - add OF match table
Input: ili210x - add ILI251X support
Input: ili210x - fetch touchscreen geometry from DT
Martin Kepplinger (3):
Input: st1232 - add support for st1633
Input: st1232 - add Martin as module author
Input: st1232 - switch to gpiod API
Matthias Fend (1):
Input: st1232 - handle common DT bindings
Richard Leitner (5):
Input: sx8654 - add reset-gpio support
Input: sx8654 - add sx8655 and sx8656 to compatibles
Input: sx8654 - add sx8650 support
Input: sx8654 - use common of_touchscreen functions
Input: sx8654 - convert #defined flags to BIT(x)
Rob Herring (1):
Input: i8042 - rework DT node name comparisons
Simon Shields (1):
Input: tm2-touchkey - add support for midas touchkey
Sven Van Asbroeck (2):
Input: qt2160 - remove redundant spinlock
Input: synaptics_i2c - remove redundant spinlock
Vincent Batts (1):
Input: elan_i2c - add id for touchpad found in Lenovo s21e-20
YueHaibing (2):
Input: mtk-pmic-keys - remove duplicated include from mtk-pmic-keys.c
Input: ti_am335x_tsc - remove set but not used variable 'tscadc_dev'
Diffstat:
--------
.../bindings/input/cypress,tm2-touchkey.txt | 9 +-
.../devicetree/bindings/input/ilitek,ili2xxx.txt | 25 ++
.../devicetree/bindings/input/msm-vibrator.txt | 36 +++
.../bindings/input/touchscreen/edt-ft5x06.txt | 13 +-
.../bindings/input/touchscreen/goodix.txt | 14 +-
.../bindings/input/touchscreen/sitronix-st1232.txt | 8 +-
.../bindings/input/touchscreen/sx8654.txt | 10 +-
drivers/input/joystick/db9.c | 2 +-
drivers/input/keyboard/gpio_keys.c | 10 +
drivers/input/keyboard/mcs_touchkey.c | 5 +-
drivers/input/keyboard/mtk-pmic-keys.c | 13 +-
drivers/input/keyboard/qt2160.c | 9 -
drivers/input/keyboard/tca6416-keypad.c | 4 +-
drivers/input/keyboard/tm2-touchkey.c | 136 ++++++---
drivers/input/misc/Kconfig | 10 +
drivers/input/misc/Makefile | 1 +
drivers/input/misc/ims-pcu.c | 27 +-
drivers/input/misc/msm-vibrator.c | 281 ++++++++++++++++++
drivers/input/misc/soc_button_array.c | 6 +-
drivers/input/mouse/elan_i2c_core.c | 1 +
drivers/input/mouse/synaptics_i2c.c | 22 +-
drivers/input/serio/i8042-sparcio.h | 21 +-
drivers/input/tablet/wacom_serial4.c | 2 +
drivers/input/touchscreen/Kconfig | 7 +-
drivers/input/touchscreen/ad7879.c | 11 +-
drivers/input/touchscreen/edt-ft5x06.c | 110 ++++++-
drivers/input/touchscreen/goodix.c | 6 +-
drivers/input/touchscreen/ili210x.c | 321 +++++++++++++--------
drivers/input/touchscreen/st1232.c | 154 ++++++----
drivers/input/touchscreen/stmfts.c | 30 +-
drivers/input/touchscreen/sx8654.c | 255 ++++++++++++++--
drivers/input/touchscreen/ti_am335x_tsc.c | 4 -
include/linux/input/ili210x.h | 11 -
33 files changed, 1207 insertions(+), 367 deletions(-)
create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt
create mode 100644 Documentation/devicetree/bindings/input/msm-vibrator.txt
create mode 100644 drivers/input/misc/msm-vibrator.c
delete mode 100644 include/linux/input/ili210x.h
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: fix oops in input_to_handler
From: Dmitry Torokhov @ 2019-03-09 23:46 UTC (permalink / raw)
To: Zhipeng Xie
Cc: rydberg, linux-input, linux-kernel, kernel.openeuler, euleros,
huawei.libin, yangyingliang
In-Reply-To: <1551413607-32036-1-git-send-email-xiezhipeng1@huawei.com>
Hi Zhipeng,
On Fri, Mar 01, 2019 at 12:13:27PM +0800, Zhipeng Xie wrote:
> we got the following boot crash:
>
> [ 36.086344] Internal error: Oops: 96000004 [#1] SMP
> [ 36.091371] CPU: 32 PID: 0 Comm: swapper/32 Tainted: G OE 4.19.25-vhulk1901.1.0.h111.aarch64 #1
> [ 36.101444] Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.58 10/24/2018
> [ 36.108860] pstate: 20000085 (nzCv daIf -PAN -UAO)
> [ 36.113727] pc : input_to_handler+0x2c/0x148
> [ 36.118058] lr : input_pass_values.part.2+0x148/0x168
> [ 36.123177] sp : ffff000100103ba0
> [ 36.126535] x29: ffff000100103ba0 x28: ffff801fb2ac5958
> [ 36.131924] x27: ffff000009799000 x26: 0000000000000001
> [ 36.137375] x25: 0000000000000000 x24: ffff801fb5b57c00
> [ 36.142822] x23: 000000020987f3d0 x22: ffff801faf427e00
> [ 36.148211] x21: 0000000000000003 x20: 0000000000000003
> [ 36.153599] x19: ffff801faf427e00 x18: 000000000000000e
> [ 36.158986] x17: 000000000000000e x16: 0000000000000007
> [ 36.164374] x15: 0000000000000001 x14: 0000000000000019
> [ 36.169762] x13: 0000000000000033 x12: 000000000000004c
> [ 36.175150] x11: 0000000000000068 x10: ffff000008dfa290
> [ 36.180538] x9 : 000000000000007d x8 : 0000000000000000
> [ 36.185925] x7 : 0000000000000053 x6 : 0000000000000000
> [ 36.191313] x5 : 0000000000000000 x4 : 0000000000000000
> [ 36.196700] x3 : 0000000000000010 x2 : 0000000000000003
> [ 36.202088] x1 : ffff801fb5b57c00 x0 : ffff000008a120a0
> [ 36.207477] Process swapper/32 (pid: 0, stack limit = 0x0000000032f86b58)
> [ 36.214361] Call trace:
> [ 36.216840] input_to_handler+0x2c/0x148
> [ 36.220816] input_pass_values.part.2+0x148/0x168
> [ 36.225582] input_handle_event+0x130/0x5b8
> [ 36.229823] i6.242013] hid_input_report+0x128/0x1b0
> [ 36.246076] hid_irq_in+0x240/0x298
> [ 36.249613] __usb_hcd_giveback_urb+0x9c/0x130
> [ 36.257460] usb_giveback_urb_bh+0xf4/0x198
> [ 36.265127] tasklet_action_common.isra.6+0x94/0x160
> [ 36.273458] tasklet_hi_action+0x2c/0x38
> [ 36.280597] __do_softirq+0x118/0x314
> [ 36.287494] irq_exit+0xa4/0xe8
> [ 36.293682] __handle_domain_irq+0x6c/0xc0
> [ 36.300783] gic_handle_irq+0x6c/0x170
> [ 36.307296] el1_irq+0xb8/0x140
> [ 36.313283] arch_cpu_idle+0x38/0x1c0
> [ 36.319776] default_idle_call+0x24/0x44
> [ 36.326527] do_idle+0x1ec/0x2d0
> [ 36.332503] cpu_startup_entry+0x28/0x30
> [ 36.339161] secondary_start_kernel+0x194/0x1d8
>
> We need to check the input_handler before referencing its members.
>
> Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
> ---
> drivers/input/input.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 3304aaa..b768d14 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -100,6 +100,9 @@ static unsigned int input_to_handler(struct input_handle *handle,
> struct input_value *end = vals;
> struct input_value *v;
>
> + if (!handler)
> + return 0;
No, is not a proper change. That means that someone registered an input
handle without setting handler, which is not allowed. Do you have any
custom input handlers in your system?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: raspberrypi-ts: select CONFIG_INPUT_POLLDEV
From: Dmitry Torokhov @ 2019-03-09 23:34 UTC (permalink / raw)
To: Nicolas Saenz Julienne; +Cc: Arnd Bergmann, Zhu Yi, linux-input, linux-kernel
In-Reply-To: <87a8108f573e04d5c2eaaaa23be0f3a58bd45eb1.camel@suse.de>
On Tue, Mar 05, 2019 at 11:39:42AM +0100, Nicolas Saenz Julienne wrote:
> On Mon, 2019-03-04 at 20:57 +0100, Arnd Bergmann wrote:
> > When CONFIG_INPUT_POLLDEV is disabled, we get a link error:
> >
> > drivers/input/touchscreen/raspberrypi-ts.o: In function `rpi_ts_probe':
> > raspberrypi-ts.c:(.text+0xec): undefined reference to
> > `devm_input_allocate_polled_device'
> > raspberrypi-ts.c:(.text+0xec): relocation truncated to fit: R_AARCH64_CALL26
> > against undefined symbol `devm_input_allocate_polled_device'
> > raspberrypi-ts.c:(.text+0x19c): undefined reference to
> > `input_register_polled_device'
> > raspberrypi-ts.c:(.text+0x19c): relocation truncated to fit: R_AARCH64_CALL26
> > against undefined symbol `input_register_polled_device'
> >
> > Select that symbol like we do from the other similar drivers.
> >
> > Fixes: 0b9f28fed3f7 ("Input: add official Raspberry Pi's touchscreen driver")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > drivers/input/touchscreen/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/input/touchscreen/Kconfig
> > b/drivers/input/touchscreen/Kconfig
> > index 7c597a49c265..7a4884ad198b 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -699,6 +699,7 @@ config TOUCHSCREEN_EDT_FT5X06
> > config TOUCHSCREEN_RASPBERRYPI_FW
> > tristate "Raspberry Pi's firmware base touch screen support"
> > depends on RASPBERRYPI_FIRMWARE || (RASPBERRYPI_FIRMWARE=n &&
> > COMPILE_TEST)
> > + select INPUT_POLLDEV
> > help
> > Say Y here if you have the official Raspberry Pi 7 inch screen on
> > your system.
>
> Thanks!
> Looks good to me.
>
> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: msm-vibrator: use correct gpio header
From: Dmitry Torokhov @ 2019-03-09 23:33 UTC (permalink / raw)
To: Linus Walleij
Cc: Arnd Bergmann, Brian Masney, Linux Input,
linux-kernel@vger.kernel.org
In-Reply-To: <CACRpkdaq9YzFSSXp7HSOf+RC2PGxv0N-m+iV99tn-0xTeEZr=Q@mail.gmail.com>
On Tue, Mar 05, 2019 at 08:49:01AM +0100, Linus Walleij wrote:
> On Mon, Mar 4, 2019 at 8:57 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> > When CONFIG_GPIOLIB is not set, we get a couple of build
> > errors during test building:
> >
> > drivers/input/misc/msm-vibrator.c: In function 'msm_vibrator_start':
> > drivers/input/misc/msm-vibrator.c:79:3: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
> > gpiod_set_value_cansleep(vibrator->enable_gpio, 1);
> > ^~~~~~~~~~~~~~~~~~~~~~~~
> > gpio_set_value_cansleep
> > drivers/input/misc/msm-vibrator.c: In function 'msm_vibrator_probe':
> > drivers/input/misc/msm-vibrator.c:176:26: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration]
> > vibrator->enable_gpio = devm_gpiod_get(&pdev->dev, "enable",
> > ^~~~~~~~~~~~~~
> > devm_gpio_free
> > drivers/input/misc/msm-vibrator.c:177:13: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
> > GPIOD_OUT_LOW);
> > ^~~~~~~~~~~~~
> > GPIOF_INIT_LOW
> > drivers/input/misc/msm-vibrator.c:177:13: note: each undeclared identifier is reported only once for each function it appears in
> >
> > This is easy to avoid when we use gpio/consumer.h as the documented interface.
> >
> > Fixes: 0f681d09e66e ("Input: add new vibrator driver for various MSM SOCs")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 1/2] Input: synaptics-rmi4 - clear irqs before set irqs
From: Aaron Ma @ 2019-03-09 8:37 UTC (permalink / raw)
To: Christopher Heiny, dmitry.torokhov@gmail.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Duggan, benjamin.tissoires@redhat.com
In-Reply-To: <17cd420ea32a9787c56ba25e36e7661541c2f65f.camel@synaptics.com>
Hi,
On 3/9/19 7:13 AM, Christopher Heiny wrote:
> I'm not sure this is a safe action, due to a race condition with the
> actual IRQ handler (rmi_process_interrupt_requests from rmi_driver.c).
> Remember that reading the IRQ status register clears all the IRQ bits.
> So you're faced with this possible scenario:
> - ATTN asserted, indicating new data in IRQ status register
> - rmi_driver_set_irq_bits called
> - rmi_driver_set_irq_bits reads IRQ status, clearing bits
> - rmi_process_interrupt_requests called
> - rmi_process_interrupt_request reads IRQ status, sees no
> bits set, nested IRQs are not handled
> This could lead to loss of data or inconsistent system state
> information. For example, a button up or down event may be lost, with
> consequent weird behavior by the user interface.
rmi_driver_set_irq_bits is only called to config and enable specific
functions of RMI.
Reading IRQ status before set irqs is supposed to clear spam data/irq
status.
spam data make probe/detect touchpad/trackpoint fail.
rmi_smb_resume -> rmi_driver_reset_handler -> fn-config ->
clear_irq_bits -> set_irq_bits -> enable_irq -> irq_handler ->
rmi_process_interrupt_requests
set_irq_bits will not be in interrupt context, it enables IRQ bits of RMI.
Regards,
Aaron
^ permalink raw reply
* [PATCH] input: pm8xxx-vibrator: fix a potential NULL pointer dereference
From: Kangjie Lu @ 2019-03-09 5:39 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, Dmitry Torokhov, linux-input, linux-kernel
In case of_device_get_match_data fails to find the matched data,
returns -ENODEV
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
drivers/input/misc/pm8xxx-vibrator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c
index 7dd1c1fbe42a..740e59c11808 100644
--- a/drivers/input/misc/pm8xxx-vibrator.c
+++ b/drivers/input/misc/pm8xxx-vibrator.c
@@ -196,6 +196,8 @@ static int pm8xxx_vib_probe(struct platform_device *pdev)
vib->vib_input_dev = input_dev;
regs = of_device_get_match_data(&pdev->dev);
+ if (unlikely(!regs))
+ return -ENODEV;
/* operate in manual mode */
error = regmap_read(vib->regmap, regs->drv_addr, &val);
--
2.17.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox