From patchwork Thu Nov 15 10:56:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 12864 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E1FB823E13 for ; Thu, 15 Nov 2012 10:57:25 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7DB39A19172 for ; Thu, 15 Nov 2012 10:57:25 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so897637iag.11 for ; Thu, 15 Nov 2012 02:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tgae9t7LSL+eEcbyBWmKg7sU/VkGvgHbKEVGUMzHnWs=; b=IIHqW9BVCfVFpk5WHqMs2lJ7ZuDhYqcD5/DN34susxcPuPeLB3wXeF6TYYG5b9rLX6 Bjk/3Eos1LKysChp4aQdnq2tHawrRXdoQ89wZ4YrTyr+3sPH6Q1LMQch3KPIig7S1hNU 0cMoDSSs7ypUI3YG/HvZLb0Qi0AwgZVCmGgsSD3wEFiILIHnND8vP8D1ycMMK5eRol2H ReywoDDVCslPQ+hgCW/OIDBNHxVVI5Dm0xVXiGLC+D2kjSV4olCcSGzZuAyYlfntdfkK 5nQBJ8v9gGL+QfEiTKMGMmelYIGw7pWUtKpQexJFXFNWq3tQ/3hM0x6ysbUShRxDKsvK SmMg== Received: by 10.50.173.34 with SMTP id bh2mr484263igc.70.1352977044957; Thu, 15 Nov 2012 02:57:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp807235igt; Thu, 15 Nov 2012 02:57:24 -0800 (PST) Received: by 10.68.137.198 with SMTP id qk6mr3571679pbb.60.1352977044082; Thu, 15 Nov 2012 02:57:24 -0800 (PST) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id xg10si20465871pbc.177.2012.11.15.02.57.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 02:57:24 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of hongbo.zhang@linaro.org) client-ip=209.85.160.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of hongbo.zhang@linaro.org) smtp.mail=hongbo.zhang@linaro.org Received: by mail-pb0-f44.google.com with SMTP id uo1so1083580pbc.31 for ; Thu, 15 Nov 2012 02:57:23 -0800 (PST) Received: by 10.68.248.70 with SMTP id yk6mr3321297pbc.160.1352977043837; Thu, 15 Nov 2012 02:57:23 -0800 (PST) Received: from stebjsxu0148.bjs.st.com ([124.127.135.94]) by mx.google.com with ESMTPS id nv2sm9347303pbc.44.2012.11.15.02.57.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 02:57:23 -0800 (PST) From: "hongbo.zhang" To: linux-pm@vger.kernel.org, rui.zhang@intel.com Cc: linux-kernel@vger.kernel.org, amit.kachhap@linaro.org, patches@linaro.org, linaro-dev@lists.linaro.org, linaro-kernel@lists.linaro.org, STEricsson_nomadik_linux@list.st.com, kernel@igloocommunity.org, "hongbo.zhang" Subject: [PATCH V6 2/2] Thermal: Add ST-Ericsson DB8500 thermal properties and platform data. Date: Thu, 15 Nov 2012 18:56:43 +0800 Message-Id: <1352977003-25095-3-git-send-email-hongbo.zhang@linaro.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1352977003-25095-1-git-send-email-hongbo.zhang@linaro.com> References: <1352977003-25095-1-git-send-email-hongbo.zhang@linaro.com> X-Gm-Message-State: ALoCoQmkK+GMcb5oqgEh2iJBmzmZMbpWQfgkL5EO/8DNpKy1vIHs2CHjkFleJAOr7hJfPquxcosI From: "hongbo.zhang" 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 Reviewed-by: Viresh Kumar Acked-by: Linus Walleij --- arch/arm/boot/dts/dbx5x0.dtsi | 14 +++++++++ arch/arm/boot/dts/snowball.dts | 31 ++++++++++++++++++ arch/arm/configs/u8500_defconfig | 2 ++ arch/arm/mach-ux500/board-mop500.c | 64 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi index 4b0e0ca..731086b 100644 --- a/arch/arm/boot/dts/dbx5x0.dtsi +++ b/arch/arm/boot/dts/dbx5x0.dtsi @@ -203,6 +203,14 @@ 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"; @@ -660,5 +668,11 @@ ranges = <0 0x50000000 0x4000000>; status = "disabled"; }; + + cpufreq-cooling { + compatible = "stericsson,db8500-cpufreq-cooling"; + status = "disabled"; + }; + }; }; diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 702c0ba..c6f85f0 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -99,6 +99,33 @@ 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"; @@ -183,5 +210,9 @@ reg = <0x33>; }; }; + + cpufreq-cooling { + status = "okay"; + }; }; }; diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig index da68454..250625d 100644 --- a/arch/arm/configs/u8500_defconfig +++ b/arch/arm/configs/u8500_defconfig @@ -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 diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 416d436..b03216b 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -229,6 +230,67 @@ static struct ab8500_platform_data ab8500_platdata = { }; /* + * 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)