From patchwork Thu Apr 25 12:30:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 2488211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6560DDF5B1 for ; Thu, 25 Apr 2013 12:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755924Ab3DYMcF (ORCPT ); Thu, 25 Apr 2013 08:32:05 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60624 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755892Ab3DYMcD (ORCPT ); Thu, 25 Apr 2013 08:32:03 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLT000AK9HE3GP0@mailout4.samsung.com>; Thu, 25 Apr 2013 21:32:02 +0900 (KST) X-AuditID: cbfee61b-b7fcf6d00000058e-9f-517922426b60 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 89.CF.01422.24229715; Thu, 25 Apr 2013 21:32:02 +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 <0MLT00FFR9FCKK30@mmp2.samsung.com>; Thu, 25 Apr 2013 21:32:02 +0900 (KST) From: Lukasz Majewski To: Kukjin Kim Cc: "devicetree-discuss@lists.ozlabs.org" , Zhang Rui , "linux-samsung-soc@vger.kernel.org" , Linux PM list , Amit Daniel Kachhap , Lukasz Majewski , t.figa@samsung.com, Sachin Kamat , Myungjoo Ham , Kyungmin Park Subject: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Date: Thu, 25 Apr 2013 14:30:43 +0200 Message-id: <1366893045-31586-3-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1366893045-31586-1-git-send-email-l.majewski@samsung.com> References: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> <1366893045-31586-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBLMWRmVeSWpSXmKPExsVy+t9jQV0npcpAg1nTpSyWPJjCaHFg9kNW i94FV9kszja9Ybd483Azo8Xn3iOMFjPO72OyuN24gs3iycM+NouTf3oZLdbPeM3iwO2xeM9L Jo871/aweZyfsZDRo2/LKkaPz5vkAlijuGxSUnMyy1KL9O0SuDKaZ7MXvOWreH5SuoFxOk8X IyeHhICJxJmp/5ggbDGJC/fWs3UxcnEICUxnlFi6czI7hNPFJLF58Ss2kCo2AT2Jz3efgnWI CKhJ9CzeyghSxCxwh1niU3MjC0hCWCBa4u3NNjCbRUBV4trdY+wgNq+Am8SlaSeZIdbJSzy9 3wc2lFPAXWLnq26obU2MEp+/PGWawMi7gJFhFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkZw +D2T3sG4qsHiEKMAB6MSD6/Aq/JAIdbEsuLK3EOMEhzMSiK8S+QrA4V4UxIrq1KL8uOLSnNS iw8xSnOwKInzHmy1DhQSSE8sSc1OTS1ILYLJMnFwSjUwiqfrsVyb/WCZwd2sBSy+4rLnb92Y YqNtbXnM/NvF699u7Njm5VX44UOd+77U1lPlBx3tNq1//eX4ctOq9jlO1lMaRM0XrrtUUvhh isK09AKFDX+/Z91hWt2k9WXNN7fNS7t7Zod0fXt4fP2hpDcXSydsOvnr7D69/29nB9UJaAot cJvn/KPq80olluKMREMt5qLiRACMPjRlOwIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org TMU probe function now checks for a device tree defined regulator. For compatibility reasons it is allowed to probe driver even without this regulator defined. Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park --- Changes for v2: - Change dev_info() to dev_warn() --- drivers/thermal/exynos_thermal.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c index 3d6e32a..328fe7e 100644 --- a/drivers/thermal/exynos_thermal.c +++ b/drivers/thermal/exynos_thermal.c @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -119,6 +120,8 @@ #define EXYNOS_ZONE_COUNT 3 +#define EXYNOS_TMU_REGULATOR "vdd_ts" + struct exynos_tmu_data { struct exynos_tmu_platform_data *pdata; struct resource *mem; @@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) { struct exynos_tmu_data *data; struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data; + struct regulator *reg; int ret, i; if (!pdata) @@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct platform_device *pdev) dev_err(&pdev->dev, "No platform init data supplied.\n"); return -ENODEV; } + + reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR); + if (!IS_ERR(reg)) { + ret = regulator_enable(reg); + if (ret) { + dev_err(&pdev->dev, "Regulator %s not enabled.\n", + EXYNOS_TMU_REGULATOR); + return ret; + } + } else { + dev_warn(&pdev->dev, + "Regulator %s not defined at device tree.\n", + EXYNOS_TMU_REGULATOR); + } + data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data), GFP_KERNEL); if (!data) {