diff options
-rw-r--r-- | Documentation/devicetree/bindings/input/cap11xx.txt | 4 | ||||
-rw-r--r-- | drivers/input/keyboard/cap11xx.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/input/cap11xx.txt b/Documentation/devicetree/bindings/input/cap11xx.txt index 61d20d8d97e2..7d0a3009771b 100644 --- a/Documentation/devicetree/bindings/input/cap11xx.txt +++ b/Documentation/devicetree/bindings/input/cap11xx.txt | |||
@@ -28,6 +28,10 @@ Optional properties: | |||
28 | Valid values are 1, 2, 4, and 8. | 28 | Valid values are 1, 2, 4, and 8. |
29 | By default, a gain of 1 is set. | 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 | linux,keycodes: Specifies an array of numeric keycode values to | 35 | linux,keycodes: Specifies an array of numeric keycode values to |
32 | be used for the channels. If this property is | 36 | be used for the channels. If this property is |
33 | omitted, KEY_A, KEY_B, etc are used as | 37 | omitted, KEY_A, KEY_B, etc are used as |
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 @@ | |||
45 | #define CAP11XX_REG_STANDBY_SENSITIVITY 0x42 | 45 | #define CAP11XX_REG_STANDBY_SENSITIVITY 0x42 |
46 | #define CAP11XX_REG_STANDBY_THRESH 0x43 | 46 | #define CAP11XX_REG_STANDBY_THRESH 0x43 |
47 | #define CAP11XX_REG_CONFIG2 0x44 | 47 | #define CAP11XX_REG_CONFIG2 0x44 |
48 | #define CAP11XX_REG_CONFIG2_ALT_POL BIT(6) | ||
48 | #define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X)) | 49 | #define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X)) |
49 | #define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X)) | 50 | #define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X)) |
50 | #define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9 | 51 | #define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9 |
@@ -263,6 +264,13 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client, | |||
263 | dev_err(dev, "Invalid sensor-gain value %d\n", gain32); | 264 | dev_err(dev, "Invalid sensor-gain value %d\n", gain32); |
264 | } | 265 | } |
265 | 266 | ||
267 | if (of_property_read_bool(node, "microchip,irq-active-high")) { | ||
268 | error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2, | ||
269 | CAP11XX_REG_CONFIG2_ALT_POL, 0); | ||
270 | if (error) | ||
271 | return error; | ||
272 | } | ||
273 | |||
266 | /* Provide some useful defaults */ | 274 | /* Provide some useful defaults */ |
267 | for (i = 0; i < cap->num_channels; i++) | 275 | for (i = 0; i < cap->num_channels; i++) |
268 | priv->keycodes[i] = KEY_A + i; | 276 | priv->keycodes[i] = KEY_A + i; |