From patchwork Sat Oct 5 10:13:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ikjoon Jang X-Patchwork-Id: 11175579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDA521747 for ; Sat, 5 Oct 2019 10:14:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A54B82133F for ; Sat, 5 Oct 2019 10:14:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FOTeY/vH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725985AbfJEKOC (ORCPT ); Sat, 5 Oct 2019 06:14:02 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40940 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbfJEKOB (ORCPT ); Sat, 5 Oct 2019 06:14:01 -0400 Received: by mail-pf1-f196.google.com with SMTP id x127so5427623pfb.7 for ; Sat, 05 Oct 2019 03:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uxfFhC+Gco8oPLc2lC4Mh4+Ud03liyn0rjCnfNDhxQY=; b=FOTeY/vHx02g5ZfG+FGNAYkQdEj/8IPx4lnA8YLbaf08vhNFsGy1Xu8AVYG/Jc04L+ pANSzFUwMBpMVrxAfnS6u1u/yMgcwe5w72Ir2cSLPVQa3QV7eBFyBHuJ0NYbIREtHPXc vOezN6c2Cwmgd9IdG3fxYR//zS/gRL/cyzxtE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uxfFhC+Gco8oPLc2lC4Mh4+Ud03liyn0rjCnfNDhxQY=; b=XkNcXKCV9sZnLuJKnVXt5U3wzfAZMZ+azmKloTMCTZp8mCnDthTbx2oaPZftQ620yy VE0Nodh2g9RTxDiZUWgkfwHADv3xqQvrDf2FRoLzAsTKawjlOoxiZawM2H2sqi9KJWPC CV1547aUmwSkgcZ5gnQRda/pPA6UY3P5bN2PLiYLkps+YUN/ZrRUeMYNzLobhyaDxU7A FQ5Jp+sxvSlcOJ9pKX8TA9XMfLoiD5bto1mz7t7kVws5NH3Ov+ChyzlCiv6bnimqnooU cTM7FtceDqYzFe23JX0O3fUOW9Li0O5siXx5I4Wk5p2Q04Cdrb+3JT9Xr6ppHSYpkaei LWFw== X-Gm-Message-State: APjAAAXjrKzBEF86nOXki/jWRhb8h+fizROta05rMlW/9KYv6LmhUF9l iKe36eZ4hacylho+llh/5k0y4u/CY5s= X-Google-Smtp-Source: APXvYqxEZB2oeygrzS2m96wqhJ3bnMYuQjFeV97DuMHCDvFOw1Hw3Trk8BPAx3J7OxP0YcZcuTtWsA== X-Received: by 2002:a17:90a:28c5:: with SMTP id f63mr22095283pjd.67.1570270440988; Sat, 05 Oct 2019 03:14:00 -0700 (PDT) Received: from ikjn-glaptop.roam.corp.google.com ([61.254.209.103]) by smtp.gmail.com with ESMTPSA id c3sm7558890pgl.51.2019.10.05.03.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2019 03:14:00 -0700 (PDT) From: Ikjoon Jang To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Brian Norris , Enrico Granata , Ting Shen , Nicolas Boichat , Ikjoon Jang Subject: [PATCH 1/3] dt-bindings: input: Add DT bindings for Whiskers switch Date: Sat, 5 Oct 2019 18:13:45 +0800 Message-Id: <20191005101345.146460-1-ikjn@chromium.org> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add the DT binding document for Hammer's TABLET_MODE switch. Signed-off-by: Ikjoon Jang --- .../devicetree/bindings/input/cros-cbas.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/cros-cbas.yaml diff --git a/Documentation/devicetree/bindings/input/cros-cbas.yaml b/Documentation/devicetree/bindings/input/cros-cbas.yaml new file mode 100644 index 000000000000..3bc989c6a295 --- /dev/null +++ b/Documentation/devicetree/bindings/input/cros-cbas.yaml @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/cros-cbas.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ChromeOS Hammer's Base Attached Switch + +maintainers: + - Dmitry Torokhov + +description: + This device is used to signal when a detachable base is attached to a + Chrome OS tablet. The node for this device must be under a cros-ec node + like google,cros-ec-spi or google,cros-ec-i2c. + +properties: + compatible: + const: google,cros-cbas + +required: + - compatible From patchwork Sat Oct 5 10:14:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ikjoon Jang X-Patchwork-Id: 11175581 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 148AD76 for ; Sat, 5 Oct 2019 10:15:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3C8A2133F for ; Sat, 5 Oct 2019 10:15:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bd/SpF5Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725976AbfJEKO6 (ORCPT ); Sat, 5 Oct 2019 06:14:58 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43492 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbfJEKO6 (ORCPT ); Sat, 5 Oct 2019 06:14:58 -0400 Received: by mail-pg1-f193.google.com with SMTP id v27so5184564pgk.10 for ; Sat, 05 Oct 2019 03:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3RTNY8wK4fg6Ur2FSGs8j8MYz5LC7K5RU1Q9U1f79zE=; b=bd/SpF5Z6uDGHkSQeb9tqR1c4yP+9mM2N9y/zARpg7UBQjUfkGuHWVD77pi+c099tj +wXHtq/uN3a7co3rwkD4JKB9YLAEu1l5Sgy29gzliPJvDlGGMiYV+siW6/bvfFqgiqSz owpXUicJzYPD5Rygwqj3waXUdqN7oOWKN2lik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3RTNY8wK4fg6Ur2FSGs8j8MYz5LC7K5RU1Q9U1f79zE=; b=Qy91aQ3egRavWCYgjy7hLz5WUAZJkrflWhHIezk1UP0tyfmYAdp24S71v7/VuUehgL qtEEsRsTocguwgycpHu5iAGhxTYKrb7iH6HH/E+KwhiVK3iCoWfrXp/4Nrx+duRHBvtc bdN4H6WzZfgC3YvYNa59//YgJkRi3rBqPh1pB/Y+jfJfjsIIZP8wkk1FjWzclO0rLWwm JE/H9yv6FIlEdfXBanfdDI4BJRoTdxnFUvNTh2EFHay6XjdyHcwWeTfPfN/h25MFiPRY ZPGK7C06i5S7Ekgc89R2s78itiym8LuO6/qSwGfOgsCMbrSI4yYdacGSFbsxsaWx00h8 DqJA== X-Gm-Message-State: APjAAAU7zjFk5KQctg+LwWmff8TfdRxgDf80bhv2N8ivpARfRBFcaiwV PQgGyO1ynJPcgc1PAu3A8c1bV+iUSzE= X-Google-Smtp-Source: APXvYqy819c+zDO2gbBv4p7WXcuJLsdEBSZATNeDcK4UJhT+HMC7FijTUsBwBco/wu4fFgEuDbevRw== X-Received: by 2002:a63:4616:: with SMTP id t22mr20787000pga.123.1570270496997; Sat, 05 Oct 2019 03:14:56 -0700 (PDT) Received: from ikjn-glaptop.roam.corp.google.com ([61.254.209.103]) by smtp.gmail.com with ESMTPSA id m123sm9607933pfb.133.2019.10.05.03.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2019 03:14:56 -0700 (PDT) From: Ikjoon Jang To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Brian Norris , Enrico Granata , Ting Shen , Nicolas Boichat , Ikjoon Jang Subject: [PATCH 2/3] HID: google: Add of_match table to Whiskers switch device. Date: Sat, 5 Oct 2019 18:14:44 +0800 Message-Id: <20191005101444.146554-1-ikjn@chromium.org> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add a device tree match table. Change-Id: Iaee68311073cefa4b99cde182bd37d1a67c94ea6 Signed-off-by: Ikjoon Jang --- drivers/hid/hid-google-hammer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c index 31e4a39946f5..bf2b6c6c9787 100644 --- a/drivers/hid/hid-google-hammer.c +++ b/drivers/hid/hid-google-hammer.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -272,12 +273,21 @@ static const struct acpi_device_id cbas_ec_acpi_ids[] = { }; MODULE_DEVICE_TABLE(acpi, cbas_ec_acpi_ids); +#ifdef CONFIG_OF +static const struct of_device_id cbas_ec_of_match[] = { + { .compatible = "google,cros-cbas" }, + { }, +}; +MODULE_DEVICE_TABLE(of, cbas_ec_of_match); +#endif + static struct platform_driver cbas_ec_driver = { .probe = cbas_ec_probe, .remove = cbas_ec_remove, .driver = { .name = "cbas_ec", .acpi_match_table = ACPI_PTR(cbas_ec_acpi_ids), + .of_match_table = of_match_ptr(cbas_ec_of_match), .pm = &cbas_ec_pm_ops, }, }; From patchwork Sat Oct 5 10:16:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ikjoon Jang X-Patchwork-Id: 11175583 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10F701747 for ; Sat, 5 Oct 2019 10:16:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB7B3222C0 for ; Sat, 5 Oct 2019 10:16:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oKYr8rvm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbfJEKQo (ORCPT ); Sat, 5 Oct 2019 06:16:44 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36257 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbfJEKQo (ORCPT ); Sat, 5 Oct 2019 06:16:44 -0400 Received: by mail-pl1-f196.google.com with SMTP id j11so4358505plk.3 for ; Sat, 05 Oct 2019 03:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=By/tkFXpcovd+/oyN3ineSJ0gYN93wEee4C2ekIO2Ic=; b=oKYr8rvm7PDDnBB0z2S6/KdLSYzcUNHwSOj1J9T/ChP0bnupJTdyM+SfvEPl1GzLPt NeFCQ/a7Nmqv03dECle5ic16CoB8H2UHbglD+VB4p79kmUVMZUNJtdq6rjozXagtM6Ez OIoz2fWoVuXD2zAk35AyB0F+h2mnTKUPFPMB0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=By/tkFXpcovd+/oyN3ineSJ0gYN93wEee4C2ekIO2Ic=; b=tBmPi+nPFAFCxPzVdafnEH663wP4AX4P6NOaZod123ZpREWKnfxDmF69asq8UZyARK 73UPlh0f6KruIAoeqncIO8ZVsQBOqBfSOliqvsaDvfH+f5KUX2nHUcC0yqZ5qBhm4JQu rvi3md3WGbyqYI2jq8ZwLKY4zJR3/kUrVYvqzb7O0ijUyqhZ/FeLLo7Tw1RKNgocIQZ+ EQia24web+SD7uQTi3i5q5CdPyzAVH9H+2Sw7R1EVZDWPWbbUY+kIwhXbl1IsB565+1I LMjh2i6FGCcmdkE0HcVOW3PFEtfve25LEhABMG2bXmXrhXcKqAldZ1R4s3XSVSSPn3mW Ng8A== X-Gm-Message-State: APjAAAV64DPitcMZnfezCrak0KEJFDBJW8z0Hm16w246VL36yihl8oB2 /+j7HKrmJWRqaKnHmG8fqpd4HIRJOZo= X-Google-Smtp-Source: APXvYqyx6DaEE0oraB7LAbHSkND2TJ8TnSGts/p6253FS+92EDlqSNGabp0guVGGBosi3GSyYCx/1w== X-Received: by 2002:a17:902:720a:: with SMTP id ba10mr20268276plb.328.1570270602686; Sat, 05 Oct 2019 03:16:42 -0700 (PDT) Received: from ikjn-glaptop.roam.corp.google.com ([61.254.209.103]) by smtp.gmail.com with ESMTPSA id v68sm10682279pfv.47.2019.10.05.03.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2019 03:16:42 -0700 (PDT) From: Ikjoon Jang To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Brian Norris , Enrico Granata , Ting Shen , Nicolas Boichat , Ikjoon Jang Subject: [PATCH 3/3] HID: google: whiskers: mask out extra flags in EC event_type Date: Sat, 5 Oct 2019 18:16:29 +0800 Message-Id: <20191005101629.146710-1-ikjn@chromium.org> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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,