Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2297051rdb; Mon, 9 Oct 2023 22:15:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuIsUdF22Wp6FW8OXQlhuEzIM4mTaCD7puUoKQYkhunBmyDrm8o9wFAIIRrvZzcQIFo5in X-Received: by 2002:a05:690c:4085:b0:5a7:b481:4dd2 with SMTP id gb5-20020a05690c408500b005a7b4814dd2mr1927780ywb.47.1696914908838; Mon, 09 Oct 2023 22:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696914908; cv=none; d=google.com; s=arc-20160816; b=B12YqiIwzGijvwHpTNrEw2ZgosShSFs7RzzuhqHvulyVNE8AM4C81+vutuTWOBA9QB d3I0RkBzA6DYZbprtznPpJIPJZ0OAmtQra3UGvCg6d2pkjHrdwwX49xRi1vRuLo6iYu1 uFRDHLw6ji1PCYgmKR8MJ/YbRfajgEGyrR1SzXPQT3GSgjl3jQvx9RpS09EUNYkH4HS6 OlrTHb3gpNVT5cLniViYta0qSR8F3UrGGoQ+Y7lqe98qYIOM7Vb+7KUKCcg6Zg0wPwuG MoPbsSoXPQnYTaf30XY6VdkUK47vgLK5R38qT/rlkPh1/KYnwkp/wCWEUQXICQu6boCH kqBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lQhFnAIsenhwSznaxFHDKOg/ZsGnf5ZuY98Fxq45IkU=; fh=ko4XMjYlwdrntyaK7WPrUdKF5R1nwac86HjV9SyRVTw=; b=YNrFgEPJIC4TdFziJy1NCr8ZdW0YLAtPzZMCz3lqQEvFk/PvDqT7aKz9AoLlx459Tt kahp/ChkvG/ZVJA/KhvyZbomw1sKEVUajIeZTcrrVlvrEfMIlc9FRZ6tC4dgiFG/8Adq ZXi4yGYP427vrxX+Nvg+JTXZJ2U9z0Kgrfw3KMXAfdM/dc1J6GPdfmT1FhAHSjSnYDq4 tTaUexS0oGhLWlwhIWWWuf5/Ld1CU4IVUCZaPCFSO2g6+F8N2mbqzGiMqR2Fbz9iD1wH q97AkkAIx2d7rr70CVGNzGel3jkPM1V0nqEdq+WPGm0n4sCo+rOsZ66pCLrwhPxydGKA ttJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ok652WnK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bv71-20020a632e4a000000b00565eb0b4f33si1723734pgb.224.2023.10.09.22.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 22:15:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ok652WnK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E274780279E1; Mon, 9 Oct 2023 22:15:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376324AbjJJFOr (ORCPT + 99 others); Tue, 10 Oct 2023 01:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344471AbjJJFOp (ORCPT ); Tue, 10 Oct 2023 01:14:45 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C35D7A9 for ; Mon, 9 Oct 2023 22:14:42 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6a4ff9d7e86so351495b3a.0 for ; Mon, 09 Oct 2023 22:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696914882; x=1697519682; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=lQhFnAIsenhwSznaxFHDKOg/ZsGnf5ZuY98Fxq45IkU=; b=ok652WnKTnG7RvB9k2L6OF1mO6beOBVFoLqB4RCpSnRNt55Q3veMZ44txBh5Exr7WE +YGr/kelHSXiQtoEmUV7cvG9jnY/AEoRp7clyzRGLSFdsEZGqc6ZC6GkyNUfJhHIWMZB Bs5a0XEW3/nVTrDsG4+Vgnv9NPXmO8Rvgt+qJWutIPZy1sCcnNz017v6vca1v7lLsGWR Gy1wVZZq5+xNRiSxcvyxgAYpVVAousAqQL5m4sn/o2K+AEwVG741XK5jPnR79m1iEijf GNT2V4f5SNfRvSwZ14EcdvBvbOu8r2eV9OWChsQaS/ZKyRnRxxETQr9LJdYEuHvIihb8 ikTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696914882; x=1697519682; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lQhFnAIsenhwSznaxFHDKOg/ZsGnf5ZuY98Fxq45IkU=; b=M0OGn2FCbxxKrfF2hJS9hCUycx0BEc/madBGSzKbHr5utuXfBJVCoN1ESf6rJyWj1I 0y+SX8BoDDcL3qe3ESiPAAS2ORaQazXKGZmok1JwayeMLnjf12+ftd9F+df9xBT3dvE+ LcphSw6/WxCpsAiCpLz1CPQXU2ZdfYApY1poFJrRGcBmiUgaEfALnJuIyCGMYCZdbM8F 6m6joBxsx1OdLOYFtt7MdF3H0u1MmJ/DfkB5DxZyODpCoF1IUtq61zfVPbcDBd06Cgrr wEFX5OP685bJMuce3EKMQ/1oimCoJtEq19Xs6Pe3uIXI9MksCN8wQmbshjy0nEN3PZdZ Aeyg== X-Gm-Message-State: AOJu0YzJ8BQxmBh/MCZOuitR0q7IWCjLYq8B8Iu5Zy1ayfTtu1Ay8NTc Lj8ZKTuVlfWD8CouPIZKhX1dWQ== X-Received: by 2002:a05:6a00:1d94:b0:690:d314:38d with SMTP id z20-20020a056a001d9400b00690d314038dmr19656361pfw.1.1696914881956; Mon, 09 Oct 2023 22:14:41 -0700 (PDT) Received: from octopus ([2400:4050:c3e1:100:d26f:f61a:9867:e809]) by smtp.gmail.com with ESMTPSA id a21-20020a62bd15000000b00693498a846esm7249060pff.80.2023.10.09.22.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 22:14:41 -0700 (PDT) Date: Tue, 10 Oct 2023 14:14:37 +0900 From: AKASHI Takahiro To: Cristian Marussi Cc: Linus Walleij , Rob Herring , sudeep.holla@arm.com, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, Oleksii_Moisieiev@epam.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [RFC v2 5/5] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver Message-ID: Mail-Followup-To: AKASHI Takahiro , Cristian Marussi , Linus Walleij , Rob Herring , sudeep.holla@arm.com, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, Oleksii_Moisieiev@epam.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org References: <20231005025843.508689-1-takahiro.akashi@linaro.org> <20231005025843.508689-6-takahiro.akashi@linaro.org> <20231006132346.GA3426353-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 22:15:04 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 04:08:13PM +0100, Cristian Marussi wrote: > On Mon, Oct 09, 2023 at 03:13:24PM +0200, Linus Walleij wrote: > > On Mon, Oct 9, 2023 at 11:08???AM Cristian Marussi > > wrote: > > > > > > > + gpio0: gpio@0 { > > > > > + compatible = "pin-control-gpio"; > > > > > + gpio-controller; > > > > > + #gpio-cells = <2>; > > > > > + gpio-ranges = <&scmi_pinctrl 0 10 5>, > > > > > + <&scmi_pinctrl 5 0 0>; > > > > > + gpio-ranges-group-names = "", > > > > > + "pinmux_gpio"; > > > > > + }; > > > > > > > > > > Assuming the above &scmi_pinctrl refers to the protocol node as we > > > usually do, > > > > No it does not, it is a three-layer cake. > > > > scmi <-> scmi_pinctrl <-> scmi_gpio > > > > it refers to the scmi_pinctrl node. > > > > Thanks, this explains a lot. > Cristian Just in case, gpio-ranges = <&scmi_pinctrl 0 10 5>; means that SCMI *pin* range [10..(10+5-1)] are mapped to this driver's gpio range [0..(5-1)]. So any consumer driver can access a gpio pin as: foo-gpios = <&gpio0 3>; will refer to gpio pin#3 that is actually SCMI's 13. gpio-ranges = <&scmi_pinctrl 5 0 0>; gpio-ranges-group-names = "pinmux_gpio"; means that SCMI *group*, "pinmux_gpio", are mapped to this driver's gpio range which starts with 5. If "pinmux_gpio" indicates SCMI *pin* range [20..24], baa-gpios = <&gpio0 7>; will refer to gpio pin#7 that is actually SCMI's 22 (=20 + (7-5)). This way, we (consumer drivers) don't care what is the underlying pin controller. -Takahiro Akashi > > > There is no SCMI GPIO protocol, instead SCMI is using the > > operations already available in the pin controller to exercise > > GPIO. Generic pin control has operations to drive lines for > > example, and Takahiro is adding the ability for a generic pin > > controller to also read a line. > > > > > > Yours, > > Linus Walleij