Commit a36516b0 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Samuel Ortiz

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: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 88b62b91
...@@ -39,6 +39,14 @@ enum palmas_ids { ...@@ -39,6 +39,14 @@ enum palmas_ids {
PALMAS_USB_ID, PALMAS_USB_ID,
}; };
static struct resource palmas_rtc_resources[] = {
{
.start = PALMAS_RTC_ALARM_IRQ,
.end = PALMAS_RTC_ALARM_IRQ,
.flags = IORESOURCE_IRQ,
},
};
static const struct mfd_cell palmas_children[] = { static const struct mfd_cell palmas_children[] = {
{ {
.name = "palmas-pmic", .name = "palmas-pmic",
...@@ -59,6 +67,8 @@ static const struct mfd_cell palmas_children[] = { ...@@ -59,6 +67,8 @@ static const struct mfd_cell palmas_children[] = {
{ {
.name = "palmas-rtc", .name = "palmas-rtc",
.id = PALMAS_RTC_ID, .id = PALMAS_RTC_ID,
.resources = &palmas_rtc_resources[0],
.num_resources = ARRAY_SIZE(palmas_rtc_resources),
}, },
{ {
.name = "palmas-pwrbutton", .name = "palmas-pwrbutton",
...@@ -456,8 +466,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c, ...@@ -456,8 +466,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
ret = mfd_add_devices(palmas->dev, -1, ret = mfd_add_devices(palmas->dev, -1,
children, ARRAY_SIZE(palmas_children), children, ARRAY_SIZE(palmas_children),
NULL, regmap_irq_chip_get_base(palmas->irq_data), NULL, 0,
NULL); regmap_irq_get_domain(palmas->irq_data));
kfree(children); kfree(children);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment