From patchwork Fri Dec 13 16:38:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 3341481 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 28F719F380 for ; Fri, 13 Dec 2013 16:40:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7A0E20808 for ; Fri, 13 Dec 2013 16:40:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21DB1207FD for ; Fri, 13 Dec 2013 16:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192Ab3LMQja (ORCPT ); Fri, 13 Dec 2013 11:39:30 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:39227 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753142Ab3LMQjZ (ORCPT ); Fri, 13 Dec 2013 11:39:25 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MXR007SZ7LOFH80@mailout2.samsung.com>; Sat, 14 Dec 2013 01:39:25 +0900 (KST) X-AuditID: cbfee61b-b7fbf6d0000051a3-4d-52ab383c8ed4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 1C.E7.20899.C383BA25; Sat, 14 Dec 2013 01:39:24 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MXR00KQG7KG6MA0@mmp2.samsung.com>; Sat, 14 Dec 2013 01:39:24 +0900 (KST) From: Lukasz Majewski To: Viresh Kumar , "Rafael J. Wysocki" , Zhang Rui , Eduardo Valentin Cc: "cpufreq@vger.kernel.org" , Linux PM list , Jonghwa Lee , Lukasz Majewski , Lukasz Majewski , linux-kernel , Bartlomiej Zolnierkiewicz , Myungjoo Ham , durgadoss.r@intel.com, linux-samsung-soc@vger.kernel.org Subject: [PATCH v11 7/7] thermal:exynos:boost: Automatic enable/disable of BOOST feature (at Exynos4412) Date: Fri, 13 Dec 2013 17:38:37 +0100 Message-id: <1386952717-30947-8-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1386952717-30947-1-git-send-email-l.majewski@samsung.com> References: <1370502472-7249-1-git-send-email-l.majewski@samsung.com> <1386952717-30947-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsVy+t9jQV0bi9VBBue2m1lsnLGe1eJp0w92 i76fV5gt1uz/yWTRefYJs8WbR9wWbx5uZrS4vGsOm8Xn3iOMFjPO72OyuN24gs3izOlLrBZP HvaxWWz86uHA57F4z0smjzvX9rB5rJv2ltljy9V2Fo++LasYPY7f2M7k8XmTXAB7FJdNSmpO Zllqkb5dAlfGsU9fmAr2SlQ82/2BvYFxkXAXIyeHhICJxK33b5kgbDGJC/fWs3UxcnEICUxn lHj99z8zSEJIoItJ4t9fRxCbTUBP4vPdp0wgRSICS4CKmhawgjjMAhuZJXbOfMsGUiUskCWx sesaWDeLgKrE7jOnGUFsXgE3icn989kh1ilKdD+bAFbPKeAuMW3TKkaI1U2MEs+v3GecwMi7 gJFhFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkZwwD6T3sG4qsHiEKMAB6MSD69n76ogIdbE suLK3EOMEhzMSiK8Iaqrg4R4UxIrq1KL8uOLSnNSiw8xSnOwKInzHmy1DhQSSE8sSc1OTS1I LYLJMnFwSjUwKuxO3u80fcr907YTXk7YGaTiVil4WPJs/cNNAsvjXzu9PtK1myc9qOBIl7fx Y2Mtu2a98PayGC3jZ+JdD+J7qy1Mn1hVXctY92Wy2dpw14MXJi8KemHv67PwiUjNw2puhoyt TZ7rzi1d0aRSl+L6hGXmkz2VK0suhEi5fPNatmb5hPXv5RPZlFiKMxINtZiLihMBokCuw1QC AAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch provides auto disable/enable operation for boost. It uses already present thermal infrastructure to provide boost hysteresis. The TMU data has been modified to work properly with or without boost. Signed-off-by: Lukasz Majewski Signed-off-by: Myungjoo Ham Acked-by: Eduardo Valentin --- Changes for v11: - Use only one thermal data set - Adjust Exynos4412 thermal data to work with or without BOOST Changes for v10: - Remove boost related code from thermal_core.c - Use already present thermal infrastructure to provide thermal hysteresis - Introduce special set of TMU data for BOOST Changes for v9: - None Changes for v8: - Move cpufreq_boost_* stub functions definition (needed when cpufreq is not compiled in) to cpufreq.h at cpufreq core support commit Changes for v7: - None Changes for v6: - Disable boost only when supported and enabled - Protect boost related thermal_zone_device struct fields with mutex - Evaluate temperature trend during boost enable decision - Create separate methods to handle boost enable/disable (thermal_boost_{enable|disable}) operations - Boost is disabled at any trip point passage (not only the non critical one) - Add stub definitions for cpufreq boost functions used when CONFIG_CPU_FREQ is NOT defined. Changes for v5: - Move boost disable code from cpu_cooling.c to thermal_core.c (to handle_non_critical_trips) - Extent struct thermal_zone_device by adding overheated bool flag - Implement auto enable of boost after device cools down - Introduce boost_polling flag, which indicates if thermal uses it's predefined pool delay or has woken up thermal workqueue only to wait until device cools down. Changes for v4: - New patch drivers/thermal/samsung/exynos_tmu_data.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c index 073c292..476b768 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c @@ -131,8 +131,8 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = { #define EXYNOS4412_TMU_DATA \ .threshold_falling = 10, \ - .trigger_levels[0] = 85, \ - .trigger_levels[1] = 103, \ + .trigger_levels[0] = 70, \ + .trigger_levels[1] = 95, \ .trigger_levels[2] = 110, \ .trigger_levels[3] = 120, \ .trigger_enable[0] = true, \ @@ -155,12 +155,12 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = { .second_point_trim = 85, \ .default_temp_offset = 50, \ .freq_tab[0] = { \ - .freq_clip_max = 800 * 1000, \ - .temp_level = 85, \ + .freq_clip_max = 1400 * 1000, \ + .temp_level = 70, \ }, \ .freq_tab[1] = { \ - .freq_clip_max = 200 * 1000, \ - .temp_level = 103, \ + .freq_clip_max = 400 * 1000, \ + .temp_level = 95, \ }, \ .freq_tab_count = 2, \ .registers = &exynos4412_tmu_registers, \