linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] convert to use basic mmio gpio library
@ 2014-10-29 13:56 kamlakant.patel
  2014-10-29 13:56 ` [PATCH 1/5] gpio: moxart: " kamlakant.patel
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: kamlakant.patel @ 2014-10-29 13:56 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: Kamlakant Patel, linux-gpio

From: Kamlakant Patel <kamlakant.patel@linaro.org>

This patch converts GPIO drivers to use BASIC MMIO GPIO library
(i.e GPIO GENERIC library) which makes drivers smaller and simpler.

This patch needs to be tested on different platforms.

Kamlakant Patel (5):
  gpio: moxart: convert to use basic mmio gpio library
  gpio: timberdale: convert to use basic mmio gpio library
  gpio: iop: convert to use basic mmio gpio library
  gpio: ge: convert to use basic mmio gpio library
  gpio: document basic mmio gpio library

 Documentation/gpio/driver.txt  | 50 ++++++++++++++++++++++
 drivers/gpio/Kconfig           |  4 ++
 drivers/gpio/gpio-ge.c         | 96 +++++++++++++++++-------------------------
 drivers/gpio/gpio-iop.c        | 96 ++++++++----------------------------------
 drivers/gpio/gpio-moxart.c     | 76 ++++++++++++---------------------
 drivers/gpio/gpio-timberdale.c | 90 ++++++++++++---------------------------
 6 files changed, 162 insertions(+), 250 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] gpio: moxart: convert to use basic mmio gpio library
@ 2014-11-17 13:58 Jonas Jensen
  0 siblings, 0 replies; 13+ messages in thread
From: Jonas Jensen @ 2014-11-17 13:58 UTC (permalink / raw)
  To: linux-gpio@vger.kernel.org

On 12 November 2014 13:00, Kamlakant Patel <kamlakant.patel@linaro.org> wrote:
>
> Hi Jonas,
>
> This is an updated version of the previous patch with some fixes.
> Could you please try it out.

Thanks, it works, tested on UC-7112-LX hardware.

I have one additional nit..

The GPIO base number is implicitly changed from 0 to 224
(ARCH_NR_GPIOS (256) - ngpio (32)) which happen because of
bgpio_init() (it sets base -1 / gpiochip_find_base() on
gpiochip_add()). Which is confusing since the valid range (from user
space) used to be 0-31. So on export we now get:

[root@zurkon ~]# echo 24 > /sys/class/gpio/export
    [   61.640000] gpio-24 (?): gpiod_request: status -517
    [   61.650000] export_store: status -19

I see other drivers explicitly set base after bgpio_init(), my
suggestion is that we do the same here e.g. :

> +       bgc->gc.label = "moxart-gpio";
> +       bgc->gc.request = moxart_gpio_request;
> +       bgc->gc.free = moxart_gpio_free;
> +       bgc->gc.get = moxart_gpio_get;
> +       bgc->data = bgc->read_reg(bgc->reg_set);
> +       bgc->gc.ngpio = 32;
> +       bgc->gc.dev = dev;
> +       bgc->gc.owner = THIS_MODULE;

bgc->gc.base = 0;


Tested-by: Jonas Jensen <jonas.jensen@gmail.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-12-02 12:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 13:56 [PATCH 0/5] convert to use basic mmio gpio library kamlakant.patel
2014-10-29 13:56 ` [PATCH 1/5] gpio: moxart: " kamlakant.patel
2014-11-03 14:08   ` Jonas Jensen
2014-11-07  4:31     ` Kamlakant Patel
2014-11-12 12:00     ` Kamlakant Patel
     [not found]       ` <CACmBeS1Gf4U-A_-HHy-c+iDRqt81vTaMxjKsekcjnVMvTxTBuw@mail.gmail.com>
     [not found]         ` <CA+aN+yvwDtsm5g2o4mQPUBgzjtkJMUu-DXzXfZKzFyGg-C0PJw@mail.gmail.com>
2014-11-28  8:02           ` Linus Walleij
2014-12-02 12:03             ` Kamlakant Patel
2014-10-29 13:56 ` [PATCH 2/5] gpio: timberdale: " kamlakant.patel
2014-10-29 13:56 ` [PATCH 3/5] gpio: iop: " kamlakant.patel
2014-10-29 13:56 ` [PATCH 4/5] gpio: ge: " kamlakant.patel
2014-11-07  9:10 ` [PATCH 0/5] " Alexandre Courbot
2014-11-13  9:48   ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2014-11-17 13:58 [PATCH 1/5] gpio: moxart: " Jonas Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).