summaryrefslogtreecommitdiff
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-08-18 16:58:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-18 17:05:14 +0200
commitb240d0143bfbc96f610405f978e4753fd663cbfc (patch)
tree2886397dce432a8df89b3bec2140d7a64069736f /include/linux/mfd
parent78dd4243574ffc05c266e5cab7c0d3ebafea51dd (diff)
staging: mfd: hi6421-spmi-pmic: get rid of interrupt properties
Both irqnum and irqarray properties reflect the same thing: the number of bits and bytes for interrupts at this chipset. E. g.: irqnum = 8 x irqarray This can be seen by the way pending interrupts are handled: /* During probe time */ pmic->irqs = devm_kzalloc(dev, pmic->irqnum * sizeof(int), GFP_KERNEL); /* While handling IRQs */ for (i = 0; i < pmic->irqarray; i++) { pending = hi6421_spmi_pmic_read(pmic, (i + pmic->irq_addr)); pending &= 0xff; for_each_set_bit(offset, &pending, 8) generic_handle_irq(pmic->irqs[offset + i * 8]); } Going further, there are some logic at the driver which assumes that irqarray is 2: /* solve powerkey order */ if ((i == HISI_IRQ_KEY_NUM) && ((pending & HISI_IRQ_KEY_VALUE) == HISI_IRQ_KEY_VALUE)) { generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_DOWN]); generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_UP]); pending &= (~HISI_IRQ_KEY_VALUE); } As HISI_IRQ_KEY_DOWN and HISI_IRQ_KEY_UP are fixed values and don't depend on irqnum/irqarray. The IRQ addr and mask addr seem to be also fixed, based on some comments at the OF parsing code. So, get rid of them too, removing the of parsing function completely. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/e231244e42cb5b56240705cac2f987e11a078038.1597762400.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/hi6421-spmi-pmic.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/include/linux/mfd/hi6421-spmi-pmic.h b/include/linux/mfd/hi6421-spmi-pmic.h
index ff3adfa7b3ec..2c8896fd852e 100644
--- a/include/linux/mfd/hi6421-spmi-pmic.h
+++ b/include/linux/mfd/hi6421-spmi-pmic.h
@@ -17,16 +17,6 @@
#define HISI_ECO_MODE_ENABLE (1)
#define HISI_ECO_MODE_DISABLE (0)
-struct hi6421_spmi_irq_mask_info {
- int start_addr;
- int array;
-};
-
-struct hi6421_spmi_irq_info {
- int start_addr;
- int array;
-};
-
struct hi6421_spmi_pmic {
struct resource *res;
struct device *dev;
@@ -36,11 +26,6 @@ struct hi6421_spmi_pmic {
int irq;
int gpio;
unsigned int *irqs;
-
- int irqnum;
- int irqarray;
- int irq_mask_addr;
- int irq_addr;
};
int hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg);