]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Thermal: Add ST-Ericsson DB8500 thermal properties and platform data.
authorhongbo.zhang <hongbo.zhang@linaro.com>
Thu, 15 Nov 2012 10:56:43 +0000 (18:56 +0800)
committerZhang Rui <rui.zhang@intel.com>
Thu, 15 Nov 2012 12:51:02 +0000 (20:51 +0800)
This patch adds device tree properties for ST-Ericsson DB8500 thermal driver,
also adds the platform data to support the old fashion.

Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
arch/arm/boot/dts/dbx5x0.dtsi
arch/arm/boot/dts/snowball.dts
arch/arm/configs/u8500_defconfig
arch/arm/mach-ux500/board-mop500.c

index 4b0e0ca08f40d3d81b90be09b8cce47b9b225fac..731086b2fca221ec61aab7fd020d52cf475ff36f 100644 (file)
                                reg = <0x80157450 0xC>;
                        };
 
+                       thermal@801573c0 {
+                               compatible = "stericsson,db8500-thermal";
+                               reg = <0x801573c0 0x40>;
+                               interrupts = <21 0x4>, <22 0x4>;
+                               interrupt-names = "IRQ_HOTMON_LOW", "IRQ_HOTMON_HIGH";
+                               status = "disabled";
+                        };
+
                        db8500-prcmu-regulators {
                                compatible = "stericsson,db8500-prcmu-regulator";
 
                        ranges = <0 0x50000000 0x4000000>;
                        status = "disabled";
                };
+
+               cpufreq-cooling {
+                       compatible = "stericsson,db8500-cpufreq-cooling";
+                       status = "disabled";
+                };
+
        };
 };
index 702c0baa6004bb9bddba8bbe5c19f008c31bbce0..c6f85f0bc53100e27362efaa5174fbc8e314d843 100644 (file)
                        status = "okay";
                };
 
+               prcmu@80157000 {
+                       thermal@801573c0 {
+                               num-trips = <4>;
+
+                               trip0-temp = <70000>;
+                               trip0-type = "active";
+                               trip0-cdev-num = <1>;
+                               trip0-cdev-name0 = "thermal-cpufreq-0";
+
+                               trip1-temp = <75000>;
+                               trip1-type = "active";
+                               trip1-cdev-num = <1>;
+                               trip1-cdev-name0 = "thermal-cpufreq-0";
+
+                               trip2-temp = <80000>;
+                               trip2-type = "active";
+                               trip2-cdev-num = <1>;
+                               trip2-cdev-name0 = "thermal-cpufreq-0";
+
+                               trip3-temp = <85000>;
+                               trip3-type = "critical";
+                               trip3-cdev-num = <0>;
+
+                               status = "okay";
+                        };
+               };
+
                external-bus@50000000 {
                        status = "okay";
 
                                reg = <0x33>;
                        };
                };
+
+               cpufreq-cooling {
+                       status = "okay";
+               };
        };
 };
index da6845493caabae29842d959f0b80bdcc1bd7790..250625d5223fe88ff9e505b97a1c3fbb01d03215 100644 (file)
@@ -69,6 +69,8 @@ CONFIG_GPIO_TC3589X=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_AB8500_BM=y
 CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL=y
+CONFIG_THERMAL=y
+CONFIG_CPU_THERMAL=y
 CONFIG_MFD_STMPE=y
 CONFIG_MFD_TC3589X=y
 CONFIG_AB5500_CORE=y
index 416d436111f29bbc64c267f104ab2838cf3db0ac..b03216b1549535910f876423c1dbc5723aa3c3ad 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/io.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/i2c-nomadik.h>
+#include <linux/platform_data/db8500_thermal.h>
 #include <linux/gpio.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/pl022.h>
@@ -228,6 +229,67 @@ static struct ab8500_platform_data ab8500_platdata = {
        .codec          = &ab8500_codec_pdata,
 };
 
+/*
+ * Thermal Sensor
+ */
+
+static struct resource db8500_thsens_resources[] = {
+       {
+               .name = "IRQ_HOTMON_LOW",
+               .start  = IRQ_PRCMU_HOTMON_LOW,
+               .end    = IRQ_PRCMU_HOTMON_LOW,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .name = "IRQ_HOTMON_HIGH",
+               .start  = IRQ_PRCMU_HOTMON_HIGH,
+               .end    = IRQ_PRCMU_HOTMON_HIGH,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct db8500_thsens_platform_data db8500_thsens_data = {
+       .trip_points[0] = {
+               .temp = 70000,
+               .type = THERMAL_TRIP_ACTIVE,
+               .cdev_name = {
+                       [0] = "thermal-cpufreq-0",
+               },
+       },
+       .trip_points[1] = {
+               .temp = 75000,
+               .type = THERMAL_TRIP_ACTIVE,
+               .cdev_name = {
+                       [0] = "thermal-cpufreq-0",
+               },
+       },
+       .trip_points[2] = {
+               .temp = 80000,
+               .type = THERMAL_TRIP_ACTIVE,
+               .cdev_name = {
+                       [0] = "thermal-cpufreq-0",
+               },
+       },
+       .trip_points[3] = {
+               .temp = 85000,
+               .type = THERMAL_TRIP_CRITICAL,
+       },
+       .num_trips = 4,
+};
+
+static struct platform_device u8500_thsens_device = {
+       .name           = "db8500-thermal",
+       .resource       = db8500_thsens_resources,
+       .num_resources  = ARRAY_SIZE(db8500_thsens_resources),
+       .dev    = {
+               .platform_data  = &db8500_thsens_data,
+       },
+};
+
+static struct platform_device u8500_cpufreq_cooling_device = {
+       .name           = "db8500-cpufreq-cooling",
+};
+
 /*
  * TPS61052
  */
@@ -583,6 +645,8 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
        &snowball_key_dev,
        &snowball_sbnet_dev,
        &snowball_gpio_en_3v3_regulator_dev,
+       &u8500_thsens_device,
+       &u8500_cpufreq_cooling_device,
 };
 
 static void __init mop500_init_machine(void)