diff mbox series

[1/3] regmap: Pass regmap and irq_drv_data as parameters for set_type_config()

Message ID c94de04b84d66b9686e26cb7653ae360f3075ede.1677547393.git.william.gray@linaro.org
State New
Headers show
Series Migrate PCIe-IDIO-24 GPIO driver to the regmap API | expand

Commit Message

William Breathitt Gray Feb. 28, 2023, 1:53 a.m. UTC
Allow struct regmap_irq_chip set_type_config() callbacks to access the
device regmap and irq_drv_data by passing them as parameters.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
 drivers/base/regmap/regmap-irq.c | 13 +++++++++----
 include/linux/regmap.h           | 12 ++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index a8f185430a07..eac55a3af6d9 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -333,8 +333,9 @@  static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
 	}
 
 	if (d->chip->set_type_config) {
-		ret = d->chip->set_type_config(d->config_buf, type,
-					       irq_data, reg);
+		ret = d->chip->set_type_config(map, d->config_buf, type,
+					       irq_data, reg,
+					       d->chip->irq_drv_data);
 		if (ret)
 			return ret;
 	}
@@ -650,18 +651,22 @@  EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
 
 /**
  * regmap_irq_set_type_config_simple() - Simple IRQ type configuration callback.
+ * @map: The regmap for the device.
  * @buf: Buffer containing configuration register values, this is a 2D array of
  *       `num_config_bases` rows, each of `num_config_regs` elements.
  * @type: The requested IRQ type.
  * @irq_data: The IRQ being configured.
  * @idx: Index of the irq's config registers within each array `buf[i]`
+ * @irq_drv_data: Driver specific IRQ data
  *
  * This is a &struct regmap_irq_chip->set_type_config callback suitable for
  * chips with one config register. Register values are updated according to
  * the &struct regmap_irq_type data associated with an IRQ.
  */
-int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
-				      const struct regmap_irq *irq_data, int idx)
+int regmap_irq_set_type_config_simple(struct regmap *map, unsigned int **buf,
+				      unsigned int type,
+				      const struct regmap_irq *irq_data,
+				      int idx, void *irq_drv_data)
 {
 	const struct regmap_irq_type *t = &irq_data->type;
 
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index a3bc695bcca0..49073f5ae87a 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1648,8 +1648,10 @@  struct regmap_irq_chip {
 				unsigned int mask_buf, void *irq_drv_data);
 	int (*set_type_virt)(unsigned int **buf, unsigned int type,
 			     unsigned long hwirq, int reg);
-	int (*set_type_config)(unsigned int **buf, unsigned int type,
-			       const struct regmap_irq *irq_data, int idx);
+	int (*set_type_config)(struct regmap *map, unsigned int **buf,
+			       unsigned int type,
+			       const struct regmap_irq *irq_data, int idx,
+			       void *irq_drv_data);
 	unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
 				    unsigned int base, int index);
 	void *irq_drv_data;
@@ -1657,8 +1659,10 @@  struct regmap_irq_chip {
 
 unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
 					   unsigned int base, int index);
-int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
-				      const struct regmap_irq *irq_data, int idx);
+int regmap_irq_set_type_config_simple(struct regmap *map, unsigned int **buf,
+				      unsigned int type,
+				      const struct regmap_irq *irq_data,
+				      int idx, void *irq_drv_data);
 
 int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 			int irq_base, const struct regmap_irq_chip *chip,