From patchwork Thu Oct 9 16:38:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5059381 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 AC9069F349 for ; Thu, 9 Oct 2014 16:39:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9AD82020E for ; Thu, 9 Oct 2014 16:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8ADC201FE for ; Thu, 9 Oct 2014 16:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757329AbaJIQjf (ORCPT ); Thu, 9 Oct 2014 12:39:35 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:65353 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757272AbaJIQje (ORCPT ); Thu, 9 Oct 2014 12:39:34 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ND6000P1RLWEE40@mailout3.samsung.com>; Fri, 10 Oct 2014 01:39:32 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-39-5436ba445d8b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 26.CD.20081.44AB6345; Fri, 10 Oct 2014 01:39:32 +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 <0ND600M6SRKZPK30@mmp2.samsung.com>; Fri, 10 Oct 2014 01:39:32 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Zhang Rui Cc: "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, Linux PM list , Kukjin Kim , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Amit Daniel Kachhap , Kyungmin Park , Chanwoo Choi , Lukasz Majewski Subject: [PATCH 06/21] thermal: exynos: Provide thermal_exynos.h file to be included in device tree files Date: Thu, 09 Oct 2014 18:38:42 +0200 Message-id: <1412872737-624-7-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1412872737-624-1-git-send-email-l.majewski@samsung.com> References: <1412872737-624-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsVy+t9jQV2XXWYhBgvbtSwaroZYbJyxntXi +pfnrBbzr1xjtehdcJXN4mzTG3aLN4+4Ld483MxosekxUPxz7xFGixnn9zFZPHnYx+bA47Fz 1l12j8V7XjJ5bF5S77Fu2ltmj74tqxg9Pm+SC2CL4rJJSc3JLEst0rdL4Mp4+uYjU8Eb2YoZ GxaxNzD+l+hi5OSQEDCROHJ1ChOELSZx4d56ti5GLg4hgemMEtt7J0M5XUwS1/quMIJUsQno SXy++xSsQ0TAW+L1vumMIEXMAleZJS7vXskKkhAWyJa41fYQqIiDg0VAVaJ9pTNImFfARWLR sy52iG2KEt3PJrCB2JwCrhJPH69mBrGFgGpuP3rJPoGRdwEjwypG0dSC5ILipPRcQ73ixNzi 0rx0veT83E2M4GB8JrWDcWWDxSFGAQ5GJR7eB/9MQ4RYE8uKK3MPMUpwMCuJ8G6faRYixJuS WFmVWpQfX1Sak1p8iFGag0VJnPdAq3WgkEB6YklqdmpqQWoRTJaJg1OqgfHohA9tUz+cEXzr clL+MeuRCc6vPYpetZZfFm1iEm7WyXJwOZVb3Lvr+eEWBv9eWc0FrsECrwR917LuvMNj/nWO Vv12noi5R3/0z31QHir0NcBNe/nHSj2LQMsNr/s+1KS+M1mvxbfz7AYj9bcuEi82PphmeOJI +b7QJqbKd66Fy5sPPGiYOl2JpTgj0VCLuag4EQCUM4CXQgIAAA== 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, T_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 is a preparatory patch for being able to read Exynos thermal configuration from the device tree. The DTC is not able to interpret enums properly and hence it is necessary to #define those values explicitly. Signed-off-by: Lukasz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 2 +- drivers/thermal/samsung/exynos_tmu.h | 23 +++------------- include/dt-bindings/thermal/thermal_exynos.h | 40 ++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 include/dt-bindings/thermal/thermal_exynos.h diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index fa29b95..2f55daa 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -159,7 +159,7 @@ struct exynos_tmu_data { void __iomem *base; void __iomem *base_second; int irq; - enum soc_type soc; + int soc; struct work_struct irq_work; struct mutex lock; struct clk *clk, *clk_sec; diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index da3009b..a089391 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -26,24 +26,7 @@ #include "exynos_thermal_common.h" -enum calibration_type { - TYPE_ONE_POINT_TRIMMING, - TYPE_ONE_POINT_TRIMMING_25, - TYPE_ONE_POINT_TRIMMING_85, - TYPE_TWO_POINT_TRIMMING, - TYPE_NONE, -}; - -enum soc_type { - SOC_ARCH_EXYNOS3250 = 1, - SOC_ARCH_EXYNOS4210, - SOC_ARCH_EXYNOS4412, - SOC_ARCH_EXYNOS5250, - SOC_ARCH_EXYNOS5260, - SOC_ARCH_EXYNOS5420, - SOC_ARCH_EXYNOS5420_TRIMINFO, - SOC_ARCH_EXYNOS5440, -}; +#include /** * struct exynos_tmu_platform_data @@ -115,8 +98,8 @@ struct exynos_tmu_platform_data { u8 second_point_trim; u8 default_temp_offset; - enum calibration_type cal_type; - enum soc_type type; + u32 cal_type; + u32 type; struct freq_clip_table freq_tab[4]; unsigned int freq_tab_count; }; diff --git a/include/dt-bindings/thermal/thermal_exynos.h b/include/dt-bindings/thermal/thermal_exynos.h new file mode 100644 index 0000000..5d91d64 --- /dev/null +++ b/include/dt-bindings/thermal/thermal_exynos.h @@ -0,0 +1,40 @@ +/* + * thermal_exynos.h - Samsung EXYNOS TMU device tree definitions + * + * Copyright (C) 2014 Samsung Electronics + * Lukasz Majewski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _EXYNOS_THERMAL_TMU_DT_H +#define _EXYNOS_THERMAL_TMU_DT_H + +#define TYPE_ONE_POINT_TRIMMING 0 +#define TYPE_ONE_POINT_TRIMMING_25 1 +#define TYPE_ONE_POINT_TRIMMING_85 2 +#define TYPE_TWO_POINT_TRIMMING 3 +#define TYPE_NONE 4 + +#define SOC_ARCH_EXYNOS3250 1 +#define SOC_ARCH_EXYNOS4210 2 +#define SOC_ARCH_EXYNOS4412 3 +#define SOC_ARCH_EXYNOS5250 4 +#define SOC_ARCH_EXYNOS5260 5 +#define SOC_ARCH_EXYNOS5420_TRIMINFO 6 +#define SOC_ARCH_EXYNOS5420 7 +#define SOC_ARCH_EXYNOS5440 8 + +#endif /* _EXYNOS_THERMAL_TMU_DT_H */