Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1386468pxb; Thu, 4 Mar 2021 10:00:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5yi0SQuRAu3zCLDqpq9ZJApcW3mGT4n6+az9NA8FtqK+28OlRrgmorQZbWBWkKVaB8wBT X-Received: by 2002:a17:906:7c44:: with SMTP id g4mr4849549ejp.269.1614880823863; Thu, 04 Mar 2021 10:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614880823; cv=none; d=google.com; s=arc-20160816; b=J6Tmp3c9AC6MAPGWjkgI9YW84DO3Xml990djEcgMaUcuyRi7X1MbrXfgZ92rOUVpDb IqDm/hmuOMOdvSCrXQnOwwJJypnviTEoHU9zLaLdRPCKKw5bfuSKxLmElAcUMf7OINaQ ei1t1sDdY2bszspvfTAnZnEpiGCjf+895m0TUZLsSGFpYT5yhXIplwNoCrC/girVc3Pp V8VoSBuLt7brYRnm3hCv5tjNjWZi4qJfT00KZkLOx3l/OcaHj+r3x8ay7S2za5KmcrIR 3/KPANhZFVezJYyyzs8Hn/oWrqzxS9BoPn7PdbD1Fd2xZsexBGIz0ECuPif7R8NxVBxp hZtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=7L6ldQhpGzs3xLIq8oXpk2BNI6m2lMU5dInt+OjQ/hE=; b=UO5pnfsG0z/zyOPDEETo7THsDxDNWldzBSgNupTKXVBEDfXQas2RiyVvejQ4xpbzjI L2IC5feKzy3GYm7cehY17Cgu6SSITzkpK+VTOAXHL1ByVsbnJyTC5QdqK0IsexUPbAbo bRvDCy7vdGldPqZfrcicSGN52cpwIRX+gRvEgvKh8jktXvzSOHKrT0nulM6C0T1pTolP BXxpabysUzEJ/KaaZwbPt0HwEF5J0Ljnifw7JVxRB+3C+jj6/gLCpSqZwtUCZUgfCNCC KkTUy9kbu4bKNpKY4QB6zz8Xljx52kvrRQfhOsqvmoOzZcLxmJtFuGcDP4M9Qlo0+kSS dfIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NnXBHTtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si95558edq.210.2021.03.04.10.00.00; Thu, 04 Mar 2021 10:00:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NnXBHTtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235564AbhCDPp4 (ORCPT + 99 others); Thu, 4 Mar 2021 10:45:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235547AbhCDPp2 (ORCPT ); Thu, 4 Mar 2021 10:45:28 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4629DC061756; Thu, 4 Mar 2021 07:44:48 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id w7so8464379wmb.5; Thu, 04 Mar 2021 07:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7L6ldQhpGzs3xLIq8oXpk2BNI6m2lMU5dInt+OjQ/hE=; b=NnXBHTtpCGowCPvVs40ll/KxB7mLq2dz3YgqwFr2q5BSn9Cj+RwEnaqCRUEbnYwyeQ bU/gBL99IYMzGDB8FjSfy1IwaclZDhpkI/jPrUSQawyeKGYkgN3+Ck2shPrUNefnPO8O mdm3hAFbLt7fDYu4N53gNPvk+p81jWOAGUDEFuFwPVAJSAGMlGdc+0PvTLrRgYTBxGzM hkJ+1B/JpwxX/hNnpnWs+bwofda9h64covW9imLXu6xLNpHXaPSfWJwRybXd1jUUXdxD DAPVvfd/VYX+lDIkLA6gh3sSPw6zhJkKXVzwMaxrWfjnuPvrUWvFU+leVTqdVox53aYO p3eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7L6ldQhpGzs3xLIq8oXpk2BNI6m2lMU5dInt+OjQ/hE=; b=C2L5ybOlSXIcXtgRO9i53hCba1DqhUxTZ2e5GgA6nGYDlUPClsvCkHlsdP6TD0yLVM LP7JOR+xNJtRt7gxBhXYnaco1oc64Q0/XGJQsCnufsvmpNWCQoLCIoF2z4UDsv4D8fEg UbZBKvNKABAHzOdjEVcShb9DWHhWzL1GJ/73pTTcWILOIyepalJr6to8raDVV+KVpBO0 sCQukoPt22dUm6AdydHt4R1ph7JI/YGP2N+VcsaitW7tfFBpi4HYPZgwwqt44p+g6HPY D2sfCbgLg+AnYKsfWys1WxLPTOOkPPgf9siQ9ELFzmIz0gdoRyOOR25nlzRr5Nzfmjrw 6Tww== X-Gm-Message-State: AOAM532b4gjaXt4sLrtjUrGH5Iuz6ncwffexm6RilpVVTmOhtsI0139l 6DkM5H+/MnInhwgc7FDuEXc= X-Received: by 2002:a05:600c:35c2:: with SMTP id r2mr4519413wmq.54.1614872686938; Thu, 04 Mar 2021 07:44:46 -0800 (PST) Received: from macbook-pro-alvaro.lan (170.red-88-1-105.dynamicip.rima-tde.net. [88.1.105.170]) by smtp.gmail.com with ESMTPSA id d204sm10808676wmc.17.2021.03.04.07.44.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Mar 2021 07:44:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [PATCH v4 02/15] gpio: regmap: set gpio_chip of_node From: =?utf-8?Q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= In-Reply-To: Date: Thu, 4 Mar 2021 16:44:47 +0100 Cc: Rob Herring , Michael Walle , Bartosz Golaszewski , Florian Fainelli , bcm-kernel-feedback-list , Jonas Gorski , Necip Fazil Yildiran , "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List , linux-arm Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <68F60F3F-33DD-4183-84F9-8D62BFA8A8F1@gmail.com> References: <20210304085710.7128-1-noltari@gmail.com> <20210304085710.7128-3-noltari@gmail.com> <9A8A595D-2556-4493-AA96-41A3C3E39292@gmail.com> <0504ADC2-0DD5-4E9E-B7DF-353B4EBAB6B4@gmail.com> To: Andy Shevchenko , Linus Walleij X-Mailer: Apple Mail (2.3654.60.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > El 4 mar 2021, a las 16:28, Andy Shevchenko = escribi=C3=B3: >=20 > On Thu, Mar 4, 2021 at 5:24 PM =C3=81lvaro Fern=C3=A1ndez Rojas = wrote: >>> El 4 mar 2021, a las 16:17, Andy Shevchenko = escribi=C3=B3: >>> On Thu, Mar 4, 2021 at 5:06 PM =C3=81lvaro Fern=C3=A1ndez Rojas = wrote: >>>>> El 4 mar 2021, a las 11:35, Andy Shevchenko = escribi=C3=B3: >>>>> On Thu, Mar 4, 2021 at 10:57 AM =C3=81lvaro Fern=C3=A1ndez Rojas >>>>> wrote: >>>=20 >>>>>> + * @of_node: (Optional) The device node >>>>>=20 >>>>>> + struct device_node *of_node; >>>>>=20 >>>>> Can we use fwnode from day 1, please? >>>>=20 >>>> Could you explain this? I haven=E2=80=99t dealt with fwnode never = :$ >>>> BTW, this is done to fix this check when parsing gpio ranges: >>>> = https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba37= 0f797/drivers/gpio/gpiolib-of.c#L933-L934 >>>=20 >>> Use struct fwnode_handle pointer instead of OF-specific one. >>=20 >> But is that compatible with the current gpiolib-of code? :$ >=20 > Yes (after a bit of amendment I have sent today as v2: > = https://lore.kernel.org/linux-gpio/20210304150215.80652-1-andriy.shevchenk= o@linux.intel.com/T/#u). Well that doesn=E2=80=99t fulfill my definition of =E2=80=9Ccurrent = gpiolib-of code=E2=80=9D=E2=80=A6 @Linus what should I do about this? >=20 >>> Also here is the question, why do you need to have that field in the >>> regmap config structure and can't simply use the parent's fwnode? >>> Also I'm puzzled why it's not working w/o this patch: GPIO library >>> effectively assigns parent's fwnode (okay, of_node right now). >>=20 >> Because gpio regmap a child node of the pin controller, which is the = one probed (gpio regmap is probed from the pin controller). >> Therefore the parent=E2=80=99s fwnode is useless, since the correct = gpio_chip node is the child's one (we have pin-ranges declared in the = child node, referencing the parent pinctrl node). >=20 > I see. Can you point me out to the code where we get the node and > where it's being retrieved / filled? Sure, this is where the child node is searched: = https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb4= 8c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L100-L109 Then the gpio child node is probed and assigned here: = https://github.com/Noltari/linux/blob/6d1ebb8ff26ed54592eef1fcd3b58834acb4= 8c04/drivers/pinctrl/bcm/pinctrl-bcm63xx.c#L51 Basically, I based that part of the code on the ingenic pin controller: = https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba37= 0f797/drivers/pinctrl/pinctrl-ingenic.c#L2485-L2491 = https://github.com/torvalds/linux/blob/f69d02e37a85645aa90d18cacfff36dba37= 0f797/Documentation/devicetree/bindings/pinctrl/ingenic%2Cpinctrl.yaml#L15= 5-L176 >=20 > --=20 > With Best Regards, > Andy Shevchenko Best regards, =C3=81lvaro.=