From patchwork Fri Apr 19 16:38:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 2466181 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 B1D7FDF25A for ; Fri, 19 Apr 2013 16:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030607Ab3DSQik (ORCPT ); Fri, 19 Apr 2013 12:38:40 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51152 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030927Ab3DSQih (ORCPT ); Fri, 19 Apr 2013 12:38:37 -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 <0MLI001P5GVYD9R0@mailout4.samsung.com>; Sat, 20 Apr 2013 01:38:37 +0900 (KST) X-AuditID: cbfee61b-b7f076d0000034b6-ea-5171730ce534 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BC.57.13494.C0371715; Sat, 20 Apr 2013 01:38:36 +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 <0MLI007XRGVRC400@mmp2.samsung.com>; Sat, 20 Apr 2013 01:38:36 +0900 (KST) From: Lukasz Majewski To: Kukjin Kim Cc: Mike Turquette , Zhang Rui , devicetree-discuss@lists.ozlabs.org, linux-samsung-soc@vger.kernel.org, Linux PM list , Amit Daniel Kachhap , Lukasz Majewski , Kyungmin Park Subject: [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Date: Fri, 19 Apr 2013 18:38:11 +0200 Message-id: <1366389493-8239-5-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> References: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t9jQV2e4sJAgyPd1hZLHkxhtDgw+yGr Re+Cq2wWZ5vesFu8ebiZ0eJz7xFGixnn9zFZPJ1wkc3iycM+NgdOj8V7XjJ53Lm2h83j/IyF jB59W1YxenzeJBfAGsVlk5Kak1mWWqRvl8CV8XPdd9aCLXwVqz80MjcwvuLuYuTkkBAwkVh2 YSIjhC0mceHeerYuRi4OIYHpjBIvn5xlhnC6mCTm/J7CClLFJqAn8fnuUyYQW0RATaJn8VZG kCJmgdNMEhNfLwUrEhbwk/g87StQEQcHi4CqxMol0SBhXgFXiR0nXzNBbJOXeHq/jw3E5hRw k/g3owXsCiGgmu6nx5knMPIuYGRYxSiaWpBcUJyUnmukV5yYW1yal66XnJ+7iREcas+kdzCu arA4xCjAwajEw/shujBQiDWxrLgy9xCjBAezkgjvcjOgEG9KYmVValF+fFFpTmrxIUZpDhYl cd6DrdaBQgLpiSWp2ampBalFMFkmDk6pBsbIfy6+JiYV9Sskr2ziqauYJPMmdt2fN+UXLPtq j+sz5V6w/uKaE2t7Q8wo6LjZ0cLeOk6jplvJ8ov6RVfPz0qJ626oSoq49bCFuz68N9Zo0yW1 rX0zr35R43m4g4fpXeEs+5jEy+JPWMQFZadNu2nCqDSd81dA3Tzvb96CDafPf2mxnzwxV4ml OCPRUIu5qDgRAGD31z4xAgAA 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 --- 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 ba6094c..e922fa4 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; @@ -944,6 +947,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) @@ -953,6 +957,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_info(&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) {