mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keerthy <j-keerthy@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Tero Kristo <t-kristo@ti.com>
Subject: Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances
Date: Thu, 12 Jan 2017 07:22:19 +0530	[thread overview]
Message-ID: <2683ca92-e1c3-7b87-cd8c-bf6095b09ff9@ti.com> (raw)
In-Reply-To: <CACRpkdYzq0o3Y2BoccPVK4Ro1NWdspqcF12GO0c7wwhz3WPVoA@mail.gmail.com>



On Wednesday 11 January 2017 09:23 PM, Linus Walleij wrote:
> On Wed, Jan 11, 2017 at 1:40 PM, Keerthy <j-keerthy@ti.com> wrote:
>> On Wednesday 11 January 2017 04:34 PM, Linus Walleij wrote:
>>> On Wed, Jan 4, 2017 at 9:26 AM, Keerthy <j-keerthy@ti.com> wrote:
>>>
>>>> gpio2regs is written making an assumption that driver supports only
>>>> one instance of gpio controller. Removing this and adding a generic
>>>> array so as to support multiple instances of gpio controllers.
>>>>
>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>
>>>
>>>> -               regs = gpio2regs(base);
>>>> +               regs = gpio_base + offset_array[i];
>>>
>>>
>>> I understand this.
>>>
>>>> -       struct davinci_gpio_regs __iomem *g = gpio2regs(hw);
>>>> +       struct davinci_gpio_controller *chips =
>>>> +                               (struct davinci_gpio_controller
>>>> *)d->host_data;
>>>> +       struct davinci_gpio_regs __iomem *g = chips[hw / 32].regs;
>>>
>>>
>>> And this, if each instans has 32 GPIOs.
>>>
>>>> -               g = gpio2regs(0);
>>>> +               g = chips[0].regs;
>>>
>>>
>>> Also makes sense.
>>>
>>>> -               g = gpio2regs(gpio);
>>>> +               g = chips[bank / 2].regs;
>>>
>>>
>>> But what is this? I don't understand that /2 at all. Please insert a
>>> comment explaining it so I can figure it out. Are there two banks
>>> per instance?
>>
>>
>> Yes! There are register sets for 32 GPIOs. 2 banks of 16 GPIOs are covered
>> by each set of registers hence /2. Shall i add a comment and send this patch
>> alone separately?
>
> Yeah.
>
> I am currently confused by several patch sets for davinci in my inbox,
> can you rebase on my devel branch when I push it and resend
> *all* you have cooking for DaVinci?

Sure Linus i will do that.

Thanks,
Keerthy

>
> Yours,
> Linus Walleij
>

  reply	other threads:[~2017-01-12  1:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  8:26 [PATCH 1/2] gpio: davinci: Remove redundant members davinci_gpio_controller stuct Keerthy
2017-01-04  8:26 ` [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Keerthy
2017-01-11 11:04   ` Linus Walleij
2017-01-11 12:40     ` Keerthy
2017-01-11 15:53       ` Linus Walleij
2017-01-12  1:52         ` Keerthy [this message]
2017-01-13  3:54         ` Keerthy
2017-01-11 11:00 ` [PATCH 1/2] gpio: davinci: Remove redundant members davinci_gpio_controller stuct Linus Walleij

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=2683ca92-e1c3-7b87-cd8c-bf6095b09ff9@ti.com \
    --to=j-keerthy@ti.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=t-kristo@ti.com \
    /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®