* [RESEND PATCH v4 2/4] rtc: at91sam9: Set name of regmap_config
From: Jeffy Chen @ 2018-03-09 8:43 UTC (permalink / raw)
To: linux-kernel, broonie, alexandre.belloni
Cc: Guenter Roeck, Arnd Bergmann, Joseph Lo, Rob Herring,
Catalin Marinas, Emil Renner Berthing, Heiko Stuebner,
Brian Norris, Thomas Gleixner, Philippe Ombredanne,
linux-rockchip, Kate Stewart, linux-input, Will Deacon,
Jeffy Chen, Matthias Kaehlcke, devicetree, stephen lu,
Greg Kroah-Hartman, Arvind Yadav, linux-arm-ke
In-Reply-To: <20180309084351.32009-1-jeffy.chen@rock-chips.com>
We are now allowing to register debugfs without a valid device, and not
having a valid name will end up using "dummy*" to create debugfs dir.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v4:
Not to use rtc dev to init regmap, the gpbr is not directly related to
the rtc.
Changes in v3: None
drivers/rtc/rtc-at91sam9.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 7418a763ce52..ee71e647fd43 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -349,6 +349,7 @@ static const struct rtc_class_ops at91_rtc_ops = {
};
static const struct regmap_config gpbr_regmap_config = {
+ .name = "gpbr",
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
--
2.11.0
^ permalink raw reply related
* [RESEND PATCH v4 1/4] mfd: syscon: Set name of regmap_config
From: Jeffy Chen @ 2018-03-09 8:43 UTC (permalink / raw)
To: linux-kernel, broonie, alexandre.belloni
Cc: Guenter Roeck, Arnd Bergmann, Joseph Lo, Rob Herring,
Catalin Marinas, Emil Renner Berthing, Heiko Stuebner,
Brian Norris, Thomas Gleixner, Philippe Ombredanne,
linux-rockchip, Kate Stewart, linux-input, Will Deacon,
Jeffy Chen, Matthias Kaehlcke, devicetree, stephen lu,
Greg Kroah-Hartman, Arvind Yadav, linux-arm-ke
In-Reply-To: <20180309084351.32009-1-jeffy.chen@rock-chips.com>
We are now allowing to register debugfs without a valid device, and not
having a valid name will end up using "dummy*" to create debugfs dir.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v4: None
Changes in v3:
Modify commit message.
drivers/mfd/syscon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index fc9ba0ea4e44..b6d05cd934e6 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -110,6 +110,7 @@ static struct syscon *of_syscon_register(struct device_node *np)
syscon_config.reg_stride = reg_io_width;
syscon_config.val_bits = reg_io_width * 8;
syscon_config.max_register = resource_size(&res) - reg_io_width;
+ syscon_config.name = of_node_full_name(np);
regmap = regmap_init_mmio(NULL, base, &syscon_config);
if (IS_ERR(regmap)) {
--
2.11.0
^ permalink raw reply related
* [RESEND PATCH v4 0/4] Set name of regmap_config
From: Jeffy Chen @ 2018-03-09 8:43 UTC (permalink / raw)
To: linux-kernel, broonie, alexandre.belloni
Cc: Guenter Roeck, Arnd Bergmann, Joseph Lo, Rob Herring,
Catalin Marinas, Emil Renner Berthing, Heiko Stuebner,
Brian Norris, Thomas Gleixner, Philippe Ombredanne,
linux-rockchip, Kate Stewart, linux-input, Will Deacon,
Jeffy Chen, Matthias Kaehlcke, devicetree, stephen lu,
Greg Kroah-Hartman, Arvind Yadav, linux-arm-ke
After 9b947a13e7f6 ("regmap: use debugfs even when no device"), we are
allowing regmap to create debugfs without a valid device. Some of them
would end up using "dummy*" as debugfs name.
This series try to set names in some regmap_config to avoid that.
Changes in v4:
Not to use rtc dev to init regmap, the gpbr is not directly related to
the rtc.
Changes in v3:
Modify commit message.
Jeffy Chen (4):
mfd: syscon: Set name of regmap_config
rtc: at91sam9: Set name of regmap_config
clk: lpc32xx: Set name of regmap_config
ARM: rockchip: Set name of regmap_config
arch/arm/mach-rockchip/platsmp.c | 1 +
drivers/clk/nxp/clk-lpc32xx.c | 1 +
drivers/mfd/syscon.c | 1 +
drivers/rtc/rtc-at91sam9.c | 1 +
4 files changed, 4 insertions(+)
--
2.11.0
^ permalink raw reply
* Re: [PATCH v3 1/2] input: Add RAVE SP Powerbutton driver
From: Dmitry Torokhov @ 2018-03-08 23:34 UTC (permalink / raw)
To: Andrey Smirnov
Cc: linux-input, linux-kernel, Rob Herring, Mark Rutland, devicetree,
Guenter Roeck, Chris Healy, Lucas Stach
In-Reply-To: <20180307020134.26293-1-andrew.smirnov@gmail.com>
On Tue, Mar 06, 2018 at 06:01:33PM -0800, Andrey Smirnov wrote:
> Add driver that properly handles input event emitted by RAVE SP
> devices.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: devicetree@vger.kernel.org
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Applied, thank you.
> ---
>
> Changes since [v2]:
>
> - Collected Reviewed-by from Lucas
>
> Changes since [v1]:
>
> - Removed redundant dev.parent assignment
>
> - Various cosmetic changes
>
> [v2] lkml.kernel.org/r/20180301165527.22274-1-andrew.smirnov@gmail.com
> [v1] lkml.kernel.org/r/20180226154130.25774-1-andrew.smirnov@gmail.com
>
> drivers/input/misc/Kconfig | 9 ++++
> drivers/input/misc/Makefile | 1 +
> drivers/input/misc/rave-sp-pwrbutton.c | 94 ++++++++++++++++++++++++++++++++++
> 3 files changed, 104 insertions(+)
> create mode 100644 drivers/input/misc/rave-sp-pwrbutton.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 62a1312a7387..6a3c753b093b 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -841,4 +841,13 @@ config INPUT_HISI_POWERKEY
> To compile this driver as a module, choose M here: the
> module will be called hisi_powerkey.
>
> +config INPUT_RAVE_SP_PWRBUTTON
> + tristate "RAVE SP Power button Driver"
> + depends on RAVE_SP_CORE
> + help
> + Say Y here if you want to enable power key reporting from RAVE SP
> +
> + To compile this driver as a module, choose M here: the
> + module will be called rave-sp-pwrbutton.
> +
> endif
> diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
> index a8f61af865aa..8cc58f362bb8 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -60,6 +60,7 @@ obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o
> obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
> obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o
> obj-$(CONFIG_INPUT_PWM_VIBRA) += pwm-vibra.o
> +obj-$(CONFIG_INPUT_RAVE_SP_PWRBUTTON) += rave-sp-pwrbutton.o
> obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o
> obj-$(CONFIG_INPUT_REGULATOR_HAPTIC) += regulator-haptic.o
> obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o
> diff --git a/drivers/input/misc/rave-sp-pwrbutton.c b/drivers/input/misc/rave-sp-pwrbutton.c
> new file mode 100644
> index 000000000000..bcab3cdb7ebd
> --- /dev/null
> +++ b/drivers/input/misc/rave-sp-pwrbutton.c
> @@ -0,0 +1,94 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// Power Button driver for RAVE SP
> +//
> +// Copyright (C) 2017 Zodiac Inflight Innovations
> +//
> +//
> +
> +#include <linux/input.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/mfd/rave-sp.h>
> +#include <linux/platform_device.h>
> +
> +#define RAVE_SP_EVNT_BUTTON_PRESS (RAVE_SP_EVNT_BASE + 0x00)
> +
> +struct rave_sp_power_button {
> + struct input_dev *idev;
> + struct notifier_block nb;
> +};
> +
> +static int rave_sp_power_button_event(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct rave_sp_power_button *pb =
> + container_of(nb, struct rave_sp_power_button, nb);
> + const u8 event = rave_sp_action_unpack_event(action);
> + const u8 value = rave_sp_action_unpack_value(action);
> + struct input_dev *idev = pb->idev;
> +
> + if (event == RAVE_SP_EVNT_BUTTON_PRESS) {
> + input_report_key(idev, KEY_POWER, value);
> + input_sync(idev);
> +
> + return NOTIFY_STOP;
> + }
> +
> + return NOTIFY_DONE;
> +}
> +
> +static int rave_sp_pwrbutton_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct rave_sp_power_button *pb;
> + struct input_dev *idev;
> + int error;
> +
> + pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL);
> + if (!pb)
> + return -ENOMEM;
> +
> + idev = devm_input_allocate_device(dev);
> + if (!idev)
> + return -ENOMEM;
> +
> + idev->name = pdev->name;
> +
> + input_set_capability(idev, EV_KEY, KEY_POWER);
> +
> + error = input_register_device(idev);
> + if (error)
> + return error;
> +
> + pb->idev = idev;
> + pb->nb.notifier_call = rave_sp_power_button_event;
> + pb->nb.priority = 128;
> +
> + error = devm_rave_sp_register_event_notifier(dev, &pb->nb);
> + if (error)
> + return error;
> +
> + return 0;
> +}
> +
> +static const struct of_device_id rave_sp_pwrbutton_of_match[] = {
> + { .compatible = "zii,rave-sp-pwrbutton" },
> + {}
> +};
> +
> +static struct platform_driver rave_sp_pwrbutton_driver = {
> + .probe = rave_sp_pwrbutton_probe,
> + .driver = {
> + .name = KBUILD_MODNAME,
> + .of_match_table = rave_sp_pwrbutton_of_match,
> + },
> +};
> +module_platform_driver(rave_sp_pwrbutton_driver);
> +
> +MODULE_DEVICE_TABLE(of, rave_sp_pwrbutton_of_match);
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>");
> +MODULE_AUTHOR("Nikita Yushchenko <nikita.yoush@cogentembedded.com>");
> +MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>");
> +MODULE_DESCRIPTION("RAVE SP Power Button driver");
> --
> 2.14.3
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: i8042: add Lenovo ThinkPad L460 to i8042 reset list
From: Dmitry Torokhov @ 2018-03-08 23:33 UTC (permalink / raw)
To: Dennis Wassenberg
Cc: Arvind Yadav, Marcos Paulo de Souza, Daniel Drake, Kai-Heng Feng,
linux-input, linux-kernel
In-Reply-To: <3063cecf-a893-6c0e-06cd-dfe325c45e2f@secunet.com>
On Thu, Mar 08, 2018 at 05:35:14PM +0100, Dennis Wassenberg wrote:
> Reset i8042 before probing because of insufficient
> BIOS initialisation of the i8042 serial controller.
> This makes synaptics touchpad detection possible.
> Without resetting the synaptics touchpad is not detected
> because there are always NACK messages from AUX port.
>
> Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Applied, thank you.
> ---
> drivers/input/serio/i8042-x86ia64io.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
> index 6cbbdc6..7755134 100644
> --- a/drivers/input/serio/i8042-x86ia64io.h
> +++ b/drivers/input/serio/i8042-x86ia64io.h
> @@ -627,6 +627,13 @@ static inline void i8042_write_command(int val)
> DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
> },
> },
> + {
> + /* Lenovo ThinkPad L460 */
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
> + },
> + },
> { }
> };
>
> --
> 1.9.1
>
>
--
Dmitry
^ permalink raw reply
* [PATCH] Input: i8042: add Lenovo ThinkPad L460 to i8042 reset list
From: Dennis Wassenberg @ 2018-03-08 16:35 UTC (permalink / raw)
To: Dmitry Torokhov, Arvind Yadav, Marcos Paulo de Souza,
Daniel Drake, Kai-Heng Feng
Cc: linux-input, linux-kernel
Reset i8042 before probing because of insufficient
BIOS initialisation of the i8042 serial controller.
This makes synaptics touchpad detection possible.
Without resetting the synaptics touchpad is not detected
because there are always NACK messages from AUX port.
Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
---
drivers/input/serio/i8042-x86ia64io.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 6cbbdc6..7755134 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -627,6 +627,13 @@ static inline void i8042_write_command(int val)
DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
},
},
+ {
+ /* Lenovo ThinkPad L460 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
+ },
+ },
{ }
};
--
1.9.1
^ permalink raw reply related
* [PATCH v5 2/3] Input: gpio-keys - allow setting wakeup event action in DT
From: Jeffy Chen @ 2018-03-08 7:32 UTC (permalink / raw)
To: linux-kernel
Cc: briannorris, heiko, dtor, dianders, Jeffy Chen, devicetree,
Rob Herring, Dmitry Torokhov, linux-input, Mark Rutland
In-Reply-To: <20180308073213.8419-1-jeffy.chen@rock-chips.com>
Allow specifying event actions to trigger wakeup when using the
gpio-keys input device as a wakeup source.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
Specify wakeup event action instead of irq trigger type as Brian
suggested.
Documentation/devicetree/bindings/input/gpio-keys.txt | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.txt b/Documentation/devicetree/bindings/input/gpio-keys.txt
index a94940481e55..996ce84352cb 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.txt
+++ b/Documentation/devicetree/bindings/input/gpio-keys.txt
@@ -26,6 +26,14 @@ Optional subnode-properties:
If not specified defaults to 5.
- wakeup-source: Boolean, button can wake-up the system.
(Legacy property supported: "gpio-key,wakeup")
+ - wakeup-event-action: Specifies whether the key should wake the
+ system when asserted, when deasserted, or both. This property is
+ only valid for keys that wake up the system (e.g., when the
+ "wakeup-source" property is also provided).
+ Supported values are defined in linux-event-codes.h:
+ EV_ACT_ASSERTED - asserted
+ EV_ACT_DEASSERTED - deasserted
+ EV_ACT_ANY - both asserted and deasserted
- linux,can-disable: Boolean, indicates that button is connected
to dedicated (not shared) interrupt which can be disabled to
suppress events from the button.
--
2.11.0
^ permalink raw reply related
* [PATCH v5 1/3] Input: gpio-keys - add support for wakeup event action
From: Jeffy Chen @ 2018-03-08 7:32 UTC (permalink / raw)
To: linux-kernel
Cc: briannorris, heiko, dtor, dianders, Jeffy Chen, devicetree,
Guenter Roeck, Thomas Gleixner, Joseph Lo, stephen lu,
Rob Herring, Dmitry Torokhov, Kate Stewart, linux-input,
Greg Kroah-Hartman, Mark Rutland, Philippe Ombredanne,
Arvind Yadav
In-Reply-To: <20180308073213.8419-1-jeffy.chen@rock-chips.com>
Add support for specifying event actions to trigger wakeup when using
the gpio-keys input device as a wakeup source.
This would allow the device to configure when to wakeup the system. For
example a gpio-keys input device for pen insert, may only want to wakeup
the system when ejecting the pen.
Suggested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v5:
Remove unneeded irq_wake flag as Andy suggested.
Changes in v4:
Add dt-binding gpio-keys.h, stop saving irq trigger type, add enable/disable wakeup helpers as Dmitry suggested.
Changes in v3:
Adding more comments as Brian suggested.
Changes in v2:
Specify wakeup event action instead of irq trigger type as Brian
suggested.
drivers/input/keyboard/gpio_keys.c | 63 +++++++++++++++++++++++++++++++++--
include/dt-bindings/input/gpio-keys.h | 13 ++++++++
include/linux/gpio_keys.h | 2 ++
3 files changed, 75 insertions(+), 3 deletions(-)
create mode 100644 include/dt-bindings/input/gpio-keys.h
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 87e613dc33b8..f6d5cfd44833 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -30,6 +30,7 @@
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h>
+#include <dt-bindings/input/gpio-keys.h>
struct gpio_button_data {
const struct gpio_keys_button *button;
@@ -45,6 +46,7 @@ struct gpio_button_data {
unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */
unsigned int irq;
+ unsigned int wakeup_trigger_type;
spinlock_t lock;
bool disabled;
bool key_pressed;
@@ -540,6 +542,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}
if (bdata->gpiod) {
+ int active_low = gpiod_is_active_low(bdata->gpiod);
+
if (button->debounce_interval) {
error = gpiod_set_debounce(bdata->gpiod,
button->debounce_interval * 1000);
@@ -568,6 +572,24 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
isr = gpio_keys_gpio_isr;
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
+ switch (button->wakeup_event_action) {
+ case EV_ACT_ASSERTED:
+ bdata->wakeup_trigger_type = active_low ?
+ IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING;
+ break;
+ case EV_ACT_DEASSERTED:
+ bdata->wakeup_trigger_type = active_low ?
+ IRQ_TYPE_EDGE_RISING : IRQ_TYPE_EDGE_FALLING;
+ break;
+ case EV_ACT_ANY:
+ /* fall through */
+ default:
+ /*
+ * For other cases, we are OK letting suspend/resume
+ * not reconfigure the trigger type.
+ */
+ break;
+ }
} else {
if (!button->irq) {
dev_err(dev, "Found button without gpio or irq\n");
@@ -586,6 +608,11 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
isr = gpio_keys_irq_isr;
irqflags = 0;
+
+ /*
+ * For IRQ buttons, there is no interrupt for release.
+ * So we don't need to reconfigure the trigger type for wakeup.
+ */
}
bdata->code = &ddata->keymap[idx];
@@ -718,6 +745,9 @@ gpio_keys_get_devtree_pdata(struct device *dev)
/* legacy name */
fwnode_property_read_bool(child, "gpio-key,wakeup");
+ fwnode_property_read_u32(child, "wakeup-event-action",
+ &button->wakeup_event_action);
+
button->can_disable =
fwnode_property_read_bool(child, "linux,can-disable");
@@ -845,6 +875,31 @@ static int gpio_keys_probe(struct platform_device *pdev)
return 0;
}
+static int gpio_keys_enable_wakeup(struct gpio_button_data *bdata)
+{
+ int ret;
+
+ ret = enable_irq_wake(bdata->irq);
+ if (ret)
+ return ret;
+
+ if (bdata->wakeup_trigger_type)
+ irq_set_irq_type(bdata->irq, bdata->wakeup_trigger_type);
+
+ return 0;
+}
+
+static void gpio_keys_disable_wakeup(struct gpio_button_data *bdata)
+{
+ /**
+ * The trigger type is always both edges for gpio-based keys and we do
+ * not support changing wakeup trigger for interrupt-based keys.
+ */
+ if (bdata->wakeup_trigger_type)
+ irq_set_irq_type(bdata->irq, IRQ_TYPE_EDGE_BOTH);
+ disable_irq_wake(bdata->irq);
+}
+
static int __maybe_unused gpio_keys_suspend(struct device *dev)
{
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
@@ -854,8 +909,9 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
if (device_may_wakeup(dev)) {
for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
+
if (bdata->button->wakeup)
- enable_irq_wake(bdata->irq);
+ gpio_keys_enable_wakeup(bdata);
bdata->suspended = true;
}
} else {
@@ -878,9 +934,10 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
if (device_may_wakeup(dev)) {
for (i = 0; i < ddata->pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
- if (bdata->button->wakeup)
- disable_irq_wake(bdata->irq);
+
bdata->suspended = false;
+ if (irqd_is_wakeup_set(irq_get_irq_data(bdata->irq)))
+ gpio_keys_disable_wakeup(bdata);
}
} else {
mutex_lock(&input->mutex);
diff --git a/include/dt-bindings/input/gpio-keys.h b/include/dt-bindings/input/gpio-keys.h
new file mode 100644
index 000000000000..8962df79e753
--- /dev/null
+++ b/include/dt-bindings/input/gpio-keys.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides constants for gpio keys bindings.
+ */
+
+#ifndef _DT_BINDINGS_GPIO_KEYS_H
+#define _DT_BINDINGS_GPIO_KEYS_H
+
+#define EV_ACT_ANY 0x00 /* asserted or deasserted */
+#define EV_ACT_ASSERTED 0x01 /* asserted */
+#define EV_ACT_DEASSERTED 0x02 /* deasserted */
+
+#endif /* _DT_BINDINGS_GPIO_KEYS_H */
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index d06bf77400f1..7160df54a6fe 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -13,6 +13,7 @@ struct device;
* @desc: label that will be attached to button's gpio
* @type: input event type (%EV_KEY, %EV_SW, %EV_ABS)
* @wakeup: configure the button as a wake-up source
+ * @wakeup_event_action: event action to trigger wakeup
* @debounce_interval: debounce ticks interval in msecs
* @can_disable: %true indicates that userspace is allowed to
* disable button via sysfs
@@ -26,6 +27,7 @@ struct gpio_keys_button {
const char *desc;
unsigned int type;
int wakeup;
+ int wakeup_event_action;
int debounce_interval;
bool can_disable;
int value;
--
2.11.0
^ permalink raw reply related
* [PATCH v5 0/3] gpio-keys: Add support for specifying wakeup event action
From: Jeffy Chen @ 2018-03-08 7:32 UTC (permalink / raw)
To: linux-kernel
Cc: Kate Stewart, Mark Rutland, heiko, stephen lu, Catalin Marinas,
Will Deacon, Joseph Lo, Emil Renner Berthing, Brian Norris,
linux-rockchip, Matthias Kaehlcke, linux-input, briannorris, dtor,
devicetree, Arnd Bergmann, Jeffy Chen, dianders, Rob Herring,
Arvind Yadav, Thomas Gleixner, linux-arm-kernel,
Greg Kroah-Hartman, Dmitry Torokhov, Guenter Roeck, Philippe
On chromebook kevin, we are using gpio-keys for pen insert event. But
we only want it to wakeup the system when ejecting the pen.
So we may need to change the interrupt trigger type during suspending.
Changes in v5:
Remove unneeded irq_wake flag as Andy suggested.
Changes in v4:
Add dt-binding gpio-keys.h, stop saving irq trigger type, add enable/disable wakeup helpers as Dmitry suggested.
Include dt-binding gpio-keys.h
Changes in v3:
Adding more comments as Brian suggested.
Changes in v2:
Specify wakeup event action instead of irq trigger type as Brian
suggested.
Specify wakeup event action instead of irq trigger type as Brian
suggested.
Specify wakeup event action instead of irq trigger type as Brian
suggested.
Jeffy Chen (3):
Input: gpio-keys - add support for wakeup event action
Input: gpio-keys - allow setting wakeup event action in DT
arm64: dts: rockchip: kevin: Avoid wakeup when inserting the pen
.../devicetree/bindings/input/gpio-keys.txt | 8 +++
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 3 ++
drivers/input/keyboard/gpio_keys.c | 63 ++++++++++++++++++++--
include/dt-bindings/input/gpio-keys.h | 13 +++++
include/linux/gpio_keys.h | 2 +
5 files changed, 86 insertions(+), 3 deletions(-)
create mode 100644 include/dt-bindings/input/gpio-keys.h
--
2.11.0
^ permalink raw reply
* Re: [PATCH v4 1/3] Input: gpio-keys - add support for wakeup event action
From: JeffyChen @ 2018-03-08 7:32 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Linux Kernel Mailing List, briannorris, Heiko Stübner,
Dmitry Torokhov, Douglas Anderson, devicetree, Guenter Roeck,
Thomas Gleixner, Joseph Lo, stephen lu, Rob Herring,
Dmitry Torokhov, Kate Stewart, linux-input, Greg Kroah-Hartman,
Mark Rutland, Philippe Ombredanne, Arvind Yadav
In-Reply-To: <CAHp75VcmbHbnD8FnTHXAqGajhs10wA7Z7U_D6SY9=j=y+GLLPA@mail.gmail.com>
Hi Andy,
Thanks for your reply.
On 03/07/2018 07:57 PM, Andy Shevchenko wrote:
> On Tue, Mar 6, 2018 at 9:44 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>> Add support for specifying event actions to trigger wakeup when using
>> the gpio-keys input device as a wakeup source.
>>
>> This would allow the device to configure when to wakeup the system. For
>> example a gpio-keys input device for pen insert, may only want to wakeup
>> the system when ejecting the pen.
>
>> + bool wakeup_enabled;
>
>> + if (bdata->wakeup_enabled) {
>
> This is redundant. IRQ core keeps track on this information already.
>
> Check below as an example
> aef3ad103a68 ("serial: core: remove unneeded irq_wake flag")
>
right, that make sense.
>
^ permalink raw reply
* Re: [PATCH v3 2/2] dt-bindings: input: Add binding for RAVE SP input driver
From: Rob Herring @ 2018-03-08 2:04 UTC (permalink / raw)
To: Andrey Smirnov
Cc: Dmitry Torokhov, linux-input, linux-kernel, Mark Rutland,
devicetree, Guenter Roeck, Chris Healy, Lucas Stach
In-Reply-To: <20180307020134.26293-2-andrew.smirnov@gmail.com>
On Tue, Mar 06, 2018 at 06:01:34PM -0800, Andrey Smirnov wrote:
> Add Device Tree bindings for RAVE SP input drvier - an MFD cell of
> parent RAVE SP driver (documented in
> Documentation/devicetree/bindings/mfd/zii,rave-sp.txt).
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: devicetree@vger.kernel.org
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Acked-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>
> Changes since [v2]:
>
> - Collected Acked-by from Lucas
>
> - Removed unnecessary status="okay"
>
> No changes between v1 and v2, so v1 is not referenced here.
>
> [v2] lkml.kernel.org/r/20180301165527.22274-2-andrew.smirnov@gmail.com
>
> .../bindings/input/zii,rave-sp-pwrbutton.txt | 23 ++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* [git pull] Input updates for v4.16-rc4
From: Dmitry Torokhov @ 2018-03-07 23:53 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:
- we are reverting patch that was switched touchpad on Lenovo T460P over
to native RMI because on these boxes BIOS messes up with SMBus
controller state. We might re-enable it later once SMBus issue is
resolved
- disabling interrupts in matrix_keypad driver was racy
- mms114 now has SPDX header and matching MODULE_LICENSE
Changelog:
---------
Andi Shyti (2):
Input: mms114 - fix license module information
Input: mms114 - add SPDX identifier
Dmitry Torokhov (1):
Revert "Input: synaptics - Lenovo Thinkpad T460p devices should use RMI"
Zhang Bo (1):
Input: matrix_keypad - fix race when disabling interrupts
Diffstat:
--------
drivers/input/keyboard/matrix_keypad.c | 4 +++-
drivers/input/mouse/synaptics.c | 1 -
drivers/input/touchscreen/mms114.c | 15 ++++++---------
3 files changed, 9 insertions(+), 11 deletions(-)
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH V1] Input: pm8941-pwrkey: add resin key capabilities
From: Dmitry Torokhov @ 2018-03-07 20:21 UTC (permalink / raw)
To: Tirupathi Reddy
Cc: robh+dt, mark.rutland, linux-input, linux-arm-msm, devicetree,
linux-kernel
In-Reply-To: <1520410173-2507-1-git-send-email-tirupath@codeaurora.org>
Hi Tirupathi,
On Wed, Mar 07, 2018 at 01:39:33PM +0530, Tirupathi Reddy wrote:
> Add resin key support to handle different types of key events
> defined in different platforms.
>
> Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
> ---
> .../bindings/input/qcom,pm8941-pwrkey.txt | 20 ++++++-
> drivers/input/misc/pm8941-pwrkey.c | 63 +++++++++++++++++++++-
> 2 files changed, 81 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
> index 07bf55f..1c437e9 100644
> --- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
> +++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
> @@ -20,6 +20,14 @@ PROPERTIES
> defined by the binding document describing the node's
> interrupt parent.
>
> +- interrupt-names:
> + Usage: required
> + Value type: <stringlist>
> + Definition: Interrupt names. This list must match up 1-to-1 with the
> + interrupts specified in the 'interrupts' property. "kpdpwr"
> + must be specified. "resin" may be specified for some
> + platforms.
> +
> - debounce:
> Usage: optional
> Value type: <u32>
> @@ -32,12 +40,22 @@ PROPERTIES
> Definition: presence of this property indicates that the KPDPWR_N pin
> should be configured for pull up.
>
> +- linux,code:
> + Usage: required for "resin" key
> + Value type: <u32>
> + Definition: The input key-code associated with the resin key.
> + Use the linux event codes defined in
> + include/dt-bindings/input/linux-event-codes.h
> +
> EXAMPLE
>
> pwrkey@800 {
> compatible = "qcom,pm8941-pwrkey";
> reg = <0x800>;
> - interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> + interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>,
> + <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> + interrupt-names = "kpdpwr", "resin";
> debounce = <15625>;
> bias-pull-up;
> + linux,code = <KEY_VOLUMEDOWN>;
> };
> diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
> index 18ad956..3f801cf 100644
> --- a/drivers/input/misc/pm8941-pwrkey.c
> +++ b/drivers/input/misc/pm8941-pwrkey.c
> @@ -28,6 +28,7 @@
>
> #define PON_RT_STS 0x10
> #define PON_KPDPWR_N_SET BIT(0)
> +#define PON_RESIN_N_SET BIT(1)
>
> #define PON_PS_HOLD_RST_CTL 0x5a
> #define PON_PS_HOLD_RST_CTL2 0x5b
> @@ -46,6 +47,8 @@
> struct pm8941_pwrkey {
> struct device *dev;
> int irq;
> + int resin_irq;
> + u32 resin_key_code;
> u32 baseaddr;
> struct regmap *regmap;
> struct input_dev *input;
> @@ -130,6 +133,24 @@ static irqreturn_t pm8941_pwrkey_irq(int irq, void *_data)
> return IRQ_HANDLED;
> }
>
> +static irqreturn_t pm8941_resinkey_irq(int irq, void *_data)
> +{
> + struct pm8941_pwrkey *pwrkey = _data;
> + unsigned int sts;
> + int error;
> +
> + error = regmap_read(pwrkey->regmap,
> + pwrkey->baseaddr + PON_RT_STS, &sts);
> + if (error)
> + return IRQ_HANDLED;
It looks like you are reading the same register as the power on key.
Won't you lose events if both are pressed at the same time?
I think you need a unified interrupt handler...
> +
> + input_report_key(pwrkey->input, pwrkey->resin_key_code,
> + !!(sts & PON_RESIN_N_SET));
> + input_sync(pwrkey->input);
> +
> + return IRQ_HANDLED;
> +}
> +
> static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev)
> {
> struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev);
> @@ -153,6 +174,35 @@ static int __maybe_unused pm8941_pwrkey_resume(struct device *dev)
> static SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops,
> pm8941_pwrkey_suspend, pm8941_pwrkey_resume);
>
> +static int pm8941_resin_key_init(struct pm8941_pwrkey *pwrkey)
> +{
> + int error;
> +
> + /*
> + * Get the standard-key parameters. This might not be
> + * specified if there is no key mapping on the reset line.
> + */
> + error = of_property_read_u32(pwrkey->dev->of_node, "linux,code",
> + &pwrkey->resin_key_code);
> + if (error) {
> + dev_err(pwrkey->dev, "failed to read key-code for resin key\n");
> + return error;
> + }
> +
> + /* Register key configuration */
> + input_set_capability(pwrkey->input, EV_KEY, pwrkey->resin_key_code);
> +
> + error = devm_request_threaded_irq(pwrkey->dev, pwrkey->resin_irq,
> + NULL, pm8941_resinkey_irq,
> + IRQF_ONESHOT,
> + "pm8941_resinkey", pwrkey);
> + if (error)
> + dev_err(pwrkey->dev, "failed requesting resin key IRQ: %d\n",
> + error);
> +
> + return error;
> +}
> +
> static int pm8941_pwrkey_probe(struct platform_device *pdev)
> {
> struct pm8941_pwrkey *pwrkey;
> @@ -182,7 +232,7 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> - pwrkey->irq = platform_get_irq(pdev, 0);
> + pwrkey->irq = platform_get_irq_byname(pdev, "kpdpwr");
You are breaking support for old DTS here I'm afraid.
> if (pwrkey->irq < 0) {
> dev_err(&pdev->dev, "failed to get irq\n");
> return pwrkey->irq;
> @@ -241,6 +291,17 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
> return error;
> }
>
> + pwrkey->resin_irq = platform_get_irq_byname(pdev, "resin");
> + if (pwrkey->resin_irq >= 0) {
This is not entirely correct. I'd say if you have -ENXIO you can
conclude that the support for "resin" key is not enabled, but the rest
of the errors you should report up the stack. Deferrals will be retried
and other errors are fatal.
> + /* resin key capabilities are defined in device node */
> + error = pm8941_resin_key_init(pwrkey);
> + if (error) {
> + dev_err(&pdev->dev, "failed resin key initialization: %d\n",
> + error);
> + return error;
> + }
> + }
> +
> error = input_register_device(pwrkey->input);
> if (error) {
> dev_err(&pdev->dev, "failed to register input device: %d\n",
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] HID: ntrig: document sysfs interface
From: Jiri Kosina @ 2018-03-07 14:46 UTC (permalink / raw)
To: Aishwarya Pant
Cc: Benjamin Tissoires, linux-input, linux-kernel, Jonathan Corbet,
Greg KH, Julia Lawall, linux-doc
In-Reply-To: <20180302053017.GA23123@mordor.localdomain>
On Fri, 2 Mar 2018, Aishwarya Pant wrote:
> Add sysfs documentation for N-Trig touchscreens under Documentation/ABI.
> Descriptions have been collected from code comments.
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v4 1/3] Input: gpio-keys - add support for wakeup event action
From: Andy Shevchenko @ 2018-03-07 11:57 UTC (permalink / raw)
To: Jeffy Chen
Cc: Linux Kernel Mailing List, briannorris, Heiko Stübner,
Dmitry Torokhov, Douglas Anderson, devicetree, Guenter Roeck,
Thomas Gleixner, Joseph Lo, stephen lu, Rob Herring,
Dmitry Torokhov, Kate Stewart, linux-input, Greg Kroah-Hartman,
Mark Rutland, Philippe Ombredanne, Arvind Yadav
In-Reply-To: <20180306074418.8879-2-jeffy.chen@rock-chips.com>
On Tue, Mar 6, 2018 at 9:44 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
> Add support for specifying event actions to trigger wakeup when using
> the gpio-keys input device as a wakeup source.
>
> This would allow the device to configure when to wakeup the system. For
> example a gpio-keys input device for pen insert, may only want to wakeup
> the system when ejecting the pen.
> + bool wakeup_enabled;
> + if (bdata->wakeup_enabled) {
This is redundant. IRQ core keeps track on this information already.
Check below as an example
aef3ad103a68 ("serial: core: remove unneeded irq_wake flag")
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH V1] Input: pm8941-pwrkey: add resin key capabilities
From: Tirupathi Reddy @ 2018-03-07 8:09 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: tirupath, linux-input, linux-arm-msm, devicetree, linux-kernel
Add resin key support to handle different types of key events
defined in different platforms.
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
---
.../bindings/input/qcom,pm8941-pwrkey.txt | 20 ++++++-
drivers/input/misc/pm8941-pwrkey.c | 63 +++++++++++++++++++++-
2 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
index 07bf55f..1c437e9 100644
--- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
+++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
@@ -20,6 +20,14 @@ PROPERTIES
defined by the binding document describing the node's
interrupt parent.
+- interrupt-names:
+ Usage: required
+ Value type: <stringlist>
+ Definition: Interrupt names. This list must match up 1-to-1 with the
+ interrupts specified in the 'interrupts' property. "kpdpwr"
+ must be specified. "resin" may be specified for some
+ platforms.
+
- debounce:
Usage: optional
Value type: <u32>
@@ -32,12 +40,22 @@ PROPERTIES
Definition: presence of this property indicates that the KPDPWR_N pin
should be configured for pull up.
+- linux,code:
+ Usage: required for "resin" key
+ Value type: <u32>
+ Definition: The input key-code associated with the resin key.
+ Use the linux event codes defined in
+ include/dt-bindings/input/linux-event-codes.h
+
EXAMPLE
pwrkey@800 {
compatible = "qcom,pm8941-pwrkey";
reg = <0x800>;
- interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+ interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>,
+ <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-names = "kpdpwr", "resin";
debounce = <15625>;
bias-pull-up;
+ linux,code = <KEY_VOLUMEDOWN>;
};
diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
index 18ad956..3f801cf 100644
--- a/drivers/input/misc/pm8941-pwrkey.c
+++ b/drivers/input/misc/pm8941-pwrkey.c
@@ -28,6 +28,7 @@
#define PON_RT_STS 0x10
#define PON_KPDPWR_N_SET BIT(0)
+#define PON_RESIN_N_SET BIT(1)
#define PON_PS_HOLD_RST_CTL 0x5a
#define PON_PS_HOLD_RST_CTL2 0x5b
@@ -46,6 +47,8 @@
struct pm8941_pwrkey {
struct device *dev;
int irq;
+ int resin_irq;
+ u32 resin_key_code;
u32 baseaddr;
struct regmap *regmap;
struct input_dev *input;
@@ -130,6 +133,24 @@ static irqreturn_t pm8941_pwrkey_irq(int irq, void *_data)
return IRQ_HANDLED;
}
+static irqreturn_t pm8941_resinkey_irq(int irq, void *_data)
+{
+ struct pm8941_pwrkey *pwrkey = _data;
+ unsigned int sts;
+ int error;
+
+ error = regmap_read(pwrkey->regmap,
+ pwrkey->baseaddr + PON_RT_STS, &sts);
+ if (error)
+ return IRQ_HANDLED;
+
+ input_report_key(pwrkey->input, pwrkey->resin_key_code,
+ !!(sts & PON_RESIN_N_SET));
+ input_sync(pwrkey->input);
+
+ return IRQ_HANDLED;
+}
+
static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev)
{
struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev);
@@ -153,6 +174,35 @@ static int __maybe_unused pm8941_pwrkey_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops,
pm8941_pwrkey_suspend, pm8941_pwrkey_resume);
+static int pm8941_resin_key_init(struct pm8941_pwrkey *pwrkey)
+{
+ int error;
+
+ /*
+ * Get the standard-key parameters. This might not be
+ * specified if there is no key mapping on the reset line.
+ */
+ error = of_property_read_u32(pwrkey->dev->of_node, "linux,code",
+ &pwrkey->resin_key_code);
+ if (error) {
+ dev_err(pwrkey->dev, "failed to read key-code for resin key\n");
+ return error;
+ }
+
+ /* Register key configuration */
+ input_set_capability(pwrkey->input, EV_KEY, pwrkey->resin_key_code);
+
+ error = devm_request_threaded_irq(pwrkey->dev, pwrkey->resin_irq,
+ NULL, pm8941_resinkey_irq,
+ IRQF_ONESHOT,
+ "pm8941_resinkey", pwrkey);
+ if (error)
+ dev_err(pwrkey->dev, "failed requesting resin key IRQ: %d\n",
+ error);
+
+ return error;
+}
+
static int pm8941_pwrkey_probe(struct platform_device *pdev)
{
struct pm8941_pwrkey *pwrkey;
@@ -182,7 +232,7 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
return -ENODEV;
}
- pwrkey->irq = platform_get_irq(pdev, 0);
+ pwrkey->irq = platform_get_irq_byname(pdev, "kpdpwr");
if (pwrkey->irq < 0) {
dev_err(&pdev->dev, "failed to get irq\n");
return pwrkey->irq;
@@ -241,6 +291,17 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
return error;
}
+ pwrkey->resin_irq = platform_get_irq_byname(pdev, "resin");
+ if (pwrkey->resin_irq >= 0) {
+ /* resin key capabilities are defined in device node */
+ error = pm8941_resin_key_init(pwrkey);
+ if (error) {
+ dev_err(&pdev->dev, "failed resin key initialization: %d\n",
+ error);
+ return error;
+ }
+ }
+
error = input_register_device(pwrkey->input);
if (error) {
dev_err(&pdev->dev, "failed to register input device: %d\n",
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
^ permalink raw reply related
* [PATCH v3 2/2] dt-bindings: input: Add binding for RAVE SP input driver
From: Andrey Smirnov @ 2018-03-07 2:01 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Andrey Smirnov, linux-input, linux-kernel, Rob Herring,
Mark Rutland, devicetree, Guenter Roeck, Chris Healy, Lucas Stach
In-Reply-To: <20180307020134.26293-1-andrew.smirnov@gmail.com>
Add Device Tree bindings for RAVE SP input drvier - an MFD cell of
parent RAVE SP driver (documented in
Documentation/devicetree/bindings/mfd/zii,rave-sp.txt).
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
Changes since [v2]:
- Collected Acked-by from Lucas
- Removed unnecessary status="okay"
No changes between v1 and v2, so v1 is not referenced here.
[v2] lkml.kernel.org/r/20180301165527.22274-2-andrew.smirnov@gmail.com
.../bindings/input/zii,rave-sp-pwrbutton.txt | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
diff --git a/Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt b/Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
new file mode 100644
index 000000000000..b217018d03e9
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
@@ -0,0 +1,23 @@
+Zodiac Inflight Innovations RAVE Supervisory Processor Power Button Bindings
+
+RAVE SP input device is a "MFD cell" device corresponding to power
+button functionality of RAVE Supervisory Processor. It is expected
+that its Device Tree node is specified as a child of the node
+corresponding to the parent RAVE SP device (as documented in
+Documentation/devicetree/bindings/mfd/zii,rave-sp.txt)
+
+Required properties:
+
+- compatible: Should be "zii,rave-sp-pwrbutton"
+
+Example:
+
+ rave-sp {
+ compatible = "zii,rave-sp-rdu1";
+ current-speed = <38400>;
+
+ pwrbutton {
+ compatible = "zii,rave-sp-pwrbutton";
+ };
+ }
+
--
2.14.3
^ permalink raw reply related
* [PATCH v3 1/2] input: Add RAVE SP Powerbutton driver
From: Andrey Smirnov @ 2018-03-07 2:01 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Andrey Smirnov, linux-input, linux-kernel, Rob Herring,
Mark Rutland, devicetree, Guenter Roeck, Chris Healy, Lucas Stach
Add driver that properly handles input event emitted by RAVE SP
devices.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
Changes since [v2]:
- Collected Reviewed-by from Lucas
Changes since [v1]:
- Removed redundant dev.parent assignment
- Various cosmetic changes
[v2] lkml.kernel.org/r/20180301165527.22274-1-andrew.smirnov@gmail.com
[v1] lkml.kernel.org/r/20180226154130.25774-1-andrew.smirnov@gmail.com
drivers/input/misc/Kconfig | 9 ++++
drivers/input/misc/Makefile | 1 +
drivers/input/misc/rave-sp-pwrbutton.c | 94 ++++++++++++++++++++++++++++++++++
3 files changed, 104 insertions(+)
create mode 100644 drivers/input/misc/rave-sp-pwrbutton.c
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 62a1312a7387..6a3c753b093b 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -841,4 +841,13 @@ config INPUT_HISI_POWERKEY
To compile this driver as a module, choose M here: the
module will be called hisi_powerkey.
+config INPUT_RAVE_SP_PWRBUTTON
+ tristate "RAVE SP Power button Driver"
+ depends on RAVE_SP_CORE
+ help
+ Say Y here if you want to enable power key reporting from RAVE SP
+
+ To compile this driver as a module, choose M here: the
+ module will be called rave-sp-pwrbutton.
+
endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index a8f61af865aa..8cc58f362bb8 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o
obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o
obj-$(CONFIG_INPUT_PWM_VIBRA) += pwm-vibra.o
+obj-$(CONFIG_INPUT_RAVE_SP_PWRBUTTON) += rave-sp-pwrbutton.o
obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o
obj-$(CONFIG_INPUT_REGULATOR_HAPTIC) += regulator-haptic.o
obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o
diff --git a/drivers/input/misc/rave-sp-pwrbutton.c b/drivers/input/misc/rave-sp-pwrbutton.c
new file mode 100644
index 000000000000..bcab3cdb7ebd
--- /dev/null
+++ b/drivers/input/misc/rave-sp-pwrbutton.c
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Power Button driver for RAVE SP
+//
+// Copyright (C) 2017 Zodiac Inflight Innovations
+//
+//
+
+#include <linux/input.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mfd/rave-sp.h>
+#include <linux/platform_device.h>
+
+#define RAVE_SP_EVNT_BUTTON_PRESS (RAVE_SP_EVNT_BASE + 0x00)
+
+struct rave_sp_power_button {
+ struct input_dev *idev;
+ struct notifier_block nb;
+};
+
+static int rave_sp_power_button_event(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ struct rave_sp_power_button *pb =
+ container_of(nb, struct rave_sp_power_button, nb);
+ const u8 event = rave_sp_action_unpack_event(action);
+ const u8 value = rave_sp_action_unpack_value(action);
+ struct input_dev *idev = pb->idev;
+
+ if (event == RAVE_SP_EVNT_BUTTON_PRESS) {
+ input_report_key(idev, KEY_POWER, value);
+ input_sync(idev);
+
+ return NOTIFY_STOP;
+ }
+
+ return NOTIFY_DONE;
+}
+
+static int rave_sp_pwrbutton_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct rave_sp_power_button *pb;
+ struct input_dev *idev;
+ int error;
+
+ pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL);
+ if (!pb)
+ return -ENOMEM;
+
+ idev = devm_input_allocate_device(dev);
+ if (!idev)
+ return -ENOMEM;
+
+ idev->name = pdev->name;
+
+ input_set_capability(idev, EV_KEY, KEY_POWER);
+
+ error = input_register_device(idev);
+ if (error)
+ return error;
+
+ pb->idev = idev;
+ pb->nb.notifier_call = rave_sp_power_button_event;
+ pb->nb.priority = 128;
+
+ error = devm_rave_sp_register_event_notifier(dev, &pb->nb);
+ if (error)
+ return error;
+
+ return 0;
+}
+
+static const struct of_device_id rave_sp_pwrbutton_of_match[] = {
+ { .compatible = "zii,rave-sp-pwrbutton" },
+ {}
+};
+
+static struct platform_driver rave_sp_pwrbutton_driver = {
+ .probe = rave_sp_pwrbutton_probe,
+ .driver = {
+ .name = KBUILD_MODNAME,
+ .of_match_table = rave_sp_pwrbutton_of_match,
+ },
+};
+module_platform_driver(rave_sp_pwrbutton_driver);
+
+MODULE_DEVICE_TABLE(of, rave_sp_pwrbutton_of_match);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>");
+MODULE_AUTHOR("Nikita Yushchenko <nikita.yoush@cogentembedded.com>");
+MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>");
+MODULE_DESCRIPTION("RAVE SP Power Button driver");
--
2.14.3
^ permalink raw reply related
* Re: [PATCH v2 2/2] dt-bindings: input: Add binding for RAVE SP input driver
From: Andrey Smirnov @ 2018-03-07 1:51 UTC (permalink / raw)
To: Fabio Estevam
Cc: Dmitry Torokhov, linux-input, linux-kernel, Rob Herring,
Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Guenter Roeck, Chris Healy, Lucas Stach
In-Reply-To: <CAOMZO5DTWrMS-RrDwqMg5CTjH_dCdkiyvDJ+zgje49yzbbNUhg@mail.gmail.com>
On Tue, Mar 6, 2018 at 6:17 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Andrey,
>
> On Thu, Mar 1, 2018 at 1:55 PM, Andrey Smirnov <andrew.smirnov@gmail.com> wrote:
> l
>> +++ b/Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
>> @@ -0,0 +1,24 @@
>> +Zodiac Inflight Innovations RAVE Supervisory Processor Power Button Bindings
>> +
>> +RAVE SP input device is a "MFD cell" device corresponding to power
>> +button functionality of RAVE Supervisory Processor. It is expected
>> +that its Device Tree node is specified as a child of the node
>> +corresponding to the parent RAVE SP device (as documented in
>> +Documentation/devicetree/bindings/mfd/zii,rave-sp.txt)
>> +
>> +Required properties:
>> +
>> +- compatible: Should be "zii,rave-sp-pwrbutton"
>> +
>> +Example:
>> +
>> + rave-sp {
>> + compatible = "zii,rave-sp-rdu1";
>> + current-speed = <38400>;
>> +
>> + pwrbutton {
>> + compatible = "zii,rave-sp-pwrbutton";
>> + status = "okay";
>
> In the dts patch review Shawn said:
>
> "The okay status is to flip the state of devices that are initially
> disabled. I think it's unnecessary for the case here."
>
> so please remove the status line.
Sure, will do in v3.
Thanks,
Andrey Smirnov
^ permalink raw reply
* Re: [PATCH v2 1/1] HID: Logitech K290: Add driver for the Logitech K290 USB keyboard
From: Florent Flament @ 2018-03-06 23:11 UTC (permalink / raw)
To: Benjamin Tissoires, Nestor Lopez Casado
Cc: andy.shevchenko, Jiri Kosina, lkml, open list:HID CORE LAYER
In-Reply-To: <1520292697.14077.14.camel@florentflament.com>
Hi Benjamin, Nestor,
On Tue, 2018-03-06 at 00:31 +0100, Florent Flament wrote:
> On Mon, 2018-03-05 at 18:26 +0100, Benjamin Tissoires wrote:
> > Hi Florent,
>
> Hi Benjamin,
>
> >
> > On Mon, Mar 5, 2018 at 10:31 AM, Nestor Lopez Casado
> > <nlopezcasad@logitech.com> wrote:
> > > Hello Florent,
> > >
> > > In my view, this driver may not be a good idea. The default
> > > behaviour
> > > of K290 is 'send multimedia keycodes' with the user given the
> > > choice
> > > to change that behaviour via vendor commands. Putting a driver
> > > that
> > > will unconditionally change that behaviour without the user's
> > > consent
> > > might bother other users that prefer the multimedia keycodes by
> > > default.
> > >
> > > Besides, I'd argue that instead of a kernel module this would be
> > > best
> > > achieved from a user space application. Something in the lines of
> > > Solaar (github pwr/solaar) or libratbag (there's an issue open to
> > > support keyboards) or even a specific application built for the
> > > purpose. Anyways, please collect the input from Benjamin and Jiri
> > > as
> > > they as they best placed to advise than myself.
> >
> > On top of what Nestor said, this type of functionality, if we want
> > to
> > have them in the kernel should probably be integrated in
> > hid-logitech-hidpp, in order not having some magic reports to send.
> >
> > Things like reconnect of the device would be handled far more
> > easily
> > in hid-logitech-hidpp while you would be reinventing the wheel
> > here.
> >
> > One other thing I do not like in this submission of the driver is
> > the
> > direct use of USB while we have a full transport agnostic layer
> > called
> > HID.
>
> Fair enough, I didn't have a look at how hid-logitech-hidpp is
> working
> yet. I'll dig into that to see if this driver can me implemented more
> elegantly.
I had a closer look at how the HID layer is interacting with the USB
layer. And as far as I understand, the only way to send a message to
the USB control endpoint from the HID layer is through the
hid_submit_ctrl function in drivers/hid/usbhid/hid-core.c, which does
this:
usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir;
usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT :
HID_REQ_GET_REPORT;
usbhid->cr->wValue = cpu_to_le16(((report->type + 1) << 8) |
report->id);
usbhid->cr->wIndex = cpu_to_le16(usbhid->ifnum);
usbhid->cr->wLength = cpu_to_le16(len);
dbg_hid("submitting ctrl urb: %s wValue=0x%04x wIndex=0x%04x
wLength=%u\n",
usbhid->cr->bRequest == HID_REQ_SET_REPORT ? "Set_Report" :
"Get_Report",
usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength);
r = usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC);
While this is probably fine for most HID devices, some devices (like
the Logitech K290) need to receive a vendor specific request directly
adressed to the device (i.e bRequestType = USB_TYPE_VENDOR |
USB_RECIPE_DEVICE). While in the hid_submit_ctrl function, the
bRequestType is hardcoded to USB_TYPE_CLASS | USB_RECIP_INTERFACE.
So it looks like the mechanism used by Logitech to allow switching its
K290 keyboard behavior is not HID compliant and requires to forge a
custom USB request.
Apparently this keyboard is not the only device that requires the same
kind of custom USB requests. If we look at the hid-elo driver, the
same usb_control_msg calls are performed in elo_smartset_send_get:
return usb_control_msg(dev, pipe, command,
dir | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, 0, data, ELO_SMARTSET_PACKET_SIZE,
ELO_SMARTSET_CMD_TIMEOUT);
and in elo_flush_smartset_responses:
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
ELO_FLUSH_SMARTSET_RESPONSES,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
So far, I don't think that it's feasible to send the control message
required to toggle the keyboard behavior from the HID layer, though I'd
be glad to have your thoughts.
Regards,
Florent Flament
^ permalink raw reply
* Re: [PATCH] HID: hid-ntrig: use true and false for boolean values
From: Gustavo A. R. Silva @ 2018-03-06 16:50 UTC (permalink / raw)
To: Jiri Kosina, Gustavo A. R. Silva
Cc: Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <nycvar.YFH.7.76.1803061519430.15778@cbobk.fhfr.pm>
Hi Jiri,
On 03/06/2018 08:20 AM, Jiri Kosina wrote:
> On Mon, 5 Mar 2018, Gustavo A. R. Silva wrote:
>
>> Assign true or false to boolean variables instead of an integer value.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> I've commited this (and the hid-multitouch variant of it as well) to
> for-4.17/upstream.
>
Good to know.
Thanks
--
Gustavo
^ permalink raw reply
* Re: [PATCH 1/1] HID: core: rewrite the hid-generic automatic unbind
From: Jiri Kosina @ 2018-03-06 15:03 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: open list:HID CORE LAYER, lkml
In-Reply-To: <CAO-hwJJGvaT5_5NW9u0zgJ=d+s0vHF6TOiNN--PzHq5e281Frw@mail.gmail.com>
On Tue, 6 Mar 2018, Benjamin Tissoires wrote:
> > We actually can have the unbind/rebind logic in hid-core.c, leaving
> > only the match function in hid-generic.
> > This makes hid-generic simpler and the whole logic simpler too.
> >
> > Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > ---
> >
> > Hi Jiri,
> >
> > while trying to find out a local bug, I figured out we don't really
> > need the bus_add_driver and bus_removed_driver callbacks.
> >
> > This makes the code simpler and also allows other drivers to remove
> > themself if other conditions are met. They just need to implement a smart
> > enough .matchcallback and they are done.
> >
>
> Looks like you are reviewing HID patches right now :)
Indeed! :)
> I just wanted to dig this one out from your mailbox. I still think
> it's valuable.
> IIRC it should still apply on your tree, but if not, I can quickly
> update the patch.
Ah, thanks for a friendly ping! This really slipped in between cracks.
Applied now.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH 1/1] HID: core: rewrite the hid-generic automatic unbind
From: Benjamin Tissoires @ 2018-03-06 14:21 UTC (permalink / raw)
To: Jiri Kosina; +Cc: open list:HID CORE LAYER, lkml, Benjamin Tissoires
In-Reply-To: <20171208142944.15695-1-benjamin.tissoires@redhat.com>
Hi Jiri,
On Fri, Dec 8, 2017 at 3:29 PM, Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
> We actually can have the unbind/rebind logic in hid-core.c, leaving
> only the match function in hid-generic.
> This makes hid-generic simpler and the whole logic simpler too.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>
> Hi Jiri,
>
> while trying to find out a local bug, I figured out we don't really
> need the bus_add_driver and bus_removed_driver callbacks.
>
> This makes the code simpler and also allows other drivers to remove
> themself if other conditions are met. They just need to implement a smart
> enough .matchcallback and they are done.
>
Looks like you are reviewing HID patches right now :)
I just wanted to dig this one out from your mailbox. I still think
it's valuable.
IIRC it should still apply on your tree, but if not, I can quickly
update the patch.
Cheers,
Benjamin
> drivers/hid/hid-core.c | 35 ++++++++++++++++++++++++-----------
> drivers/hid/hid-generic.c | 33 ---------------------------------
> include/linux/hid.h | 4 ----
> 3 files changed, 24 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index c2560aae5542..c058bb911ca1 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2197,31 +2197,40 @@ void hid_destroy_device(struct hid_device *hdev)
> EXPORT_SYMBOL_GPL(hid_destroy_device);
>
>
> -static int __bus_add_driver(struct device_driver *drv, void *data)
> +static int __hid_bus_reprobe_drivers(struct device *dev, void *data)
> {
> - struct hid_driver *added_hdrv = data;
> - struct hid_driver *hdrv = to_hid_driver(drv);
> + struct hid_driver *hdrv = data;
> + struct hid_device *hdev = to_hid_device(dev);
>
> - if (hdrv->bus_add_driver)
> - hdrv->bus_add_driver(added_hdrv);
> + if (hdev->driver == hdrv &&
> + !hdrv->match(hdev, hid_ignore_special_drivers))
> + return device_reprobe(dev);
>
> return 0;
> }
>
> -static int __bus_removed_driver(struct device_driver *drv, void *data)
> +static int __hid_bus_driver_added(struct device_driver *drv, void *data)
> {
> - struct hid_driver *removed_hdrv = data;
> struct hid_driver *hdrv = to_hid_driver(drv);
>
> - if (hdrv->bus_removed_driver)
> - hdrv->bus_removed_driver(removed_hdrv);
> + if (hdrv->match) {
> + bus_for_each_dev(&hid_bus_type, NULL, hdrv,
> + __hid_bus_reprobe_drivers);
> + }
>
> return 0;
> }
>
> +static int __bus_removed_driver(struct device_driver *drv, void *data)
> +{
> + return bus_rescan_devices(&hid_bus_type);
> +}
> +
> int __hid_register_driver(struct hid_driver *hdrv, struct module *owner,
> const char *mod_name)
> {
> + int ret;
> +
> hdrv->driver.name = hdrv->name;
> hdrv->driver.bus = &hid_bus_type;
> hdrv->driver.owner = owner;
> @@ -2230,9 +2239,13 @@ int __hid_register_driver(struct hid_driver *hdrv, struct module *owner,
> INIT_LIST_HEAD(&hdrv->dyn_list);
> spin_lock_init(&hdrv->dyn_lock);
>
> - bus_for_each_drv(&hid_bus_type, NULL, hdrv, __bus_add_driver);
> + ret = driver_register(&hdrv->driver);
> +
> + if (ret == 0)
> + bus_for_each_drv(&hid_bus_type, NULL, NULL,
> + __hid_bus_driver_added);
>
> - return driver_register(&hdrv->driver);
> + return ret;
> }
> EXPORT_SYMBOL_GPL(__hid_register_driver);
>
> diff --git a/drivers/hid/hid-generic.c b/drivers/hid/hid-generic.c
> index 3c0a1bf433d7..c25b4718de44 100644
> --- a/drivers/hid/hid-generic.c
> +++ b/drivers/hid/hid-generic.c
> @@ -26,37 +26,6 @@
>
> static struct hid_driver hid_generic;
>
> -static int __unmap_hid_generic(struct device *dev, void *data)
> -{
> - struct hid_driver *hdrv = data;
> - struct hid_device *hdev = to_hid_device(dev);
> -
> - /* only unbind matching devices already bound to hid-generic */
> - if (hdev->driver != &hid_generic ||
> - hid_match_device(hdev, hdrv) == NULL)
> - return 0;
> -
> - if (dev->parent) /* Needed for USB */
> - device_lock(dev->parent);
> - device_release_driver(dev);
> - if (dev->parent)
> - device_unlock(dev->parent);
> -
> - return 0;
> -}
> -
> -static void hid_generic_add_driver(struct hid_driver *hdrv)
> -{
> - bus_for_each_dev(&hid_bus_type, NULL, hdrv, __unmap_hid_generic);
> -}
> -
> -static void hid_generic_removed_driver(struct hid_driver *hdrv)
> -{
> - int ret;
> -
> - ret = driver_attach(&hid_generic.driver);
> -}
> -
> static int __check_hid_generic(struct device_driver *drv, void *data)
> {
> struct hid_driver *hdrv = to_hid_driver(drv);
> @@ -97,8 +66,6 @@ static struct hid_driver hid_generic = {
> .name = "hid-generic",
> .id_table = hid_table,
> .match = hid_generic_match,
> - .bus_add_driver = hid_generic_add_driver,
> - .bus_removed_driver = hid_generic_removed_driver,
> };
> module_hid_driver(hid_generic);
>
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 091a81cf330f..a62ee4a609ac 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -686,8 +686,6 @@ struct hid_usage_id {
> * @input_mapped: invoked on input registering after mapping an usage
> * @input_configured: invoked just before the device is registered
> * @feature_mapping: invoked on feature registering
> - * @bus_add_driver: invoked when a HID driver is about to be added
> - * @bus_removed_driver: invoked when a HID driver has been removed
> * @suspend: invoked on suspend (NULL means nop)
> * @resume: invoked on resume if device was not reset (NULL means nop)
> * @reset_resume: invoked on resume if device was reset (NULL means nop)
> @@ -742,8 +740,6 @@ struct hid_driver {
> void (*feature_mapping)(struct hid_device *hdev,
> struct hid_field *field,
> struct hid_usage *usage);
> - void (*bus_add_driver)(struct hid_driver *driver);
> - void (*bus_removed_driver)(struct hid_driver *driver);
> #ifdef CONFIG_PM
> int (*suspend)(struct hid_device *hdev, pm_message_t message);
> int (*resume)(struct hid_device *hdev);
> --
> 2.14.3
>
^ permalink raw reply
* Re: [PATCH] HID: hid-ntrig: use true and false for boolean values
From: Jiri Kosina @ 2018-03-06 14:20 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Benjamin Tissoires, linux-input, linux-kernel,
Gustavo A. R. Silva
In-Reply-To: <20180306000624.GA2680@embeddedgus>
On Mon, 5 Mar 2018, Gustavo A. R. Silva wrote:
> Assign true or false to boolean variables instead of an integer value.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
I've commited this (and the hid-multitouch variant of it as well) to
for-4.17/upstream.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: logitech-hidpp: document sysfs interface
From: Jiri Kosina @ 2018-03-06 14:18 UTC (permalink / raw)
To: Aishwarya Pant
Cc: Benjamin Tissoires, linux-input, linux-kernel, Jonathan Corbet,
Greg KH, Julia Lawall, linux-doc
In-Reply-To: <20180302131653.GA24934@mordor.localdomain>
On Fri, 2 Mar 2018, Aishwarya Pant wrote:
> Descriptions have been collected from git commit logs.
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ 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