From patchwork Fri Jan 22 22:54:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 369558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55778C433E6 for ; Fri, 22 Jan 2021 22:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B9CC23AC0 for ; Fri, 22 Jan 2021 22:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728882AbhAVWzh (ORCPT ); Fri, 22 Jan 2021 17:55:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbhAVWzZ (ORCPT ); Fri, 22 Jan 2021 17:55:25 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1B6C061794 for ; Fri, 22 Jan 2021 14:54:45 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id f63so4773932pfa.13 for ; Fri, 22 Jan 2021 14:54:45 -0800 (PST) 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=C89gw6YvNATURTK9LTqx+RBcivfIy7/zRAMs6G4Hk8A=; b=PsvLEMzbpQV8uTWCDWCZe12J/6HFr573xVJJKHzUv9sGJufSbhhY5mVyf/kYxLTpC9 8hyHGdZmMDFRxly2ZNJ8oCCxRpayaUrJ3H9+LdezSpGIK+mxuEv1bgelLzyyaOVspW5z hUl6/enhunBTGLj+zsCufXjIVTeBwkMUQn4so= 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=C89gw6YvNATURTK9LTqx+RBcivfIy7/zRAMs6G4Hk8A=; b=OTPPHJHR2oJ+MuO0lE9mJhebRtLAyDd3QjmOJzt49S/+r0GcWeyrvfapJnPcNrXcBu 25pq4qx3uKxbEv8QLQeHiCnpfFlXk+ydYlrobExrzgeXw+d0QiC1rErKjXG1H4v4+tBA 8sDATFrC3asBOEcpq4RkFGPOcWaqwywC3rdkVj0RRo9Plg79PjhueEQfG+8MZR6LwRsE 5dIZTHD/kldYvXtoqGoKifqMRq1lOVPEY93Gh/Qlj58h3NDZmr+txOcHuXvjdi3/Ma1t hDApXr41SVnTSw39rndapJvohQ9Ao09fI0NMBPOxFfO3xTjfPu7ljMDu7/CZ0yLHCAWX a5Hw== X-Gm-Message-State: AOAM530E6U3VvSR5YfsmHO8L5XFpHju9vIaUiE3p1y0G2+Ei5UxF827K XLu87M6Td2kXFle1JTmvl+qEHSrvJRe7lQ== X-Google-Smtp-Source: ABdhPJzr0zZEMTiv6i0Pk6M0VCXjUpl8GGjXkZL3oXFmtA2iioxrMcptT2U+p+0okuzjCesuPlu4ZA== X-Received: by 2002:a05:6a00:2296:b029:1b6:6972:2f2a with SMTP id f22-20020a056a002296b02901b669722f2amr7012104pfe.69.1611356085048; Fri, 22 Jan 2021 14:54:45 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id i62sm6433509pfe.84.2021.01.22.14.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 14:54:44 -0800 (PST) From: Stephen Boyd To: Jonathan Cameron Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Dmitry Torokhov , Benson Leung , Guenter Roeck , Douglas Anderson , Gwendal Grignou , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH 0/3] iio: Add a ChromeOS EC MKBP proximity driver Date: Fri, 22 Jan 2021 14:54:40 -0800 Message-Id: <20210122225443.186184-1-swboyd@chromium.org> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This is a different approach to [1] where I tried to add this proximity sensor logic to the input subsystem. Instead, we'll take the approach of making a small IIO proximity driver that parses the EC switch bitmap to find out if the front proximity sensor is detecting something or not. This allows us to treat proximity sensors as IIO devices all the time in userspace instead of handling this switch on the EC via the input subsystem and then other proximity sensors via IIO. [1] https://lore.kernel.org/r/20201205004709.3126266-1-swboyd@chromium.org Cc: Dmitry Torokhov Cc: Benson Leung Cc: Guenter Roeck Cc: Douglas Anderson Cc: Gwendal Grignou Cc: Cc: Rob Herring Stephen Boyd (3): platform/chrome: cros_ec: Add SW_FRONT_PROXIMITY MKBP define dt-bindings: iio: Add cros ec proximity yaml doc iio: proximity: Add a ChromeOS EC MKBP proximity driver .../proximity/google,cros-ec-proximity.yaml | 37 +++ drivers/iio/proximity/Kconfig | 11 + drivers/iio/proximity/Makefile | 1 + drivers/iio/proximity/cros_ec_proximity.c | 252 ++++++++++++++++++ .../linux/platform_data/cros_ec_commands.h | 1 + 5 files changed, 302 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml create mode 100644 drivers/iio/proximity/cros_ec_proximity.c base-commit: 19c329f6808995b142b3966301f217c831e7cf31