From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Valentin Subject: Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Date: Thu, 25 Apr 2013 11:44:08 -0400 Message-ID: <51794F48.5040401@ti.com> References: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> <1366893045-31586-1-git-send-email-l.majewski@samsung.com> <1366893045-31586-3-git-send-email-l.majewski@samsung.com> <20130425152934.5041cc98@amdc308.digital.local> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from bear.ext.ti.com ([192.94.94.41]:45218 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757820Ab3DYPo3 (ORCPT ); Thu, 25 Apr 2013 11:44:29 -0400 In-Reply-To: <20130425152934.5041cc98@amdc308.digital.local> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Lukasz Majewski Cc: amit daniel kachhap , Kukjin Kim , "devicetree-discuss@lists.ozlabs.org" , Zhang Rui , "linux-samsung-soc@vger.kernel.org" , Linux PM list , t.figa@samsung.com, Sachin Kamat , Myungjoo Ham , Kyungmin Park , eduardo.valentin@ti.com Amit, Lukasz, On 25-04-2013 09:29, Lukasz Majewski wrote: > Hi Amit, > >> Hi Lukasz Majewski, >> >> Sorry for late review but I am currently working on restructuring the >> whole exynos thermal driver and this support of LDO can be added as >> feature as not all socs support this. This is also suggested by >> Eduardo. All your other patches looks fine. > > But this is how it is already done. The VDD_TS is optional, so > Exynos5440 and Exynos4210 will not be broken. > > This shall preserve the correct behavior of the thermal driver. > If you guys plan to move to feature based approach, like suggested in V1, then Id recommend adding a /* TODO: */ entry in your driver. Amit, are you including this LDO support on your rework? >> >> Thanks, >> Amit Daniel >> >> On Thu, Apr 25, 2013 at 6:00 PM, Lukasz Majewski >> wrote: >>> 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) { >>> -- >>> 1.7.10.4 >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe >>> linux-samsung-soc" in the body of a message to >>> majordomo@vger.kernel.org More majordomo info at >>> http://vger.kernel.org/majordomo-info.html > > >