Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1556665
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances |
| Date | 2017-01-11 17:00 +0100 |
| Message-ID | <sYttF-id-41@gated-at.bofh.it> (permalink) |
| References | <sVP7j-27Q-11@gated-at.bofh.it> <sVP7j-27Q-9@gated-at.bofh.it> <sYoX0-69r-13@gated-at.bofh.it> <sYqvM-6ZO-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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? Yours, Linus Walleij
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Keerthy <j-keerthy@ti.com> - 2017-01-04 09:30 +0100
Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Linus Walleij <linus.walleij@linaro.org> - 2017-01-11 12:10 +0100
Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Keerthy <j-keerthy@ti.com> - 2017-01-11 13:50 +0100
Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Linus Walleij <linus.walleij@linaro.org> - 2017-01-11 17:00 +0100
Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Keerthy <j-keerthy@ti.com> - 2017-01-12 03:00 +0100
Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to accommodate multi instances Keerthy <j-keerthy@ti.com> - 2017-01-13 05:00 +0100
csiph-web