Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matt Ranostay and committed by
Dmitry Torokhov
6bdd2fd1 7609a5e9

+12
+4
Documentation/devicetree/bindings/input/cap11xx.txt
··· 28 28 Valid values are 1, 2, 4, and 8. 29 29 By default, a gain of 1 is set. 30 30 31 + microchip,irq-active-high: By default the interrupt pin is active low 32 + open drain. This property allows using the active 33 + high push-pull output. 34 + 31 35 linux,keycodes: Specifies an array of numeric keycode values to 32 36 be used for the channels. If this property is 33 37 omitted, KEY_A, KEY_B, etc are used as
+8
drivers/input/keyboard/cap11xx.c
··· 45 45 #define CAP11XX_REG_STANDBY_SENSITIVITY 0x42 46 46 #define CAP11XX_REG_STANDBY_THRESH 0x43 47 47 #define CAP11XX_REG_CONFIG2 0x44 48 + #define CAP11XX_REG_CONFIG2_ALT_POL BIT(6) 48 49 #define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X)) 49 50 #define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X)) 50 51 #define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9 ··· 262 261 gain = ilog2(gain32); 263 262 else 264 263 dev_err(dev, "Invalid sensor-gain value %d\n", gain32); 264 + } 265 + 266 + if (of_property_read_bool(node, "microchip,irq-active-high")) { 267 + error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2, 268 + CAP11XX_REG_CONFIG2_ALT_POL, 0); 269 + if (error) 270 + return error; 265 271 } 266 272 267 273 /* Provide some useful defaults */