Skip to content
Permalink
Browse files
gpio: regmap: set gpio_chip of_node
This is needed for properly registering GPIO regmap as a child of a regmap
pin controller.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Michael Walle <michael@walle.cc>
  • Loading branch information
Noltari authored and intel-lab-lkp committed Mar 7, 2021
1 parent c41d1b1 commit 46aec6ed90edf467c2e19c6e91e17d6b7567967f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
@@ -249,6 +249,10 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config

chip = &gpio->gpio_chip;
chip->parent = config->parent;
if (config->fwnode)
chip->of_node = to_of_node(config->fwnode);
else
chip->of_node = dev_of_node(config->parent);
chip->base = -1;
chip->ngpio = config->ngpio;
chip->names = config->names;
@@ -4,6 +4,7 @@
#define _LINUX_GPIO_REGMAP_H

struct device;
struct fwnode_handle;
struct gpio_regmap;
struct irq_domain;
struct regmap;
@@ -16,6 +17,7 @@ struct regmap;
* @parent: The parent device
* @regmap: The regmap used to access the registers
* given, the name of the device is used
* @fwnode: (Optional) The firmware node
* @label: (Optional) Descriptive name for GPIO controller.
* If not given, the name of the device is used.
* @ngpio: Number of GPIOs
@@ -57,6 +59,7 @@ struct regmap;
struct gpio_regmap_config {
struct device *parent;
struct regmap *regmap;
struct fwnode_handle *fwnode;

const char *label;
int ngpio;

0 comments on commit 46aec6e

Please sign in to comment.