Commit 008b3040 authored by Haojian Zhuang's avatar Haojian Zhuang Committed by Samuel Ortiz

mfd: Add rtc support to 88pm860x

Enable rtc function in 88pm860x PMIC.
Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@marvell.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent db13c040
...@@ -90,6 +90,10 @@ static struct resource charger_resources[] __devinitdata = { ...@@ -90,6 +90,10 @@ static struct resource charger_resources[] __devinitdata = {
{PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,}, {PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,},
}; };
static struct resource rtc_resources[] __devinitdata = {
{PM8607_IRQ_RTC, PM8607_IRQ_RTC, "rtc", IORESOURCE_IRQ,},
};
static struct mfd_cell bk_devs[] = { static struct mfd_cell bk_devs[] = {
{"88pm860x-backlight", 0,}, {"88pm860x-backlight", 0,},
{"88pm860x-backlight", 1,}, {"88pm860x-backlight", 1,},
...@@ -143,6 +147,10 @@ static struct mfd_cell power_devs[] = { ...@@ -143,6 +147,10 @@ static struct mfd_cell power_devs[] = {
{"88pm860x-charger", -1,}, {"88pm860x-charger", -1,},
}; };
static struct mfd_cell rtc_devs[] = {
{"88pm860x-rtc", -1,},
};
static struct pm860x_backlight_pdata bk_pdata[ARRAY_SIZE(bk_devs)]; static struct pm860x_backlight_pdata bk_pdata[ARRAY_SIZE(bk_devs)];
static struct pm860x_led_pdata led_pdata[ARRAY_SIZE(led_devs)]; static struct pm860x_led_pdata led_pdata[ARRAY_SIZE(led_devs)];
static struct regulator_init_data regulator_pdata[ARRAY_SIZE(regulator_devs)]; static struct regulator_init_data regulator_pdata[ARRAY_SIZE(regulator_devs)];
...@@ -635,6 +643,26 @@ static void __devinit device_regulator_init(struct pm860x_chip *chip, ...@@ -635,6 +643,26 @@ static void __devinit device_regulator_init(struct pm860x_chip *chip,
return; return;
} }
static void __devinit device_rtc_init(struct pm860x_chip *chip,
struct i2c_client *i2c,
struct pm860x_platform_data *pdata)
{
int ret;
if ((pdata == NULL))
return;
rtc_devs[0].platform_data = pdata->rtc;
rtc_devs[0].pdata_size = sizeof(struct pm860x_rtc_pdata);
rtc_devs[0].num_resources = ARRAY_SIZE(rtc_resources);
rtc_devs[0].resources = &rtc_resources[0];
ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0],
ARRAY_SIZE(rtc_devs), &rtc_resources[0],
chip->irq_base);
if (ret < 0)
dev_err(chip->dev, "Failed to add rtc subdev\n");
}
static void __devinit device_touch_init(struct pm860x_chip *chip, static void __devinit device_touch_init(struct pm860x_chip *chip,
struct i2c_client *i2c, struct i2c_client *i2c,
struct pm860x_platform_data *pdata) struct pm860x_platform_data *pdata)
...@@ -770,6 +798,7 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, ...@@ -770,6 +798,7 @@ static void __devinit device_8607_init(struct pm860x_chip *chip,
goto out; goto out;
device_regulator_init(chip, i2c, pdata); device_regulator_init(chip, i2c, pdata);
device_rtc_init(chip, i2c, pdata);
device_onkey_init(chip, i2c, pdata); device_onkey_init(chip, i2c, pdata);
device_touch_init(chip, i2c, pdata); device_touch_init(chip, i2c, pdata);
device_power_init(chip, i2c, pdata); device_power_init(chip, i2c, pdata);
......
...@@ -125,6 +125,16 @@ comment "I2C RTC drivers" ...@@ -125,6 +125,16 @@ comment "I2C RTC drivers"
if I2C if I2C
config RTC_DRV_88PM860X
tristate "Marvell 88PM860x"
depends on RTC_CLASS && I2C && MFD_88PM860X
help
If you say yes here you get support for RTC function in Marvell
88PM860x chips.
This driver can also be built as a module. If so, the module
will be called rtc-88pm860x.
config RTC_DRV_DS1307 config RTC_DRV_DS1307
tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025" tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025"
help help
......
...@@ -15,6 +15,7 @@ rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o ...@@ -15,6 +15,7 @@ rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o
# Keep the list ordered. # Keep the list ordered.
obj-$(CONFIG_RTC_DRV_88PM860X) += rtc-88pm860x.o
obj-$(CONFIG_RTC_DRV_AB3100) += rtc-ab3100.o obj-$(CONFIG_RTC_DRV_AB3100) += rtc-ab3100.o
obj-$(CONFIG_RTC_DRV_AB8500) += rtc-ab8500.o obj-$(CONFIG_RTC_DRV_AB8500) += rtc-ab8500.o
obj-$(CONFIG_RTC_DRV_AT32AP700X)+= rtc-at32ap700x.o obj-$(CONFIG_RTC_DRV_AT32AP700X)+= rtc-at32ap700x.o
......
This diff is collapsed.
...@@ -330,6 +330,11 @@ struct pm860x_led_pdata { ...@@ -330,6 +330,11 @@ struct pm860x_led_pdata {
unsigned long flags; unsigned long flags;
}; };
struct pm860x_rtc_pdata {
int (*sync)(unsigned int ticks);
int vrtc;
};
struct pm860x_touch_pdata { struct pm860x_touch_pdata {
int gpadc_prebias; int gpadc_prebias;
int slot_cycle; int slot_cycle;
...@@ -349,6 +354,7 @@ struct pm860x_power_pdata { ...@@ -349,6 +354,7 @@ struct pm860x_power_pdata {
struct pm860x_platform_data { struct pm860x_platform_data {
struct pm860x_backlight_pdata *backlight; struct pm860x_backlight_pdata *backlight;
struct pm860x_led_pdata *led; struct pm860x_led_pdata *led;
struct pm860x_rtc_pdata *rtc;
struct pm860x_touch_pdata *touch; struct pm860x_touch_pdata *touch;
struct pm860x_power_pdata *power; struct pm860x_power_pdata *power;
struct regulator_init_data *regulator; struct regulator_init_data *regulator;
......
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