2015-07-16 16:17 GMT+08:00 Linus Walleij <linus.walleij@xxxxxxxxxx>: > On Mon, Jun 29, 2015 at 4:35 AM, Jun Nie <jun.nie@xxxxxxxxxx> wrote: > >> Add ZTE zx296702 GPIO controller support >> >> Signed-off-by: Jun Nie <jun.nie@xxxxxxxxxx> > > Patch applied with Shawn's ACK. > > Kudos for using GPIOLIB_IRQCHIP, well done. > >> + if (of_property_read_bool(dev->of_node, "gpio-ranges")) >> + chip->uses_pinctrl = true; > > I see this follows the PL061 pattern, maybe we should start doing this > in the gpiolib core. A structure with all functions and flags can be feed to a new function that calls gpiochip_add(). We can abstract logic of struct gpio_chip members value assignment. For example, a struct gpio_chip with these members assigned at compiling stage can be copied directly to instantiation memory space and call gpiochip_add(). We can do this in driver too. For interrupt stuff, it is hard to abstract because argument vary much from driver to driver and different functions are called in different drivers. A structure can also serve more or less to abstract function calls, but not much. What's your thoughts? > > Yours, > Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html