ARM: tegra: Use new nct interface for cdev bind
Joshua Primero [Wed, 31 Oct 2012 01:46:10 +0000 (18:46 -0700)]
Remove the create_cdev function pointers from nct platform data and
just utilize cdev type name to bind with nct driver.

Change-Id: I7be429a8b8e0deb485c24e3d3c779d3ca1f09d2b
Signed-off-by: Joshua Primero <jprimero@nvidia.com>
Reviewed-on: http://git-master/r/165187
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/board-dalmore-sensors.c
arch/arm/mach-tegra/board-pluto-sensors.c
arch/arm/mach-tegra/board-roth-sensors.c
arch/arm/mach-tegra/cpu-tegra.c

index d1a7c3e..aff2e55 100644 (file)
@@ -87,10 +87,13 @@ static struct balanced_throttle tj_throttle = {
        },
 };
 
-static struct thermal_cooling_device *dalmore_create_cdev(void *data)
+static int __init dalmore_throttle_init(void)
 {
-       return balanced_throttle_register(&tj_throttle, "dalmore-nct");
+       if (machine_is_dalmore())
+               balanced_throttle_register(&tj_throttle, "dalmore-nct");
+       return 0;
 }
+module_init(dalmore_throttle_init);
 
 static struct nct1008_platform_data dalmore_nct1008_pdata = {
        .supported_hwrev = true,
@@ -102,7 +105,8 @@ static struct nct1008_platform_data dalmore_nct1008_pdata = {
 
        /* Thermal Throttling */
        .passive = {
-               .create_cdev = dalmore_create_cdev,
+               .enable = true,
+               .type = "dalmore-nct",
                .trip_temp = 80000,
                .tc1 = 0,
                .tc2 = 1,
@@ -581,7 +585,8 @@ static int dalmore_nct1008_init(void)
                        BUG();
 
                active_cdev = &dalmore_nct1008_pdata.active;
-               active_cdev->create_cdev = edp_cooling_device_create;
+               active_cdev->enable = true;
+               active_cdev->type = "edp";
                active_cdev->hysteresis = 1000;
 
                for (i = 0; i < cpu_edp_limits_size-1; i++) {
index e914a51..20ce651 100644 (file)
@@ -35,6 +35,7 @@
 #include <media/imx091.h>
 #include <media/imx132.h>
 #include <media/ad5816.h>
+#include <asm/mach-types.h>
 
 #include "gpio-names.h"
 #include "board.h"
@@ -263,10 +264,13 @@ static struct balanced_throttle tj_throttle = {
        },
 };
 
-static struct thermal_cooling_device *pluto_create_cdev(void *data)
+static int __init pluto_throttle_init(void)
 {
-       return balanced_throttle_register(&tj_throttle, "pluto-nct");
+       if (machine_is_tegra_pluto())
+               balanced_throttle_register(&tj_throttle, "pluto-nct");
+       return 0;
 }
+module_init(pluto_throttle_init);
 
 static struct nct1008_platform_data pluto_nct1008_pdata = {
        .supported_hwrev = true,
@@ -278,7 +282,8 @@ static struct nct1008_platform_data pluto_nct1008_pdata = {
 
        /* Thermal Throttling */
        .passive = {
-               .create_cdev = pluto_create_cdev,
+               .enable = true,
+               .type = "pluto-nct",
                .trip_temp = 80000,
                .tc1 = 0,
                .tc2 = 1,
@@ -725,7 +730,8 @@ static int pluto_nct1008_init(void)
                        BUG();
 
                active_cdev = &pluto_nct1008_pdata.active;
-               active_cdev->create_cdev = edp_cooling_device_create;
+               active_cdev->enable = true;
+               active_cdev->type = "edp";
                active_cdev->hysteresis = 1000;
 
                for (i = 0; i < cpu_edp_limits_size-1; i++) {
index 73907ae..aed266c 100644 (file)
@@ -74,10 +74,13 @@ static struct balanced_throttle tj_throttle = {
        },
 };
 
-static struct thermal_cooling_device *roth_create_cdev(void *data)
+static int __init roth_throttle_init(void)
 {
-       return balanced_throttle_register(&tj_throttle, "roth-nct");
+       if (machine_is_roth())
+               balanced_throttle_register(&tj_throttle, "roth-nct");
+       return 0;
 }
+module_init(roth_throttle_init);
 
 static struct nct1008_platform_data roth_nct1008_pdata = {
        .supported_hwrev = true,
@@ -89,7 +92,8 @@ static struct nct1008_platform_data roth_nct1008_pdata = {
 
        /* Thermal Throttling */
        .passive = {
-               .create_cdev = roth_create_cdev,
+               .enable = true,
+               .type = "roth-nct",
                .trip_temp = 80000,
                .tc1 = 0,
                .tc2 = 1,
@@ -205,7 +209,8 @@ static int roth_nct1008_init(void)
                        BUG();
 
                active_cdev = &roth_nct1008_pdata.active;
-               active_cdev->create_cdev = edp_cooling_device_create;
+               active_cdev->enable = true;
+               active_cdev->type = "edp";
                active_cdev->hysteresis = 1000;
 
                for (i = 0; i < cpu_edp_limits_size-1; i++) {
index ed55065..90a0fe9 100644 (file)
@@ -275,13 +275,15 @@ static struct thermal_cooling_device_ops tegra_edp_cooling_ops = {
        .set_cur_state = tegra_edp_set_cur_state,
 };
 
-struct thermal_cooling_device *edp_cooling_device_create(void *v)
+static int __init edp_init(void)
 {
-       return thermal_cooling_device_register(
+       thermal_cooling_device_register(
                                "edp",
                                NULL,
                                &tegra_edp_cooling_ops);
+       return 0;
 }
+module_init(edp_init);
 
 int tegra_system_edp_alarm(bool alarm)
 {