diff src/cs/drivers/drv_app/kpd/kpd_physical_key_def.h @ 446:bed6d393f3e0

C1xx targets: sensible handling of Compal's power key wiring
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 28 Jan 2018 19:26:10 +0000
parents 945cf7f506b2
children 92dbfa906f66
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/kpd/kpd_physical_key_def.h	Mon Jan 22 05:45:26 2018 +0000
+++ b/src/cs/drivers/drv_app/kpd/kpd_physical_key_def.h	Sun Jan 28 19:26:10 2018 +0000
@@ -26,6 +26,7 @@
 
 #ifndef _WINDOWS
    #include "config/board.cfg"
+   #include "config/fc-target.cfg"
 #endif
 
 /** Definition of the physical key ID.
@@ -63,6 +64,8 @@
 
 #endif
 
+#ifndef CONFIG_TARGET_COMPAL
+
 /* The PWR key is mapped on Analog Base Band, it's the SPI which inform
    the keypad that the PWR key is pressed, so the process for this key
    is different of the others, a subscriber can be notified only by a
@@ -71,5 +74,19 @@
    #define allows to map any key with the PWR key. */
 #define KPD_SHORT_PRESS_PWR_KEY KPD_PKEY_RED
 
+#else
+
+/*
+ * On C1xx phones the red key grounds not only the PWON signal to the ABB,
+ * but also row input line 4 of the regular keypad matrix.  The latter
+ * results in the regular keypad interrupt being generated, so we have
+ * to handle it with the regular keys, not in TI's way.  We disable the
+ * KPD_SHORT_PRESS_PWR_KEY mechanism by defining it to a key that does not
+ * exist on this keypad.
+ */
+
+#define KPD_SHORT_PRESS_PWR_KEY KPD_PKEY_REC
+
+#endif
 
 #endif /* #ifndef _KPD_PHYSICAL_KEY_DEF_H_ */