From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8851CD68ED for ; Tue, 10 Oct 2023 05:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bfn4w+khIvbsr4U8Wc2uMgvBeaNrFc3uduVzh2p/ey8=; b=NDdxD4ENeriRCY itcaN68CnzW5GvaxhkJtO7yQL4XCct1cFK6MsBkT/xJCHqstALl8CrX/KKHb982xn8axYxRfRc6oN VzbDS5MmuHjpZbmwObGQlkfun3nLFbzVVV46MchfB1ZnXDmg1RGvRKbSEZT2UMXJLQ0AJ4ZiqvivH sHy0VidKTnVqFkWeePfuL2mS/gcnC3t7kkvEXAE8Co92fY5gytnDZtI1ecxW/1Krd13TE1x8ALGjd uO8NPOqERdiyg/+189QQVVD1etiwvIa9Sd05lyKUB771fg5pX09yo4k4swm9rcqh1O1QQ+giT/q7r s/gkV/cQM/QqpTXVaBnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq54x-00CR28-38; Tue, 10 Oct 2023 05:14:47 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qq54u-00CR1P-2j for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 05:14:46 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6a4ff9d7e86so351494b3a.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=lists.infradead.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=f5dy1/k1k9q8mPvuzW4pEV6K/chAidTIeOE3i6vYgn9bigS/YYjP7ruVf5Zd2xGnxC wGAsTfRk3yLGI0tC/8rhAK6rKdhrVgZRMVvJycJA+ex7f2CMaEgg0vyDUwiXPpt87Rfh nBKVT4J7WHn1Y/Wo45E4LrgZkJQmhqH+6mm6y43LWlD7wLyhkWo3MZPxN5N4TP/4gIEK XFtUjbtxHhsiHIPkG3/Vfm3jtxlE4A5clG1n8irIthIVWKcfIDxRarRc2HbzUXfJC+80 pVcFbCIrKO3nTDY+NsL8Rjv4L8XhplgVwpZb0UX7SB3R5e9sjUGCDqqzsWXnPmnpOvhg Q6/Q== 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=SRgbNPM+EwE5yusnvO+8FF99KpxVXXno0qfytKqXKh88xxlL9GSPL0CFbLwc+EtAUe WkHSogEdqnjpAPSoJJOdTOUenfxrwpI2PO8lrEiwqr6xEunm+8VwHY/UYQICqFK+IgeL 57Hv5O3FmbM9djUwsIzasoud/eHXQIeavErSVFCJ+w9SYuVE/vaMmOppt18ukQ/8/jtc gxIGYLSKnYRewyjkTnDC4VaY45XoBs/WKACqjP1YNiKWiESWoBZ9L4Had0wyws7Ad34e WXWcsNFiB6O/WyoAegLWSFpkC2Wc1aQoYB4o3FojX1Ko6LgqFA8EOjAsVrog8e4h4FND G1vw== X-Gm-Message-State: AOJu0YxC53sJV28jZ0r6DPF/0Vc9+eeoxSA3KvluBNoVWa0V4T5haJGE sXqkmeW/oZSvtxUX8cWNUiM9xg== X-Google-Smtp-Source: AGHT+IHaDM+YNCNE4eJtZUKYwuSPOdk4MvZD+JiNAp5tSoamQIDjMvlQP3IbKsJSsbElOx6id1n8pA== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231009_221444_978829_CBBF11DF X-CRM114-Status: GOOD ( 20.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel