Reported-by: Mickey Lauer <[EMAIL PROTECTED]>

AUX level detection is inverted based on GTA01 or 02

Signed-off-by: Andy Green <[EMAIL PROTECTED]>
---

 drivers/input/keyboard/neo1973kbd.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/neo1973kbd.c 
b/drivers/input/keyboard/neo1973kbd.c
index 868d0a7..2ea6846 100644
--- a/drivers/input/keyboard/neo1973kbd.c
+++ b/drivers/input/keyboard/neo1973kbd.c
@@ -39,8 +39,11 @@ struct neo1973kbd {
 static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id)
 {
        struct neo1973kbd *neo1973kbd_data = dev_id;
+       int key_pressed = !gpio_get_value(irq_to_gpio(irq));
 
-       int key_pressed = !!gpio_get_value(irq_to_gpio(irq));
+       /* GTA02 has inverted sense level compared to GTA01 */
+       if (machine_is_neo1973_gta02())
+               key_pressed = !key_pressed;
        input_report_key(neo1973kbd_data->input, KEY_PHONE, key_pressed);
        input_sync(neo1973kbd_data->input);
 


Reply via email to