From patchwork Tue Mar 26 11:33:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2336101 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9D3BF3FD40 for ; Tue, 26 Mar 2013 11:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512Ab3CZLm1 (ORCPT ); Tue, 26 Mar 2013 07:42:27 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:35065 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011Ab3CZLm0 (ORCPT ); Tue, 26 Mar 2013 07:42:26 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp2so4703904pbb.20 for ; Tue, 26 Mar 2013 04:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=vZURSM3+RDgqmAxDzqlhC0eOiQl21oaEFiUpvl5qD8k=; b=qgjxrXliiiZ1QL73tfwcUf/vVKL1Ak94I77UX2DvVWdAFU+/AF/zNjrcPKsP0lXSg2 afsqoAg19qCc+PwOfq4q9i4O9fqtn6X663ywncoPZsBmqvUHdBPX0sZwaasgL0xHDIXx kllEvg9n+RJL3q5DQUFP4qPsz0RRt2bn5v3KuVMWCpcrHFUynshX/g94YctcA/pJB2LM vdv+TUeNazYHxwhHtSd612b+q3tK7fY0HA4FOX5wYs9NeLLyw5Mc2q0KUTBOVEJ1L6GM eYSMyX6OmdLL5tQt+tMqvmD7kI6hPvffDcMf3z0Qxr0zWMpsAno9zB7qlvd0uA/M40s6 JLzw== X-Received: by 10.67.1.97 with SMTP id bf1mr23737468pad.118.1364297689493; Tue, 26 Mar 2013 04:34:49 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id is1sm17236493pbc.15.2013.03.26.04.34.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 Mar 2013 04:34:48 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Cc: Thomas Abraham , Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, Kukjin Kim Subject: [PATCH 6/9] thermal: exynos: small cleanups to prepare for adding exynos5440 driver Date: Tue, 26 Mar 2013 17:03:59 +0530 Message-Id: <1364297642-2746-7-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1364297642-2746-1-git-send-email-amit.daniel@samsung.com> References: <1364297642-2746-1-git-send-email-amit.daniel@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add calib mode, trigger types and trigger_enable array. This is needed for adding exynos5440 TMU driver. Signed-off-by: Amit Daniel Kachhap --- drivers/thermal/samsung/exynos4210_thermal.c | 30 ++++++++++++------------ include/linux/platform_data/exynos_thermal.h | 32 +++++++++++++------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/thermal/samsung/exynos4210_thermal.c b/drivers/thermal/samsung/exynos4210_thermal.c index 09ea8c8..58d16ac 100644 --- a/drivers/thermal/samsung/exynos4210_thermal.c +++ b/drivers/thermal/samsung/exynos4210_thermal.c @@ -276,10 +276,10 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) if (on) { con |= EXYNOS_TMU_CORE_ON; - interrupt_en = pdata->trigger_level3_en << 12 | - pdata->trigger_level2_en << 8 | - pdata->trigger_level1_en << 4 | - pdata->trigger_level0_en; + interrupt_en = pdata->trigger_enable[3] << 12 | + pdata->trigger_enable[2] << 8 | + pdata->trigger_enable[1] << 4 | + pdata->trigger_enable[0]; if (pdata->threshold_falling) interrupt_en |= interrupt_en << 16; } else { @@ -394,10 +394,10 @@ static struct exynos_tmu_platform_data const exynos4210_default_tmu_data = { .trigger_levels[0] = 5, .trigger_levels[1] = 20, .trigger_levels[2] = 30, - .trigger_level0_en = 1, - .trigger_level1_en = 1, - .trigger_level2_en = 1, - .trigger_level3_en = 0, + .trigger_enable[0] = 1, + .trigger_enable[1] = 1, + .trigger_enable[2] = 1, + .trigger_enable[3] = 0, .gain = 15, .reference_voltage = 7, .cal_type = TYPE_ONE_POINT_TRIMMING, @@ -423,10 +423,10 @@ static struct exynos_tmu_platform_data const exynos_default_tmu_data = { .trigger_levels[0] = 85, .trigger_levels[1] = 103, .trigger_levels[2] = 110, - .trigger_level0_en = 1, - .trigger_level1_en = 1, - .trigger_level2_en = 1, - .trigger_level3_en = 0, + .trigger_enable[0] = 1, + .trigger_enable[1] = 1, + .trigger_enable[2] = 1, + .trigger_enable[3] = 0, .gain = 8, .reference_voltage = 16, .noise_cancel_mode = 4, @@ -566,9 +566,9 @@ static int exynos_tmu_probe(struct platform_device *pdev) /* Register the sensor with thermal management interface */ (&exynos_sensor_conf)->driver_data = data; - exynos_sensor_conf.trip_data.trip_count = pdata->trigger_level0_en + - pdata->trigger_level1_en + pdata->trigger_level2_en + - pdata->trigger_level3_en; + exynos_sensor_conf.trip_data.trip_count = pdata->trigger_enable[0] + + pdata->trigger_enable[1] + pdata->trigger_enable[2] + + pdata->trigger_enable[3]; for (i = 0; i < exynos_sensor_conf.trip_data.trip_count; i++) exynos_sensor_conf.trip_data.trip_val[i] = diff --git a/include/linux/platform_data/exynos_thermal.h b/include/linux/platform_data/exynos_thermal.h index 893b758..1090f48 100644 --- a/include/linux/platform_data/exynos_thermal.h +++ b/include/linux/platform_data/exynos_thermal.h @@ -31,6 +31,17 @@ enum calibration_type { TYPE_NONE, }; +enum calibration_mode { + SW_MODE, + HW_MODE, +}; + +enum trigger_type { + ACTIVE, + CRITICAL, + HW_TRIP, +}; + enum soc_type { SOC_ARCH_EXYNOS4210 = 1, SOC_ARCH_EXYNOS, @@ -71,18 +82,9 @@ struct freq_clip_table { * 3: temperature for trigger_level3 interrupt * condition for trigger_level3 interrupt: * current temperature > threshold + trigger_levels[3] - * @trigger_level0_en: + * @trigger_enable[]: array to denote which trigger levels are enabled. * 1 = enable trigger_level0 interrupt, * 0 = disable trigger_level0 interrupt - * @trigger_level1_en: - * 1 = enable trigger_level1 interrupt, - * 0 = disable trigger_level1 interrupt - * @trigger_level2_en: - * 1 = enable trigger_level2 interrupt, - * 0 = disable trigger_level2 interrupt - * @trigger_level3_en: - * 1 = enable trigger_level3 interrupt, - * 0 = disable trigger_level3 interrupt * @gain: gain of amplifier in the positive-TC generator block * 0 <= gain <= 15 * @reference_voltage: reference voltage of amplifier @@ -93,6 +95,7 @@ struct freq_clip_table { * @type: determines the type of SOC * @efuse_value: platform defined fuse value * @cal_type: calibration type for temperature + * @cal_mode: calibration mode for temperature * @freq_clip_table: Table representing frequency reduction percentage. * @freq_tab_count: Count of the above table as frequency reduction may * applicable to only some of the trigger levels. @@ -103,18 +106,15 @@ struct exynos_tmu_platform_data { u8 threshold; u8 threshold_falling; u8 trigger_levels[MAX_TRIP]; - bool trigger_level0_en; - bool trigger_level1_en; - bool trigger_level2_en; - bool trigger_level3_en; - bool trigger_level4_en; - + enum trigger_type trigger_type[MAX_TRIP]; + bool trigger_enable[MAX_TRIP]; u8 gain; u8 reference_voltage; u8 noise_cancel_mode; u32 efuse_value; enum calibration_type cal_type; + enum calibration_mode cal_mode; enum soc_type type; struct freq_clip_table freq_tab[MAX_TRIP]; unsigned int freq_tab_count;