aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/palmas.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-01-03 05:46:57 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-13 18:22:44 -0500
commita36516b016f52f0f6e5284025e3487f63b4be33b (patch)
tree240bad9dddca57a6e81eab93ed77ed9c13c5a9c2 /drivers/mfd/palmas.c
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
mfd: palmas: Add rtc irq number as irq resource for palmas-rtc
Palma RTC is capable of generating alarm interrupt. Pass the alarm interrupt as IRQ_RESOURCE for palmas-rtc sub device driver so that rtc driver can get irq as platform_get_irq(). Also pass the irq domain in mfd_add_devices() to properly offset the irqs for sub devices. This is needed when adding device through DT. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/palmas.c')
-rw-r--r--drivers/mfd/palmas.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 6ffd7a2affdc..bbdbc50a3cca 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -39,6 +39,14 @@ enum palmas_ids {
39 PALMAS_USB_ID, 39 PALMAS_USB_ID,
40}; 40};
41 41
42static struct resource palmas_rtc_resources[] = {
43 {
44 .start = PALMAS_RTC_ALARM_IRQ,
45 .end = PALMAS_RTC_ALARM_IRQ,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
42static const struct mfd_cell palmas_children[] = { 50static const struct mfd_cell palmas_children[] = {
43 { 51 {
44 .name = "palmas-pmic", 52 .name = "palmas-pmic",
@@ -59,6 +67,8 @@ static const struct mfd_cell palmas_children[] = {
59 { 67 {
60 .name = "palmas-rtc", 68 .name = "palmas-rtc",
61 .id = PALMAS_RTC_ID, 69 .id = PALMAS_RTC_ID,
70 .resources = &palmas_rtc_resources[0],
71 .num_resources = ARRAY_SIZE(palmas_rtc_resources),
62 }, 72 },
63 { 73 {
64 .name = "palmas-pwrbutton", 74 .name = "palmas-pwrbutton",
@@ -456,8 +466,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
456 466
457 ret = mfd_add_devices(palmas->dev, -1, 467 ret = mfd_add_devices(palmas->dev, -1,
458 children, ARRAY_SIZE(palmas_children), 468 children, ARRAY_SIZE(palmas_children),
459 NULL, regmap_irq_chip_get_base(palmas->irq_data), 469 NULL, 0,
460 NULL); 470 regmap_irq_get_domain(palmas->irq_data));
461 kfree(children); 471 kfree(children);
462 472
463 if (ret < 0) 473 if (ret < 0)