Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1233962rdb; Mon, 2 Oct 2023 03:34:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx49IARsD1/GpVGBP9You9IdkfjvZKIJQxiQevzIlVKXRmppkbKLCokIiNji1jx9OpH0tt X-Received: by 2002:a17:903:230c:b0:1c7:26ea:b220 with SMTP id d12-20020a170903230c00b001c726eab220mr11737731plh.18.1696242881129; Mon, 02 Oct 2023 03:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696242881; cv=none; d=google.com; s=arc-20160816; b=HVWMu3q6uUTdLRvn0QliRQoZtQ8urIWGZ+FjUpZbcGMmaI+AedhYHwIzqGQhGoMNwk qHxytT65PXjV/rfX/MwaesTeRiop9/H73EyUYsX7Tug9mgFfsd10orG5N7J9mjsN32D8 CQuHrwr1OFYX7v5Z2DLm+HMpX9NvmkOkIaAZwYhVIv30ZE4l6MksIen6jsX3Wuv/lUgy 6koWOBifi+WGAuEF4Rjxic6HoYqVY2Ndn1aoyANAYZZb/mVfQgBIcB4WyO/f0t8UCv76 mamxbtA0E+zPqxqgq7U4cogDc+/8OWMLh3HjBzKGTSMO7/8QE0aT2VY8eByFsj6CTiDv F1lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VWuACrVMiSb7UXfUbQbyMPZK0CXvOIuNQRYAat1PZ5c=; fh=P4xFsFd3z9cFTGu9wQS2ywn40uR35wPJe0Y1+QD5lPo=; b=BE4/TsEkqVqpp5XDNK7RH7ctZMj9Mad2VWJdeoztg2o+o/MXnv+1fewuUTpKH7slEG lgM7s/HpWQwBj0KIiXcPAfcYY0FCAVVUTKgF76aT1L+9eMDltF1ds7g4jyKAEAknEj4c qsrb7chqSHj8LlmnbIVkWVpmfHSZG0EmxsObO+ZJAXlJ4qmvvgNYZQjze/nR33MKHZ4y /Zfn2WR7zOUPcHMBKKxsQcbxyNGvWXrcgKd/gyW2rHIrG0ZqoDakENSYvMvczAlLeLCY izS/kIPSVDMIUEFIeynBXG0ojkxi9UGufjvRwblA39amMGq1vcg723z/4nPKoW83Hz81 xULw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=mGMXbFfS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u17-20020a170903125100b001b89fd6bec4si28704072plh.144.2023.10.02.03.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 03:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=mGMXbFfS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 50A1F80A97CE; Mon, 2 Oct 2023 01:33:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235821AbjJBIdS (ORCPT + 99 others); Mon, 2 Oct 2023 04:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235797AbjJBIdR (ORCPT ); Mon, 2 Oct 2023 04:33:17 -0400 Received: from mail-vk1-xa2c.google.com (mail-vk1-xa2c.google.com [IPv6:2607:f8b0:4864:20::a2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B707D3 for ; Mon, 2 Oct 2023 01:33:14 -0700 (PDT) Received: by mail-vk1-xa2c.google.com with SMTP id 71dfb90a1353d-49352207f33so6290653e0c.2 for ; Mon, 02 Oct 2023 01:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696235593; x=1696840393; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VWuACrVMiSb7UXfUbQbyMPZK0CXvOIuNQRYAat1PZ5c=; b=mGMXbFfSAdQ33Pn8DhFNdxYHGwLi1a/WtP8laaF5BKHoK/uLaC+caGWUNjCpDbMU5l 79CFu4zh0pKKdRq+i0BdVlOOizdKEJOXBJ/Rp5JcwleufcbxuqsMJQwkyiyOzVVTYAky lKW8hiXPVgwfQt439QxyYvx+jkr4WZp6xqh8+sW+04Ice2ZtTmQSbW3OBsEqeTxWEBru qKPDFIFRst8RpT8GDOGsIUHFu92Fb9nFj/xryNhPkM5GeRM590UR9XjXuMRD3488J/1g MqWunFTqozbKWvOfY5ugD38/+Y6dtM20YjjmXR1XnvwckDjK8NjBkvg6K2+icFyZRGe5 mSZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696235593; x=1696840393; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VWuACrVMiSb7UXfUbQbyMPZK0CXvOIuNQRYAat1PZ5c=; b=mKZOmIoNCRiR32lEHmGcrNaXQtnnmKGaSmKJsRKxrgypcxK6BNpSS54o/fOojkj83H CPH8gbgW1k0EuhsCgnOW4KwwykAsznQjVK/0pYNwxCMgjlBoZm++pIiuGUJU4auW/RFZ ZDprYEj/s1qIGOhCtuyh9NATyqusJAcZx+9GcouOdaf+BlFuS6rYIjY5dzX/GpHm5Yww nfmF5aviJwk73jW9vcesubGl7mRbBefCsoOgibA3iJ2IuI7APfZh7MJvt7pjyTV3AZmT ys0wYf8EftbxhpIfXuaBF9f/rCetKJJvDqn882/Zmp0XVAoYxNrXvRFFf/tJZSgTzozC uaxQ== X-Gm-Message-State: AOJu0Yym19qG8FYUo+ZeCeCYOLe/DuWbwbbd0UA2B5djH0N8NfaWhwab l4nUCVfUoulrZd+cfawvvRvr8ScGCVKJkEkNHJWoUw== X-Received: by 2002:a1f:4c05:0:b0:49a:b9d3:692a with SMTP id z5-20020a1f4c05000000b0049ab9d3692amr8265541vka.5.1696235593620; Mon, 02 Oct 2023 01:33:13 -0700 (PDT) MIME-Version: 1.0 References: <20230911094443.14040-1-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 2 Oct 2023 10:33:02 +0200 Message-ID: Subject: Re: [PATCH] hte: tegra194: improve the GPIO-related comment To: Dipen Patel Cc: Thierry Reding , Jonathan Hunter , timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Linus Walleij Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 02 Oct 2023 01:33:29 -0700 (PDT) On Fri, Sep 29, 2023 at 11:38=E2=80=AFPM Dipen Patel wr= ote: > > On 9/11/23 2:44 AM, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Using any of the GPIO interfaces using the global numberspace is > > deprecated. Make it clear in the comment. > > > > Signed-off-by: Bartosz Golaszewski > > Acked-by: Linus Walleij > > --- > > This was part of a wider series but since this is independent, I'm send= ing > > it separately. > > > > drivers/hte/hte-tegra194.c | 13 ++++++++----- > > 1 file changed, 8 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c > > index 6fe6897047ac..9fd3c00ff695 100644 > > --- a/drivers/hte/hte-tegra194.c > > +++ b/drivers/hte/hte-tegra194.c > > @@ -407,12 +407,15 @@ static int tegra_hte_line_xlate(struct hte_chip *= gc, > > return -EINVAL; > > > > /* > > + * GPIO consumers can access GPIOs in two ways: > > * > > - * There are two paths GPIO consumers can take as follows: > > - * 1) The consumer (gpiolib-cdev for example) which uses GPIO glo= bal > > - * number which gets assigned run time. > > - * 2) The consumer passing GPIO from the DT which is assigned > > - * statically for example by using TEGRA194_AON_GPIO gpio DT bind= ing. > > + * 1) Using the global GPIO numberspace. > > + * > > + * This is the old, now DEPRECATED method and should not be used = in > > + * new code. TODO: Check if tegra is even concerned by this. > This use case is to do namespace mapping from gpio subsystem to hte. Few = doubts: > 1. What does deprecate mean here? Does gpio subsys not use global space a= nymore? It does but we don't want to expose this to external users in any way anymore (and haven't to for years). This is what deprecated means. Users should deal with opaque GPIO descriptors not global GPIO numberspace. > 2. If yes, what GPIO number is set when it comes from gpiolib-cdev, as ba= sed on that I may have to > reflect in the mapping, tegra194_aon_gpio_map for example. Why DO you have to use a GPIO number though? If HTE needs just a number from some HTE numberspace (which in itself may be unnecessary) then why not just keep a local IDA for it? Do you have to know the GPIOs internal numbering scheme to make it work? Bart > > + * > > + * 2) Using GPIO descriptors that can be assigned to consumer dev= ices > > + * using device-tree, ACPI or lookup tables. > > * > > * The code below addresses both the consumer use cases and maps = into > > * HTE/GTE namespace. >