* Re: [PATCH 1/2] Input: omap-keypad: Fix keyboard debounce configuration
From: Dmitry Torokhov @ 2018-12-03 19:25 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-input, linux-kernel, linux-omap, Axel Haslam, Felipe Balbi,
Illia Smyrnov, Marcel Partap, Merlijn Wajer, Michael Scott, NeKit,
Pavel Machek, Sebastian Reichel
In-Reply-To: <20181203012933.6647-1-tony@atomide.com>
On Sun, Dec 02, 2018 at 05:29:32PM -0800, Tony Lindgren wrote:
> I noticed that the Android v3.0.8 kernel on droid4 is using different
> keypad values from the mainline kernel and does not have issues with
> keys occasionally being stuck until pressed again. Turns out there was
> an earlier patch posted to fix this as "Input: omap-keypad: errata i689:
> Correct debounce time", but it was never reposted to fix use macros
> for timing calculations.
>
> This updated version is using macros, and also fixes the use of the
> input clock rate to use 32768KiHz instead of 32000KiHz. And we want to
> use the known good Android kernel values of 3 and 6 instead of 2 and 6
> in the earlier patch.
>
> Cc: Axel Haslam <axelhaslam@ti.com>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Illia Smyrnov <illia.smyrnov@ti.com>
> Cc: Marcel Partap <mpartap@gmx.net>
> Cc: Merlijn Wajer <merlijn@wizzup.org>
> Cc: Michael Scott <hashcode0f@gmail.com>
> Cc: NeKit <nekit1000@gmail.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Sebastian Reichel <sre@kernel.org>
> Reported-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Applied, thank you.
> ---
> drivers/input/keyboard/omap4-keypad.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -60,8 +60,18 @@
>
> /* OMAP4 values */
> #define OMAP4_VAL_IRQDISABLE 0x0
> -#define OMAP4_VAL_DEBOUNCINGTIME 0x7
> -#define OMAP4_VAL_PVT 0x7
> +
> +/*
> + * Errata i689: If a key is released for a time shorter than debounce time,
> + * the keyboard will idle and never detect the key release. The workaround
> + * is to use at least a 12ms debounce time. See omap5432 TRM chapter
> + * "26.4.6.2 Keyboard Controller Timer" for more information.
> + */
> +#define OMAP4_KEYPAD_PTV_DIV_128 0x6
> +#define OMAP4_KEYPAD_DEBOUNCINGTIME_MS(dbms, ptv) \
> + ((((dbms) * 1000) / ((1 << ((ptv) + 1)) * (1000000 / 32768))) - 1)
> +#define OMAP4_VAL_DEBOUNCINGTIME_16MS \
> + OMAP4_KEYPAD_DEBOUNCINGTIME_MS(16, OMAP4_KEYPAD_PTV_DIV_128)
>
> enum {
> KBD_REVISION_OMAP4 = 0,
> @@ -181,9 +191,9 @@ static int omap4_keypad_open(struct input_dev *input)
>
> kbd_writel(keypad_data, OMAP4_KBD_CTRL,
> OMAP4_DEF_CTRL_NOSOFTMODE |
> - (OMAP4_VAL_PVT << OMAP4_DEF_CTRL_PTV_SHIFT));
> + (OMAP4_KEYPAD_PTV_DIV_128 << OMAP4_DEF_CTRL_PTV_SHIFT));
> kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
> - OMAP4_VAL_DEBOUNCINGTIME);
> + OMAP4_VAL_DEBOUNCINGTIME_16MS);
> /* clear pending interrupts */
> kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
> --
> 2.19.2
--
Dmitry
^ permalink raw reply
* Re: [PATCH 2/2] Input: omap-keypad: Fix idle configration to not block SoC idle states
From: Dmitry Torokhov @ 2018-12-03 19:23 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-input, linux-kernel, linux-omap, Axel Haslam, Illia Smyrnov,
Marcel Partap, Merlijn Wajer, Michael Scott, NeKit, Pavel Machek,
Sebastian Reichel
In-Reply-To: <20181203012933.6647-2-tony@atomide.com>
On Sun, Dec 02, 2018 at 05:29:33PM -0800, Tony Lindgren wrote:
> With PM enabled, I noticed that pressing a key on the droid4 keyboard will
> block deeper idle states for the SoC. Looks like we can fix this by
> managing the idle register to gether with the interrupt similar to what
> we already do for the GPIO controller.
>
> Note that we now must also disable OMAP4_DEF_IRQENABLE_LONGKEY as it
> should not be used together with debounce according to the TRM.
>
> Cc: Axel Haslam <axelhaslam@ti.com>
> Cc: Illia Smyrnov <illia.smyrnov@ti.com>
> Cc: Marcel Partap <mpartap@gmx.net>
> Cc: Merlijn Wajer <merlijn@wizzup.org>
> Cc: Michael Scott <hashcode0f@gmail.com>
> Cc: NeKit <nekit1000@gmail.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Sebastian Reichel <sre@kernel.org>
> Reported-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/input/keyboard/omap4-keypad.c | 28 ++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -53,11 +53,12 @@
> /* OMAP4 bit definitions */
> #define OMAP4_DEF_IRQENABLE_EVENTEN BIT(0)
> #define OMAP4_DEF_IRQENABLE_LONGKEY BIT(1)
> -#define OMAP4_DEF_WUP_EVENT_ENA BIT(0)
> -#define OMAP4_DEF_WUP_LONG_KEY_ENA BIT(1)
> #define OMAP4_DEF_CTRL_NOSOFTMODE BIT(1)
> #define OMAP4_DEF_CTRL_PTV_SHIFT 2
>
> +#define OMAP4_KBD_IRQ_MASK (OMAP4_DEF_IRQENABLE_LONGKEY | \
> + OMAP4_DEF_IRQENABLE_EVENTEN)
> +
> /* OMAP4 values */
> #define OMAP4_VAL_IRQDISABLE 0x0
>
> @@ -127,9 +128,11 @@ static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
> struct omap4_keypad *keypad_data = dev_id;
>
> if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
> - /* Disable interrupts */
> + /* Disable interrupts and wake-up events */
> kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> OMAP4_VAL_IRQDISABLE);
I wonder, do we need to turn off interrupts at keyboard controller
level, or we should simply use IRQF_ONESHOT?
> + kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, 0);
So we are saying that disabling wakeup for the time between hard
interrupt firing, and when interrupt thread runs, makes much difference?
It is surprising to me... How long does it take to schedule interrupt
thread?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 6/9] Input: goodix - Add vcc-supply regulator support
From: Dmitry Torokhov @ 2018-12-03 19:13 UTC (permalink / raw)
To: Jagan Teki
Cc: Maxime Ripard, Rob Herring, Chen-Yu Tsai,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20181203101547.16835-6-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
On Mon, Dec 03, 2018 at 03:45:44PM +0530, Jagan Teki wrote:
> vcc-supply property is need for some Goodix CTP controller like GT5663
> where 3.3V external pull-up regulator connected via controller VCC pin.
>
> So, enable the regulator for those it attached the vcc-supply.
>
> Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
> ---
> drivers/input/touchscreen/goodix.c | 39 ++++++++++++++++++++++++++----
> 1 file changed, 34 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index f2d9c2c41885..7adcf1491609 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -27,6 +27,7 @@
> #include <linux/delay.h>
> #include <linux/irq.h>
> #include <linux/interrupt.h>
> +#include <linux/regulator/consumer.h>
> #include <linux/slab.h>
> #include <linux/acpi.h>
> #include <linux/of.h>
> @@ -47,6 +48,7 @@ struct goodix_ts_data {
> struct touchscreen_properties prop;
> unsigned int max_touch_num;
> unsigned int int_trigger_type;
> + struct regulator *vcc;
> struct gpio_desc *gpiod_int;
> struct gpio_desc *gpiod_rst;
> u16 id;
> @@ -58,6 +60,7 @@ struct goodix_ts_data {
>
> #define GOODIX_GPIO_INT_NAME "irq"
> #define GOODIX_GPIO_RST_NAME "reset"
> +#define GOODIX_VCC_CTP_NAME "vcc"
>
> #define GOODIX_MAX_HEIGHT 4096
> #define GOODIX_MAX_WIDTH 4096
> @@ -525,12 +528,24 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
> {
> int error;
> struct device *dev;
> + struct regulator *regulator;
> struct gpio_desc *gpiod;
>
> if (!ts->client)
> return -EINVAL;
> dev = &ts->client->dev;
>
> + regulator = devm_regulator_get(dev, GOODIX_VCC_CTP_NAME);
> + if (IS_ERR(regulator)) {
> + error = PTR_ERR(regulator);
> + if (error != -EPROBE_DEFER)
> + dev_err(dev, "Failed to get vcc regulator: %d\n",
> + error);
> + return error;
> + }
> +
> + ts->vcc = regulator;
> +
> /* Get the interrupt GPIO pin number */
> gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME, GPIOD_IN);
> if (IS_ERR(gpiod)) {
> @@ -786,25 +801,34 @@ static int goodix_ts_probe(struct i2c_client *client,
> if (error)
> return error;
>
> + /* power the controller */
> + if (ts->vcc) {
ts->vcc is never NULL.
> + error = regulator_enable(ts->vcc);
> + if (error) {
> + dev_err(&client->dev, "Controller fail to enable vcc\n");
> + return error;
> + }
> + }
> +
> if (ts->gpiod_int && ts->gpiod_rst) {
> /* reset the controller */
> error = goodix_reset(ts);
> if (error) {
> dev_err(&client->dev, "Controller reset failed.\n");
> - return error;
> + goto error;
> }
> }
>
> error = goodix_i2c_test(client);
> if (error) {
> dev_err(&client->dev, "I2C communication failure: %d\n", error);
> - return error;
> + goto error;
> }
>
> error = goodix_read_version(ts);
> if (error) {
> dev_err(&client->dev, "Read version failed.\n");
> - return error;
> + goto error;
> }
>
> ts->chip = goodix_get_chip_data(ts->id);
> @@ -823,17 +847,22 @@ static int goodix_ts_probe(struct i2c_client *client,
> dev_err(&client->dev,
> "Failed to invoke firmware loader: %d\n",
> error);
> - return error;
> + goto error;
> }
>
> return 0;
> } else {
> error = goodix_configure_dev(ts);
> if (error)
> - return error;
> + goto error;
> }
>
> return 0;
> +
> +error:
> + if (ts->vcc)
> + regulator_disable(ts->vcc);
Same here.
> + return error;
> }
>
> static int goodix_ts_remove(struct i2c_client *client)
You need to disable regulator on removal as well.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 5/9] dt-bindings: input: touchscreen: goodix: Document vcc-supply property
From: Chen-Yu Tsai @ 2018-12-03 10:41 UTC (permalink / raw)
To: Jagan Teki
Cc: Maxime Ripard, Rob Herring, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA, devicetree, linux-arm-kernel,
linux-kernel, Lee Jones, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20181203101547.16835-5-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
On Mon, Dec 3, 2018 at 6:16 PM Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org> wrote:
>
> vcc-supply property is need for some Goodix CTP controller like GT5663
> where 3.3V external pull-up regulator connected via controller VCC pin.
"External pull-up regulator" sounds fishy. Chips have power supply
pins, either combined, or separate rails for analog, digital, and I/O.
For Goodix chips these are AVDD28, AVDD22, DVDD12, amd VDDIO. The name
and description you provide match none of these.
If a regulator is needed for pull-up resistors on the I2C bus, this
should be referenced in either the I2C bus master node, or if the I2C
bus goes through a pin controller, in the pin controller node.
Putting the reference in the slave device node is wrong, since it
doesn't actually use it. It becomes even clearer when you have multiple
slaves on the same bus, and you reference the same regulator in all
of them.
Or, as a last resort, you could mark it as always-on with a TODO note.
ChenYu
> So, document the same as optional property.
>
> Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
> ---
> Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> index f7e95c52f3c7..604766e347ce 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
> @@ -23,6 +23,7 @@ Optional properties:
> - touchscreen-inverted-y : Y axis is inverted (boolean)
> - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
> (swapping is done after inverting the axis)
> + - vcc-supply : 3v3 regulator phandle for controller VCC pin
>
> Example:
>
> --
> 2.18.0.321.gffc6fa0e3
>
^ permalink raw reply
* Re: [PATCH 1/9] dt-bindings: gpio-axp209: Add AXP803 GPIOs compatible (w/ AXP813 fallback)
From: Chen-Yu Tsai @ 2018-12-03 10:32 UTC (permalink / raw)
To: Jagan Teki
Cc: Maxime Ripard, Rob Herring, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA, devicetree, linux-arm-kernel,
linux-kernel, Lee Jones, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
On Mon, Dec 3, 2018 at 6:16 PM Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org> wrote:
>
> AXP803 PMIC has two GPIO's which is similar to the one in
> AXP813 PMIC.
>
> Add a compatible string for it with AXP813 fallback compatible string, in
> this case the AXP813 driver can be used.
>
> Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
First of all, please write a cover letter.
Second, the GPIO stuff is covered already by Oskari Lemmela's
"AXP8x3 AC and battery power supply support" series. The device
tree patches from that series were merged last Friday. The driver
patches are pending. That already covers patches 1~3 and half of
patch 4 of your series.
ChenYu
^ permalink raw reply
* [PATCH 9/9] arm64: dts: allwinner: a64-amarula-relic: Add GT5663 CTP node
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Add Goodix GT5663 capacitive touch controller node on
Amarula A64-Relic board.
The CTP connected to board with,
- SDA, SCK from i2c1
- GPIO-LD0 as vcc supply
- PH4 gpio as interrupt pin
- PH8 gpio as reset pin
- X and Y axis are inverted
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
.../allwinner/sun50i-a64-amarula-relic.dts | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
index 9ac6d773188b..913fcdff828e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
@@ -88,6 +88,28 @@
status = "okay";
};
+&i2c1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+ status = "okay";
+
+ touchscreen@5d {
+ compatible = "goodix,gt5663";
+ reg = <0x5d>;
+ vcc-supply = <®_ldo_io0>; /* VCC-CTP: GPIO0-LDO */
+ interrupt-parent = <&pio>;
+ interrupts = <7 4 IRQ_TYPE_EDGE_FALLING>;
+ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* CTP-INT: PH4 */
+ reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* CTP-RST: PH8 */
+ touchscreen-inverted-x;
+ touchscreen-inverted-y;
+ };
+};
+
+&i2c1_pins {
+ bias-pull-up;
+};
+
&mmc1 {
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
@@ -251,6 +273,13 @@
regulator-name = "vdd-cpus";
};
+®_ldo_io0 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-ctp";
+ status = "okay";
+};
+
®_rtc_ldo {
regulator-name = "vcc-rtc";
};
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 8/9] Input: goodix - Add GT5663 CTP support
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
GT5663 is capacitive touch controller with customized smart wakeup gestures,
the existing goodix driver will work by phandle vcc-supply regulator.
So, add compatible for the same.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
drivers/input/touchscreen/goodix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 7adcf1491609..0c09512bcdea 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -971,6 +971,7 @@ MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
#ifdef CONFIG_OF
static const struct of_device_id goodix_of_match[] = {
{ .compatible = "goodix,gt1151" },
+ { .compatible = "goodix,gt5663" },
{ .compatible = "goodix,gt911" },
{ .compatible = "goodix,gt9110" },
{ .compatible = "goodix,gt912" },
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 7/9] dt-bindings: input: touchscreen: goodix: Add GT5663 compatible
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
GT5663 is capacitive touch controller with customized smart wakeup gestures,
the existing goodix driver will work by phandle vcc-supply regulator.
So, document compatible and example node for the same.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
.../bindings/input/touchscreen/goodix.txt | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index 604766e347ce..1898d3dde8e1 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -3,6 +3,7 @@ Device tree bindings for Goodix GT9xx series touchscreen controller
Required properties:
- compatible : Should be "goodix,gt1151"
+ or "goodix,gt5663"
or "goodix,gt911"
or "goodix,gt9110"
or "goodix,gt912"
@@ -42,3 +43,15 @@ Example:
/* ... */
};
+
+ touchscreen@5d {
+ compatible = "goodix,gt5663";
+ reg = <0x5d>;
+ vcc-supply = <®_ldo_io0>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 4 IRQ_TYPE_EDGE_FALLING>;
+ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* CTP-INT: PH4 */
+ reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* CTP-RST: PH8 */
+ touchscreen-inverted-x;
+ touchscreen-inverted-y;
+ };
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 6/9] Input: goodix - Add vcc-supply regulator support
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
vcc-supply property is need for some Goodix CTP controller like GT5663
where 3.3V external pull-up regulator connected via controller VCC pin.
So, enable the regulator for those it attached the vcc-supply.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
drivers/input/touchscreen/goodix.c | 39 ++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index f2d9c2c41885..7adcf1491609 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -27,6 +27,7 @@
#include <linux/delay.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
+#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/of.h>
@@ -47,6 +48,7 @@ struct goodix_ts_data {
struct touchscreen_properties prop;
unsigned int max_touch_num;
unsigned int int_trigger_type;
+ struct regulator *vcc;
struct gpio_desc *gpiod_int;
struct gpio_desc *gpiod_rst;
u16 id;
@@ -58,6 +60,7 @@ struct goodix_ts_data {
#define GOODIX_GPIO_INT_NAME "irq"
#define GOODIX_GPIO_RST_NAME "reset"
+#define GOODIX_VCC_CTP_NAME "vcc"
#define GOODIX_MAX_HEIGHT 4096
#define GOODIX_MAX_WIDTH 4096
@@ -525,12 +528,24 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
{
int error;
struct device *dev;
+ struct regulator *regulator;
struct gpio_desc *gpiod;
if (!ts->client)
return -EINVAL;
dev = &ts->client->dev;
+ regulator = devm_regulator_get(dev, GOODIX_VCC_CTP_NAME);
+ if (IS_ERR(regulator)) {
+ error = PTR_ERR(regulator);
+ if (error != -EPROBE_DEFER)
+ dev_err(dev, "Failed to get vcc regulator: %d\n",
+ error);
+ return error;
+ }
+
+ ts->vcc = regulator;
+
/* Get the interrupt GPIO pin number */
gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME, GPIOD_IN);
if (IS_ERR(gpiod)) {
@@ -786,25 +801,34 @@ static int goodix_ts_probe(struct i2c_client *client,
if (error)
return error;
+ /* power the controller */
+ if (ts->vcc) {
+ error = regulator_enable(ts->vcc);
+ if (error) {
+ dev_err(&client->dev, "Controller fail to enable vcc\n");
+ return error;
+ }
+ }
+
if (ts->gpiod_int && ts->gpiod_rst) {
/* reset the controller */
error = goodix_reset(ts);
if (error) {
dev_err(&client->dev, "Controller reset failed.\n");
- return error;
+ goto error;
}
}
error = goodix_i2c_test(client);
if (error) {
dev_err(&client->dev, "I2C communication failure: %d\n", error);
- return error;
+ goto error;
}
error = goodix_read_version(ts);
if (error) {
dev_err(&client->dev, "Read version failed.\n");
- return error;
+ goto error;
}
ts->chip = goodix_get_chip_data(ts->id);
@@ -823,17 +847,22 @@ static int goodix_ts_probe(struct i2c_client *client,
dev_err(&client->dev,
"Failed to invoke firmware loader: %d\n",
error);
- return error;
+ goto error;
}
return 0;
} else {
error = goodix_configure_dev(ts);
if (error)
- return error;
+ goto error;
}
return 0;
+
+error:
+ if (ts->vcc)
+ regulator_disable(ts->vcc);
+ return error;
}
static int goodix_ts_remove(struct i2c_client *client)
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 5/9] dt-bindings: input: touchscreen: goodix: Document vcc-supply property
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
vcc-supply property is need for some Goodix CTP controller like GT5663
where 3.3V external pull-up regulator connected via controller VCC pin.
So, document the same as optional property.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
index f7e95c52f3c7..604766e347ce 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
@@ -23,6 +23,7 @@ Optional properties:
- touchscreen-inverted-y : Y axis is inverted (boolean)
- touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
(swapping is done after inverting the axis)
+ - vcc-supply : 3v3 regulator phandle for controller VCC pin
Example:
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 4/9] arm64: allwinner: dts: axp803: Set GPIO0/1 pinmux for LD0s
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
GPIO0, GPIO1 can be used as LDO like ldo_io0, ldo_io1 in
AXP803.
So, attach the LDO GPIO pins along with pinctrl properties.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
arch/arm64/boot/dts/allwinner/axp803.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
index c6b95980d476..b0d6b3c3cf38 100644
--- a/arch/arm64/boot/dts/allwinner/axp803.dtsi
+++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
@@ -54,6 +54,16 @@
"x-powers,axp813-gpio";
gpio-controller;
#gpio-cells = <2>;
+
+ gpio0_ldo: gpio0-ldo {
+ pins = "GPIO0";
+ function = "ldo";
+ };
+
+ gpio1_ldo: gpio1-ldo {
+ pins = "GPIO1";
+ function = "ldo";
+ };
};
regulators {
@@ -137,12 +147,16 @@
};
reg_ldo_io0: ldo-io0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio0_ldo>;
regulator-name = "ldo-io0";
status = "disabled";
};
reg_ldo_io1: ldo-io1 {
regulator-name = "ldo-io1";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio1_ldo>;
status = "disabled";
};
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 3/9] arm64: allwinner: dts: axp803: Add GPIO DT node
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Add GPIO/pinctrl node for AXP803 PMIC.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
arch/arm64/boot/dts/allwinner/axp803.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
index e5eae8bafc42..c6b95980d476 100644
--- a/arch/arm64/boot/dts/allwinner/axp803.dtsi
+++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
@@ -49,6 +49,13 @@
interrupt-controller;
#interrupt-cells = <1>;
+ axp_gpio: axp-gpio {
+ compatible = "x-powers,axp803-gpio",
+ "x-powers,axp813-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
regulators {
/* Default work frequency for buck regulators */
x-powers,dcdc-freq = <3000>;
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 2/9] mfd: axp20x: Add GPIO/pinctrl support for AXP803
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
Cc: Jagan Teki
In-Reply-To: <20181203101547.16835-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Add GPIO/pinctrl support for AXP803.
This will reuse the similar compatible to that of AXP813,
since both PMIC GPIO's are same.
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
drivers/mfd/axp20x.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 0be511dd93d0..bc705ba49c3f 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -731,8 +731,12 @@ static const struct mfd_cell axp803_cells[] = {
.name = "axp221-pek",
.num_resources = ARRAY_SIZE(axp803_pek_resources),
.resources = axp803_pek_resources,
+ }, {
+ .name = "axp20x-regulator",
+ }, {
+ .name = "axp20x-gpio",
+ .of_compatible = "x-powers,axp813-gpio",
},
- { .name = "axp20x-regulator" },
};
static const struct mfd_cell axp806_self_working_cells[] = {
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* [PATCH 1/9] dt-bindings: gpio-axp209: Add AXP803 GPIOs compatible (w/ AXP813 fallback)
From: Jagan Teki @ 2018-12-03 10:15 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Chen-Yu Tsai, Dmitry Torokhov,
linux-input, devicetree, linux-arm-kernel, linux-kernel,
Lee Jones, linux-sunxi
Cc: Jagan Teki
AXP803 PMIC has two GPIO's which is similar to the one in
AXP813 PMIC.
Add a compatible string for it with AXP813 fallback compatible string, in
this case the AXP813 driver can be used.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Documentation/devicetree/bindings/gpio/gpio-axp209.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-axp209.txt b/Documentation/devicetree/bindings/gpio/gpio-axp209.txt
index fc42b2caa06d..c8c5d20856c9 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-axp209.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-axp209.txt
@@ -12,6 +12,7 @@ Required properties:
- compatible: Should be one of:
- "x-powers,axp209-gpio"
- "x-powers,axp813-gpio"
+ - "x-powers,axp803-gpio", "x-powers,axp813-gpio"
- #gpio-cells: Should be two. The first cell is the pin number and the
second is the GPIO flags.
- gpio-controller: Marks the device node as a GPIO controller.
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related
* Re: [PATCH v2 0/7] Input: sx8654 - reset-gpio, sx865[056] support, etc.
From: Richard Leitner @ 2018-12-03 8:25 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: linux-input, devicetree, linux-kernel, Richard Leitner
In-Reply-To: <20181017125116.20077-1-richard.leitner@skidata.com>
Hi,
another friendly reminder for this patchset...
Any comments/objections?
regards;Richard.L
On 17.10.18 14:51, Richard Leitner wrote:
> Add reset-gpio, sx8654[056] and common of_touchscreen functions support
> for the sx8654 driver.
>
> Changes v2:
> - use devm_gpiod_get_optional in probe instead of in #ifdef CONFIG_OF
> - convert flags to BIT() in a separate patch
> - replace hrtimer with "regular" timer
> - use of_device_get_match_data instead of of_match_device
> - add driver data to i2c_device_id table for non-DT fallback
> - fix sequence of common touchscreen initialization
> - div. minor stlye changes
>
> Richard Leitner (8):
> dt-bindings: input: touchscreen: sx8654: add reset-gpio property
> Input: sx8654 - add reset-gpio support
> dt-bindings: input: touchscreen: sx8654: add compatible models
> Input: sx8654 - add sx8655 and sx8656 to compatibles
> dt-bindings: input: touchscreen: sx8654: add sx8650 to comatibles
> Input: sx8654 - add sx8650 support
> Input: sx8654 - use common of_touchscreen functions
> Input: sx8654 - convert #defined flags to BIT(x)
>
> .../bindings/input/touchscreen/sx8654.txt | 10 +-
> drivers/input/touchscreen/sx8654.c | 245 ++++++++++++++++++---
> 2 files changed, 229 insertions(+), 26 deletions(-)
>
^ permalink raw reply
* Re: [PATCH v7 0/7] Introduce STPMIC1 PMIC Driver
From: Lee Jones @ 2018-12-03 7:11 UTC (permalink / raw)
To: Pascal PAILLET-LME
Cc: dmitry.torokhov@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, lgirdwood@gmail.com, broonie@kernel.org,
wim@linux-watchdog.org, linux@roeck-us.net,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
benjamin.gaignard@linaro.org, eballetbo@gmail.com,
axel.lin@ingics.com
In-Reply-To: <1543571742-17995-1-git-send-email-p.paillet@st.com>
On Fri, 30 Nov 2018, Pascal PAILLET-LME wrote:
> The goal of this patch-set is to propose a driver for the STPMIC1 PMIC from
> STMicroelectronics.
> The STPMIC1 regulators supply power to an application processor as well as
> to external system peripherals such as DDR, Flash memories and system
> devices. It also features onkey button input and an hardware watchdog.
> The STPMIC1 is controlled via I2C.
>
> Main driver is drivers/mfd/stpmic1 that handle I2C regmap configuration and
> irqchip. stpmic1_regulator, stpmic1_onkey and stpmic1_wdt need stpmic1 mfd
> as parent.
>
> STPMIC1 MFD and regulator drivers maybe mandatory at boot time.
>
> Pascal Paillet (7):
> changes in v7:
> * rebase on regul/for-next
>
> dt-bindings: mfd: document stpmic1
> mfd: stpmic1: add stpmic1 driver
> dt-bindings: input: document stpmic1 pmic onkey
> input: stpmic1: add stpmic1 onkey driver
> dt-bindings: watchdog: document stpmic1 pmic watchdog
> watchdog: stpmic1: add stpmic1 watchdog driver
> regulator: stpmic1: fix regulator_lock usage
>
> .../devicetree/bindings/input/st,stpmic1-onkey.txt | 28 +++
> .../devicetree/bindings/mfd/st,stpmic1.txt | 61 ++++++
> .../bindings/watchdog/st,stpmic1-wdt.txt | 11 ++
> drivers/input/misc/Kconfig | 11 ++
> drivers/input/misc/Makefile | 2 +
> drivers/input/misc/stpmic1_onkey.c | 198 +++++++++++++++++++
> drivers/mfd/Kconfig | 16 ++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/stpmic1.c | 213 +++++++++++++++++++++
> drivers/regulator/stpmic1_regulator.c | 2 +-
Is it just Mark you're waiting on now?
> drivers/watchdog/Kconfig | 12 ++
> drivers/watchdog/Makefile | 1 +
> drivers/watchdog/stpmic1_wdt.c | 139 ++++++++++++++
> include/dt-bindings/mfd/st,stpmic1.h | 50 +++++
> include/linux/mfd/stpmic1.h | 212 ++++++++++++++++++++
> 15 files changed, 956 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
> create mode 100644 Documentation/devicetree/bindings/mfd/st,stpmic1.txt
> create mode 100644 Documentation/devicetree/bindings/watchdog/st,stpmic1-wdt.txt
> create mode 100644 drivers/input/misc/stpmic1_onkey.c
> create mode 100644 drivers/mfd/stpmic1.c
> create mode 100644 drivers/watchdog/stpmic1_wdt.c
> create mode 100644 include/dt-bindings/mfd/st,stpmic1.h
> create mode 100644 include/linux/mfd/stpmic1.h
>
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* [PATCH 2/2] HID: input: support Microsoft wireless radio control hotkey
From: Chris Chiu @ 2018-12-03 6:46 UTC (permalink / raw)
To: jikos, benjamin.tissoires, rydberg; +Cc: linux-input, linux-kernel, linux
In-Reply-To: <20181203064621.69876-1-chiu@endlessm.com>
The ASUS laptops start to support the airplane mode radio management
to replace the original mechanism of airplane mode toggle hotkey.
On the ASUS P5440FF, it presents as a HID device connecting via
I2C, named i2c-AMPD0001. When pressing it, the Embedded Controller
send hid report via I2C and switch the airplane mode indicator LED
based on the status.
However, it's not working because it fails to be identified as a
hidinput device. It fails in hidinput_connect() due to the macro
IS_INPUT_APPLICATION doesn't have HID_GD_WIRELESS_RADIO_CTLS as
a legit application code.
It's easy to add the HID I2C vendor and product id to the quirk
list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it
makes more sense to support it as a generic input application.
Signed-off-by: Chris Chiu <chiu@endlessm.com>
---
include/linux/hid.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index ce5f996c8d3d..42079116fb61 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -840,7 +840,8 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
#define IS_INPUT_APPLICATION(a) \
(((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
|| ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
- || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL))
+ || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \
+ || (a == HID_GD_WIRELESS_RADIO_CTLS))
/* HID core API */
--
2.19.1
^ permalink raw reply related
* [PATCH 1/2] HID: use macros in IS_INPUT_APPLICATION
From: Chris Chiu @ 2018-12-03 6:46 UTC (permalink / raw)
To: jikos, benjamin.tissoires, rydberg; +Cc: linux-input, linux-kernel, linux
Add missing definition for HID_DG_WHITEBOARD then replace the hid
usage hex with macros for better readibility.
Signed-off-by: Chris Chiu <chiu@endlessm.com>
---
include/linux/hid.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index a355d61940f2..ce5f996c8d3d 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -238,6 +238,7 @@ struct hid_item {
#define HID_DG_LIGHTPEN 0x000d0003
#define HID_DG_TOUCHSCREEN 0x000d0004
#define HID_DG_TOUCHPAD 0x000d0005
+#define HID_DG_WHITEBOARD 0x000d0006
#define HID_DG_STYLUS 0x000d0020
#define HID_DG_PUCK 0x000d0021
#define HID_DG_FINGER 0x000d0022
@@ -836,7 +837,10 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
/* We ignore a few input applications that are not widely used */
-#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
+#define IS_INPUT_APPLICATION(a) \
+ (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
+ || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
+ || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL))
/* HID core API */
--
2.19.1
^ permalink raw reply related
* [PATCH 2/2] Input: omap-keypad: Fix idle configration to not block SoC idle states
From: Tony Lindgren @ 2018-12-03 1:29 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, linux-omap, Axel Haslam, Illia Smyrnov,
Marcel Partap, Merlijn Wajer, Michael Scott, NeKit, Pavel Machek,
Sebastian Reichel
In-Reply-To: <20181203012933.6647-1-tony@atomide.com>
With PM enabled, I noticed that pressing a key on the droid4 keyboard will
block deeper idle states for the SoC. Looks like we can fix this by
managing the idle register to gether with the interrupt similar to what
we already do for the GPIO controller.
Note that we now must also disable OMAP4_DEF_IRQENABLE_LONGKEY as it
should not be used together with debounce according to the TRM.
Cc: Axel Haslam <axelhaslam@ti.com>
Cc: Illia Smyrnov <illia.smyrnov@ti.com>
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Michael Scott <hashcode0f@gmail.com>
Cc: NeKit <nekit1000@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/input/keyboard/omap4-keypad.c | 28 ++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -53,11 +53,12 @@
/* OMAP4 bit definitions */
#define OMAP4_DEF_IRQENABLE_EVENTEN BIT(0)
#define OMAP4_DEF_IRQENABLE_LONGKEY BIT(1)
-#define OMAP4_DEF_WUP_EVENT_ENA BIT(0)
-#define OMAP4_DEF_WUP_LONG_KEY_ENA BIT(1)
#define OMAP4_DEF_CTRL_NOSOFTMODE BIT(1)
#define OMAP4_DEF_CTRL_PTV_SHIFT 2
+#define OMAP4_KBD_IRQ_MASK (OMAP4_DEF_IRQENABLE_LONGKEY | \
+ OMAP4_DEF_IRQENABLE_EVENTEN)
+
/* OMAP4 values */
#define OMAP4_VAL_IRQDISABLE 0x0
@@ -127,9 +128,11 @@ static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
struct omap4_keypad *keypad_data = dev_id;
if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
- /* Disable interrupts */
+ /* Disable interrupts and wake-up events */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
OMAP4_VAL_IRQDISABLE);
+ kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, 0);
+
return IRQ_WAKE_THREAD;
}
@@ -173,10 +176,9 @@ static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
- /* enable interrupts */
- kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
- OMAP4_DEF_IRQENABLE_EVENTEN |
- OMAP4_DEF_IRQENABLE_LONGKEY);
+ /* enable interrupts and wake-up events */
+ kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE, OMAP4_KBD_IRQ_MASK);
+ kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, OMAP4_KBD_IRQ_MASK);
return IRQ_HANDLED;
}
@@ -197,11 +199,10 @@ static int omap4_keypad_open(struct input_dev *input)
/* clear pending interrupts */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
- kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
- OMAP4_DEF_IRQENABLE_EVENTEN |
- OMAP4_DEF_IRQENABLE_LONGKEY);
- kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
- OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
+
+ /* enable interrupts and wake-up events */
+ kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE, OMAP4_KBD_IRQ_MASK);
+ kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, OMAP4_KBD_IRQ_MASK);
enable_irq(keypad_data->irq);
@@ -214,9 +215,10 @@ static void omap4_keypad_close(struct input_dev *input)
disable_irq(keypad_data->irq);
- /* Disable interrupts */
+ /* Disable interrupts and wake-up events */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
OMAP4_VAL_IRQDISABLE);
+ kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, 0);
/* clear pending interrupts */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
--
2.19.2
^ permalink raw reply
* [PATCH 1/2] Input: omap-keypad: Fix keyboard debounce configuration
From: Tony Lindgren @ 2018-12-03 1:29 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, linux-omap, Axel Haslam, Felipe Balbi,
Illia Smyrnov, Marcel Partap, Merlijn Wajer, Michael Scott, NeKit,
Pavel Machek, Sebastian Reichel
I noticed that the Android v3.0.8 kernel on droid4 is using different
keypad values from the mainline kernel and does not have issues with
keys occasionally being stuck until pressed again. Turns out there was
an earlier patch posted to fix this as "Input: omap-keypad: errata i689:
Correct debounce time", but it was never reposted to fix use macros
for timing calculations.
This updated version is using macros, and also fixes the use of the
input clock rate to use 32768KiHz instead of 32000KiHz. And we want to
use the known good Android kernel values of 3 and 6 instead of 2 and 6
in the earlier patch.
Cc: Axel Haslam <axelhaslam@ti.com>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Illia Smyrnov <illia.smyrnov@ti.com>
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Michael Scott <hashcode0f@gmail.com>
Cc: NeKit <nekit1000@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/input/keyboard/omap4-keypad.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -60,8 +60,18 @@
/* OMAP4 values */
#define OMAP4_VAL_IRQDISABLE 0x0
-#define OMAP4_VAL_DEBOUNCINGTIME 0x7
-#define OMAP4_VAL_PVT 0x7
+
+/*
+ * Errata i689: If a key is released for a time shorter than debounce time,
+ * the keyboard will idle and never detect the key release. The workaround
+ * is to use at least a 12ms debounce time. See omap5432 TRM chapter
+ * "26.4.6.2 Keyboard Controller Timer" for more information.
+ */
+#define OMAP4_KEYPAD_PTV_DIV_128 0x6
+#define OMAP4_KEYPAD_DEBOUNCINGTIME_MS(dbms, ptv) \
+ ((((dbms) * 1000) / ((1 << ((ptv) + 1)) * (1000000 / 32768))) - 1)
+#define OMAP4_VAL_DEBOUNCINGTIME_16MS \
+ OMAP4_KEYPAD_DEBOUNCINGTIME_MS(16, OMAP4_KEYPAD_PTV_DIV_128)
enum {
KBD_REVISION_OMAP4 = 0,
@@ -181,9 +191,9 @@ static int omap4_keypad_open(struct input_dev *input)
kbd_writel(keypad_data, OMAP4_KBD_CTRL,
OMAP4_DEF_CTRL_NOSOFTMODE |
- (OMAP4_VAL_PVT << OMAP4_DEF_CTRL_PTV_SHIFT));
+ (OMAP4_KEYPAD_PTV_DIV_128 << OMAP4_DEF_CTRL_PTV_SHIFT));
kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
- OMAP4_VAL_DEBOUNCINGTIME);
+ OMAP4_VAL_DEBOUNCINGTIME_16MS);
/* clear pending interrupts */
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
--
2.19.2
^ permalink raw reply
* Re: [regression, bisected] Keyboard not responding after resuming from suspend/hibernate
From: Pavel Machek @ 2018-12-02 22:28 UTC (permalink / raw)
To: Numan Demirdöğen
Cc: jason.low2, Waiman.Long, paulmck, tglx, dmitry.torokhov, peterz,
mingo, linux-kernel, linux-input
In-Reply-To: <20181130154455.21578c4d@korsan.localdomain>
[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]
On Fri 2018-11-30 15:44:55, Numan Demirdöğen wrote:
> Sun, 28 Oct 2018 22:06:54 +0300 tarihinde
> Numan Demirdöğen <if.gnu.linux@gmail.com> yazdı:
>
> >Thu, 25 Oct 2018 09:49:03 +0200 tarihinde
> >Pavel Machek <pavel@ucw.cz> yazdı:
> >
> >> Hi!
> >>
> >> Here's problem bisected down to:
> >>
> >> commit 9d659ae14b545c4296e812c70493bfdc999b5c1c
> >> Author: Peter Zijlstra <peterz@infradead.org>
> >> Date: Tue Aug 23 14:40:16 2016 +0200
> >>
> >> locking/mutex: Add lock handoff to avoid starvation
> >>
> >> Implement lock handoff to avoid lock starvation.
> >>
> >> Numan, I assume revert of that patch on the 4.18 kernel still makes
> >> it work?
> >>
> >
> >Unfortunately, I could not revert
> >9d659ae14b545c4296e812c70493bfdc999b5c1c on kernels from 4.18.16 to
> >4.10-rc1 because there were too much conflicts, which I could not solve
> >as an "average Joe". I tried a3ea3d9b865c2a8f7fe455c7fa26db4b6fd066e3
> >which is parent of 9d659ae14b545c4296e812c70493bfdc999b5c1c and
> >succeeded to compile kernel.
> >
> >git checkout a3ea3d9b865c2a8f7fe455c7fa26db4b6fd066e3
> >
> >Then, I compiled kernel and rebooted with it. I tried a couples of
> >times suspending and resuming, all of the time keyboard worked as
> >expected.
> >
>
> With this one line patch from Takashi Iwai, keyboard is working as
> expected after resuming from suspend/hibernate.
>
> --- a/kernel/locking/mutex.c
> +++ b/kernel/locking/mutex.c
> @@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
> * Bit2 indicates handoff has been done and we're waiting for pickup.
> */
> #define MUTEX_FLAG_WAITERS 0x01
> -#define MUTEX_FLAG_HANDOFF 0x02
> +#define MUTEX_FLAG_HANDOFF 0x00
> #define MUTEX_FLAG_PICKUP 0x04
>
> #define MUTEX_FLAGS 0x07
>
>
> Thanks in advance and regards,
Ok. So it is a regression, and you can ask Linus to apply this
.. but... that's kind of heavy solution. Peter, do you have any other
ideas?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply
* [PATCH] HID: asus: Add support for the ASUS T101HA keyboard dock
From: Aleix Roca Nonell @ 2018-12-01 19:01 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel
The ASUS T101HA keyboard dock generates HID events using the ASUS vendor
specific UsagePage 0xff31. In consequence, some multimedia keys such as
brightness up and down are not working with hid-generic.
This commit adds the T101HA dock into the supported device list of the
hid-asus driver. It also prevents the dock's integrated touchpad to be
bound with hid-asus given that it is already working fine with
hid-multitouch.
Signed-off-by: Aleix Roca Nonell <kernelrocks@gmail.com>
---
This is my very first kernel patch done in my free time (be aware of the
newbie!!) so please, let me know if I can improve anything and I will
happily do it :)
drivers/hid/hid-asus.c | 12 ++++++++++++
drivers/hid/hid-ids.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index ab8bd40a77ed..d8b55dca97c6 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -42,6 +42,7 @@ MODULE_AUTHOR("Frederik Wenigwieser <frederik.wenigwieser@gmail.com>");
MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define T100_TPAD_INTF 2
+#define T101HA_TPAD_INTF 2
#define T100CHI_MOUSE_REPORT_ID 0x06
#define FEATURE_REPORT_ID 0x0d
@@ -70,6 +71,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define QUIRK_T100_KEYBOARD BIT(6)
#define QUIRK_T100CHI BIT(7)
#define QUIRK_G752_KEYBOARD BIT(8)
+#define QUIRK_T101HA_DOCK BIT(9)
#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
QUIRK_NO_INIT_REPORTS | \
@@ -649,6 +651,14 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
int ret;
struct asus_drvdata *drvdata;
+ if (id->driver_data & QUIRK_T101HA_DOCK) {
+ struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
+
+ /* use hid-multitouch for T101HA touchpad */
+ if (intf->altsetting->desc.bInterfaceNumber == T101HA_TPAD_INTF)
+ return -ENODEV;
+ }
+
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (drvdata == NULL) {
hid_err(hdev, "Can't alloc Asus descriptor\n");
@@ -830,6 +840,8 @@ static const struct hid_device_id asus_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
USB_DEVICE_ID_ASUSTEK_T100TAF_KEYBOARD),
QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
+ USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD), QUIRK_T101HA_DOCK },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_ASUS_AK1D) },
{ HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_ASUS_MD_5110) },
{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_ASUS_MD_5112) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 4206428c0ba2..f1eee2778b70 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -184,6 +184,7 @@
#define USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD 0x17e0
#define USB_DEVICE_ID_ASUSTEK_T100TAF_KEYBOARD 0x1807
#define USB_DEVICE_ID_ASUSTEK_T100CHI_KEYBOARD 0x8502
+#define USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD 0x183d
#define USB_DEVICE_ID_ASUSTEK_T304_KEYBOARD 0x184a
#define USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD 0x8585
#define USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD 0x0101
--
2.19.2
^ permalink raw reply related
* [PATCH] HID: debug: Change to use DEFINE_SHOW_ATTRIBUTE macro
From: Yangtao Li @ 2018-12-01 2:49 UTC (permalink / raw)
To: jikos, benjamin.tissoires; +Cc: linux-input, linux-kernel, Yangtao Li
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
drivers/hid/hid-debug.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index b48100236df8..c530476edba6 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1072,11 +1072,6 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
return 0;
}
-static int hid_debug_rdesc_open(struct inode *inode, struct file *file)
-{
- return single_open(file, hid_debug_rdesc_show, inode->i_private);
-}
-
static int hid_debug_events_open(struct inode *inode, struct file *file)
{
int err = 0;
@@ -1211,12 +1206,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)
return 0;
}
-static const struct file_operations hid_debug_rdesc_fops = {
- .open = hid_debug_rdesc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(hid_debug_rdesc);
static const struct file_operations hid_debug_events_fops = {
.owner = THIS_MODULE,
--
2.17.0
^ permalink raw reply related
* Re: [PATCH] HID: input: support Microsoft wireless radio control hotkey
From: kbuild test robot @ 2018-11-30 15:03 UTC (permalink / raw)
Cc: kbuild-all, jikos, benjamin.tissoires, rydberg, linux-input,
linux-kernel, linux, Chris Chiu
In-Reply-To: <20181130064617.67920-1-chiu@endlessm.com>
[-- Attachment #1: Type: text/plain, Size: 6650 bytes --]
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.20-rc4 next-20181130]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Chris-Chiu/HID-input-support-Microsoft-wireless-radio-control-hotkey/20181130-150723
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from drivers/hid/usbhid/hiddev.c:35:0:
drivers/hid/usbhid/hiddev.c: In function 'hiddev_connect':
include/linux/hid.h:839:99: error: expected expression before '||' token
#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || || (a == 0x0001000c) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
^
>> drivers/hid/usbhid/hiddev.c:906:9: note: in expansion of macro 'IS_INPUT_APPLICATION'
!IS_INPUT_APPLICATION(hid->collection[i].usage))
^~~~~~~~~~~~~~~~~~~~
vim +/IS_INPUT_APPLICATION +906 drivers/hid/usbhid/hiddev.c
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 891
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 892 /*
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 893 * This is where hid.c calls us to connect a hid device to the hiddev driver
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 894 */
93c10132 drivers/hid/usbhid/hiddev.c Jiri Slaby 2008-06-27 895 int hiddev_connect(struct hid_device *hid, unsigned int force)
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 896 {
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 897 struct hiddev *hiddev;
4916b3a5 drivers/usb/input/hiddev.c Jiri Kosina 2006-12-08 898 struct usbhid_device *usbhid = hid->driver_data;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 899 int retval;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 900
93c10132 drivers/hid/usbhid/hiddev.c Jiri Slaby 2008-06-27 901 if (!force) {
93c10132 drivers/hid/usbhid/hiddev.c Jiri Slaby 2008-06-27 902 unsigned int i;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 903 for (i = 0; i < hid->maxcollection; i++)
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 904 if (hid->collection[i].type ==
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 905 HID_COLLECTION_APPLICATION &&
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 @906 !IS_INPUT_APPLICATION(hid->collection[i].usage))
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 907 break;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 908
93c10132 drivers/hid/usbhid/hiddev.c Jiri Slaby 2008-06-27 909 if (i == hid->maxcollection)
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 910 return -1;
93c10132 drivers/hid/usbhid/hiddev.c Jiri Slaby 2008-06-27 911 }
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 912
bbdb7daf drivers/usb/input/hiddev.c Oliver Neukum 2006-01-06 913 if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL)))
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 914 return -1;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 915
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 916 init_waitqueue_head(&hiddev->wait);
826d5982 drivers/usb/input/hiddev.c Dmitry Torokhov 2006-07-19 917 INIT_LIST_HEAD(&hiddev->list);
cdcb44e8 drivers/hid/usbhid/hiddev.c Jiri Kosina 2007-05-10 918 spin_lock_init(&hiddev->list_lock);
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 919 mutex_init(&hiddev->existancelock);
76052749 drivers/hid/usbhid/hiddev.c Jiri Kosina 2009-01-07 920 hid->hiddev = hiddev;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 921 hiddev->hid = hid;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 922 hiddev->exist = 1;
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 923 retval = usb_register_dev(usbhid->intf, &hiddev_class);
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 924 if (retval) {
4291ee30 drivers/hid/usbhid/hiddev.c Joe Perches 2010-12-09 925 hid_err(hid, "Not able to get a minor for this device\n");
76052749 drivers/hid/usbhid/hiddev.c Jiri Kosina 2009-01-07 926 hid->hiddev = NULL;
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 927 kfree(hiddev);
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 928 return -1;
07903407 drivers/hid/usbhid/hiddev.c Oliver Neukum 2008-12-16 929 }
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 930
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 931 /*
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 932 * If HID_QUIRK_NO_INIT_REPORTS is set, make sure we don't initialize
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 933 * the reports.
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 934 */
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 935 hiddev->initialized = hid->quirks & HID_QUIRK_NO_INIT_REPORTS;
9143059f drivers/hid/usbhid/hiddev.c Benjamin Tissoires 2017-03-08 936
733aca90 drivers/hid/usbhid/hiddev.c Jaejoong Kim 2017-03-03 937 hiddev->minor = usbhid->intf->minor;
733aca90 drivers/hid/usbhid/hiddev.c Jaejoong Kim 2017-03-03 938
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 939 return 0;
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 940 }
^1da177e drivers/usb/input/hiddev.c Linus Torvalds 2005-04-16 941
:::::: The code at line 906 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26902 bytes --]
^ permalink raw reply
* Re: [regression, bisected] Keyboard not responding after resuming from suspend/hibernate
From: Numan Demirdöğen @ 2018-11-30 12:44 UTC (permalink / raw)
Cc: jason.low2, Waiman.Long, paulmck, tglx, dmitry.torokhov, peterz,
mingo, linux-kernel, linux-input, Pavel Machek
In-Reply-To: <20181028220654.7e77e5d7@ubuntu>
[-- Attachment #1: Type: text/plain, Size: 1707 bytes --]
Sun, 28 Oct 2018 22:06:54 +0300 tarihinde
Numan Demirdöğen <if.gnu.linux@gmail.com> yazdı:
>Thu, 25 Oct 2018 09:49:03 +0200 tarihinde
>Pavel Machek <pavel@ucw.cz> yazdı:
>
>> Hi!
>>
>> Here's problem bisected down to:
>>
>> commit 9d659ae14b545c4296e812c70493bfdc999b5c1c
>> Author: Peter Zijlstra <peterz@infradead.org>
>> Date: Tue Aug 23 14:40:16 2016 +0200
>>
>> locking/mutex: Add lock handoff to avoid starvation
>>
>> Implement lock handoff to avoid lock starvation.
>>
>> Numan, I assume revert of that patch on the 4.18 kernel still makes
>> it work?
>>
>
>Unfortunately, I could not revert
>9d659ae14b545c4296e812c70493bfdc999b5c1c on kernels from 4.18.16 to
>4.10-rc1 because there were too much conflicts, which I could not solve
>as an "average Joe". I tried a3ea3d9b865c2a8f7fe455c7fa26db4b6fd066e3
>which is parent of 9d659ae14b545c4296e812c70493bfdc999b5c1c and
>succeeded to compile kernel.
>
>git checkout a3ea3d9b865c2a8f7fe455c7fa26db4b6fd066e3
>
>Then, I compiled kernel and rebooted with it. I tried a couples of
>times suspending and resuming, all of the time keyboard worked as
>expected.
>
With this one line patch from Takashi Iwai, keyboard is working as
expected after resuming from suspend/hibernate.
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
* Bit2 indicates handoff has been done and we're waiting for pickup.
*/
#define MUTEX_FLAG_WAITERS 0x01
-#define MUTEX_FLAG_HANDOFF 0x02
+#define MUTEX_FLAG_HANDOFF 0x00
#define MUTEX_FLAG_PICKUP 0x04
#define MUTEX_FLAGS 0x07
Thanks in advance and regards,
--
Numan Demirdöğen
[-- Attachment #2: Dijital OpenPGP imzası --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
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