Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp947707pxb; Wed, 3 Mar 2021 22:08:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9KZPwdAxnIwAJGSkeNahaIfzXI3BN2Yc24CiV0GumIrhsIj63DbD9iMhdcqUYLdlTIvWg X-Received: by 2002:a17:907:9858:: with SMTP id jj24mr2454038ejc.212.1614838099801; Wed, 03 Mar 2021 22:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614838099; cv=none; d=google.com; s=arc-20160816; b=CvXrRvcj4ENZ5/XvJecCrlORwlMY2y2GJNsnRI5t2rYmGLpuvBkfiyhQc9a9Jy59/H SS3SPOlYTvVErQDz89pc4QpeXNGuG0NZrXljdoYHvIkPj85qPVGwTFAphlI0XvYhB6Rj NxekLGNwSYXsbYowT1gprFWI4SgwwJMZuCCItqBXfIKbMSrpt92b5QpEnfs08G6ICybx Y80HbxlkS/7Q7VRl5fwfVO3j36ZeN+H4S5Wu4UIsf1w8mSgjo+ydxyAEtnn/72KZYYiH 8c51QmSH4bF2a2tc1Si14RW+XkOKmdQDxNCIDbLL4lnOhnKX/ZcfKK3hpWL/Ur3p/PGf ekSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VKa9ZLInAy2XzS1IUg7DGYoE6OxMM/zNE7tI2sgufOA=; b=b0XgbVOKZJhdrZFUk/eMiLv+51piiAoIvSq3t2FxNuXQBZmg2IPV+v+p9dKtkue/Z/ WpkFb5BA7DIetey6xkI5LNJ/xACBh8Z0rE+p4R1vrh5+USBJYTQlbc9jyM/z2s8fUca1 ZBU/8W8memKbCxHrGagFOBsRFhMp8lPyywREZv4+ZZsgenhkpyc3Q6jOXXAcnmbPSFyi i94dmyIwRB+N7HeAhFMHcWKjs7YNBmvoiZ8L34U0az2L0q+LUOlgT30zc+VqegcOaeDq oWlKdHMxMVvMm8/qD+0RHxC1d+wbx11jz2u7a0olhoQJJARjhjIO30XiISJDyWD0kfRc MOZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nBxjVUfB; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si16926930edd.179.2021.03.03.22.07.57; Wed, 03 Mar 2021 22:08:19 -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=@ti.com header.s=ti-com-17Q1 header.b=nBxjVUfB; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382673AbhCBJkv (ORCPT + 99 others); Tue, 2 Mar 2021 04:40:51 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:55848 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1838142AbhCBJ3P (ORCPT ); Tue, 2 Mar 2021 04:29:15 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 1229RZbM117601; Tue, 2 Mar 2021 03:27:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1614677255; bh=VKa9ZLInAy2XzS1IUg7DGYoE6OxMM/zNE7tI2sgufOA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=nBxjVUfBlRsYk2MpVi97OJS/jowTlC6jCid6bRscRLGZNrHe9wRt63lIkr+MNtN2/ mqpHAEBGhvoT+ATAls/rEJsUrJKGrwFzUwUkHVVPQ772inAhNxvcin5ohos0G17bEg fCGWJqE0kk3NsU8vEwXtP+cQ/zMx7skQSzb/+OpU= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 1229RZtZ004151 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Mar 2021 03:27:35 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 2 Mar 2021 03:27:34 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 2 Mar 2021 03:27:34 -0600 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 1229RVZf054243; Tue, 2 Mar 2021 03:27:32 -0600 Subject: Re: [PATCH] gpio: omap: Honor "aliases" node To: Alexander Sverdlin , CC: Santosh Shilimkar , Kevin Hilman , Linus Walleij , Bartosz Golaszewski , Rob Herring , , , References: <20210302011813.2331879-1-alexander.sverdlin@gmail.com> From: Grygorii Strashko Message-ID: Date: Tue, 2 Mar 2021 11:27:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210302011813.2331879-1-alexander.sverdlin@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/2021 03:18, Alexander Sverdlin wrote: > Currently the naming of the GPIO chips depends on their order in the DT, > but also on the kernel version (I've noticed the change from v5.10.x to > v5.11). Honor the persistent enumeration in the "aliases" node like other > GPIO drivers do. > > Signed-off-by: Alexander Sverdlin > --- > Yes, I noticed checkpatch "WARNING: DT binding docs and includes should be > a separate patch." > However, the parts below are tiny and barely make sense separately. > > Documentation/devicetree/bindings/gpio/gpio-omap.txt | 6 ++++++ > drivers/gpio/gpio-omap.c | 5 +++++ > 2 files changed, 11 insertions(+) > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt > index e57b2cb28f6c..6050db3fd84e 100644 > --- a/Documentation/devicetree/bindings/gpio/gpio-omap.txt > +++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt > @@ -30,9 +30,15 @@ OMAP specific properties: > - ti,gpio-always-on: Indicates if a GPIO bank is always powered and > so will never lose its logic state. > > +Note: GPIO ports can have an alias correctly numbered in "aliases" node for > +persistent enumeration. > > Example: > > +aliases { > + gpio0 = &gpio0; > +}; > + > gpio0: gpio@44e07000 { > compatible = "ti,omap4-gpio"; > reg = <0x44e07000 0x1000>; > diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c > index 41952bb818ad..dd2a8f6d920f 100644 > --- a/drivers/gpio/gpio-omap.c > +++ b/drivers/gpio/gpio-omap.c > @@ -1014,6 +1014,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) > bank->chip.parent = &omap_mpuio_device.dev; > bank->chip.base = OMAP_MPUIO(0); > } else { > +#ifdef CONFIG_OF_GPIO > + ret = of_alias_get_id(bank->chip.of_node, "gpio"); > + if (ret >= 0) > + gpio = ret * bank->width; > +#endif > label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d", > gpio, gpio + bank->width - 1); > if (!label) > You're not the first one, this was not accepted. See [1] [1] https://patchwork.kernel.org/project/linux-omap/patch/1465898604-16294-1-git-send-email-u.kleine-koenig@pengutronix.de/ -- Best regards, grygorii