From patchwork Wed Dec 10 12:09:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5468351 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 34DB99F1CD for ; Wed, 10 Dec 2014 12:11:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1CE920160 for ; Wed, 10 Dec 2014 12:11:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74F562011D for ; Wed, 10 Dec 2014 12:10:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751853AbaLJMK5 (ORCPT ); Wed, 10 Dec 2014 07:10:57 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:61116 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbaLJMK4 (ORCPT ); Wed, 10 Dec 2014 07:10:56 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NGD000058I73M30@mailout3.samsung.com>; Wed, 10 Dec 2014 21:10:55 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-4f-5488384f33d9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6A.C8.09430.F4838845; Wed, 10 Dec 2014 21:10:55 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGD004CJ8GLGMG0@mmp1.samsung.com>; Wed, 10 Dec 2014 21:10:55 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Zhang Rui Cc: Linux PM list , "linux-samsung-soc@vger.kernel.org" , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Kukjin Kim , Amit Daniel Kachhap , Abhilash Kesavan , Abhilash Kesavan , Kyungmin Park , Chanwoo Choi , Lukasz Majewski Subject: [PATCH v2 02/17] thermal: exynos: Provide thermal_exynos.h file to be included in device tree files Date: Wed, 10 Dec 2014 13:09:41 +0100 Message-id: <1418213396-743-3-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1418213396-743-1-git-send-email-l.majewski@samsung.com> References: <1412872737-624-1-git-send-email-l.majewski@samsung.com> <1418213396-743-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsVy+t9jAV1/i44Qg3OHRSwer1nMZNFwNcRi 44z1rBbXvzxntZh/5RqrxZq/Sha9C66yWZxtesNu8eYRt8Wbh5sZLT73HmG0mHF+H5PFk4d9 bA68Hjtn3WX3WLznJZPHumlvmT36tqxi9Pi8SS6ANYrLJiU1J7MstUjfLoEr4+DL6IJNshUb 1kc2MF6V6GLk5JAQMJH4t+o0M4QtJnHh3nq2LkYuDiGBRYwS1/ZfZYJwupgkNs2/xAJSxSag J/H57lMmEFtEwFvi9b7pjCBFzAJdLBI7VsxnA0kIC+RJzHjyD6yIRUBVYv7OPkYQm1fARWLG rvVQ6xQlup9NAKvnFHCVOHPqBli9kEC9xKLFb1gnMPIuYGRYxSiaWpBcUJyUnmukV5yYW1ya l66XnJ+7iREcis+kdzCuarA4xCjAwajEwxtwuT1EiDWxrLgy9xCjBAezkgjvG8mOECHelMTK qtSi/Pii0pzU4kOM0hwsSuK8SvZtIUIC6YklqdmpqQWpRTBZJg5OqQZG9p45z09dt9rB5Lre h+P7TNEtd/aHFzVXF9j+c6i1XLXZfdYztWMqHquYSrv49X8t12V2ic6pi/95Qldmt/XMRTMX XrBdd+giV1Jc1LPNlcsEClKXBZ4vtntuvelk9od/0xm7rVySHolZyFxapyOpoZqi9TU4tvvX wedMsx8cuh0r7O536V6iEktxRqKhFnNRcSIAcoXme0ECAAA= 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 to be able to read Exynos thermal configuration from the device tree. It turned out that DTC is not able to interpret enums properly and hence it is necessary to #define those values explicitly. For this reason the ./include/dt-bindings/thermal/thermal_exynos.h file has been introduced. Signed-off-by: Lukasz Majewski --- Changes for v2: - None --- drivers/thermal/samsung/exynos_tmu.c | 2 +- drivers/thermal/samsung/exynos_tmu.h | 24 +++--------------- include/dt-bindings/thermal/thermal_exynos.h | 37 ++++++++++++++++++++++++++++ 3 files changed, 42 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 32ac366..936d16f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -144,7 +144,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..03ebdd0 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,9 @@ 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 cal_mode; + 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..85789be --- /dev/null +++ b/include/dt-bindings/thermal/thermal_exynos.h @@ -0,0 +1,37 @@ +/* + * 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. + * + */ + +#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 */