Whiskers needs to get notifications from EC for getting current base
attached state. EC sends extra bits in event_type field that receiver
should mask out.

Signed-off-by: Ikjoon Jang <i...@chromium.org>
---
 drivers/hid/hid-google-hammer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
index bf2b6c6c9787..91cb62afbc2b 100644
--- a/drivers/hid/hid-google-hammer.c
+++ b/drivers/hid/hid-google-hammer.c
@@ -96,8 +96,9 @@ static int cbas_ec_notify(struct notifier_block *nb,
        struct cros_ec_device *ec = _notify;
        unsigned long flags;
        bool base_present;
+       const u8 event_type = ec->event_data.event_type & 
EC_MKBP_EVENT_TYPE_MASK;
 
-       if (ec->event_data.event_type == EC_MKBP_EVENT_SWITCH) {
+       if (event_type == EC_MKBP_EVENT_SWITCH) {
                base_present = cbas_parse_base_state(
                                        &ec->event_data.data.switches);
                dev_dbg(cbas_ec.dev,
-- 
2.23.0.581.g78d2f28ef7-goog

Reply via email to