From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 11 Apr 2014 13:25:03 +0200 Subject: [PATCH v4 1/9] mfd: AXP20x: Add mfd driver for AXP20x PMIC In-Reply-To: <1397209093-10077-2-git-send-email-carlo@caione.org> References: <1397209093-10077-1-git-send-email-carlo@caione.org> <1397209093-10077-2-git-send-email-carlo@caione.org> Message-ID: <235623053.nj0gFkxyW5@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Friday 11 April 2014 11:38:05 Carlo Caione wrote: > +#define AXP20X_IRQ(_irq, _off, _mask) \ > + [AXP20X_IRQ_##_irq] = { .reg_offset = (_off), .mask = BIT(_mask) } > + > +static const struct regmap_irq axp20x_regmap_irqs[] = { > + AXP20X_IRQ(ACIN_OVER_V, 0, 7), > + AXP20X_IRQ(ACIN_PLUGIN, 0, 6), > + AXP20X_IRQ(ACIN_REMOVAL, 0, 5), > + AXP20X_IRQ(VBUS_OVER_V, 0, 4), > + AXP20X_IRQ(VBUS_PLUGIN, 0, 3), > + AXP20X_IRQ(VBUS_REMOVAL, 0, 2), > + AXP20X_IRQ(VBUS_V_LOW, 0, 1), > + AXP20X_IRQ(BATT_PLUGIN, 1, 7), > + AXP20X_IRQ(BATT_REMOVAL, 1, 6), > + AXP20X_IRQ(BATT_ENT_ACT_MODE, 1, 5), > + AXP20X_IRQ(BATT_EXIT_ACT_MODE, 1, 4), > + AXP20X_IRQ(CHARG, 1, 3), > + AXP20X_IRQ(CHARG_DONE, 1, 2), > + AXP20X_IRQ(BATT_TEMP_HIGH, 1, 1), Why do you have to enumerate the interrupts here? Can't you just put all the numbers into the DT nodes of the devices using them? In general, I would say that the mfd driver should not care about what is connected to it. Arnd