Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-02-12 Thread Linus Walleij
On Thu, Feb 9, 2017 at 6:14 PM, Paul Cercueil wrote: >> If you're not just replacing these with GPIO_GENERIC, please also >> include a .get_direction() callback. > > My .direction_input() and .direction_output() callbacks just call into > the pinctrl driver, using pinctrl_gpio_direction_[in,out]p

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-02-09 Thread Paul Cercueil
Hi, What some drivers do when they just get/set a bit in a register to get/set or set the direction of a GPIO, is to select GPIO_GENERIC and just bgpio_init() with the right iomem pointers, then the core will register handlers for get, set, set_direcition callback and get_direction and your driv

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-02-03 Thread Linus Walleij
On Tue, Jan 31, 2017 at 4:29 PM, Paul Cercueil wrote: > Le 2017-01-31 15:20, Linus Walleij a écrit : > >>> + of_property_read_u32(dev->of_node, "base", &jzgc->gc.base); >> >> >> Remove this. Dynamic allocation should be fine, if you're using the >> new userspace ABI like tools/gpio/* or libgpiod a

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-01-31 Thread Paul Cercueil
Le 2017-01-31 15:20, Linus Walleij a écrit : + of_property_read_u32(dev->of_node, "base", &jzgc->gc.base); Remove this. Dynamic allocation should be fine, if you're using the new userspace ABI like tools/gpio/* or libgpiod and only that and in-kernel consumers, dynamic numbers are just fine.

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-01-31 Thread Linus Walleij
On Wed, Jan 25, 2017 at 7:51 PM, Paul Cercueil wrote: > This driver handles the GPIOs of all the Ingenic JZ47xx SoCs > currently supported by the upsteam Linux kernel. > > Signed-off-by: Paul Cercueil Looking nice. > +#define JZ4740_GPIO_DATA 0x10 > +#define JZ4740_GPIO_SELECT 0x50 >

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-01-31 Thread Linus Walleij
Forgot to mention this: On Wed, Jan 25, 2017 at 7:51 PM, Paul Cercueil wrote: > This driver handles the GPIOs of all the Ingenic JZ47xx SoCs > currently supported by the upsteam Linux kernel. > > Signed-off-by: Paul Cercueil (...) > + jzgc->gc.base = -1; Nice > + of_property_read_u

[PATCH v3 04/14] GPIO: Add gpio-ingenic driver

2017-01-25 Thread Paul Cercueil
This driver handles the GPIOs of all the Ingenic JZ47xx SoCs currently supported by the upsteam Linux kernel. Signed-off-by: Paul Cercueil --- drivers/gpio/Kconfig| 10 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-ingenic.c | 367