* [PATCH v5 3/3] cap11xx: support for irq-active-high option
From: Matt Ranostay @ 2014-10-10 4:23 UTC (permalink / raw)
To: dmitry.torokhov, galak, zonque; +Cc: linux-input, devicetree, Matt Ranostay
In-Reply-To: <1412914983-3742-1-git-send-email-mranostay@gmail.com>
Some applications need to use the irq-active-high push-pull option.
This allows it be enabled in the device tree child node.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
Documentation/devicetree/bindings/input/cap11xx.txt | 4 ++++
drivers/input/keyboard/cap11xx.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt
index 8031aa5..57407be 100644
--- a/Documentation/devicetree/bindings/input/cap11xx.txt
+++ b/Documentation/devicetree/bindings/input/cap11xx.txt
@@ -28,6 +28,10 @@ Optional properties:
Valid values are 1, 2, 4, and 8.
By default, a gain of 1 is set.
+ microchip,irq-active-high: By default the interrupt pin is active low
+ open drain. This property allows using the active
+ high push-pull output.
+
linux,keycodes: Specifies an array of numeric keycode values to
be used for the channels. If this property is
omitted, KEY_A, KEY_B, etc are used as
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index b605134..a75b8fc 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -45,6 +45,7 @@
#define CAP11XX_REG_STANDBY_SENSITIVITY 0x42
#define CAP11XX_REG_STANDBY_THRESH 0x43
#define CAP11XX_REG_CONFIG2 0x44
+#define CAP11XX_REG_CONFIG2_ALT_POL BIT(6)
#define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X))
#define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X))
#define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9
@@ -255,6 +256,13 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
+ if (of_property_read_bool(node, "microchip,irq-active-high")) {
+ error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2,
+ CAP11XX_REG_CONFIG2_ALT_POL, 0);
+ if (error)
+ return error;
+ }
+
/* Provide some useful defaults */
for (i = 0; i < priv->num_channels; i++)
priv->keycodes[i] = KEY_A + i;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH RESEND RESEND] Input: evdev - add event-mask API
From: David Herrmann @ 2014-10-10 8:28 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: open list:HID CORE LAYER, Peter Hutterer, Benjamin Tissoires
In-Reply-To: <20141009225256.GA8583@dtor-ws>
Hi
On Fri, Oct 10, 2014 at 12:52 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi David,
>
> On Sun, Sep 28, 2014 at 12:19:39PM +0200, David Herrmann wrote:
>> Ping?
>
> Sorry for the delay.
>
>>
>> On Wed, Aug 13, 2014 at 9:16 AM, David Herrmann <dh.herrmann@gmail.com> wrote:
>> > Hardware manufacturers group keys in the weirdest way possible. This may
>> > cause a power-key to be grouped together with normal keyboard keys and
>> > thus be reported on the same kernel interface.
>> >
>> > However, user-space is often only interested in specific sets of events.
>> > For instance, daemons dealing with system-reboot (like systemd-logind)
>> > listen for KEY_POWER, but are not interested in any main keyboard keys.
>> > Usually, power keys are reported via separate interfaces, however,
>> > some i8042 boards report it in the AT matrix. To avoid waking up those
>> > system daemons on each key-press, we had two ideas:
>> > - split off KEY_POWER into a separate interface unconditionally
>> > - allow filtering a specific set of events on evdev FDs
>> >
>> > Splitting of KEY_POWER is a rather weird way to deal with this and may
>> > break backwards-compatibility. It is also specific to KEY_POWER and might
>> > be required for other stuff, too. Moreover, we might end up with a huge
>> > set of input-devices just to have them properly split.
>> >
>> > Hence, this patchset implements the second idea: An event-mask to specify
>> > which events you're interested in. Two ioctls allow setting this mask for
>> > each event-type. If not set, all events are reported. The type==0 entry is
>> > used same as in EVIOCGBIT to set the actual EV_* mask of filtered events.
>> > This way, you have a two-level filter.
>> >
>> > We are heavily forward-compatible to new event-types and event-codes. So
>> > new user-space will be able to run on an old kernel which doesn't know the
>> > given event-codes or event-types.
>> >
>> > Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
>> > Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
>> > ---
>> > Hi Dmitry
>> >
>> > We could really make use of this for SUSPEND/POWER key handling. We keep getting
>> > reports from people where those keys are reported as part of the main keyboard.
>> > It's really annoying if we have to wake up those processes for *every*
>> > key-press.
>> >
>> > In case you just need time to review it, let me know. Otherwise, I will keep
>> > resending it as people ask me for it all the time.
>> >
>> > Thanks
>> > David
>> >
>> > drivers/input/evdev.c | 156 ++++++++++++++++++++++++++++++++++++++++++++-
>> > include/uapi/linux/input.h | 56 ++++++++++++++++
>> > 2 files changed, 210 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
>> > index fd325ec..6386882 100644
>> > --- a/drivers/input/evdev.c
>> > +++ b/drivers/input/evdev.c
>> > @@ -51,10 +51,130 @@ struct evdev_client {
>> > struct list_head node;
>> > int clkid;
>> > bool revoked;
>> > + unsigned long *evmasks[EV_CNT];
>> > unsigned int bufsize;
>> > struct input_event buffer[];
>> > };
>> >
>> > +static size_t evdev_get_mask_cnt(unsigned int type)
>> > +{
>> > + static size_t counts[EV_CNT] = {
>> > + /* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */
>> > + [EV_SYN] = EV_CNT,
>> > + [EV_KEY] = KEY_CNT,
>> > + [EV_REL] = REL_CNT,
>> > + [EV_ABS] = ABS_CNT,
>> > + [EV_MSC] = MSC_CNT,
>> > + [EV_SW] = SW_CNT,
>> > + [EV_LED] = LED_CNT,
>> > + [EV_SND] = SND_CNT,
>> > + [EV_FF] = FF_CNT,
>> > + };
>> > +
>> > + return (type < EV_CNT) ? counts[type] : 0;
>> > +}
>> > +
>> > +/* must be called with evdev-mutex held */
>> > +static int evdev_set_mask(struct evdev_client *client,
>> > + unsigned int type,
>> > + const void __user *codes,
>> > + u32 codes_size)
>> > +{
>> > + unsigned long flags, *mask, *oldmask;
>> > + size_t cnt, size;
>> > +
>> > + /* unknown masks are simply ignored for forward-compat */
>> > + cnt = evdev_get_mask_cnt(type);
>> > + if (!cnt)
>> > + return 0;
>> > +
>> > + /* we allow 'codes_size > size' for forward-compat */
>> > + size = sizeof(unsigned long) * BITS_TO_LONGS(cnt);
>> > +
>> > + mask = kzalloc(size, GFP_KERNEL);
>> > + if (!mask)
>> > + return -ENOMEM;
>> > +
>> > + if (copy_from_user(mask, codes, min_t(size_t, codes_size, size))) {
>> > + kfree(mask);
>> > + return -EFAULT;
>> > + }
>> > +
>> > + spin_lock_irqsave(&client->buffer_lock, flags);
>> > + oldmask = client->evmasks[type];
>> > + client->evmasks[type] = mask;
>> > + spin_unlock_irqrestore(&client->buffer_lock, flags);
>> > +
>> > + kfree(oldmask);
>> > +
>> > + return 0;
>> > +}
>> > +
>> > +/* must be called with evdev-mutex held */
>> > +static int evdev_get_mask(struct evdev_client *client,
>> > + unsigned int type,
>> > + void __user *codes,
>> > + u32 codes_size)
>> > +{
>> > + unsigned long *mask;
>> > + size_t cnt, size, min, i;
>> > + u8 __user *out;
>> > +
>> > + /* we allow unknown types and 'codes_size > size' for forward-compat */
>> > + cnt = evdev_get_mask_cnt(type);
>> > + size = sizeof(unsigned long) * BITS_TO_LONGS(cnt);
>> > + min = min_t(size_t, codes_size, size);
>> > +
>> > + if (cnt > 0) {
>> > + mask = client->evmasks[type];
>> > + if (mask) {
>> > + if (copy_to_user(codes, mask, min))
>> > + return -EFAULT;
>
> I do not think this will work on big-endian setups with 64 bit kernel
> and 32 bits userspace. We already have bits_to_user(), we shoudl use
> them here. And I guess we need bits_from_user() to fetch bits from
> userspace into kernel.
Nice catch. You're right, I will switch to bits_to_user().
I fixed some typos in your changes below and merged them. Will send v2
after I booted it.
Thanks!
David
> I also tried changing verbage on the ioctls, see if you agree with the
> changes and if so please incorporate in your next version.
>
> Thanks.
>
> --
> Dmitry
>
> diff -u b/drivers/input/evdev.c b/drivers/input/evdev.c
> --- b/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -71,7 +71,7 @@
> [EV_FF] = FF_CNT,
> };
>
> - return (type < EV_CNT) ? counts[type] : 0;
> + return type < EV_CNT ? counts[type] : 0;
> }
>
> /* must be called with evdev-mutex held */
> @@ -132,7 +132,7 @@
> return -EFAULT;
> } else {
> /* fake mask with all bits set */
> - out = (u8 __user*)codes;
> + out = (u8 __user *)codes;
> for (i = 0; i < min; ++i) {
> if (put_user((u8)0xff, out + i))
> return -EFAULT;
> diff -u b/include/uapi/linux/input.h b/include/uapi/linux/input.h
> --- b/include/uapi/linux/input.h
> +++ b/include/uapi/linux/input.h
> @@ -161,53 +161,59 @@
> #define EVIOCREVOKE _IOW('E', 0x91, int) /* Revoke device access */
>
> /**
> - * EVIOCGMASK - Retrieve current event-mask
> + * EVIOCGMASK - Retrieve current event mask
> *
> - * This retrieves the current event-mask for a specific event-type. The
> - * argument must be of type "struct input_mask" and specifies the event-type to
> - * query, the receive buffer and the size of the receive buffer.
> - *
> - * The event-mask is a per-client mask that specifies which events are forwarded
> - * to the client. Each event-code is represented by a single bit in the
> - * event-mask. If the bit is set, the event is passed to the client normally.
> - * Otherwise, the event is filtered and and will never be queued on the
> - * client's receive buffer.
> - * Event-masks do not affect global state of an input-device. They only affect
> - * the open-file they're applied on. Each open-file (i.e, file-description) can
> - * have a different event-mask.
> - *
> - * The default event-mask for a client has all bits set, i.e. all events are
> - * forwarded to the client. If a kernel is queried for an unknown event-type
> - * or if the receive buffer is larger than the number of event-codes known to
> - * the kernel, the kernel returns all zeroes for those codes.
> + * This ioctl allows user to retrieve the current event mask for specific
> + * event type. The argument must be of type "struct input_mask" and
> + * specifies the event type to query, the address of the receive buffer and
> + * the size of the receive buffer.
> + *
> + * The event mask is a per-client mask that specifies which events are
> + * forwarded to the client. Each event code is represented by a single bit
> + * in the event mask. If the bit is set, the event is passed to the client
> + * normally. Otherwise, the event is filtered and will never be queued on
> + * the client's receive buffer.
> + *
> + * Event masks do not affect global state of the input device. They only
> + * affect the file descriptor they are applied to.
> + *
> + * The default event mask for a client has all bits set, i.e. all events
> + * are forwarded to the client. If kernel is queried for an unknown
> + * event type or if the receive buffer is larger than the number of
> + * event codes known to the kernel, the kernel returns all zeroes for those
> + * codes.
> *
> * At maximum, codes_size bytes are copied.
> *
> - * This ioctl may fail with ENODEV in case the file is revoked, EFAULT
> - * if the receive-buffer points to invalid memory, or EINVAL if the kernel
> - * does not implement the ioctl.
> + * This ioctl may fail with ENODEV in case the descriptor is revoked,
> + * EFAULT if the receive buffer points to invalid memory, or EINVAL if the
> + * kernel does not implement the ioctl.
> */
> +
> #define EVIOCGMASK _IOR('E', 0x92, struct input_mask) /* Get event-masks */
>
> /**
> - * EVIOCSMASK - Set event-mask
> + * EVIOCSMASK - Set event mask
> *
> - * This is the counterpart to EVIOCGMASK. Instead of receiving the current
> - * event-mask, this changes the client's event-mask for a specific type. See
> - * EVIOCGMASK for a description of event-masks and the argument-type.
> - *
> - * This ioctl provides full forward-compatibility. If the passed event-type is
> - * unknown to the kernel, or if the number of codes is bigger than known to the
> - * kernel, the ioctl is still accepted and applied. However, any unknown codes
> - * are left untouched and stay cleared. That means, the kernel always filters
> - * unknown codes regardless of what the client requests.
> - * If the new mask doesn't cover all known event-codes, all remaining codes are
> - * automatically cleared and thus filtered.
> + * This ioctl is the counterpart to EVIOCGMASK. Instead of receiving the
> + * current event mask, this changes the client's event mask for a specific
> + * type. See EVIOCGMASK for a description of event-masks and the
> + * argument-type.
> + *
> + * This ioctl provides full forward compatibility. If the passed event type
> + * is unknown to the kernel, or if the number of event codes specified in
> + * the mask is bigger than what is known to the kernel, the ioctl is still
> + * accepted and applied. However, any unknown codes are left untouched and
> + * stay cleared. That means, the kernel always filters unknown codes
> + * regardless of what the client requests. If the new mask doesn't cover
> + * all known event-codes, all remaining codes are automatically cleared and
> + * thus filtered.
> *
> * This ioctl may fail with ENODEV in case the file is revoked. EFAULT is
> - * returned if the receive-buffer points to invalid memory. EINVAL is returned
> - * if the kernel does not implement the ioctl.
> + * returned if the receive-buffer points to invalid memory. EINVAL is
> + * returned if the kernel does not implement the ioctl.
> */
> +
> #define EVIOCSMASK _IOW('E', 0x93, struct input_mask) /* Set event-masks */
>
> #define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */
^ permalink raw reply
* Re: [PATCH 0/3] input: tsc2007: Extend for pre-calibration, flipping and rotation
From: Belisko Marek @ 2014-10-10 9:28 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland,
ijc+devicetree@hellion.org.uk, Kumar Gala, Benoit Cousson,
Tony Lindgren, Russell King - ARM Linux, Dmitry Torokhov
Cc: Dr. H. Nikolaus Schaller, devicetree@vger.kernel.org, LKML,
linux-omap@vger.kernel.org, linux-arm-kernel, linux-input,
Marek Belisko
In-Reply-To: <1412108254-19234-1-git-send-email-marek@goldelico.com>
Ping. Any objections? Thanks
On Tue, Sep 30, 2014 at 10:17 PM, Marek Belisko <marek@goldelico.com> wrote:
> Following series add support to tsc2007 touchscreen driver for pre-calibration,
> flipping and rotation. Added bindings are documented and used in gta04 device tree.
>
> Marek Belisko (3):
> input: tsc2007: Add pre-calibration, flipping and rotation
> Documentation: dt: input: tsc2007: Document new parameters
> arm: dts: omap3-gta04: Extend touchscreen configs
>
> .../bindings/input/touchscreen/tsc2007.txt | 17 ++++-
> arch/arm/boot/dts/omap3-gta04.dtsi | 6 ++
> drivers/input/touchscreen/tsc2007.c | 89 +++++++++++++++++++++-
> include/linux/i2c/tsc2007.h | 6 ++
> 4 files changed, 111 insertions(+), 7 deletions(-)
>
> --
> 1.9.3
>
BR,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
^ permalink raw reply
* Re: [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params
From: Jiri Kosina @ 2014-10-10 11:30 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Henrik Rydberg, Hans de Goede, David Herrmann,
Benjamin Tissoires, linux-kernel
In-Reply-To: <20141008165425.GA23281@dtor-ws>
On Wed, 8 Oct 2014, Dmitry Torokhov wrote:
> Let's automatically set EV_ABS bit in device's event type list when calling
> input_set_abs_params() so that drivers do not have to do it explicitly.
>
> These calls are never in a hot paths so we won't lose much time by setting
> the same bit several times.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Makes sense.
Acked-by: Jiri Kosina <jkosina@suse.cz>
Thanks.
> ---
> drivers/input/input.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 29ca0bb..d2e06cc 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -498,7 +498,8 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
> absinfo->fuzz = fuzz;
> absinfo->flat = flat;
>
> - dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
> + __set_bit(EV_ABS, dev->evbit);
> + __set_bit(axis, dev->absbit);
> }
> EXPORT_SYMBOL(input_set_abs_params);
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v5 2/3] cap11xx: Add support for various cap11xx devices
From: Dmitry Torokhov @ 2014-10-10 17:29 UTC (permalink / raw)
To: Matt Ranostay; +Cc: galak, zonque, linux-input, devicetree
In-Reply-To: <1412914983-3742-3-git-send-email-mranostay@gmail.com>
Hi Matt,
On Thu, Oct 09, 2014 at 09:23:02PM -0700, Matt Ranostay wrote:
> @@ -63,7 +60,25 @@ struct cap11xx_priv {
> struct input_dev *idev;
>
> /* config */
> - unsigned short keycodes[CAP11XX_NUM_CHN];
> + unsigned int num_channels;
> + u32 keycodes[];
Any particular reason you decided to keep num_channels field givfen that
the same data is accessible through priv->idev->keycodemax?
Thanks.
--
Dmitry
^ permalink raw reply
* [PATCH] Input: i8042 - disable active multiplexing by default
From: Dmitry Torokhov @ 2014-10-10 20:51 UTC (permalink / raw)
Cc: Linus Torvalds, Vojtech Pavlik, Hans de Goede, Jiri Kosina,
linux-kernel, linux-input
Active multiplexing is a nice feature as it allows several pointing devices
(such as touchpad and external mouse) use their native protocols at the
same time. Unfortunately many manufacturers do not implement the feature
properly even though they advertise it. The problematic implementations are
never fixed, since Windows by default does not use this mode, and move from
one BIOS/model of laptop to another. When active multiplexing is broken
turning it on usually results in touchpad, keyboard, or both unresponsive.
With PS/2 usage on decline (most of PS/2 devices in use nowadays are
internal laptop touchpads), I expect number of users who have laptops with
working MUX implementation, docking stations with external PS/2 ports, and
who are still using external PS/2 mice, to be rather small. Let's flip the
default to be OFF and allow activating it through i8042.nomux=0 kernel
option. We'll also keep DMI table where we can record known good models.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Documentation/kernel-parameters.txt | 2 +-
drivers/input/serio/i8042-x86ia64io.h | 281 +---------------------------------
drivers/input/serio/i8042.c | 2 +-
3 files changed, 10 insertions(+), 275 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 10d51c2..6b10543 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1237,7 +1237,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
i8042.noloop [HW] Disable the AUX Loopback command while probing
for the AUX port
i8042.nomux [HW] Don't check presence of an active multiplexing
- controller
+ controller. Default: true.
i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
controllers
i8042.notimeout [HW] Ignore timeout condition signalled by controller
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 40b7d6c..75409ab 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -201,282 +201,17 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
};
/*
- * Some Fujitsu notebooks are having trouble with touchpads if
- * active multiplexing mode is activated. Luckily they don't have
- * external PS/2 ports so we can safely disable it.
- * ... apparently some Toshibas don't like MUX mode either and
- * die horrible death on reboot.
+ * Some laptops do increment active multiplexing mode correctly;
+ * unfortunately they are in minority.
*/
-static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
- {
- /* Fujitsu Lifebook P7010/P7010D */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
- },
- },
- {
- /* Fujitsu Lifebook P7010 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
- DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
- },
- },
- {
- /* Fujitsu Lifebook P5020D */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
- },
- },
- {
- /* Fujitsu Lifebook S2000 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
- },
- },
- {
- /* Fujitsu Lifebook S6230 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
- },
- },
- {
- /* Fujitsu T70H */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
- },
- },
- {
- /* Fujitsu-Siemens Lifebook T3010 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
- DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
- },
- },
- {
- /* Fujitsu-Siemens Lifebook E4010 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
- DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
- },
- },
- {
- /* Fujitsu-Siemens Amilo Pro 2010 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
- DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
- },
- },
- {
- /* Fujitsu-Siemens Amilo Pro 2030 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
- DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
- },
- },
- {
- /*
- * No data is coming from the touchscreen unless KBC
- * is in legacy mode.
- */
- /* Panasonic CF-29 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
- DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
- },
- },
- {
- /*
- * HP Pavilion DV4017EA -
- * errors on MUX ports are reported without raising AUXDATA
- * causing "spurious NAK" messages.
- */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
- },
- },
- {
- /*
- * HP Pavilion ZT1000 -
- * like DV4017EA does not raise AUXERR for errors on MUX ports.
- */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
- },
- },
- {
- /*
- * HP Pavilion DV4270ca -
- * like DV4017EA does not raise AUXERR for errors on MUX ports.
- */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
- },
- },
- {
- /* Sharp Actius MM20 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
- },
- },
- {
- /* Sony Vaio FS-115b */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
- },
- },
+static const struct dmi_system_id __initconst i8042_dmi_mux_table[] = {
{
/*
- * Sony Vaio FZ-240E -
- * reset and GET ID commands issued via KBD port are
- * sometimes being delivered to AUX3.
+ * Panasonic CF-18 needs to be in MUX mode since the
+ * touchscreen is on serio3 and it also has touchpad.
*/
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
- },
- },
- {
- /*
- * Most (all?) VAIOs do not have external PS/2 ports nor
- * they implement active multiplexing properly, and
- * MUX discovery usually messes up keyboard/touchpad.
- */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
- },
- },
- {
- /* Amoi M636/A737 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
- DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
- },
- },
- {
- /* Lenovo 3000 n100 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
- DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
- },
- },
- {
- /* Acer Aspire 5710 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
- },
- },
- {
- /* Gericom Bellagio */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
- DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
- },
- },
- {
- /* IBM 2656 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
- },
- },
- {
- /* Dell XPS M1530 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
- },
- },
- {
- /* Compal HEL80I */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
- },
- },
- {
- /* Dell Vostro 1510 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
- },
- },
- {
- /* Acer Aspire 5536 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
- },
- },
- {
- /* Dell Vostro V13 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
- },
- },
- {
- /* Newer HP Pavilion dv4 models */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
- },
- },
- {
- /* Asus X450LCP */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
- DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
- },
- },
- {
- /* Avatar AVIU-145A6 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
- DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
},
},
{ }
@@ -999,8 +734,8 @@ static int __init i8042_platform_init(void)
if (dmi_check_system(i8042_dmi_noloop_table))
i8042_noloop = true;
- if (dmi_check_system(i8042_dmi_nomux_table))
- i8042_nomux = true;
+ if (dmi_check_system(i8042_dmi_mux_table))
+ i8042_nomux = false;
if (dmi_check_system(i8042_dmi_notimeout_table))
i8042_notimeout = true;
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index f5a98af..9a97c2b 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -39,7 +39,7 @@ static bool i8042_noaux;
module_param_named(noaux, i8042_noaux, bool, 0);
MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port.");
-static bool i8042_nomux;
+static bool i8042_nomux = true;
module_param_named(nomux, i8042_nomux, bool, 0);
MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing controller is present.");
--
2.1.0.rc2.206.gedb03e5
--
Dmitry
^ permalink raw reply related
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Jiri Kosina @ 2014-10-10 20:59 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Linus Torvalds, Vojtech Pavlik, Hans de Goede,
linux-kernel
In-Reply-To: <20141010205131.GA3271@dtor-ws>
On Fri, 10 Oct 2014, Dmitry Torokhov wrote:
> Active multiplexing is a nice feature as it allows several pointing devices
> (such as touchpad and external mouse) use their native protocols at the
> same time. Unfortunately many manufacturers do not implement the feature
> properly even though they advertise it. The problematic implementations are
> never fixed, since Windows by default does not use this mode, and move from
> one BIOS/model of laptop to another. When active multiplexing is broken
> turning it on usually results in touchpad, keyboard, or both unresponsive.
>
> With PS/2 usage on decline (most of PS/2 devices in use nowadays are
> internal laptop touchpads), I expect number of users who have laptops with
> working MUX implementation, docking stations with external PS/2 ports, and
> who are still using external PS/2 mice, to be rather small. Let's flip the
> default to be OFF and allow activating it through i8042.nomux=0 kernel
> option. We'll also keep DMI table where we can record known good models.
Being responsible for introducing a non-trivial portion of
i8042_dmi_nomux_table[] entries:
Acked-by: Jiri Kosina <jkosina@suse.cz>
If nothing else, it'd make my life easier :)
[ ... snip ... ]
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index f5a98af..9a97c2b 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -39,7 +39,7 @@ static bool i8042_noaux;
> module_param_named(noaux, i8042_noaux, bool, 0);
> MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port.");
>
> -static bool i8042_nomux;
> +static bool i8042_nomux = true;
Hmmm ... perhaps if we want to be really friendly, we should warn (and I
definitely don't mean WARN(), but rather pr_info() or something) if we
encounter that the cmdline contains 'i8042.nomux=1'.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Dmitry Torokhov @ 2014-10-10 21:02 UTC (permalink / raw)
To: Jiri Kosina
Cc: linux-input, Linus Torvalds, Vojtech Pavlik, Hans de Goede,
linux-kernel
In-Reply-To: <alpine.LNX.2.00.1410102252480.31343@pobox.suse.cz>
On Fri, Oct 10, 2014 at 10:59:19PM +0200, Jiri Kosina wrote:
> On Fri, 10 Oct 2014, Dmitry Torokhov wrote:
>
> > Active multiplexing is a nice feature as it allows several pointing devices
> > (such as touchpad and external mouse) use their native protocols at the
> > same time. Unfortunately many manufacturers do not implement the feature
> > properly even though they advertise it. The problematic implementations are
> > never fixed, since Windows by default does not use this mode, and move from
> > one BIOS/model of laptop to another. When active multiplexing is broken
> > turning it on usually results in touchpad, keyboard, or both unresponsive.
> >
> > With PS/2 usage on decline (most of PS/2 devices in use nowadays are
> > internal laptop touchpads), I expect number of users who have laptops with
> > working MUX implementation, docking stations with external PS/2 ports, and
> > who are still using external PS/2 mice, to be rather small. Let's flip the
> > default to be OFF and allow activating it through i8042.nomux=0 kernel
> > option. We'll also keep DMI table where we can record known good models.
>
> Being responsible for introducing a non-trivial portion of
> i8042_dmi_nomux_table[] entries:
>
> Acked-by: Jiri Kosina <jkosina@suse.cz>
>
> If nothing else, it'd make my life easier :)
>
> [ ... snip ... ]
> > diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> > index f5a98af..9a97c2b 100644
> > --- a/drivers/input/serio/i8042.c
> > +++ b/drivers/input/serio/i8042.c
> > @@ -39,7 +39,7 @@ static bool i8042_noaux;
> > module_param_named(noaux, i8042_noaux, bool, 0);
> > MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port.");
> >
> > -static bool i8042_nomux;
> > +static bool i8042_nomux = true;
>
> Hmmm ... perhaps if we want to be really friendly, we should warn (and I
> definitely don't mean WARN(), but rather pr_info() or something) if we
> encounter that the cmdline contains 'i8042.nomux=1'.
Warn about what? That they do not need this option anymore? They might
if they downgrade the kernel. I would not bother...
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v5 2/3] cap11xx: Add support for various cap11xx devices
From: Matt Ranostay @ 2014-10-10 21:06 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Kumar Gala, Daniel Mack, linux-input, devicetree@vger.kernel.org
In-Reply-To: <20141010172952.GA32974@dtor-ws>
No just an oversight..
Thanks,
Matt
On Fri, Oct 10, 2014 at 10:29 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Matt,
>
> On Thu, Oct 09, 2014 at 09:23:02PM -0700, Matt Ranostay wrote:
>> @@ -63,7 +60,25 @@ struct cap11xx_priv {
>> struct input_dev *idev;
>>
>> /* config */
>> - unsigned short keycodes[CAP11XX_NUM_CHN];
>> + unsigned int num_channels;
>> + u32 keycodes[];
>
> Any particular reason you decided to keep num_channels field givfen that
> the same data is accessible through priv->idev->keycodemax?
>
> Thanks.
>
> --
> Dmitry
^ permalink raw reply
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Dave Jones @ 2014-10-10 21:18 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Linus Torvalds, Vojtech Pavlik, Hans de Goede,
Jiri Kosina, linux-kernel
In-Reply-To: <20141010205131.GA3271@dtor-ws>
On Fri, Oct 10, 2014 at 01:51:31PM -0700, Dmitry Torokhov wrote:
> /*
> - * Some Fujitsu notebooks are having trouble with touchpads if
> - * active multiplexing mode is activated. Luckily they don't have
> - * external PS/2 ports so we can safely disable it.
> - * ... apparently some Toshibas don't like MUX mode either and
> - * die horrible death on reboot.
> + * Some laptops do increment active multiplexing mode correctly;
> + * unfortunately they are in minority.
> */
s/increment/implement/ ?
Dave
^ permalink raw reply
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Dmitry Torokhov @ 2014-10-10 21:22 UTC (permalink / raw)
To: Dave Jones, linux-input, Linus Torvalds, Vojtech Pavlik,
Hans de Goede, Jiri Kosina, linux-kernel
In-Reply-To: <20141010211827.GA26222@redhat.com>
On Fri, Oct 10, 2014 at 05:18:27PM -0400, Dave Jones wrote:
> On Fri, Oct 10, 2014 at 01:51:31PM -0700, Dmitry Torokhov wrote:
>
> > /*
> > - * Some Fujitsu notebooks are having trouble with touchpads if
> > - * active multiplexing mode is activated. Luckily they don't have
> > - * external PS/2 ports so we can safely disable it.
> > - * ... apparently some Toshibas don't like MUX mode either and
> > - * die horrible death on reboot.
> > + * Some laptops do increment active multiplexing mode correctly;
> > + * unfortunately they are in minority.
> > */
>
> s/increment/implement/ ?
Thanks Dave, I'll fix it up.
--
Dmitry
^ permalink raw reply
* Re: Elan TS driver patch
From: 'Dmitry Torokhov' @ 2014-10-10 22:11 UTC (permalink / raw)
To: ELAN 劉嘉駿
Cc: linux-input, bleung, 'Charles Mooney',
'Jeff.Chuang', '梁博翔'
In-Reply-To: <006001cfe294$13720370$3a560a50$@emc.com.tw>
Hi Scott,
On Wed, Oct 08, 2014 at 09:06:20AM +0800, ELAN 劉嘉駿 wrote:
> Hi Dmitry:
> Thank for reply. Please let me know if anything needs we do.
What is the part name/number of this touchscreen. As the example with
touchpad shown us device tree folks are not happy with the generic
"i2c_touchpad" or "elants_i2c" and would rather we used proper model
number in bindings.
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v6 0/3] cap1106: add support for cap11xx variants
From: Matt Ranostay @ 2014-10-11 5:06 UTC (permalink / raw)
To: dmitry.torokhov, galak, zonque; +Cc: linux-input, devicetree, Matt Ranostay
Changes from v5:
* Removed redundant num_channel from the private structure
Matt Ranostay (3):
cap11xx: make driver generic for variant support
cap11xx: Add support for various cap11xx devices
cap11xx: support for irq-active-high option
.../devicetree/bindings/input/cap1106.txt | 53 ---
.../devicetree/bindings/input/cap11xx.txt | 59 ++++
drivers/input/keyboard/Kconfig | 8 +-
drivers/input/keyboard/Makefile | 2 +-
drivers/input/keyboard/cap1106.c | 341 -------------------
drivers/input/keyboard/cap11xx.c | 366 +++++++++++++++++++++
6 files changed, 430 insertions(+), 399 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/cap1106.txt
create mode 100644 Documentation/devicetree/bindings/input/cap11xx.txt
delete mode 100644 drivers/input/keyboard/cap1106.c
create mode 100644 drivers/input/keyboard/cap11xx.c
--
1.9.1
^ permalink raw reply
* [PATCH v6 1/3] cap11xx: make driver generic for variant support
From: Matt Ranostay @ 2014-10-11 5:06 UTC (permalink / raw)
To: dmitry.torokhov, galak, zonque; +Cc: linux-input, devicetree, Matt Ranostay
In-Reply-To: <1413004014-23807-1-git-send-email-mranostay@gmail.com>
cap1106 driver can support much more one device make the driver
generic for support of similar parts.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
.../devicetree/bindings/input/cap1106.txt | 53 ----
.../devicetree/bindings/input/cap11xx.txt | 54 ++++
drivers/input/keyboard/Kconfig | 8 +-
drivers/input/keyboard/Makefile | 2 +-
drivers/input/keyboard/cap1106.c | 341 ---------------------
drivers/input/keyboard/cap11xx.c | 340 ++++++++++++++++++++
6 files changed, 399 insertions(+), 399 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/cap1106.txt
create mode 100644 Documentation/devicetree/bindings/input/cap11xx.txt
delete mode 100644 drivers/input/keyboard/cap1106.c
create mode 100644 drivers/input/keyboard/cap11xx.c
diff --git a/Documentation/devicetree/bindings/input/cap1106.txt b/Documentation/devicetree/bindings/input/cap1106.txt
deleted file mode 100644
index 4b46390..0000000
--- a/Documentation/devicetree/bindings/input/cap1106.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-Device tree bindings for Microchip CAP1106, 6 channel capacitive touch sensor
-
-The node for this driver must be a child of a I2C controller node, as the
-device communication via I2C only.
-
-Required properties:
-
- compatible: Must be "microchip,cap1106"
-
- reg: The I2C slave address of the device.
- Only 0x28 is valid.
-
- interrupts: Property describing the interrupt line the
- device's ALERT#/CM_IRQ# pin is connected to.
- The device only has one interrupt source.
-
-Optional properties:
-
- autorepeat: Enables the Linux input system's autorepeat
- feature on the input device.
-
- microchip,sensor-gain: Defines the gain of the sensor circuitry. This
- effectively controls the sensitivity, as a
- smaller delta capacitance is required to
- generate the same delta count values.
- Valid values are 1, 2, 4, and 8.
- By default, a gain of 1 is set.
-
- linux,keycodes: Specifies an array of numeric keycode values to
- be used for the channels. If this property is
- omitted, KEY_A, KEY_B, etc are used as
- defaults. The array must have exactly six
- entries.
-
-Example:
-
-i2c_controller {
- cap1106@28 {
- compatible = "microchip,cap1106";
- interrupt-parent = <&gpio1>;
- interrupts = <0 0>;
- reg = <0x28>;
- autorepeat;
- microchip,sensor-gain = <2>;
-
- linux,keycodes = <103 /* KEY_UP */
- 106 /* KEY_RIGHT */
- 108 /* KEY_DOWN */
- 105 /* KEY_LEFT */
- 109 /* KEY_PAGEDOWN */
- 104>; /* KEY_PAGEUP */
- };
-}
diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt
new file mode 100644
index 0000000..738f5f3
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/cap11xx.txt
@@ -0,0 +1,54 @@
+Device tree bindings for Microchip CAP1106 based capacitive touch sensor
+
+The node for this driver must be a child of a I2C controller node, as the
+device communication via I2C only.
+
+Required properties:
+
+ compatible: Must be on the following, depending on the model:
+ "microchip,cap1106"
+
+ reg: The I2C slave address of the device.
+ Only 0x28 is valid.
+
+ interrupts: Property describing the interrupt line the
+ device's ALERT#/CM_IRQ# pin is connected to.
+ The device only has one interrupt source.
+
+Optional properties:
+
+ autorepeat: Enables the Linux input system's autorepeat
+ feature on the input device.
+
+ microchip,sensor-gain: Defines the gain of the sensor circuitry. This
+ effectively controls the sensitivity, as a
+ smaller delta capacitance is required to
+ generate the same delta count values.
+ Valid values are 1, 2, 4, and 8.
+ By default, a gain of 1 is set.
+
+ linux,keycodes: Specifies an array of numeric keycode values to
+ be used for the channels. If this property is
+ omitted, KEY_A, KEY_B, etc are used as
+ defaults. The array must have exactly six
+ entries.
+
+Example:
+
+i2c_controller {
+ cap1106@28 {
+ compatible = "microchip,cap1106";
+ interrupt-parent = <&gpio1>;
+ interrupts = <0 0>;
+ reg = <0x28>;
+ autorepeat;
+ microchip,sensor-gain = <2>;
+
+ linux,keycodes = <103 /* KEY_UP */
+ 106 /* KEY_RIGHT */
+ 108 /* KEY_DOWN */
+ 105 /* KEY_LEFT */
+ 109 /* KEY_PAGEDOWN */
+ 104>; /* KEY_PAGEUP */
+ };
+}
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index a3958c6..96ee26c 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -665,14 +665,14 @@ config KEYBOARD_CROS_EC
To compile this driver as a module, choose M here: the
module will be called cros_ec_keyb.
-config KEYBOARD_CAP1106
- tristate "Microchip CAP1106 touch sensor"
+config KEYBOARD_CAP11XX
+ tristate "Microchip CAP11XX based touch sensors"
depends on OF && I2C
select REGMAP_I2C
help
- Say Y here to enable the CAP1106 touch sensor driver.
+ Say Y here to enable the CAP11XX touch sensor driver.
To compile this driver as a module, choose M here: the
- module will be called cap1106.
+ module will be called cap11xx.
endif
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 0a33456..febafa5 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
-obj-$(CONFIG_KEYBOARD_CAP1106) += cap1106.o
+obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c
deleted file mode 100644
index d70b65a..0000000
--- a/drivers/input/keyboard/cap1106.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Input driver for Microchip CAP1106, 6 channel capacitive touch sensor
- *
- * http://www.microchip.com/wwwproducts/Devices.aspx?product=CAP1106
- *
- * (c) 2014 Daniel Mack <linux@zonque.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/of_irq.h>
-#include <linux/regmap.h>
-#include <linux/i2c.h>
-#include <linux/gpio/consumer.h>
-
-#define CAP1106_REG_MAIN_CONTROL 0x00
-#define CAP1106_REG_MAIN_CONTROL_GAIN_SHIFT (6)
-#define CAP1106_REG_MAIN_CONTROL_GAIN_MASK (0xc0)
-#define CAP1106_REG_MAIN_CONTROL_DLSEEP BIT(4)
-#define CAP1106_REG_GENERAL_STATUS 0x02
-#define CAP1106_REG_SENSOR_INPUT 0x03
-#define CAP1106_REG_NOISE_FLAG_STATUS 0x0a
-#define CAP1106_REG_SENOR_DELTA(X) (0x10 + (X))
-#define CAP1106_REG_SENSITIVITY_CONTROL 0x1f
-#define CAP1106_REG_CONFIG 0x20
-#define CAP1106_REG_SENSOR_ENABLE 0x21
-#define CAP1106_REG_SENSOR_CONFIG 0x22
-#define CAP1106_REG_SENSOR_CONFIG2 0x23
-#define CAP1106_REG_SAMPLING_CONFIG 0x24
-#define CAP1106_REG_CALIBRATION 0x26
-#define CAP1106_REG_INT_ENABLE 0x27
-#define CAP1106_REG_REPEAT_RATE 0x28
-#define CAP1106_REG_MT_CONFIG 0x2a
-#define CAP1106_REG_MT_PATTERN_CONFIG 0x2b
-#define CAP1106_REG_MT_PATTERN 0x2d
-#define CAP1106_REG_RECALIB_CONFIG 0x2f
-#define CAP1106_REG_SENSOR_THRESH(X) (0x30 + (X))
-#define CAP1106_REG_SENSOR_NOISE_THRESH 0x38
-#define CAP1106_REG_STANDBY_CHANNEL 0x40
-#define CAP1106_REG_STANDBY_CONFIG 0x41
-#define CAP1106_REG_STANDBY_SENSITIVITY 0x42
-#define CAP1106_REG_STANDBY_THRESH 0x43
-#define CAP1106_REG_CONFIG2 0x44
-#define CAP1106_REG_SENSOR_BASE_CNT(X) (0x50 + (X))
-#define CAP1106_REG_SENSOR_CALIB (0xb1 + (X))
-#define CAP1106_REG_SENSOR_CALIB_LSB1 0xb9
-#define CAP1106_REG_SENSOR_CALIB_LSB2 0xba
-#define CAP1106_REG_PRODUCT_ID 0xfd
-#define CAP1106_REG_MANUFACTURER_ID 0xfe
-#define CAP1106_REG_REVISION 0xff
-
-#define CAP1106_NUM_CHN 6
-#define CAP1106_PRODUCT_ID 0x55
-#define CAP1106_MANUFACTURER_ID 0x5d
-
-struct cap1106_priv {
- struct regmap *regmap;
- struct input_dev *idev;
-
- /* config */
- unsigned short keycodes[CAP1106_NUM_CHN];
-};
-
-static const struct reg_default cap1106_reg_defaults[] = {
- { CAP1106_REG_MAIN_CONTROL, 0x00 },
- { CAP1106_REG_GENERAL_STATUS, 0x00 },
- { CAP1106_REG_SENSOR_INPUT, 0x00 },
- { CAP1106_REG_NOISE_FLAG_STATUS, 0x00 },
- { CAP1106_REG_SENSITIVITY_CONTROL, 0x2f },
- { CAP1106_REG_CONFIG, 0x20 },
- { CAP1106_REG_SENSOR_ENABLE, 0x3f },
- { CAP1106_REG_SENSOR_CONFIG, 0xa4 },
- { CAP1106_REG_SENSOR_CONFIG2, 0x07 },
- { CAP1106_REG_SAMPLING_CONFIG, 0x39 },
- { CAP1106_REG_CALIBRATION, 0x00 },
- { CAP1106_REG_INT_ENABLE, 0x3f },
- { CAP1106_REG_REPEAT_RATE, 0x3f },
- { CAP1106_REG_MT_CONFIG, 0x80 },
- { CAP1106_REG_MT_PATTERN_CONFIG, 0x00 },
- { CAP1106_REG_MT_PATTERN, 0x3f },
- { CAP1106_REG_RECALIB_CONFIG, 0x8a },
- { CAP1106_REG_SENSOR_THRESH(0), 0x40 },
- { CAP1106_REG_SENSOR_THRESH(1), 0x40 },
- { CAP1106_REG_SENSOR_THRESH(2), 0x40 },
- { CAP1106_REG_SENSOR_THRESH(3), 0x40 },
- { CAP1106_REG_SENSOR_THRESH(4), 0x40 },
- { CAP1106_REG_SENSOR_THRESH(5), 0x40 },
- { CAP1106_REG_SENSOR_NOISE_THRESH, 0x01 },
- { CAP1106_REG_STANDBY_CHANNEL, 0x00 },
- { CAP1106_REG_STANDBY_CONFIG, 0x39 },
- { CAP1106_REG_STANDBY_SENSITIVITY, 0x02 },
- { CAP1106_REG_STANDBY_THRESH, 0x40 },
- { CAP1106_REG_CONFIG2, 0x40 },
- { CAP1106_REG_SENSOR_CALIB_LSB1, 0x00 },
- { CAP1106_REG_SENSOR_CALIB_LSB2, 0x00 },
-};
-
-static bool cap1106_volatile_reg(struct device *dev, unsigned int reg)
-{
- switch (reg) {
- case CAP1106_REG_MAIN_CONTROL:
- case CAP1106_REG_SENSOR_INPUT:
- case CAP1106_REG_SENOR_DELTA(0):
- case CAP1106_REG_SENOR_DELTA(1):
- case CAP1106_REG_SENOR_DELTA(2):
- case CAP1106_REG_SENOR_DELTA(3):
- case CAP1106_REG_SENOR_DELTA(4):
- case CAP1106_REG_SENOR_DELTA(5):
- case CAP1106_REG_PRODUCT_ID:
- case CAP1106_REG_MANUFACTURER_ID:
- case CAP1106_REG_REVISION:
- return true;
- }
-
- return false;
-}
-
-static const struct regmap_config cap1106_regmap_config = {
- .reg_bits = 8,
- .val_bits = 8,
-
- .max_register = CAP1106_REG_REVISION,
- .reg_defaults = cap1106_reg_defaults,
-
- .num_reg_defaults = ARRAY_SIZE(cap1106_reg_defaults),
- .cache_type = REGCACHE_RBTREE,
- .volatile_reg = cap1106_volatile_reg,
-};
-
-static irqreturn_t cap1106_thread_func(int irq_num, void *data)
-{
- struct cap1106_priv *priv = data;
- unsigned int status;
- int ret, i;
-
- /*
- * Deassert interrupt. This needs to be done before reading the status
- * registers, which will not carry valid values otherwise.
- */
- ret = regmap_update_bits(priv->regmap, CAP1106_REG_MAIN_CONTROL, 1, 0);
- if (ret < 0)
- goto out;
-
- ret = regmap_read(priv->regmap, CAP1106_REG_SENSOR_INPUT, &status);
- if (ret < 0)
- goto out;
-
- for (i = 0; i < CAP1106_NUM_CHN; i++)
- input_report_key(priv->idev, priv->keycodes[i],
- status & (1 << i));
-
- input_sync(priv->idev);
-
-out:
- return IRQ_HANDLED;
-}
-
-static int cap1106_set_sleep(struct cap1106_priv *priv, bool sleep)
-{
- return regmap_update_bits(priv->regmap, CAP1106_REG_MAIN_CONTROL,
- CAP1106_REG_MAIN_CONTROL_DLSEEP,
- sleep ? CAP1106_REG_MAIN_CONTROL_DLSEEP : 0);
-}
-
-static int cap1106_input_open(struct input_dev *idev)
-{
- struct cap1106_priv *priv = input_get_drvdata(idev);
-
- return cap1106_set_sleep(priv, false);
-}
-
-static void cap1106_input_close(struct input_dev *idev)
-{
- struct cap1106_priv *priv = input_get_drvdata(idev);
-
- cap1106_set_sleep(priv, true);
-}
-
-static int cap1106_i2c_probe(struct i2c_client *i2c_client,
- const struct i2c_device_id *id)
-{
- struct device *dev = &i2c_client->dev;
- struct cap1106_priv *priv;
- struct device_node *node;
- int i, error, irq, gain = 0;
- unsigned int val, rev;
- u32 gain32, keycodes[CAP1106_NUM_CHN];
-
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
- if (!priv)
- return -ENOMEM;
-
- priv->regmap = devm_regmap_init_i2c(i2c_client, &cap1106_regmap_config);
- if (IS_ERR(priv->regmap))
- return PTR_ERR(priv->regmap);
-
- error = regmap_read(priv->regmap, CAP1106_REG_PRODUCT_ID, &val);
- if (error)
- return error;
-
- if (val != CAP1106_PRODUCT_ID) {
- dev_err(dev, "Product ID: Got 0x%02x, expected 0x%02x\n",
- val, CAP1106_PRODUCT_ID);
- return -ENODEV;
- }
-
- error = regmap_read(priv->regmap, CAP1106_REG_MANUFACTURER_ID, &val);
- if (error)
- return error;
-
- if (val != CAP1106_MANUFACTURER_ID) {
- dev_err(dev, "Manufacturer ID: Got 0x%02x, expected 0x%02x\n",
- val, CAP1106_MANUFACTURER_ID);
- return -ENODEV;
- }
-
- error = regmap_read(priv->regmap, CAP1106_REG_REVISION, &rev);
- if (error < 0)
- return error;
-
- dev_info(dev, "CAP1106 detected, revision 0x%02x\n", rev);
- i2c_set_clientdata(i2c_client, priv);
- node = dev->of_node;
-
- if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
- if (is_power_of_2(gain32) && gain32 <= 8)
- gain = ilog2(gain32);
- else
- dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
- }
-
- BUILD_BUG_ON(ARRAY_SIZE(keycodes) != ARRAY_SIZE(priv->keycodes));
-
- /* Provide some useful defaults */
- for (i = 0; i < ARRAY_SIZE(keycodes); i++)
- keycodes[i] = KEY_A + i;
-
- of_property_read_u32_array(node, "linux,keycodes",
- keycodes, ARRAY_SIZE(keycodes));
-
- for (i = 0; i < ARRAY_SIZE(keycodes); i++)
- priv->keycodes[i] = keycodes[i];
-
- error = regmap_update_bits(priv->regmap, CAP1106_REG_MAIN_CONTROL,
- CAP1106_REG_MAIN_CONTROL_GAIN_MASK,
- gain << CAP1106_REG_MAIN_CONTROL_GAIN_SHIFT);
- if (error)
- return error;
-
- /* Disable autorepeat. The Linux input system has its own handling. */
- error = regmap_write(priv->regmap, CAP1106_REG_REPEAT_RATE, 0);
- if (error)
- return error;
-
- priv->idev = devm_input_allocate_device(dev);
- if (!priv->idev)
- return -ENOMEM;
-
- priv->idev->name = "CAP1106 capacitive touch sensor";
- priv->idev->id.bustype = BUS_I2C;
- priv->idev->evbit[0] = BIT_MASK(EV_KEY);
-
- if (of_property_read_bool(node, "autorepeat"))
- __set_bit(EV_REP, priv->idev->evbit);
-
- for (i = 0; i < CAP1106_NUM_CHN; i++)
- __set_bit(priv->keycodes[i], priv->idev->keybit);
-
- __clear_bit(KEY_RESERVED, priv->idev->keybit);
-
- priv->idev->keycode = priv->keycodes;
- priv->idev->keycodesize = sizeof(priv->keycodes[0]);
- priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
-
- priv->idev->id.vendor = CAP1106_MANUFACTURER_ID;
- priv->idev->id.product = CAP1106_PRODUCT_ID;
- priv->idev->id.version = rev;
-
- priv->idev->open = cap1106_input_open;
- priv->idev->close = cap1106_input_close;
-
- input_set_drvdata(priv->idev, priv);
-
- /*
- * Put the device in deep sleep mode for now.
- * ->open() will bring it back once the it is actually needed.
- */
- cap1106_set_sleep(priv, true);
-
- error = input_register_device(priv->idev);
- if (error)
- return error;
-
- irq = irq_of_parse_and_map(node, 0);
- if (!irq) {
- dev_err(dev, "Unable to parse or map IRQ\n");
- return -ENXIO;
- }
-
- error = devm_request_threaded_irq(dev, irq, NULL, cap1106_thread_func,
- IRQF_ONESHOT, dev_name(dev), priv);
- if (error)
- return error;
-
- return 0;
-}
-
-static const struct of_device_id cap1106_dt_ids[] = {
- { .compatible = "microchip,cap1106", },
- {}
-};
-MODULE_DEVICE_TABLE(of, cap1106_dt_ids);
-
-static const struct i2c_device_id cap1106_i2c_ids[] = {
- { "cap1106", 0 },
- {}
-};
-MODULE_DEVICE_TABLE(i2c, cap1106_i2c_ids);
-
-static struct i2c_driver cap1106_i2c_driver = {
- .driver = {
- .name = "cap1106",
- .owner = THIS_MODULE,
- .of_match_table = cap1106_dt_ids,
- },
- .id_table = cap1106_i2c_ids,
- .probe = cap1106_i2c_probe,
-};
-
-module_i2c_driver(cap1106_i2c_driver);
-
-MODULE_ALIAS("platform:cap1106");
-MODULE_DESCRIPTION("Microchip CAP1106 driver");
-MODULE_AUTHOR("Daniel Mack <linux@zonque.org>");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
new file mode 100644
index 0000000..0da2e83
--- /dev/null
+++ b/drivers/input/keyboard/cap11xx.c
@@ -0,0 +1,340 @@
+/*
+ * Input driver for Microchip CAP11xx based capacitive touch sensors
+ *
+ *
+ * (c) 2014 Daniel Mack <linux@zonque.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/of_irq.h>
+#include <linux/regmap.h>
+#include <linux/i2c.h>
+#include <linux/gpio/consumer.h>
+
+#define CAP11XX_REG_MAIN_CONTROL 0x00
+#define CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT (6)
+#define CAP11XX_REG_MAIN_CONTROL_GAIN_MASK (0xc0)
+#define CAP11XX_REG_MAIN_CONTROL_DLSEEP BIT(4)
+#define CAP11XX_REG_GENERAL_STATUS 0x02
+#define CAP11XX_REG_SENSOR_INPUT 0x03
+#define CAP11XX_REG_NOISE_FLAG_STATUS 0x0a
+#define CAP11XX_REG_SENOR_DELTA(X) (0x10 + (X))
+#define CAP11XX_REG_SENSITIVITY_CONTROL 0x1f
+#define CAP11XX_REG_CONFIG 0x20
+#define CAP11XX_REG_SENSOR_ENABLE 0x21
+#define CAP11XX_REG_SENSOR_CONFIG 0x22
+#define CAP11XX_REG_SENSOR_CONFIG2 0x23
+#define CAP11XX_REG_SAMPLING_CONFIG 0x24
+#define CAP11XX_REG_CALIBRATION 0x26
+#define CAP11XX_REG_INT_ENABLE 0x27
+#define CAP11XX_REG_REPEAT_RATE 0x28
+#define CAP11XX_REG_MT_CONFIG 0x2a
+#define CAP11XX_REG_MT_PATTERN_CONFIG 0x2b
+#define CAP11XX_REG_MT_PATTERN 0x2d
+#define CAP11XX_REG_RECALIB_CONFIG 0x2f
+#define CAP11XX_REG_SENSOR_THRESH(X) (0x30 + (X))
+#define CAP11XX_REG_SENSOR_NOISE_THRESH 0x38
+#define CAP11XX_REG_STANDBY_CHANNEL 0x40
+#define CAP11XX_REG_STANDBY_CONFIG 0x41
+#define CAP11XX_REG_STANDBY_SENSITIVITY 0x42
+#define CAP11XX_REG_STANDBY_THRESH 0x43
+#define CAP11XX_REG_CONFIG2 0x44
+#define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X))
+#define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X))
+#define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9
+#define CAP11XX_REG_SENSOR_CALIB_LSB2 0xba
+#define CAP11XX_REG_PRODUCT_ID 0xfd
+#define CAP11XX_REG_MANUFACTURER_ID 0xfe
+#define CAP11XX_REG_REVISION 0xff
+
+#define CAP11XX_NUM_CHN 6
+#define CAP11XX_PRODUCT_ID 0x55
+#define CAP11XX_MANUFACTURER_ID 0x5d
+
+struct cap11xx_priv {
+ struct regmap *regmap;
+ struct input_dev *idev;
+
+ /* config */
+ unsigned short keycodes[CAP11XX_NUM_CHN];
+};
+
+static const struct reg_default cap11xx_reg_defaults[] = {
+ { CAP11XX_REG_MAIN_CONTROL, 0x00 },
+ { CAP11XX_REG_GENERAL_STATUS, 0x00 },
+ { CAP11XX_REG_SENSOR_INPUT, 0x00 },
+ { CAP11XX_REG_NOISE_FLAG_STATUS, 0x00 },
+ { CAP11XX_REG_SENSITIVITY_CONTROL, 0x2f },
+ { CAP11XX_REG_CONFIG, 0x20 },
+ { CAP11XX_REG_SENSOR_ENABLE, 0x3f },
+ { CAP11XX_REG_SENSOR_CONFIG, 0xa4 },
+ { CAP11XX_REG_SENSOR_CONFIG2, 0x07 },
+ { CAP11XX_REG_SAMPLING_CONFIG, 0x39 },
+ { CAP11XX_REG_CALIBRATION, 0x00 },
+ { CAP11XX_REG_INT_ENABLE, 0x3f },
+ { CAP11XX_REG_REPEAT_RATE, 0x3f },
+ { CAP11XX_REG_MT_CONFIG, 0x80 },
+ { CAP11XX_REG_MT_PATTERN_CONFIG, 0x00 },
+ { CAP11XX_REG_MT_PATTERN, 0x3f },
+ { CAP11XX_REG_RECALIB_CONFIG, 0x8a },
+ { CAP11XX_REG_SENSOR_THRESH(0), 0x40 },
+ { CAP11XX_REG_SENSOR_THRESH(1), 0x40 },
+ { CAP11XX_REG_SENSOR_THRESH(2), 0x40 },
+ { CAP11XX_REG_SENSOR_THRESH(3), 0x40 },
+ { CAP11XX_REG_SENSOR_THRESH(4), 0x40 },
+ { CAP11XX_REG_SENSOR_THRESH(5), 0x40 },
+ { CAP11XX_REG_SENSOR_NOISE_THRESH, 0x01 },
+ { CAP11XX_REG_STANDBY_CHANNEL, 0x00 },
+ { CAP11XX_REG_STANDBY_CONFIG, 0x39 },
+ { CAP11XX_REG_STANDBY_SENSITIVITY, 0x02 },
+ { CAP11XX_REG_STANDBY_THRESH, 0x40 },
+ { CAP11XX_REG_CONFIG2, 0x40 },
+ { CAP11XX_REG_SENSOR_CALIB_LSB1, 0x00 },
+ { CAP11XX_REG_SENSOR_CALIB_LSB2, 0x00 },
+};
+
+static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case CAP11XX_REG_MAIN_CONTROL:
+ case CAP11XX_REG_SENSOR_INPUT:
+ case CAP11XX_REG_SENOR_DELTA(0):
+ case CAP11XX_REG_SENOR_DELTA(1):
+ case CAP11XX_REG_SENOR_DELTA(2):
+ case CAP11XX_REG_SENOR_DELTA(3):
+ case CAP11XX_REG_SENOR_DELTA(4):
+ case CAP11XX_REG_SENOR_DELTA(5):
+ case CAP11XX_REG_PRODUCT_ID:
+ case CAP11XX_REG_MANUFACTURER_ID:
+ case CAP11XX_REG_REVISION:
+ return true;
+ }
+
+ return false;
+}
+
+static const struct regmap_config cap11xx_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+
+ .max_register = CAP11XX_REG_REVISION,
+ .reg_defaults = cap11xx_reg_defaults,
+
+ .num_reg_defaults = ARRAY_SIZE(cap11xx_reg_defaults),
+ .cache_type = REGCACHE_RBTREE,
+ .volatile_reg = cap11xx_volatile_reg,
+};
+
+static irqreturn_t cap11xx_thread_func(int irq_num, void *data)
+{
+ struct cap11xx_priv *priv = data;
+ unsigned int status;
+ int ret, i;
+
+ /*
+ * Deassert interrupt. This needs to be done before reading the status
+ * registers, which will not carry valid values otherwise.
+ */
+ ret = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL, 1, 0);
+ if (ret < 0)
+ goto out;
+
+ ret = regmap_read(priv->regmap, CAP11XX_REG_SENSOR_INPUT, &status);
+ if (ret < 0)
+ goto out;
+
+ for (i = 0; i < CAP11XX_NUM_CHN; i++)
+ input_report_key(priv->idev, priv->keycodes[i],
+ status & (1 << i));
+
+ input_sync(priv->idev);
+
+out:
+ return IRQ_HANDLED;
+}
+
+static int cap11xx_set_sleep(struct cap11xx_priv *priv, bool sleep)
+{
+ return regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL,
+ CAP11XX_REG_MAIN_CONTROL_DLSEEP,
+ sleep ? CAP11XX_REG_MAIN_CONTROL_DLSEEP : 0);
+}
+
+static int cap11xx_input_open(struct input_dev *idev)
+{
+ struct cap11xx_priv *priv = input_get_drvdata(idev);
+
+ return cap11xx_set_sleep(priv, false);
+}
+
+static void cap11xx_input_close(struct input_dev *idev)
+{
+ struct cap11xx_priv *priv = input_get_drvdata(idev);
+
+ cap11xx_set_sleep(priv, true);
+}
+
+static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
+ const struct i2c_device_id *id)
+{
+ struct device *dev = &i2c_client->dev;
+ struct cap11xx_priv *priv;
+ struct device_node *node;
+ int i, error, irq, gain = 0;
+ unsigned int val, rev;
+ u32 gain32, keycodes[CAP11XX_NUM_CHN];
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->regmap = devm_regmap_init_i2c(i2c_client, &cap11xx_regmap_config);
+ if (IS_ERR(priv->regmap))
+ return PTR_ERR(priv->regmap);
+
+ error = regmap_read(priv->regmap, CAP11XX_REG_PRODUCT_ID, &val);
+ if (error)
+ return error;
+
+ if (val != CAP11XX_PRODUCT_ID) {
+ dev_err(dev, "Product ID: Got 0x%02x, expected 0x%02x\n",
+ val, CAP11XX_PRODUCT_ID);
+ return -ENODEV;
+ }
+
+ error = regmap_read(priv->regmap, CAP11XX_REG_MANUFACTURER_ID, &val);
+ if (error)
+ return error;
+
+ if (val != CAP11XX_MANUFACTURER_ID) {
+ dev_err(dev, "Manufacturer ID: Got 0x%02x, expected 0x%02x\n",
+ val, CAP11XX_MANUFACTURER_ID);
+ return -ENODEV;
+ }
+
+ error = regmap_read(priv->regmap, CAP11XX_REG_REVISION, &rev);
+ if (error < 0)
+ return error;
+
+ dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
+ i2c_set_clientdata(i2c_client, priv);
+ node = dev->of_node;
+
+ if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
+ if (is_power_of_2(gain32) && gain32 <= 8)
+ gain = ilog2(gain32);
+ else
+ dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
+ }
+
+ BUILD_BUG_ON(ARRAY_SIZE(keycodes) != ARRAY_SIZE(priv->keycodes));
+
+ /* Provide some useful defaults */
+ for (i = 0; i < ARRAY_SIZE(keycodes); i++)
+ keycodes[i] = KEY_A + i;
+
+ of_property_read_u32_array(node, "linux,keycodes",
+ keycodes, ARRAY_SIZE(keycodes));
+
+ for (i = 0; i < ARRAY_SIZE(keycodes); i++)
+ priv->keycodes[i] = keycodes[i];
+
+ error = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL,
+ CAP11XX_REG_MAIN_CONTROL_GAIN_MASK,
+ gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT);
+ if (error)
+ return error;
+
+ /* Disable autorepeat. The Linux input system has its own handling. */
+ error = regmap_write(priv->regmap, CAP11XX_REG_REPEAT_RATE, 0);
+ if (error)
+ return error;
+
+ priv->idev = devm_input_allocate_device(dev);
+ if (!priv->idev)
+ return -ENOMEM;
+
+ priv->idev->name = "CAP11XX capacitive touch sensor";
+ priv->idev->id.bustype = BUS_I2C;
+ priv->idev->evbit[0] = BIT_MASK(EV_KEY);
+
+ if (of_property_read_bool(node, "autorepeat"))
+ __set_bit(EV_REP, priv->idev->evbit);
+
+ for (i = 0; i < CAP11XX_NUM_CHN; i++)
+ __set_bit(priv->keycodes[i], priv->idev->keybit);
+
+ __clear_bit(KEY_RESERVED, priv->idev->keybit);
+
+ priv->idev->keycode = priv->keycodes;
+ priv->idev->keycodesize = sizeof(priv->keycodes[0]);
+ priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
+
+ priv->idev->id.vendor = CAP11XX_MANUFACTURER_ID;
+ priv->idev->id.product = CAP11XX_PRODUCT_ID;
+ priv->idev->id.version = rev;
+
+ priv->idev->open = cap11xx_input_open;
+ priv->idev->close = cap11xx_input_close;
+
+ input_set_drvdata(priv->idev, priv);
+
+ /*
+ * Put the device in deep sleep mode for now.
+ * ->open() will bring it back once the it is actually needed.
+ */
+ cap11xx_set_sleep(priv, true);
+
+ error = input_register_device(priv->idev);
+ if (error)
+ return error;
+
+ irq = irq_of_parse_and_map(node, 0);
+ if (!irq) {
+ dev_err(dev, "Unable to parse or map IRQ\n");
+ return -ENXIO;
+ }
+
+ error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
+ IRQF_ONESHOT, dev_name(dev), priv);
+ if (error)
+ return error;
+
+ return 0;
+}
+
+static const struct of_device_id cap11xx_dt_ids[] = {
+ { .compatible = "microchip,cap1106", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
+
+static const struct i2c_device_id cap11xx_i2c_ids[] = {
+ { "cap1106", 0 },
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
+
+static struct i2c_driver cap11xx_i2c_driver = {
+ .driver = {
+ .name = "cap11xx",
+ .owner = THIS_MODULE,
+ .of_match_table = cap11xx_dt_ids,
+ },
+ .id_table = cap11xx_i2c_ids,
+ .probe = cap11xx_i2c_probe,
+};
+
+module_i2c_driver(cap11xx_i2c_driver);
+
+MODULE_ALIAS("platform:cap11xx");
+MODULE_DESCRIPTION("Microchip CAP11XX driver");
+MODULE_AUTHOR("Daniel Mack <linux@zonque.org>");
+MODULE_LICENSE("GPL v2");
--
1.9.1
^ permalink raw reply related
* [PATCH v6 2/3] cap11xx: Add support for various cap11xx devices
From: Matt Ranostay @ 2014-10-11 5:06 UTC (permalink / raw)
To: dmitry.torokhov, galak, zonque; +Cc: linux-input, devicetree, Matt Ranostay
In-Reply-To: <1413004014-23807-1-git-send-email-mranostay@gmail.com>
Several other variants of the cap11xx device exists with a varying
number of capacitance detection channels. Add support for creating
the channels dynamically.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
.../devicetree/bindings/input/cap11xx.txt | 3 +-
drivers/input/keyboard/cap11xx.c | 62 ++++++++++++++--------
2 files changed, 42 insertions(+), 23 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt
index 738f5f3..8031aa5 100644
--- a/Documentation/devicetree/bindings/input/cap11xx.txt
+++ b/Documentation/devicetree/bindings/input/cap11xx.txt
@@ -7,9 +7,10 @@ Required properties:
compatible: Must be on the following, depending on the model:
"microchip,cap1106"
+ "microchip,cap1126"
+ "microchip,cap1188"
reg: The I2C slave address of the device.
- Only 0x28 is valid.
interrupts: Property describing the interrupt line the
device's ALERT#/CM_IRQ# pin is connected to.
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 0da2e83..91effe5 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -1,7 +1,6 @@
/*
* Input driver for Microchip CAP11xx based capacitive touch sensors
*
- *
* (c) 2014 Daniel Mack <linux@zonque.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -54,8 +53,6 @@
#define CAP11XX_REG_MANUFACTURER_ID 0xfe
#define CAP11XX_REG_REVISION 0xff
-#define CAP11XX_NUM_CHN 6
-#define CAP11XX_PRODUCT_ID 0x55
#define CAP11XX_MANUFACTURER_ID 0x5d
struct cap11xx_priv {
@@ -63,7 +60,24 @@ struct cap11xx_priv {
struct input_dev *idev;
/* config */
- unsigned short keycodes[CAP11XX_NUM_CHN];
+ u32 keycodes[];
+};
+
+struct cap11xx_hw_model {
+ uint8_t product_id;
+ unsigned int num_channels;
+};
+
+enum {
+ CAP1106,
+ CAP1126,
+ CAP1188,
+};
+
+struct cap11xx_hw_model cap11xx_devices[] = {
+ [CAP1106] = { .product_id = 0x55, .num_channels = 6 },
+ [CAP1126] = { .product_id = 0x53, .num_channels = 6 },
+ [CAP1188] = { .product_id = 0x50, .num_channels = 8 },
};
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -150,7 +164,7 @@ static irqreturn_t cap11xx_thread_func(int irq_num, void *data)
if (ret < 0)
goto out;
- for (i = 0; i < CAP11XX_NUM_CHN; i++)
+ for (i = 0; i < priv->idev->keycodemax; i++)
input_report_key(priv->idev, priv->keycodes[i],
status & (1 << i));
@@ -187,14 +201,19 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
struct device *dev = &i2c_client->dev;
struct cap11xx_priv *priv;
struct device_node *node;
+ struct cap11xx_hw_model *cap = &cap11xx_devices[id->driver_data];
int i, error, irq, gain = 0;
unsigned int val, rev;
- u32 gain32, keycodes[CAP11XX_NUM_CHN];
+ u32 gain32;
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ priv = devm_kzalloc(dev,
+ sizeof(*priv) + cap->num_channels * sizeof(u32),
+ GFP_KERNEL);
if (!priv)
return -ENOMEM;
+ BUG_ON(!cap->num_channels);
+
priv->regmap = devm_regmap_init_i2c(i2c_client, &cap11xx_regmap_config);
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
@@ -203,9 +222,9 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
if (error)
return error;
- if (val != CAP11XX_PRODUCT_ID) {
+ if (val != cap->product_id) {
dev_err(dev, "Product ID: Got 0x%02x, expected 0x%02x\n",
- val, CAP11XX_PRODUCT_ID);
+ val, cap->product_id);
return -ENODEV;
}
@@ -234,17 +253,12 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
- BUILD_BUG_ON(ARRAY_SIZE(keycodes) != ARRAY_SIZE(priv->keycodes));
-
/* Provide some useful defaults */
- for (i = 0; i < ARRAY_SIZE(keycodes); i++)
- keycodes[i] = KEY_A + i;
+ for (i = 0; i < cap->num_channels; i++)
+ priv->keycodes[i] = KEY_A + i;
of_property_read_u32_array(node, "linux,keycodes",
- keycodes, ARRAY_SIZE(keycodes));
-
- for (i = 0; i < ARRAY_SIZE(keycodes); i++)
- priv->keycodes[i] = keycodes[i];
+ priv->keycodes, cap->num_channels);
error = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL,
CAP11XX_REG_MAIN_CONTROL_GAIN_MASK,
@@ -268,17 +282,17 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
if (of_property_read_bool(node, "autorepeat"))
__set_bit(EV_REP, priv->idev->evbit);
- for (i = 0; i < CAP11XX_NUM_CHN; i++)
+ for (i = 0; i < cap->num_channels; i++)
__set_bit(priv->keycodes[i], priv->idev->keybit);
__clear_bit(KEY_RESERVED, priv->idev->keybit);
priv->idev->keycode = priv->keycodes;
- priv->idev->keycodesize = sizeof(priv->keycodes[0]);
- priv->idev->keycodemax = ARRAY_SIZE(priv->keycodes);
+ priv->idev->keycodesize = sizeof(u32);
+ priv->idev->keycodemax = cap->num_channels;
priv->idev->id.vendor = CAP11XX_MANUFACTURER_ID;
- priv->idev->id.product = CAP11XX_PRODUCT_ID;
+ priv->idev->id.product = cap->product_id;
priv->idev->id.version = rev;
priv->idev->open = cap11xx_input_open;
@@ -312,12 +326,16 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
static const struct of_device_id cap11xx_dt_ids[] = {
{ .compatible = "microchip,cap1106", },
+ { .compatible = "microchip,cap1126", },
+ { .compatible = "microchip,cap1188", },
{}
};
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
static const struct i2c_device_id cap11xx_i2c_ids[] = {
- { "cap1106", 0 },
+ { "cap1106", CAP1106 },
+ { "cap1126", CAP1126 },
+ { "cap1188", CAP1188 },
{}
};
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
--
1.9.1
^ permalink raw reply related
* [PATCH v6 3/3] cap11xx: support for irq-active-high option
From: Matt Ranostay @ 2014-10-11 5:06 UTC (permalink / raw)
To: dmitry.torokhov, galak, zonque; +Cc: linux-input, devicetree, Matt Ranostay
In-Reply-To: <1413004014-23807-1-git-send-email-mranostay@gmail.com>
Some applications need to use the irq-active-high push-pull option.
This allows it be enabled in the device tree child node.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
Documentation/devicetree/bindings/input/cap11xx.txt | 4 ++++
drivers/input/keyboard/cap11xx.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt
index 8031aa5..57407be 100644
--- a/Documentation/devicetree/bindings/input/cap11xx.txt
+++ b/Documentation/devicetree/bindings/input/cap11xx.txt
@@ -28,6 +28,10 @@ Optional properties:
Valid values are 1, 2, 4, and 8.
By default, a gain of 1 is set.
+ microchip,irq-active-high: By default the interrupt pin is active low
+ open drain. This property allows using the active
+ high push-pull output.
+
linux,keycodes: Specifies an array of numeric keycode values to
be used for the channels. If this property is
omitted, KEY_A, KEY_B, etc are used as
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 91effe5..0ae7d2f 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -45,6 +45,7 @@
#define CAP11XX_REG_STANDBY_SENSITIVITY 0x42
#define CAP11XX_REG_STANDBY_THRESH 0x43
#define CAP11XX_REG_CONFIG2 0x44
+#define CAP11XX_REG_CONFIG2_ALT_POL BIT(6)
#define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X))
#define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X))
#define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9
@@ -253,6 +254,13 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
+ if (of_property_read_bool(node, "microchip,irq-active-high")) {
+ error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2,
+ CAP11XX_REG_CONFIG2_ALT_POL, 0);
+ if (error)
+ return error;
+ }
+
/* Provide some useful defaults */
for (i = 0; i < cap->num_channels; i++)
priv->keycodes[i] = KEY_A + i;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Hans de Goede @ 2014-10-11 9:12 UTC (permalink / raw)
To: Dmitry Torokhov, Dave Jones, linux-input, Linus Torvalds,
Vojtech Pavlik, Jiri Kosina, linux-kernel
In-Reply-To: <20141010212245.GB38320@dtor-ws>
Hi,
On 10/10/2014 11:22 PM, Dmitry Torokhov wrote:
> On Fri, Oct 10, 2014 at 05:18:27PM -0400, Dave Jones wrote:
>> On Fri, Oct 10, 2014 at 01:51:31PM -0700, Dmitry Torokhov wrote:
>>
>> > /*
>> > - * Some Fujitsu notebooks are having trouble with touchpads if
>> > - * active multiplexing mode is activated. Luckily they don't have
>> > - * external PS/2 ports so we can safely disable it.
>> > - * ... apparently some Toshibas don't like MUX mode either and
>> > - * die horrible death on reboot.
>> > + * Some laptops do increment active multiplexing mode correctly;
>> > + * unfortunately they are in minority.
>> > */
>>
>> s/increment/implement/ ?
>
> Thanks Dave, I'll fix it up.
The patch looks good to me, and with the above fixup is:
Acked-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
^ permalink raw reply
* [PATCH] i8042: Add noloop quirk for Asus X750LN
From: Hans de Goede @ 2014-10-11 13:09 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, Hans de Goede
Without this the aux port does not get detected, and consequently the touchpad
will not work.
https://bugzilla.redhat.com/show_bug.cgi?id=1110011
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/serio/i8042-x86ia64io.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 40b7d6c..4a6d05d 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -101,6 +101,12 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
},
{
.matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
+ },
+ },
+ {
+ .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
--
2.1.0
^ permalink raw reply related
* hid: roccat: Fix code style issues
From: hans.duedal @ 2014-10-11 15:01 UTC (permalink / raw)
To: erazor_de; +Cc: jkosina, linux-input, Hans Duedal
From: Hans Duedal <hans.duedal@gmail.com>
Missing whitespace, semi-colon after macro, and a duplicated out of
memory message.
Signed-off-by: Hans Duedal <hans.duedal@gmail.com>
---
drivers/hid/hid-roccat-kone.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index 6101816..c292650 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -46,6 +46,7 @@ static void kone_profile_activated(struct kone_device *kone, uint new_profile)
static void kone_profile_report(struct kone_device *kone, uint new_profile)
{
struct kone_roccat_report roccat_report;
+
roccat_report.event = kone_mouse_event_switch_profile;
roccat_report.value = new_profile;
roccat_report.key = 0;
@@ -163,6 +164,7 @@ static int kone_set_settings(struct usb_device *usb_dev,
struct kone_settings const *settings)
{
int retval;
+
retval = kone_send(usb_dev, kone_command_settings,
settings, sizeof(struct kone_settings));
if (retval)
@@ -387,7 +389,7 @@ static struct bin_attribute bin_attr_profile##number = { \
.read = kone_sysfs_read_profilex, \
.write = kone_sysfs_write_profilex, \
.private = &profile_numbers[number-1], \
-};
+}
PROFILE_ATTR(1);
PROFILE_ATTR(2);
PROFILE_ATTR(3);
@@ -456,6 +458,7 @@ static ssize_t kone_sysfs_show_tcu(struct device *dev,
static int kone_tcu_command(struct usb_device *usb_dev, int number)
{
unsigned char value;
+
value = number;
return kone_send(usb_dev, kone_command_calibrate, &value, 1);
}
@@ -697,10 +700,8 @@ static int kone_init_specials(struct hid_device *hdev)
== USB_INTERFACE_PROTOCOL_MOUSE) {
kone = kzalloc(sizeof(*kone), GFP_KERNEL);
- if (!kone) {
- hid_err(hdev, "can't alloc device descriptor\n");
+ if (!kone)
return -ENOMEM;
- }
hid_set_drvdata(hdev, kone);
retval = kone_init_kone_device_struct(usb_dev, kone);
--
1.9.3 (Apple Git-50)
^ permalink raw reply related
* Re: [PATCH] i8042: Add noloop quirk for Asus X750LN
From: Dmitry Torokhov @ 2014-10-11 18:35 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-input
In-Reply-To: <1413032946-19748-1-git-send-email-hdegoede@redhat.com>
On Sat, Oct 11, 2014 at 03:09:06PM +0200, Hans de Goede wrote:
> Without this the aux port does not get detected, and consequently the touchpad
> will not work.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1110011
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied, thank you.
> ---
> drivers/input/serio/i8042-x86ia64io.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
> index 40b7d6c..4a6d05d 100644
> --- a/drivers/input/serio/i8042-x86ia64io.h
> +++ b/drivers/input/serio/i8042-x86ia64io.h
> @@ -101,6 +101,12 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
> },
> {
> .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
> + },
> + },
> + {
> + .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
> DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
> DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
> --
> 2.1.0
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: i8042 - disable active multiplexing by default
From: Pavel Machek @ 2014-10-12 14:30 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Linus Torvalds, Vojtech Pavlik, Hans de Goede,
Jiri Kosina, linux-kernel
In-Reply-To: <20141010205131.GA3271@dtor-ws>
On Fri 2014-10-10 13:51:31, Dmitry Torokhov wrote:
> Active multiplexing is a nice feature as it allows several pointing devices
> (such as touchpad and external mouse) use their native protocols at the
> same time. Unfortunately many manufacturers do not implement the feature
> properly even though they advertise it. The problematic implementations are
> never fixed, since Windows by default does not use this mode, and move from
> one BIOS/model of laptop to another. When active multiplexing is broken
> turning it on usually results in touchpad, keyboard, or both unresponsive.
>
> With PS/2 usage on decline (most of PS/2 devices in use nowadays are
> internal laptop touchpads), I expect number of users who have laptops with
> working MUX implementation, docking stations with external PS/2 ports, and
> who are still using external PS/2 mice, to be rather small. Let's flip the
> default to be OFF and allow activating it through i8042.nomux=0 kernel
> option. We'll also keep DMI table where we can record known good models.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Could we keep the old default / blacklist for the old laptops? We did
something like that for ACPI, based on year of the bios.
Old laptops are not being made any more, so blacklist will not grow
too fast...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply
* Re: Elan TS driver patch
From: Scott @ 2014-10-12 15:22 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, bleung, Charles Mooney, Jeff.Chuang,
梁博翔
In-Reply-To: <20141010221137.GD38320@dtor-ws>
Hi Dmitry:
Dmitry Torokhov <dmitry.torokhov@gmail.com> 於 2014/10/11 上午6:11 寫道:
> Hi Scott,
>
> On Wed, Oct 08, 2014 at 09:06:20AM +0800, ELAN 劉嘉駿 wrote:
>> Hi Dmitry:
>> Thank for reply. Please let me know if anything needs we do.
>
> What is the part name/number of this touchscreen. As the example with
> touchpad shown us device tree folks are not happy with the generic
> "i2c_touchpad" or "elants_i2c" and would rather we used proper model
> number in bindings.
>
I would call this driver name as “Elan Large-Size Touchscreen”.
We (Elan) have two types of TS series internally, Large-size( > 10” ~ 20") and small-size ( <= 10”)
and this driver patch is for large size. thanks.
BR
Scott
> Thanks.
>
> --
> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v6 1/3] cap11xx: make driver generic for variant support
From: Mark Rutland @ 2014-10-13 11:12 UTC (permalink / raw)
To: Matt Ranostay
Cc: dmitry.torokhov@gmail.com, galak@codeaurora.org, zonque@gmail.com,
linux-input@vger.kernel.org, devicetree@vger.kernel.org
In-Reply-To: <1413004014-23807-2-git-send-email-mranostay@gmail.com>
On Sat, Oct 11, 2014 at 06:06:52AM +0100, Matt Ranostay wrote:
> cap1106 driver can support much more one device make the driver
> generic for support of similar parts.
>
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>
> ---
> .../devicetree/bindings/input/cap1106.txt | 53 ----
> .../devicetree/bindings/input/cap11xx.txt | 54 ++++
> drivers/input/keyboard/Kconfig | 8 +-
> drivers/input/keyboard/Makefile | 2 +-
> drivers/input/keyboard/cap1106.c | 341 ---------------------
> drivers/input/keyboard/cap11xx.c | 340 ++++++++++++++++++++
> 6 files changed, 399 insertions(+), 399 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/input/cap1106.txt
> create mode 100644 Documentation/devicetree/bindings/input/cap11xx.txt
> delete mode 100644 drivers/input/keyboard/cap1106.c
> create mode 100644 drivers/input/keyboard/cap11xx.c
[...]
> diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt
> new file mode 100644
> index 0000000..738f5f3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/cap11xx.txt
> @@ -0,0 +1,54 @@
> +Device tree bindings for Microchip CAP1106 based capacitive touch sensor
> +
> +The node for this driver must be a child of a I2C controller node, as the
s/driver/device/
> +device communication via I2C only.
> +
> +Required properties:
> +
> + compatible: Must be on the following, depending on the model:
Please change this to say "Must contain one of:"
The rest is implied by the usual semantics of the compatible property.
> + "microchip,cap1106"
> +
> + reg: The I2C slave address of the device.
> + Only 0x28 is valid.
> +
> + interrupts: Property describing the interrupt line the
> + device's ALERT#/CM_IRQ# pin is connected to.
> + The device only has one interrupt source.
> +
> +Optional properties:
> +
> + autorepeat: Enables the Linux input system's autorepeat
> + feature on the input device.
> +
> + microchip,sensor-gain: Defines the gain of the sensor circuitry. This
> + effectively controls the sensitivity, as a
> + smaller delta capacitance is required to
> + generate the same delta count values.
> + Valid values are 1, 2, 4, and 8.
> + By default, a gain of 1 is set.
> +
> + linux,keycodes: Specifies an array of numeric keycode values to
> + be used for the channels. If this property is
> + omitted, KEY_A, KEY_B, etc are used as
> + defaults. The array must have exactly six
> + entries.
> +
> +Example:
> +
> +i2c_controller {
> + cap1106@28 {
> + compatible = "microchip,cap1106";
> + interrupt-parent = <&gpio1>;
> + interrupts = <0 0>;
> + reg = <0x28>;
> + autorepeat;
> + microchip,sensor-gain = <2>;
> +
> + linux,keycodes = <103 /* KEY_UP */
> + 106 /* KEY_RIGHT */
> + 108 /* KEY_DOWN */
> + 105 /* KEY_LEFT */
> + 109 /* KEY_PAGEDOWN */
> + 104>; /* KEY_PAGEUP */
As we're moving this around anyway, please bracket this list entries
individually.
Thanks,
Mark.
^ permalink raw reply
* Re: [PATCH 2/4] Input: pmic8xxx-keypad - use regmap_field for register access
From: Mark Brown @ 2014-10-13 14:02 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Stephen Boyd, Srinivas Kandagatla, Ivan T. Ivanov, linux-input,
linux-kernel, linux-arm-msm
In-Reply-To: <20141008203233.GA15198@dtor-ws>
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
On Wed, Oct 08, 2014 at 01:32:33PM -0700, Dmitry Torokhov wrote:
> On Wed, Oct 08, 2014 at 09:04:26PM +0100, Mark Brown wrote:
> > On Wed, Oct 08, 2014 at 11:20:58AM -0700, Stephen Boyd wrote:
> > > Srini/Mark, any reason why the regmap_field structure is opaque?
> > So you can't peer into it and rely on the contents. I can see it being
> > useful to add a bulk allocator.
> And then one have to define offsets in an array and use awkward syntax
> to access individual fields. Can we just reply on reviews/documentation
> for users to not do wrong thing?
I have very little confidence in users not doing awful things to be
honest, this is the sort of API where the users are just random things
all over the kernel so this sort of thing tends to be found after the
fact. I get a lot of these in drivers that just got thrown over the
wall so nobody really knows what things are doing when you do find them.
If the standard allocators aren't doing a good job (I've not checked)
I'd much rather handle this inside the API if we can.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* USB HID Telephony page causes odd mouse behavior
From: Cole, JD @ 2014-10-13 15:43 UTC (permalink / raw)
To: linux-input@vger.kernel.org; +Cc: Junge, Terry
Hi All,
We have received multiple bug reports that Plantronics headsets are causing or interfering with mouse events. We've identified the root cause of this in hid-input.c, where un-handled usages (from any usage page) will be mapped to miscellaneous LEDs, buttons, or movements. In short, press a USB equipped volume, mute, or hang-up button and get a random mouse event.
This intermittent behavior isn't consistent across all headsets since with similar capabilities as usages marked 'constant' are ignored early on in 'hidinput_configure_usage'. While interpretation of the correct use of 'constant usages' is left to the individual vendors, we still feel that the HID input driver should not be mapping otherwise unhandled usages to LED_/BIN_/REL_/ABS_MISC usages events.
Solving this issue is a larger effort and it's hard for us to comment on the needs of other manufacturers. That said, we would like to propose the attached interim fix which assumes mouse events don't come from the Telephony page.
jd
------------------ snip --------------------
>From 647545b985b75434609c58dda2ef6612e231a44e Mon Sep 17 00:00:00 2001
From: JD Cole <jd.cole@plantronics.com>
Date: Fri, 10 Oct 2014 17:41:27 -0400
Subject: [PATCH] Prevent HID Telephony page events from being mapped to
miscellaneous buttons.
The hid-input previously interpreted un-mapped telephony page usages, incorrectly,
to misc mouse, button, or LED messages. Exhibited most commonly as an USB telephony
headsets causing intermittent or "random" mouse behavior.
Signed-off-by: JD Cole <jd.cole@plantronics.com>
---
drivers/hid/hid-input.c | 3 +++
include/linux/hid.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 012880a..1e9ef8e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -895,6 +895,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
}
break;
+ case HID_UP_TELEPHONY:
+ goto ignore;
+
default:
unknown:
if (field->report_size == 1) {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 4f8aa47..6489a93 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -159,6 +159,7 @@ struct hid_item {
#define HID_UP_LED 0x00080000
#define HID_UP_BUTTON 0x00090000
#define HID_UP_ORDINAL 0x000a0000
+#define HID_UP_TELEPHONY 0x000b0000
#define HID_UP_CONSUMER 0x000c0000
#define HID_UP_DIGITIZER 0x000d0000
#define HID_UP_PID 0x000f0000
--
1.8.3.1
________________________________
CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain information that is confidential and/or legally privileged. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, please DO NOT disclose the contents to another person, store or copy the information in any medium, or use any of the information contained in or attached to this transmission for any purpose. If you have received this transmission in error, please immediately notify the sender by reply email or at privacy@plantronics.com, and destroy the original transmission and its attachments without reading or saving in any manner.
For further information about Plantronics - the Company, its products, brands, partners, please visit our website www.plantronics.com.
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox