Commit 7008dafb authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Dmitry Torokhov

Input: adp5589 - fix row 5 handling for adp5589

The adp5589 has row 5, don't skip it when creating the GPIO mapping.
Otherwise the pin gets reserved as used and it is not possible to use it as
a GPIO.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent dc262dfa
...@@ -235,7 +235,7 @@ struct adp5589_kpad { ...@@ -235,7 +235,7 @@ struct adp5589_kpad {
unsigned short gpimapsize; unsigned short gpimapsize;
unsigned extend_cfg; unsigned extend_cfg;
bool is_adp5585; bool is_adp5585;
bool adp5585_support_row5; bool support_row5;
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
unsigned char gpiomap[ADP5589_MAXGPIO]; unsigned char gpiomap[ADP5589_MAXGPIO];
bool export_gpio; bool export_gpio;
...@@ -485,7 +485,7 @@ static int adp5589_build_gpiomap(struct adp5589_kpad *kpad, ...@@ -485,7 +485,7 @@ static int adp5589_build_gpiomap(struct adp5589_kpad *kpad,
if (kpad->extend_cfg & C4_EXTEND_CFG) if (kpad->extend_cfg & C4_EXTEND_CFG)
pin_used[kpad->var->c4_extend_cfg] = true; pin_used[kpad->var->c4_extend_cfg] = true;
if (!kpad->adp5585_support_row5) if (!kpad->support_row5)
pin_used[5] = true; pin_used[5] = true;
for (i = 0; i < kpad->var->maxgpio; i++) for (i = 0; i < kpad->var->maxgpio; i++)
...@@ -884,12 +884,13 @@ static int adp5589_probe(struct i2c_client *client, ...@@ -884,12 +884,13 @@ static int adp5589_probe(struct i2c_client *client,
switch (id->driver_data) { switch (id->driver_data) {
case ADP5585_02: case ADP5585_02:
kpad->adp5585_support_row5 = true; kpad->support_row5 = true;
case ADP5585_01: case ADP5585_01:
kpad->is_adp5585 = true; kpad->is_adp5585 = true;
kpad->var = &const_adp5585; kpad->var = &const_adp5585;
break; break;
case ADP5589: case ADP5589:
kpad->support_row5 = true;
kpad->var = &const_adp5589; kpad->var = &const_adp5589;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment