From patchwork Wed Aug 28 09:16:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 2850601 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@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 D663E9F313 for ; Wed, 28 Aug 2013 09:17:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 983C120460 for ; Wed, 28 Aug 2013 09:17:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D01F20466 for ; Wed, 28 Aug 2013 09:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897Ab3H1JQw (ORCPT ); Wed, 28 Aug 2013 05:16:52 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:62325 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102Ab3H1JQr (ORCPT ); Wed, 28 Aug 2013 05:16:47 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MS8006HAHRTXIK0@mailout4.samsung.com>; Wed, 28 Aug 2013 18:16:45 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id BC.41.22755.DFFBD125; Wed, 28 Aug 2013 18:16:45 +0900 (KST) X-AuditID: cbfee68f-b7f656d0000058e3-eb-521dbffd3ed0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6B.B9.09055.DFFBD125; Wed, 28 Aug 2013 18:16:45 +0900 (KST) Received: from naveen-linux.sisodomain.com ([107.108.83.161]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MS800IQNHRI9F20@mmp2.samsung.com>; Wed, 28 Aug 2013 18:16:45 +0900 (KST) From: Naveen Krishna Chatradhi To: linux-pm@vger.kernel.org, rui.zhang@intel.com, eduardo.valentin@ti.com Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.daniel@samsung.com, kgene.kim@samsung.com, naveenkrishna.ch@gmail.com, devicetree@vger.kernel.org Subject: [PATCH 2/3] thermal: samsung: change base_common to more meaningful base_second Date: Wed, 28 Aug 2013 14:46:48 +0530 Message-id: <1377681409-18166-2-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1377681409-18166-1-git-send-email-ch.naveen@samsung.com> References: <1375336979-14747-1-git-send-email-ch.naveen@samsung.com> <1377681409-18166-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeLIzCtJLcpLzFFi42JZI2JSpft3v2yQwdJnRhYNV0Ms5h85x2qx Zv9PJoveBVfZLC7vmsNm8bn3CKPFjPP7mCwWbfvPbPHkYR+bA6fHzll32T0W73nJ5NG3ZRWj x/Eb25k8Pm+SC2CN4rJJSc3JLEst0rdL4Mq4v7WfreCDVMWMab0sDYx9Yl2MnBwSAiYSjUtm sUPYYhIX7q1n62Lk4hASWMoo8W/9fcYuRg6wolN7kiHi0xkl9v5ZwwTh9DBJnPxykwWkm03A TOLgotVgk0QEvCRmPbwKVsQssJ5R4tD2tcwgCWGBKImNO78zgdgsAqoS9+Z/YwWxeQVcJaZe uMAOsU1BYs4kG5Awp4CbxO03xxkhljUySkz/sBxsqITAJnaJFRNesEEMEpD4NvkQC0SzrMSm A8wQ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nS3HXGnTO8Imz+vppx3sfR3KgnoWGmoP02 Y6XXHNZtHEnnlzxI44lXVnHtyxGNlVqZ52ihvppJy5NRznjlwuPCEfdO/xXZnXLGVvGc/vT9 j2Ktdn82mBNurn9WlJux9WdDnfeMGWcCrL65fbY/eMyUtbq67Y/I4rmTZSfncltZyiqxFGck GmoxFxUnAgDzSB0H8AIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.4 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 On Exynos5440 and Exynos5420 there are registers common across the TMU channels. To support that, we introduced a SHARED_MEMORY flag in the driver and the 2nd set of register base and size are provided in the "reg" property of the node. As per Amit's suggestion, this patch changes the base_common to base_second. https://lkml.org/lkml/2013/8/1/38 Signed-off-by: Naveen Krishna Chatradhi --- .../devicetree/bindings/thermal/exynos-thermal.txt | 4 ++-- drivers/thermal/samsung/exynos_tmu.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt index 284f530..116cca0 100644 --- a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt @@ -11,8 +11,8 @@ - reg : Address range of the thermal registers. For soc's which has multiple instances of TMU and some registers are shared across all TMU's like interrupt related then 2 set of register has to supplied. First set - belongs to each instance of TMU and second set belongs to common TMU - registers. + belongs to each instance of TMU and second set belongs to second set + of common TMU registers. - interrupts : Should contain interrupt for thermal system - clocks : The main clock for TMU device - clock-names : Thermal system clock name diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index d201ed8..c56f7e5 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -41,7 +41,7 @@ * @id: identifier of the one instance of the TMU controller. * @pdata: pointer to the tmu platform/configuration data * @base: base address of the single instance of the TMU controller. - * @base_common: base address of the common registers of the TMU controller. + * @base_second: base address of the common registers of the TMU controller. * @irq: irq number of the TMU controller. * @soc: id of the SOC type. * @irq_work: pointer to the irq work structure. @@ -56,7 +56,7 @@ struct exynos_tmu_data { int id; struct exynos_tmu_platform_data *pdata; void __iomem *base; - void __iomem *base_common; + void __iomem *base_second; int irq; enum soc_type soc; struct work_struct irq_work; @@ -297,7 +297,7 @@ skip_calib_data: } /*Clear the PMIN in the common TMU register*/ if (reg->tmu_pmin && !data->id) - writel(0, data->base_common + reg->tmu_pmin); + writel(0, data->base_second + reg->tmu_pmin); out: clk_disable(data->clk); mutex_unlock(&data->lock); @@ -451,7 +451,7 @@ static void exynos_tmu_work(struct work_struct *work) /* Find which sensor generated this interrupt */ if (reg->tmu_irqstatus) { - val_type = readl(data->base_common + reg->tmu_irqstatus); + val_type = readl(data->base_second + reg->tmu_irqstatus); if (!((val_type >> data->id) & 0x1)) goto out; } @@ -590,7 +590,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) return -ENODEV; } - data->base_common = devm_ioremap(&pdev->dev, res.start, + data->base_second = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); if (!data->base) { dev_err(&pdev->dev, "Failed to ioremap memory\n");