Skip to content

Commit 383b323

Browse files
committed
Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers
Merge series from William Breathitt Gray <william.gray@linaro.org>: The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver. A patch to pass irq_drv_data as a parameter for struct regmap_irq_chip set_type_config() is included. This is needed by the idio_24_set_type_config() and ws16c48_set_type_config() callbacks in order to update the type configuration on their respective devices.
2 parents fac79ba + 7697c64 commit 383b323

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
}
@@ -654,13 +654,15 @@ EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
654654
* @type: The requested IRQ type.
655655
* @irq_data: The IRQ being configured.
656656
* @idx: Index of the irq's config registers within each array `buf[i]`
657+
* @irq_drv_data: Driver specific IRQ data
657658
*
658659
* This is a &struct regmap_irq_chip->set_type_config callback suitable for
659660
* chips with one config register. Register values are updated according to
660661
* the &struct regmap_irq_type data associated with an IRQ.
661662
*/
662663
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
663-
const struct regmap_irq *irq_data, int idx)
664+
const struct regmap_irq *irq_data,
665+
int idx, void *irq_drv_data)
664666
{
665667
const struct regmap_irq_type *t = &irq_data->type;
666668

include/linux/regmap.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,8 @@ struct regmap_irq_chip {
16551655
int (*set_type_virt)(unsigned int **buf, unsigned int type,
16561656
unsigned long hwirq, int reg);
16571657
int (*set_type_config)(unsigned int **buf, unsigned int type,
1658-
const struct regmap_irq *irq_data, int idx);
1658+
const struct regmap_irq *irq_data, int idx,
1659+
void *irq_drv_data);
16591660
unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
16601661
unsigned int base, int index);
16611662
void *irq_drv_data;
@@ -1664,7 +1665,8 @@ struct regmap_irq_chip {
16641665
unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
16651666
unsigned int base, int index);
16661667
int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
1667-
const struct regmap_irq *irq_data, int idx);
1668+
const struct regmap_irq *irq_data,
1669+
int idx, void *irq_drv_data);
16681670

16691671
int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
16701672
int irq_base, const struct regmap_irq_chip *chip,

0 commit comments

Comments
 (0)