summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/keyboard_scan.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h
index 8359cbd174..41cdbdf611 100644
--- a/include/keyboard_scan.h
+++ b/include/keyboard_scan.h
@@ -75,20 +75,27 @@ static inline enum boot_key keyboard_scan_get_boot_key(void)
*/
const uint8_t *keyboard_scan_get_state(void);
+enum kb_scan_disable_masks {
+ /* Reasons why keyboard scanning should be disabled */
+ KB_SCAN_DISABLE_LID_CLOSED = (1<<0),
+ KB_SCAN_DISABLE_POWER_BUTTON = (1<<1),
+ KB_SCAN_DISABLE_LID_ANGLE = (1<<2),
+};
+
#ifdef HAS_TASK_KEYSCAN
/**
- * Enables/disables keyboard matrix scan.
+ * Enable/disable keyboard scanning. Scanning will be disabled if any disable
+ * reason bit is set. Scanning is enabled only if no disable reasons are set.
+ *
+ * @param enable Clear(=1) or set(=0) disable-bits from the mask.
+ * @param mask Disable reasons from kb_scan_disable_masks
*/
-void keyboard_scan_enable(int enable);
+void keyboard_scan_enable(int enable, enum kb_scan_disable_masks mask);
#else
-static inline void keyboard_scan_enable(int enable) { }
+static inline void keyboard_scan_enable(int enable,
+ enum kb_scan_disable_masks mask) { }
#endif
-/**
- * Returns if keyboard matrix scanning is enabled/disabled.
- */
-int keyboard_scan_is_enabled(void);
-
#ifdef CONFIG_KEYBOARD_SUPPRESS_NOISE
/**
* Indicate to audio codec that a key has been pressed.