arm: tegra: Enabling RTC data based on defconfig
venu byravarasu [Tue, 26 Apr 2011 09:36:27 +0000 (14:36 +0530)]
Internal and PMU RTC data are enabled only when respective
macros are defined in the Cardhu defconfig file.

bug 793949

Original-Change-Id: Iefc074877b263f3620c5ad08026435b3232ae3aa
Reviewed-on: http://git-master/r/29637
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: Rbd711afd026a86e49fd967f549844231ee635de0

arch/arm/mach-tegra/board-cardhu-power.c
arch/arm/mach-tegra/board-cardhu.c

index 853e53d..f8d73f6 100644 (file)
@@ -239,6 +239,7 @@ TPS_PDATA_INIT_SUPPLY(ldo6, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 TPS_PDATA_INIT_SUPPLY(ldo7, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 TPS_PDATA_INIT_SUPPLY(ldo8, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 
+#if defined(CONFIG_RTC_DRV_TPS6591x)
 static struct tps6591x_rtc_platform_data rtc_data = {
        .irq = TEGRA_NR_IRQS + TPS6591X_INT_RTC_ALARM,
        .time = {
@@ -251,19 +252,20 @@ static struct tps6591x_rtc_platform_data rtc_data = {
        },
 };
 
-#define TPS_REG(_id, _data)                            \
-       {                                               \
-               .id     = TPS6591X_ID_##_id,            \
-               .name   = "tps6591x-regulator",         \
-               .platform_data  = &pdata_##_data,       \
-       }
-
 #define TPS_RTC_REG()                          \
        {                                               \
                .id     = 0,            \
                .name   = "rtc_tps6591x",       \
                .platform_data = &rtc_data,     \
        }
+#endif
+
+#define TPS_REG(_id, _data)                            \
+       {                                               \
+               .id     = TPS6591X_ID_##_id,            \
+               .name   = "tps6591x-regulator",         \
+               .platform_data  = &pdata_##_data,       \
+       }
 
 static struct tps6591x_subdev_info tps_devs_e118x[] = {
        TPS_REG(VIO, vio),
@@ -278,7 +280,9 @@ static struct tps6591x_subdev_info tps_devs_e118x[] = {
        TPS_REG(LDO_6, ldo6),
        TPS_REG(LDO_7, ldo7),
        TPS_REG(LDO_8, ldo8),
+#if defined(CONFIG_RTC_DRV_TPS6591x)
        TPS_RTC_REG(),
+#endif
 };
 
 static struct tps6591x_subdev_info tps_devs_e1198[] = {
@@ -294,7 +298,9 @@ static struct tps6591x_subdev_info tps_devs_e1198[] = {
        TPS_REG(LDO_6, ldo6),
        TPS_REG(LDO_7, ldo7),
        TPS_REG(LDO_8, ldo8),
+#if defined(CONFIG_RTC_DRV_TPS6591x)
        TPS_RTC_REG(),
+#endif
 };
 
 static struct tps6591x_platform_data tps_platform = {
@@ -749,8 +755,8 @@ static struct tegra_suspend_platform_data cardhu_suspend_data = {
        .separate_req   = true,
        .corereq_high   = false,
        .sysclkreq_high = true,
-       .wake_enb       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT,
-       .wake_high      = 0,
+       .wake_enb       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT | TEGRA_WAKE_RTC_ALARM,
+       .wake_high      = TEGRA_WAKE_RTC_ALARM,
        .wake_low       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT,
        .wake_any       = 0,
        .cpu_lp2_min_residency = 2000,
index 1569c36..522942e 100644 (file)
@@ -267,6 +267,7 @@ static void cardhu_i2c_init(void)
        platform_device_register(&tegra_i2c_device1);
 }
 
+#if defined(CONFIG_RTC_DRV_TEGRA)
 static struct resource tegra_rtc_resources[] = {
        [0] = {
                .start = TEGRA_RTC_BASE,
@@ -286,6 +287,7 @@ static struct platform_device tegra_rtc_device = {
        .resource = tegra_rtc_resources,
        .num_resources = ARRAY_SIZE(tegra_rtc_resources),
 };
+#endif
 
 static struct platform_device tegra_camera = {
        .name = "tegra_camera",
@@ -299,7 +301,9 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &tegra_uartd_device,
        &tegra_uarte_device,
        &pmu_device,
+#if defined(CONFIG_RTC_DRV_TEGRA)
        &tegra_rtc_device,
+#endif
        &tegra_udc_device,
 #if defined(CONFIG_SND_HDA_TEGRA)
        &tegra_hda_device,