From patchwork Sat Feb 10 07:09:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 199205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1336578dyd; Fri, 9 Feb 2024 23:12:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHM2VIRx3LbO/XfdlUXewU+ifOLLEDbpTFNCTDhL1eyWcQhEJ3NeQ40DSP5qlC35dlgnN9J X-Received: by 2002:a05:6a20:269d:b0:19c:6877:9943 with SMTP id h29-20020a056a20269d00b0019c68779943mr965629pze.41.1707549178296; Fri, 09 Feb 2024 23:12:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707549178; cv=pass; d=google.com; s=arc-20160816; b=ELLzn3KdW1mtE8vnW321tVbekVz0jYqRB80esC2kkPLtyqVN5YRxfE4T1hZJyjfT/x lp26IxBPEpTfSHH6PG2G5/QR7wsZZEKex1DDOjMsDGPNf90XYb8Fheu2HRoAu6hk6KhJ ZPVhLet6l86L6pDFAcocmDS4ktSvS/c+4fP810fGwJM0HIOXVp944Ij1bcCB75nr9x+3 +tO8L9+O/87tKToDCVs67b+3OB9w1HIRUyYBAe5U2UVrZX404rSPZel50CkwJV/URVBk Obw3py7YcIiwznWdOoNavBS7N1f0nLl4D8oqj9hYNnYuBk15etIMXkaJKQjyikBvKrFw wbGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=q+i5FQpJgQZM9grJNtVDZ+U7TB243p9ucbtyKq1qJsw=; fh=muIDoBxM0+OX8ECb0zISKVZq//f3dUtcwU10nwri430=; b=rp5bodBPZH07/OODzypCY71lTlrwh9q2CGR5on3KtAfPzpPd3oiKc8DdGH4cs2+W9I zas08fEjyqGprvkB5ix8fhUdQZSpcfZxxegMoH4dRoRqFY0AaZ5gQsbZLqfjq8IbF5Xl V+wTKw8MClEqnva8pNKae+A4a60pcrArhbpnxrhylwFYVdMoxW58nqvjqWarYB6Jy5oV O8LdAWM/J6pm8UdCVohrVu8cA9QQeTBIqa7WPw1zuDA03ShGtaDqhg1yptGxk4fMYHUN 0YSEoMAdj08mxgPjjc0RkfRzsIApN5dYBTz0OHRGlaVkwKePN2xQPf0ysZg3sLEdCaFe xIig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ncUZbEt4; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60307-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60307-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCUdgwSjrV9JnVmEgKRO7qf2zAqT0e6u+9Vspy0tNFe0c6YyQXRJKIAMSBdzSRJooxafkRI6HDdHH2s9F9OUdg8IFi//ZQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id sl15-20020a17090b2e0f00b0029706041e5csi3055813pjb.24.2024.02.09.23.12.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:12:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60307-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ncUZbEt4; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60307-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60307-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9DE9AB24690 for ; Sat, 10 Feb 2024 07:10:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 348E7364C2; Sat, 10 Feb 2024 07:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ncUZbEt4" Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5CB325619 for ; Sat, 10 Feb 2024 07:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707548983; cv=none; b=SwSSHkd+5nHj5qYDf4pBZYw2K8EVmfD9FaT+e/+uvFV6LiDQwAoW+NbRsR5SkhESMvejZjV481lh5WOSLWleB1CxKrFA7SYyvEPprEygOZ7DuGBdgp68yH1E0Ggs9+Cqq0RX66G+42uyqmOn2JeBnNLs+ZRPPRsABv/gySYjZdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707548983; c=relaxed/simple; bh=WXij6tQJVWGfA0jVq1TwtVWpf8MLUZF7maDtetHyCq8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tqLjtAaSFP3+2HVPcmyWXezUc3caONqfRg4h04i7GyT13w9cNCe1D1M/iVB+tRtSHIgIYookoKfMmBaoZsGcC0Gne8gmB9TrPqV5L8djz4x3gsOoBKwtI9fMkMm4Bgn6DWvuvpxV939ADNKjeLZGuGdv0ZiAAjvAjFUCfL9I8JQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ncUZbEt4; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5ce6b5e3c4eso1277349a12.2 for ; Fri, 09 Feb 2024 23:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707548981; x=1708153781; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q+i5FQpJgQZM9grJNtVDZ+U7TB243p9ucbtyKq1qJsw=; b=ncUZbEt4RjEMhyWQ/qi54rYwzgQG+iBLYaLTjLTBugzcZVXaAN5z/Rpncyh3TX3O+Q LFMQc0L1Jpr+FaLKQrZ5e3CFeNAGiIbZkq2xKpegEd9LBvZGDyMuMYyCT0M9ewWzNhKo CoV/UI1iN6oLOfEO5c6GiG1wVK3KCMOAImUIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707548981; x=1708153781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q+i5FQpJgQZM9grJNtVDZ+U7TB243p9ucbtyKq1qJsw=; b=w9K2Ef3aqPPXqp+D9jWWOrd3QvB0ypZP4v7hbe0vhTq4A4nDD5DzoM1LVEmDIIo7z+ IiBoqFTdVMhRYxHEvh5WN7LK5UnlC6mHF/u9yZoEjHLsF/jWyOtg6pzcVTZI07LDxeP/ x4nwn37sUJxbhtqX6nXKQzgHu6lxPSyPRItQVajTND+QFfDfB39Ka3nq04mo5lVYjh4e NXd2y+vNdhjgvLXFxRtvMa+oWGhKkVs7VyRq9J0LLy6xxGD62AKL2vbWTKdXBvfGgfy5 M64EOfuyTqlvbhD9/JuYleizQK2pjwtiGZZy2M0ddlbbIXfkm+Lpmfucs384ci3uBtyn iEUA== X-Gm-Message-State: AOJu0YwHP5MC5FJvzDBRTkPDZMNlI8kTMbISX21OZDrTqQ3yi0ARDiMv 7y9oBXW8bFr1BH/kXCJEhfKqh6301aeX/QgTglWhf6GJsKE+owghknOu2/HX+w== X-Received: by 2002:a05:6a00:990:b0:6e0:6c89:e30b with SMTP id u16-20020a056a00099000b006e06c89e30bmr2062527pfg.19.1707548981026; Fri, 09 Feb 2024 23:09:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXfaOQFPe2ptrEFchii8p8d5wFLx6aGOVBzgPCXZjXz6vMArnzaBrz54ebBSrY7Rc7Zb7W2VUAj9BdKIpE0W9dkz5cxBOzIBdQ4QU0l/WvK0O7VjhRWZMwqOXXJ5ykMFpmTSqgratP/faTwzXpvQwn39FSfIVAhwQwraGaTVviZc4cp5j3/BD5CdKGz4B69dvTKZDYXQVUFxLlqnjUvGKFk/DOrZ2zHtEL4xejpVDpzr3Dej3ggRlW+HoqkdCsWPepKV9T+nn9nGOIx4uY7HkdsNGhKIBRFHvFYOERt3EAfj1LY3bkRx0U41mzkKYcK1byjGEHYtEjLSBA3XWVqiZEGmSVaJTnW7QekqO11p2FvukW0hU6g6S8g5ev5eGJBl644kRvLYhHhmgIt237GF/RFZeOSkp6lJLy6lhPpBTyHf9wAeXRDf4/GfAKkUsAuhXX6e5pxcnu723SER6nLBovy4WVE9TkC2SLLkdafuZ/oWR/6aqc7YxZlFlDXXfwdiEzrdLr2sP1bzMCNmf2WF+hM6HhJXzB0gz/8ZcEMMipVJH9k Received: from localhost (175.199.125.34.bc.googleusercontent.com. [34.125.199.175]) by smtp.gmail.com with UTF8SMTPSA id z16-20020aa78890000000b006dff3ca9e26sm1635066pfe.102.2024.02.09.23.09.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Feb 2024 23:09:40 -0800 (PST) From: Stephen Boyd To: chrome-platform@lists.linux.dev Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Douglas Anderson , Pin-yen Lin , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Benson Leung , Guenter Roeck , linux-gpio@vger.kernel.org Subject: [PATCH 01/22] dt-bindings: gpio: Add binding for ChromeOS EC GPIO controller Date: Fri, 9 Feb 2024 23:09:12 -0800 Message-ID: <20240210070934.2549994-2-swboyd@chromium.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog In-Reply-To: <20240210070934.2549994-1-swboyd@chromium.org> References: <20240210070934.2549994-1-swboyd@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790495086935659469 X-GMAIL-MSGID: 1790495086935659469 The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO expander. Add a binding to describe these GPIOs in DT so that other devices described in DT can read the GPIOs on the EC. Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: Lee Jones Cc: Benson Leung Cc: Guenter Roeck Cc: Cc: Cc: Cc: Pin-yen Lin Signed-off-by: Stephen Boyd --- .../bindings/gpio/google,cros-ec-gpio.yaml | 49 +++++++++++++++++++ .../bindings/mfd/google,cros-ec.yaml | 3 ++ 2 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/google,cros-ec-gpio.yaml diff --git a/Documentation/devicetree/bindings/gpio/google,cros-ec-gpio.yaml b/Documentation/devicetree/bindings/gpio/google,cros-ec-gpio.yaml new file mode 100644 index 000000000000..a9f1d7784070 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/google,cros-ec-gpio.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/google,cros-ec-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIOs controlled by ChromeOS EC + +maintainers: + - Stephen Boyd + +description: + Google's ChromeOS EC has a gpio controller inside the Embedded Controller + (EC) and controlled via a host-command interface. The node for this + device should be under a cros-ec node like google,cros-ec-spi. + +properties: + compatible: + const: google,cros-ec-gpio + + '#gpio-cells': + const: 2 + + gpio-controller: true + +required: + - compatible + - '#gpio-cells' + - gpio-controller + +additionalProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + cros-ec@0 { + compatible = "google,cros-ec-spi"; + reg = <0>; + interrupts = <101 0>; + gpio { + compatible = "google,cros-ec-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml index e1ca4f297c6d..ded396b28fba 100644 --- a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +++ b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml @@ -93,6 +93,9 @@ properties: '#size-cells': const: 0 + gpio: + $ref: /schemas/gpio/google,cros-ec-gpio.yaml# + typec: $ref: /schemas/chrome/google,cros-ec-typec.yaml#