summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMatt Ranostay <mranostay@gmail.com>2014-11-01 04:02:08 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-11-02 08:09:11 +0100
commit6bdd2fd1ed6f66597f3cff75c1bb1569beec2fc9 (patch)
tree2f7bb73033c425f4762292f1cc0dcc67d8e155ea /drivers/input
parentInput: cap11xx - add support for various cap11xx devices (diff)
downloadlinux-6bdd2fd1ed6f66597f3cff75c1bb1569beec2fc9.tar.xz
linux-6bdd2fd1ed6f66597f3cff75c1bb1569beec2fc9.zip
Input: cap11xx - support for irq-active-high option
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> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/cap11xx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index eeda1f9359cd..4f59f0bab28f 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
@@ -263,6 +264,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;