mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dipen Patel <dipenp@nvidia.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	timestamp@lists.linux.dev, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] hte: tegra194: improve the GPIO-related comment
Date: Mon, 2 Oct 2023 09:27:45 -0700	[thread overview]
Message-ID: <7766de61-a046-3e17-1322-28bd7f1e61da@nvidia.com> (raw)
In-Reply-To: <CAMRc=MeWXapho1bsX9Si5uSx7MWVhpT2cqrv5S+qPo51Ko=Vtg@mail.gmail.com>

On 10/2/23 1:33 AM, Bartosz Golaszewski wrote:
> On Fri, Sep 29, 2023 at 11:38 PM Dipen Patel <dipenp@nvidia.com> wrote:
>>
>> On 9/11/23 2:44 AM, Bartosz Golaszewski wrote:
>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>
>>> Using any of the GPIO interfaces using the global numberspace is
>>> deprecated. Make it clear in the comment.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>> ---
>>> This was part of a wider series but since this is independent, I'm sending
>>> 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 global
>>> -      * 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 binding.
>>> +      * 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 anymore?
> 
> 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 based 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?

humm, overall, I just need to know which GPIO it is, for example, GPIO controller X Port A GPIO number 3
to do proper mapping.
Continuing from above example, the hte driver gets:
- GPIO Controller X from DT node
- the rest details in current code gets it from [1] and [2]

If there is alternate method exists, I would like to explore. I think IDA will not help in this case as ID assigned
does not hold meaning in this context.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpio/gpiolib-cdev.c?h=v6.6-rc3#n760
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/hte/hte-tegra194.c?h=v6.6-rc3#n421

> 
> Bart
> 
>>> +      *
>>> +      * 2) Using GPIO descriptors that can be assigned to consumer devices
>>> +      * using device-tree, ACPI or lookup tables.
>>>        *
>>>        * The code below addresses both the consumer use cases and maps into
>>>        * HTE/GTE namespace.
>>


  reply	other threads:[~2023-10-02 16:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11  9:44 Bartosz Golaszewski
2023-09-29 21:38 ` Dipen Patel
2023-10-02  8:33   ` Bartosz Golaszewski
2023-10-02 16:27     ` Dipen Patel [this message]
2023-10-03  8:58       ` Bartosz Golaszewski
2023-10-03 16:42         ` Dipen Patel
2023-10-04 10:04           ` Bartosz Golaszewski
2023-10-04 20:24             ` Dipen Patel
2023-10-05  6:47               ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7766de61-a046-3e17-1322-28bd7f1e61da@nvidia.com \
    --to=dipenp@nvidia.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=timestamp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®