diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-05-06 05:21:20 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:34 -0400 |
commit | 008b30408c40ede5985397e7daac45d30b375a01 (patch) | |
tree | 4396b8f96ac1aa480cfdfa61a18a2e10051de93a /drivers/mfd | |
parent | db13c04002e0d896f89657f9b2837a8ecfbb19b6 (diff) |
mfd: Add rtc support to 88pm860x
Enable rtc function in 88pm860x PMIC.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 7ba4aafb051d..f2cac9287756 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -90,6 +90,10 @@ static struct resource charger_resources[] __devinitdata = { | |||
90 | {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, | 90 | {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct resource rtc_resources[] __devinitdata = { | ||
94 | {PM8607_IRQ_RTC, PM8607_IRQ_RTC, "rtc", IORESOURCE_IRQ,}, | ||
95 | }; | ||
96 | |||
93 | static struct mfd_cell bk_devs[] = { | 97 | static struct mfd_cell bk_devs[] = { |
94 | {"88pm860x-backlight", 0,}, | 98 | {"88pm860x-backlight", 0,}, |
95 | {"88pm860x-backlight", 1,}, | 99 | {"88pm860x-backlight", 1,}, |
@@ -143,6 +147,10 @@ static struct mfd_cell power_devs[] = { | |||
143 | {"88pm860x-charger", -1,}, | 147 | {"88pm860x-charger", -1,}, |
144 | }; | 148 | }; |
145 | 149 | ||
150 | static struct mfd_cell rtc_devs[] = { | ||
151 | {"88pm860x-rtc", -1,}, | ||
152 | }; | ||
153 | |||
146 | static struct pm860x_backlight_pdata bk_pdata[ARRAY_SIZE(bk_devs)]; | 154 | static struct pm860x_backlight_pdata bk_pdata[ARRAY_SIZE(bk_devs)]; |
147 | static struct pm860x_led_pdata led_pdata[ARRAY_SIZE(led_devs)]; | 155 | static struct pm860x_led_pdata led_pdata[ARRAY_SIZE(led_devs)]; |
148 | static struct regulator_init_data regulator_pdata[ARRAY_SIZE(regulator_devs)]; | 156 | static struct regulator_init_data regulator_pdata[ARRAY_SIZE(regulator_devs)]; |
@@ -635,6 +643,26 @@ out: | |||
635 | return; | 643 | return; |
636 | } | 644 | } |
637 | 645 | ||
646 | static void __devinit device_rtc_init(struct pm860x_chip *chip, | ||
647 | struct i2c_client *i2c, | ||
648 | struct pm860x_platform_data *pdata) | ||
649 | { | ||
650 | int ret; | ||
651 | |||
652 | if ((pdata == NULL)) | ||
653 | return; | ||
654 | |||
655 | rtc_devs[0].platform_data = pdata->rtc; | ||
656 | rtc_devs[0].pdata_size = sizeof(struct pm860x_rtc_pdata); | ||
657 | rtc_devs[0].num_resources = ARRAY_SIZE(rtc_resources); | ||
658 | rtc_devs[0].resources = &rtc_resources[0]; | ||
659 | ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], | ||
660 | ARRAY_SIZE(rtc_devs), &rtc_resources[0], | ||
661 | chip->irq_base); | ||
662 | if (ret < 0) | ||
663 | dev_err(chip->dev, "Failed to add rtc subdev\n"); | ||
664 | } | ||
665 | |||
638 | static void __devinit device_touch_init(struct pm860x_chip *chip, | 666 | static void __devinit device_touch_init(struct pm860x_chip *chip, |
639 | struct i2c_client *i2c, | 667 | struct i2c_client *i2c, |
640 | struct pm860x_platform_data *pdata) | 668 | struct pm860x_platform_data *pdata) |
@@ -770,6 +798,7 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, | |||
770 | goto out; | 798 | goto out; |
771 | 799 | ||
772 | device_regulator_init(chip, i2c, pdata); | 800 | device_regulator_init(chip, i2c, pdata); |
801 | device_rtc_init(chip, i2c, pdata); | ||
773 | device_onkey_init(chip, i2c, pdata); | 802 | device_onkey_init(chip, i2c, pdata); |
774 | device_touch_init(chip, i2c, pdata); | 803 | device_touch_init(chip, i2c, pdata); |
775 | device_power_init(chip, i2c, pdata); | 804 | device_power_init(chip, i2c, pdata); |