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 ED8E2ECAAD5 for ; Tue, 6 Sep 2022 15:19:52 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-ID:References:Subject :In-Reply-To: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=MOdA8ZLoO1AJuFpDSmkge7YUN58m7cMxg3WM4LYuZTg=; b=vwrKSSYllDcS60 ZXO95ySYx7KHLR4GNseQXWSHuf4yvkdeKCZytJ3Ggvf4+LJJit+0NQvRnC6obmaon3ygM7LtzKIlj 3HBlIfXlQIJ82hb6gyL72isaQS2BRwd51xvs+8o2Q31yOD3cPncyO5GuSLcVsYJA85eWZMaIzwqTi fa4nl0GCWmikcqC3ewSNqXYgLWryCoUPK/nE1f9+zRvyhZOWaQzLZC4xbSMhOrQ6Somyf8Txaiwnr AwfcGSsDenDTEiiLeYDPoamwEYs76TYjcvoRBe0aHCNbWjtz/JqpF7qC+rnMn1STQoR11NUxz3VhL Cz7wuu2L01YUrSDBBy5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVaLO-00EgjP-SG; Tue, 06 Sep 2022 15:18:31 +0000 Received: from 80-61-163-207.fixed.kpn.net ([80.61.163.207] helo=sibelius.xs4all.nl) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVZWS-00EHT2-Df for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 14:25:54 +0000 Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id c29ccd8f; Tue, 6 Sep 2022 16:25:49 +0200 (CEST) Date: Tue, 6 Sep 2022 16:25:49 +0200 (CEST) From: Mark Kettenis To: Hector Martin Cc: linux@armlinux.org.uk, linus.walleij@linaro.org, robh@kernel.org, krzysztof.kozlowski@linaro.org, arnd@arndb.de, lee@kernel.org, alyssa@rosenzweig.io, asahi@lists.linux.dev, brgl@bgdev.pl, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, sven@svenpeter.dev, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org In-Reply-To: (message from Hector Martin on Tue, 6 Sep 2022 22:53:47 +0900) Subject: Re: [PATCH 1/6] dt-bindings: mfd: add binding for Apple Mac System Management Controller References: <20220902172808.GB52527-robh@kernel.org> <909bb4e7-5bd2-2903-5bba-87ae37f3448a@marcan.st> <5b75dc7e-5337-73eb-450f-b72f479793c4@marcan.st> Message-ID: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_072552_857124_0A073D6E X-CRM114-Status: GOOD ( 26.24 ) 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: , MIME-Version: 1.0 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 > Date: Tue, 6 Sep 2022 22:53:47 +0900 > From: Hector Martin > > On 06/09/2022 22.43, Russell King (Oracle) wrote: > > In the case of gpio-macsmc, how would we later add support for the > > slave PMU GPIOs, given that these use keys "gpXX" rather than "gPxx"? > > How do we tell the gpio-macsmc code to use a different set of keys? > > Should DT describe the key "prefix" (in other words "gp" vs "gP"), > > or should it describe it some other way. What if Apple decides to > > instantiate another GPIO controller in a later platform with a > > different prefix, could that be accomodated without breaking any > > solution we come up today? > > > > Maybe the solution to this would be to describe the key prefix in DT > > as that's effectively its "reg". Or maybe we use "reg" to describe > > it somehow (which is value of the key, which seems to have an > > "address" like quality to it?) > > > > We don't have to implement code for this now, we just need to get a > > reasonably correct DT binding for the gpio controller. > > I agree that this is something to think about (I was about to reply on > the subject). > > I can think of two ways: using `reg` for the key name, but that feels > icky since it's ASCII and not *really* a register number/address, or > something like this: > > gpio@0 { > apple,smc-key-base = "gP00"; > ... > } > > gpio@1 { > apple,smc-key-base = "gp00"; > ... > } This would still require us to add a (one-cell) "reg" property and would require adding the appropriate "#address-cells" and "#size-cells" properties to the SMC node. > But this ties back to the device enumeration too, since right now the DT > does not drive that (we'd have to add the subdevice to the mfd subdevice > list somehow anyway, if we don't switch to compatibles). > > I'd love to hear Rob's opinion on this one, and also whether the > existing Linux and OpenBSD code would currently find gpio@0 {} instead > of gpio {} for backwards compat. The OpenBSD driver does a lookup by name and the "@0" is part of that name. So that would break backwards compat. Maybe just name the slave GPIO controller "gpio-slave"? If we add compatibles, the compatibles for the nodes should propbably be different such that we can switch to do a lookup by compatible? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel