Commit 7697c64b authored by William Breathitt Gray's avatar William Breathitt Gray Committed by Mark Brown

regmap: Pass irq_drv_data as a parameter for set_type_config()

Allow the struct regmap_irq_chip set_type_config() callback to access
irq_drv_data by passing it as a parameter.
Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20e15cd3afae80922b7e0577c7741df86b3390c5.1680708357.git.william.gray@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e8d018dd
...@@ -329,8 +329,8 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type) ...@@ -329,8 +329,8 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
} }
if (d->chip->set_type_config) { if (d->chip->set_type_config) {
ret = d->chip->set_type_config(d->config_buf, type, ret = d->chip->set_type_config(d->config_buf, type, irq_data,
irq_data, reg); reg, d->chip->irq_drv_data);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -651,13 +651,15 @@ EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear); ...@@ -651,13 +651,15 @@ EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
* @type: The requested IRQ type. * @type: The requested IRQ type.
* @irq_data: The IRQ being configured. * @irq_data: The IRQ being configured.
* @idx: Index of the irq's config registers within each array `buf[i]` * @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 * This is a &struct regmap_irq_chip->set_type_config callback suitable for
* chips with one config register. Register values are updated according to * chips with one config register. Register values are updated according to
* the &struct regmap_irq_type data associated with an IRQ. * the &struct regmap_irq_type data associated with an IRQ.
*/ */
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type, int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
const struct regmap_irq *irq_data, int idx) const struct regmap_irq *irq_data,
int idx, void *irq_drv_data)
{ {
const struct regmap_irq_type *t = &irq_data->type; const struct regmap_irq_type *t = &irq_data->type;
......
...@@ -1650,7 +1650,8 @@ struct regmap_irq_chip { ...@@ -1650,7 +1650,8 @@ struct regmap_irq_chip {
int (*set_type_virt)(unsigned int **buf, unsigned int type, int (*set_type_virt)(unsigned int **buf, unsigned int type,
unsigned long hwirq, int reg); unsigned long hwirq, int reg);
int (*set_type_config)(unsigned int **buf, unsigned int type, int (*set_type_config)(unsigned int **buf, unsigned int type,
const struct regmap_irq *irq_data, int idx); 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 (*get_irq_reg)(struct regmap_irq_chip_data *data,
unsigned int base, int index); unsigned int base, int index);
void *irq_drv_data; void *irq_drv_data;
...@@ -1659,7 +1660,8 @@ struct regmap_irq_chip { ...@@ -1659,7 +1660,8 @@ struct regmap_irq_chip {
unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data, unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
unsigned int base, int index); unsigned int base, int index);
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type, int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
const struct regmap_irq *irq_data, int idx); 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 regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
int irq_base, const struct regmap_irq_chip *chip, int irq_base, const struct regmap_irq_chip *chip,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment