summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-core.c
diff options
context:
space:
mode:
authorAlexandre Torgue <alexandre.torgue@st.com>2013-05-24 11:59:47 +0200
committerLee Jones <lee.jones@linaro.org>2013-06-13 10:51:52 +0100
commit9c717cf3fa16f8ae8c6ccb8f4f8e784404ac9689 (patch)
tree37087f2d0e4646051c0c7a229086a87f3bd6e0ea /drivers/mfd/ab8500-core.c
parent2809126512fcbd61ce3140af0bc255b441fcdaf9 (diff)
mfd: ab8500-core: Add device for new RTC version for AB8540 cut2
AB8540 RTC have changed between AB8540_cut1 and AB8540_cut2.Different ressources to define for those two version. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Julien Delacou <julien.delacou@stericsson.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-core.c')
-rw-r--r--drivers/mfd/ab8500-core.c55
1 files changed, 47 insertions, 8 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 1863985df615..02698da00b78 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -650,6 +650,21 @@ static struct resource ab8500_rtc_resources[] = {
},
};
+static struct resource ab8540_rtc_resources[] = {
+ {
+ .name = "1S",
+ .start = AB8540_INT_RTC_1S,
+ .end = AB8540_INT_RTC_1S,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .name = "ALARM",
+ .start = AB8500_INT_RTC_ALARM,
+ .end = AB8500_INT_RTC_ALARM,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
static struct resource ab8500_poweronkey_db_resources[] = {
{
.name = "ONKEY_DBF",
@@ -1277,11 +1292,6 @@ static struct mfd_cell ab8540_devs[] = {
.resources = ab8505_gpadc_resources,
},
{
- .name = "ab8500-rtc",
- .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
- .resources = ab8500_rtc_resources,
- },
- {
.name = "ab8500-acc-det",
.num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
.resources = ab8500_av_acc_detect_resources,
@@ -1318,6 +1328,24 @@ static struct mfd_cell ab8540_devs[] = {
},
};
+static struct mfd_cell ab8540_cut1_devs[] = {
+ {
+ .name = "ab8500-rtc",
+ .of_compatible = "stericsson,ab8500-rtc",
+ .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
+ .resources = ab8500_rtc_resources,
+ },
+};
+
+static struct mfd_cell ab8540_cut2_devs[] = {
+ {
+ .name = "ab8540-rtc",
+ .of_compatible = "stericsson,ab8540-rtc",
+ .num_resources = ARRAY_SIZE(ab8540_rtc_resources),
+ .resources = ab8540_rtc_resources,
+ },
+};
+
static ssize_t show_chip_id(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -1721,11 +1749,22 @@ static int ab8500_probe(struct platform_device *pdev)
ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
ARRAY_SIZE(ab9540_devs), NULL,
ab8500->irq_base, ab8500->domain);
- else if (is_ab8540(ab8500))
+ else if (is_ab8540(ab8500)) {
ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs,
ARRAY_SIZE(ab8540_devs), NULL,
- ab8500->irq_base, ab8500->domain);
- else if (is_ab8505(ab8500))
+ ab8500->irq_base, NULL);
+ if (ret)
+ return ret;
+
+ if (is_ab8540_1p2_or_earlier(ab8500))
+ ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs,
+ ARRAY_SIZE(ab8540_cut1_devs), NULL,
+ ab8500->irq_base, NULL);
+ else /* ab8540 >= cut2 */
+ ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs,
+ ARRAY_SIZE(ab8540_cut2_devs), NULL,
+ ab8500->irq_base, NULL);
+ } else if (is_ab8505(ab8500))
ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs,
ARRAY_SIZE(ab8505_devs), NULL,
ab8500->irq_base, ab8500->domain);