Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2886466rdg; Mon, 16 Oct 2023 19:34:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHd7NjchkNkEydnSOI5Ysd95IlZcaEmItb2QjMlGsX/0kKS9VzQ0voS7Uvc5dBVzcZm3tlq X-Received: by 2002:a05:6a21:6d9e:b0:17a:e941:b136 with SMTP id wl30-20020a056a216d9e00b0017ae941b136mr797965pzb.9.1697510048978; Mon, 16 Oct 2023 19:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697510048; cv=none; d=google.com; s=arc-20160816; b=By40GEJaBqUa2FNp43HsFXtVhJgW5SjIZPhhkmbH7hXZ0TykjLCXiBMXCj/Bk22LgI tTALGi8f1zKyeNHC5/GIa79y3wQxKIybcSVBHSy9WnEA/F+Kg6iAP1aExorYRR4Bp99c KugUnzkolxLEaRZsk6nSfa0BAqaKwNbh0vz51wRUBXLMW/0xXSA2oUk0uRuebDzaLW2x Lnw5m/TbcjoDTOGwyohjFuJJHG8UgdIxxvPJCTr+o9Lel09DMX82ugwT9UTqfWJyXlRV NyGgBKl6YPUvaeffq8WEr3m4fglfobR6imC8XNLF6R2o0zWnYZo84UjJW1ZZE8La4Za4 Fp2g== 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=trHmVVa3HVQtG4Xt2doqvC4B0sQ9SbK5P7sWmT0onTo=; fh=VYHYLZF2XbPvGme9Y3zkdWTYuAo7LCRg6JosWpUQi08=; b=m+FRk0+GOSszFNyHe1hvOG/aUMTVXNR8ibbVRNQf7cNRwW2zOaO/6Fu2vfn0Jmo4XO WELaMsL+rN7mgYivp7BfSvwIgOXLGUCQp33PkM++VYmHlnYDEd55yX4FSZGhPq6qy9+v gBuWXnVzVD0mrhgf60dXdqXx94gJVa2joPLUtOVMxNkEH3oJ/h/Dscr1e9jMuapO4l2o UcpQMkng1runPsp8BpvlMgS1LQ8rMRuCzsTPeMjQ3RSQSp1MoIUbB1wTlydJAsJri/ZX w3EboKFizWl++gm1BfRcr8QBe9QC6tGyvP19SLhANEN7ajH8Ec7aWHyyxWTqxyegkdol YpnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Govb0Z/u"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id x5-20020a170902ea8500b001c7245a1e73si706743plb.32.2023.10.16.19.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 19:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Govb0Z/u"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id A62B98031EB0; Mon, 16 Oct 2023 19:34:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232208AbjJQCcW (ORCPT + 99 others); Mon, 16 Oct 2023 22:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjJQCcU (ORCPT ); Mon, 16 Oct 2023 22:32:20 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1AAE6 for ; Mon, 16 Oct 2023 19:32:17 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-27d8a1aed37so543114a91.1 for ; Mon, 16 Oct 2023 19:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697509937; x=1698114737; 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=trHmVVa3HVQtG4Xt2doqvC4B0sQ9SbK5P7sWmT0onTo=; b=Govb0Z/u4covux+X1yFkUr7/NBoiwPJ9CmtzIkLGTBlixGituoiSBzhgnoGI/bX17P nW4kUiYyec2FbLFc43vRfWbo23b8+zqQNVISgLXERwNW4kbu9GZ7A5+ZqK+hor9+WYBu 8Rq2+Ed2ay52cXzNP2vYb7F3fstOpIVMCiij5S88bEULwgvHeDUXgPM+sBJAcMrQrI2e r/s7Yuuttsa/i2pmEvBdoajWP4hmE6KhwGhfN7OmawYUf6/SKbypnqXbspOTDkIPhS3w ZA89Wr3me7gERgE8IXYSxfcGtS9QV/bMCgK/TzSyseAzcOLZDsOYXS34zwgjicfp0VX+ gnSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697509937; x=1698114737; 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=trHmVVa3HVQtG4Xt2doqvC4B0sQ9SbK5P7sWmT0onTo=; b=f8bp0ThgqfFtCNVrGjfbd/+2KmbjBzsbsqQdinNhcao+rrKvEm0OGfe5wHBv+MQ9N2 TBUxVheXsGJBlDazrv+PzHJgldxOhfYCMTWgVHkc9Vc3Ae014yQ8BAwt1bLueqmM2cmu at07rowXnC8gaqWiHn0JLZnl4XZypVk7mMYVrtWvR7/2IdDeGVOS9BP0mhnqeJIrfMF2 +McSqEpufwplrVO8kuft+2TfbmldfKG0CuD6nxKC9fcbyNHxxx04hlJpeivaF9RoKX/S UmE7U0j7Q29O8A+Ud3dohEPvO/11FartJ/wTj8wZx501//bvbuMqIEpRjNfUu7JkGe0E clvQ== X-Gm-Message-State: AOJu0YwjiUSKro4zEXZN4FsaYV4Alzycvf1XMRttEzYiY3Cz0s4DCw7K zNAKH/1DE1tGy0qmPJ76vDZNFw== X-Received: by 2002:a17:902:dace:b0:1ca:8e79:53ae with SMTP id q14-20020a170902dace00b001ca8e7953aemr1081353plx.1.1697509937071; Mon, 16 Oct 2023 19:32:17 -0700 (PDT) Received: from octopus ([2400:4050:c3e1:100:b992:c10c:3bda:e666]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001c9bca1d705sm284757plx.242.2023.10.16.19.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 19:32:16 -0700 (PDT) Date: Tue, 17 Oct 2023 11:32:11 +0900 From: AKASHI Takahiro To: Linus Walleij Cc: Rob Herring , sudeep.holla@arm.com, cristian.marussi@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 , Linus Walleij , Rob Herring , sudeep.holla@arm.com, cristian.marussi@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=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 19:34:06 -0700 (PDT) Hi Linus, On Thu, Oct 12, 2023 at 09:25:20AM +0200, Linus Walleij wrote: > On Tue, Oct 10, 2023 at 7:25???AM AKASHI Takahiro > wrote: > > > > We can probably mandate that this has to be inside a pin controller > > > since it is a first. > > > > Yeah, my U-Boot implementation tentatively supports both (inside and > > outside pin controller). But it is not a user's choice, but we should > > decide which way to go. > > OK I have decided we are going to put it inside the pin control node, > as a subnode. (I don't expect anyone to object.) While I'm still thinking of how I can modify my current implementation to fit into 'inside' syntax, there are a couple of concerns: 1) invoke gpiochip_add_data() at probe function Probably we no longer need "compatible" property, but instead we need to call gpiochip_add_data() explicitly in SCMI pin controller's probe as follows: scmi_pinctrl_probe() ... devm_pinctrl_register_and_init(dev, ..., pctrldev); pinctrl_enable(pctrldev); device_for_each_child_node(dev, fwnode) if (fwnode contains "gpio-controller") { /* what pin_control_gpio_probe() does */ gc->get_direction = ...; ... devm_gpiochip_data_add(dev, gc, ...); } 2) gpio-by-pinctrl.c While this file is SCMI-independent now, due to a change at (1), it would be better to move the whole content inside SCMI pin controller driver (because there is no other user for now). 3) Then, pin-control-gpio.yaml may also be put into SCMI binding (i.e. firmware/arm,scmi.yaml). Can we leave the gpio binding outside? 4) phandle in "gpio-ranges" property (As you mentioned) The first element in a tuple of "gpio-ranges" is a phandle to a pin controller node. Now that the gpio node is a sub node of pin controller, the phandle is trivial. But there is no easier way to represent it than using an explicit label: (My U-Boot implementation does this.) scmi { ... scmi_pinctrl: protocol@19 { ... gpio { gpio-controller; ... gpio-ranges = <&scmi_pinctrl ... >; } } } I tried: gpio-ranges = <0 ...>; // dtc passed, but '0' might be illegal by spec. gpio-ranges = <(-1) ...>; // dtc passed, but ... gpio-ranges = <&{..} ...>; // dtc error because it's not a full path. Do you have any other idea? Otherwise, I will modify my RFC with the changes above. -Takahiro Akashi > It makes everything easier and clearer for users I think. > > Yours, > Linus Walleij