Skip to content

Commit f33a751

Browse files
Aidan MacDonaldbroonie
authored andcommitted
regmap-irq: Remove virtual registers
No remaining users, and it's been replaced by config registers. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com Link: https://lore.kernel.org/r/20230509110100.3980123-3-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org
1 parent 212bc1c commit f33a751

2 files changed

Lines changed: 0 additions & 60 deletions

File tree

drivers/base/regmap/regmap-irq.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct regmap_irq_chip_data {
4141
unsigned int *wake_buf;
4242
unsigned int *type_buf;
4343
unsigned int *type_buf_def;
44-
unsigned int **virt_buf;
4544
unsigned int **config_buf;
4645

4746
unsigned int irq_reg_stride;
@@ -196,20 +195,6 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
196195
}
197196
}
198197

199-
if (d->chip->num_virt_regs) {
200-
for (i = 0; i < d->chip->num_virt_regs; i++) {
201-
for (j = 0; j < d->chip->num_regs; j++) {
202-
reg = d->get_irq_reg(d, d->chip->virt_reg_base[i],
203-
j);
204-
ret = regmap_write(map, reg, d->virt_buf[i][j]);
205-
if (ret != 0)
206-
dev_err(d->map->dev,
207-
"Failed to write virt 0x%x: %d\n",
208-
reg, ret);
209-
}
210-
}
211-
}
212-
213198
for (i = 0; i < d->chip->num_config_bases; i++) {
214199
for (j = 0; j < d->chip->num_config_regs; j++) {
215200
reg = d->get_irq_reg(d, d->chip->config_base[i], j);
@@ -320,13 +305,6 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
320305
return -EINVAL;
321306
}
322307

323-
if (d->chip->set_type_virt) {
324-
ret = d->chip->set_type_virt(d->virt_buf, type, data->hwirq,
325-
reg);
326-
if (ret)
327-
return ret;
328-
}
329-
330308
if (d->chip->set_type_config) {
331309
ret = d->chip->set_type_config(d->config_buf, type, irq_data,
332310
reg, d->chip->irq_drv_data);
@@ -758,9 +736,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
758736
if (chip->num_type_reg)
759737
dev_warn(map->dev, "type registers are deprecated; use config registers instead");
760738

761-
if (chip->num_virt_regs || chip->virt_reg_base || chip->set_type_virt)
762-
dev_warn(map->dev, "virtual registers are deprecated; use config registers instead");
763-
764739
if (irq_base) {
765740
irq_base = irq_alloc_descs(irq_base, 0, chip->num_irqs, 0);
766741
if (irq_base < 0) {
@@ -824,24 +799,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
824799
goto err_alloc;
825800
}
826801

827-
if (chip->num_virt_regs) {
828-
/*
829-
* Create virt_buf[chip->num_extra_config_regs][chip->num_regs]
830-
*/
831-
d->virt_buf = kcalloc(chip->num_virt_regs, sizeof(*d->virt_buf),
832-
GFP_KERNEL);
833-
if (!d->virt_buf)
834-
goto err_alloc;
835-
836-
for (i = 0; i < chip->num_virt_regs; i++) {
837-
d->virt_buf[i] = kcalloc(chip->num_regs,
838-
sizeof(**d->virt_buf),
839-
GFP_KERNEL);
840-
if (!d->virt_buf[i])
841-
goto err_alloc;
842-
}
843-
}
844-
845802
if (chip->num_config_bases && chip->num_config_regs) {
846803
/*
847804
* Create config_buf[num_config_bases][num_config_regs]
@@ -1063,11 +1020,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
10631020
kfree(d->mask_buf);
10641021
kfree(d->status_buf);
10651022
kfree(d->status_reg_buf);
1066-
if (d->virt_buf) {
1067-
for (i = 0; i < chip->num_virt_regs; i++)
1068-
kfree(d->virt_buf[i]);
1069-
kfree(d->virt_buf);
1070-
}
10711023
if (d->config_buf) {
10721024
for (i = 0; i < chip->num_config_bases; i++)
10731025
kfree(d->config_buf[i]);

include/linux/regmap.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,6 @@ struct regmap_irq_chip_data;
15441544
* @wake_base: Base address for wake enables. If zero unsupported.
15451545
* @type_base: Base address for irq type. If zero unsupported. Deprecated,
15461546
* use @config_base instead.
1547-
* @virt_reg_base: Base addresses for extra config regs. Deprecated, use
1548-
* @config_base instead.
15491547
* @config_base: Base address for IRQ type config regs. If null unsupported.
15501548
* @irq_reg_stride: Stride to use for chips where registers are not contiguous.
15511549
* @init_ack_masked: Ack all masked interrupts once during initalization.
@@ -1586,9 +1584,6 @@ struct regmap_irq_chip_data;
15861584
*
15871585
* @num_type_reg: Number of type registers. Deprecated, use config registers
15881586
* instead.
1589-
* @num_virt_regs: Number of non-standard irq configuration registers.
1590-
* If zero unsupported. Deprecated, use config registers
1591-
* instead.
15921587
* @num_config_bases: Number of config base registers.
15931588
* @num_config_regs: Number of config registers for each config base register.
15941589
*
@@ -1598,9 +1593,6 @@ struct regmap_irq_chip_data;
15981593
* after handling the interrupts in regmap_irq_handler().
15991594
* @handle_mask_sync: Callback used to handle IRQ mask syncs. The index will be
16001595
* in the range [0, num_regs)
1601-
* @set_type_virt: Driver specific callback to extend regmap_irq_set_type()
1602-
* and configure virt regs. Deprecated, use @set_type_config
1603-
* callback and config registers instead.
16041596
* @set_type_config: Callback used for configuring irq types.
16051597
* @get_irq_reg: Callback for mapping (base register, index) pairs to register
16061598
* addresses. The base register will be one of @status_base,
@@ -1630,7 +1622,6 @@ struct regmap_irq_chip {
16301622
unsigned int ack_base;
16311623
unsigned int wake_base;
16321624
unsigned int type_base;
1633-
unsigned int *virt_reg_base;
16341625
const unsigned int *config_base;
16351626
unsigned int irq_reg_stride;
16361627
unsigned int init_ack_masked:1;
@@ -1652,16 +1643,13 @@ struct regmap_irq_chip {
16521643
int num_irqs;
16531644

16541645
int num_type_reg;
1655-
int num_virt_regs;
16561646
int num_config_bases;
16571647
int num_config_regs;
16581648

16591649
int (*handle_pre_irq)(void *irq_drv_data);
16601650
int (*handle_post_irq)(void *irq_drv_data);
16611651
int (*handle_mask_sync)(int index, unsigned int mask_buf_def,
16621652
unsigned int mask_buf, void *irq_drv_data);
1663-
int (*set_type_virt)(unsigned int **buf, unsigned int type,
1664-
unsigned long hwirq, int reg);
16651653
int (*set_type_config)(unsigned int **buf, unsigned int type,
16661654
const struct regmap_irq *irq_data, int idx,
16671655
void *irq_drv_data);

0 commit comments

Comments
 (0)