aboutsummaryrefslogtreecommitdiff
path: root/include/linux/gpio/regmap.h
AgeCommit message (Collapse)AuthorFilesLines
2021-06-07gpio: regmap: move drvdata to config dataMichael Walle1-1/+5
Drop gpio_regmap_set_drvdata() and instead add it to the configuration data passed to gpio_regmap_register(). gpio_regmap_set_drvdata() can't really be used in a race free way. This is because the gpio_regmap object which is needed by _set_drvdata() is returned by gpio_regmap_register(). On the other hand, the callbacks which use the drvdata might already be called right after the gpiochip_add() call in gpio_regmap_register(). Therefore, we have to provide the drvdata early before we call gpiochip_add(). Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-03-29gpio: regmap: set gpio_chip of_nodeÁlvaro Fernández Rojas1-0/+4
This is needed for properly registering GPIO regmap as a child of a regmap pin controller. Signed-off-by: Álvaro Fernández Rojas <[email protected]> Reviewed-by: Michael Walle <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2020-07-27gpio: regmap: fix type clashMichael Walle1-1/+1
GPIO_REGMAP_ADDR_ZERO() cast to unsigned long but the actual config parameters are unsigned int. We use unsigned int here because that is the type which is used by the underlying regmap. Fixes: ebe363197e52 ("gpio: add a reusable generic gpio_chip using regmap") Reported-by: kernel test robot <[email protected]> Signed-off-by: Michael Walle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
2020-06-03gpio: add a reusable generic gpio_chip using regmapMichael Walle1-0/+86
There are quite a lot simple GPIO controller which are using regmap to access the hardware. This driver tries to be a base to unify existing code into one place. This won't cover everything but it should be a good starting point. It does not implement its own irq_chip because there is already a generic one for regmap based devices. Instead, the irq_chip will be instantiated in the parent driver and its irq domain will be associate to this driver. For now it consists of the usual registers, like set (and an optional clear) data register, an input register and direction registers. Out-of-the-box, it supports consecutive register mappings and mappings where the registers have gaps between them with a linear mapping between GPIO offset and bit position. For weirder mappings the user can register its own .xlate(). Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>