diff options
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-power.c | 10 | ||||
-rw-r--r-- | drivers/mfd/tps80031.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-tps80031.c | 12 | ||||
-rw-r--r-- | include/linux/mfd/tps80031.h | 1 |
4 files changed, 15 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c index 9f3f8ae79dbf..4bf7f03e8d6d 100644 --- a/arch/arm/mach-tegra/board-enterprise-power.c +++ b/arch/arm/mach-tegra/board-enterprise-power.c @@ -333,13 +333,6 @@ static struct tps80031_bg_platform_data battery_gauge_data = { .battery_present = 1, }; -#define TPS_RTC() \ - { \ - .id = 0, \ - .name = "rtc_tps80031", \ - .platform_data = &rtc_data, \ - } - #define TPS_BATTERY() \ { \ .name = "tps80031-charger", \ @@ -356,14 +349,12 @@ static struct tps80031_bg_platform_data battery_gauge_data = { } #define TPS80031_DEVS_COMMON \ - TPS_RTC(), \ TPS_BATTERY(), \ TPS_BATTERY_GAUGE(), \ TPS_GPADC() static struct tps80031_subdev_info tps80031_devs[] = { - TPS_RTC(), TPS_BATTERY(), TPS_BATTERY_GAUGE(), TPS_GPADC() @@ -451,6 +442,7 @@ static struct tps80031_platform_data tps_platform = { .clk32k_init_data = clk32k_idata, .clk32k_init_data_size = ARRAY_SIZE(clk32k_idata), .use_power_off = true, + .rtc_pdata = &rtc_data, }; static struct i2c_board_info __initdata enterprise_regulators[] = { diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c index f524b2964068..a1b6237bfd02 100644 --- a/drivers/mfd/tps80031.c +++ b/drivers/mfd/tps80031.c @@ -302,6 +302,9 @@ static struct mfd_cell tps80031_cell[] = { { .name = "tps80031-regulators", }, + { + .name = "tps80031-rtc", + }, }; diff --git a/drivers/rtc/rtc-tps80031.c b/drivers/rtc/rtc-tps80031.c index b2b9d04171c5..44013e13fe43 100644 --- a/drivers/rtc/rtc-tps80031.c +++ b/drivers/rtc/rtc-tps80031.c @@ -349,12 +349,20 @@ static irqreturn_t tps80031_rtc_irq(int irq, void *data) static int __devinit tps80031_rtc_probe(struct platform_device *pdev) { - struct tps80031_rtc_platform_data *pdata = pdev->dev.platform_data; + struct tps80031_platform_data *tps80031_pdata; + struct tps80031_rtc_platform_data *pdata; struct tps80031_rtc *rtc; struct rtc_time tm; int err; u8 reg; + tps80031_pdata = dev_get_platdata(pdev->dev.parent); + if (!tps80031_pdata) { + dev_err(&pdev->dev, "no tps80031 platform_data specified\n"); + return -EINVAL; + } + + pdata = tps80031_pdata->rtc_pdata; if (!pdata) { dev_err(&pdev->dev, "no platform_data specified\n"); return -EINVAL; @@ -469,7 +477,7 @@ static int __devexit tps80031_rtc_remove(struct platform_device *pdev) static struct platform_driver tps80031_rtc_driver = { .driver = { - .name = "rtc_tps80031", + .name = "tps80031-rtc", .owner = THIS_MODULE, }, .probe = tps80031_rtc_probe, diff --git a/include/linux/mfd/tps80031.h b/include/linux/mfd/tps80031.h index 974fc0db0ff2..d0cef7395172 100644 --- a/include/linux/mfd/tps80031.h +++ b/include/linux/mfd/tps80031.h @@ -199,6 +199,7 @@ struct tps80031_platform_data { int pupd_init_data_size; struct tps80031_regulator_platform_data **regulator_pdata; int num_regulator_pdata; + struct tps80031_rtc_platform_data *rtc_pdata; }; struct tps80031_bg_platform_data { |