Skip to content

Commit 7697c64

Browse files
William Breathitt Graybroonie
authored andcommitted
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: William Breathitt Gray <william.gray@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20e15cd3afae80922b7e0577c7741df86b3390c5.1680708357.git.william.gray@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e8d018d commit 7697c64

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

drivers/base/regmap/regmap-irq.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
329329
}
330330

331331
if (d->chip->set_type_config) {
332-
ret = d->chip->set_type_config(d->config_buf, type,
333-
irq_data, reg);
332+
ret = d->chip->set_type_config(d->config_buf, type, irq_data,
333+
reg, d->chip->irq_drv_data);
334334
if (ret)
335335
return ret;
336336
}
@@ -651,13 +651,15 @@ EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
651651
* @type: The requested IRQ type.
652652
* @irq_data: The IRQ being configured.
653653
* @idx: Index of the irq's config registers within each array `buf[i]`
654+
* @irq_drv_data: Driver specific IRQ data
654655
*
655656
* This is a &struct regmap_irq_chip->set_type_config callback suitable for
656657
* chips with one config register. Register values are updated according to
657658
* the &struct regmap_irq_type data associated with an IRQ.
658659
*/
659660
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
660-
const struct regmap_irq *irq_data, int idx)
661+
const struct regmap_irq *irq_data,
662+
int idx, void *irq_drv_data)
661663
{
662664
const struct regmap_irq_type *t = &irq_data->type;
663665

include/linux/regmap.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,8 @@ struct regmap_irq_chip {
16501650
int (*set_type_virt)(unsigned int **buf, unsigned int type,
16511651
unsigned long hwirq, int reg);
16521652
int (*set_type_config)(unsigned int **buf, unsigned int type,
1653-
const struct regmap_irq *irq_data, int idx);
1653+
const struct regmap_irq *irq_data, int idx,
1654+
void *irq_drv_data);
16541655
unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
16551656
unsigned int base, int index);
16561657
void *irq_drv_data;
@@ -1659,7 +1660,8 @@ struct regmap_irq_chip {
16591660
unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
16601661
unsigned int base, int index);
16611662
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
1662-
const struct regmap_irq *irq_data, int idx);
1663+
const struct regmap_irq *irq_data,
1664+
int idx, void *irq_drv_data);
16631665

16641666
int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
16651667
int irq_base, const struct regmap_irq_chip *chip,

0 commit comments

Comments
 (0)