From patchwork Tue Mar 6 14:43:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10262015 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 425EF6016D for ; Tue, 6 Mar 2018 14:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 332D02785D for ; Tue, 6 Mar 2018 14:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 270FF28511; Tue, 6 Mar 2018 14:47:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 182542785D for ; Tue, 6 Mar 2018 14:47:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbeCFOrR (ORCPT ); Tue, 6 Mar 2018 09:47:17 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:38671 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933079AbeCFOpH (ORCPT ); Tue, 6 Mar 2018 09:45:07 -0500 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180306144505epoutp036b5cca3f98edc712d28badcba6e2ae90~ZXABbEY_G1736017360epoutp03i; Tue, 6 Mar 2018 14:45:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180306144505epoutp036b5cca3f98edc712d28badcba6e2ae90~ZXABbEY_G1736017360epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520347505; bh=WSIBt26K6P7XyQCypk/gxw4RM5ZA9QATp0c1+5uajAw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ENaZlEUcWsqiVbn00RuIsip3mCOADDwqqLBVcL9VDdxukARJSN2rz7ObNxjYeALx0 DuI9ouO2WZ8CjoxD54lXGiOvPC23zPMTfYlcodQLs5u1LSxtxRCgJ56w1OuUvvRvb1 u6JJfgZ/vT30/Gli/NnEfaYUDBYi1Qq4xCUL+8qo= Received: from epsmges2p1.samsung.com (unknown [182.195.42.69]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180306144504epcas2p3b664094c6a70c523a40296d245bea01b~ZXAAZnVAU0991509915epcas2p3D; Tue, 6 Mar 2018 14:45:04 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.DE.04131.079AE9A5; Tue, 6 Mar 2018 23:45:04 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20180306144502epcas2p2818ee9c6d378d91fbff666549fb01931~ZW-_weMYB2486124861epcas2p2I; Tue, 6 Mar 2018 14:45:02 +0000 (GMT) X-AuditID: b6c32a45-3ebff70000001023-f8-5a9ea970d243 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 2F.C3.03890.E69AE9A5; Tue, 6 Mar 2018 23:45:02 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P56000X0BLSFM10@mmp1.samsung.com>; Tue, 06 Mar 2018 23:45:02 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Zhang Rui , Eduardo Valentin , Krzysztof Kozlowski Cc: Kukjin Kim , Rob Herring , Mark Rutland , Russell King , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 08/12] thermal: exynos: remove parsing of samsung,tmu_cal_type property Date: Tue, 06 Mar 2018 15:43:51 +0100 Message-id: <1520347435-22970-9-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1520347435-22970-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsWy7bCmhW7BynlRBg8mKFtsnLGe1WL+kXNA 4so1Vov+x6+ZLc6f38BusekxkHt51xw2i8+9RxgtZpzfx2RxaOpeRoul1y8yWbTuPcJu8eRh H5sDr8eaeWsYPS5fu8jssXPWXXaPxXteMnlsWtXJ5rF5Sb1H35ZVjB6fN8kFcERx2aSk5mSW pRbp2yVwZVw4cZe14KVOxbkp55kaGBtUuxg5OSQETCQ6rq9k7WLk4hAS2MEosXPrT2YI5zuj xJWTc4EyHGBVRyb7QMR3M0pc+DyPCcL5xShx/exGVpBRbAJWEhPbVzGC2CICJRLTVvUyghQx C5xlktix/R0LSEJYIFJi09FrTCA2i4CqRNutu2DNvAIeEic23GOHuElO4uSxyWBxTgFPiRMd 59hABkkInGCTaJ+znhmiyEXi7dJPjBC2sMSr41ugmqUlnq3ayAjR0Mwo8W3HHqiGCYwSe9YL QdjWEoePXwTbwCzAJ9Fx+C87xJ+8Eh1tUCUeEle+PWGDsB0lpj9bCg2XOYwSC5cuZ53AKLWA kWEVo1hqQXFuemqxUYGhXnFibnFpXrpecn7uJkZwxGu57mCccc7nEKMAB6MSD+8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Q0gv5AiWW4oxEQy3mouJEAHuXUDJJAgAA X-CMS-MailID: 20180306144502epcas2p2818ee9c6d378d91fbff666549fb01931 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180306144502epcas2p2818ee9c6d378d91fbff666549fb01931 X-RootMTR: 20180306144502epcas2p2818ee9c6d378d91fbff666549fb01931 References: <1520347435-22970-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since calibration type for temperature is SoC (not platform) specific just move it from platform data to struct exynos_tmu_data instance. Then remove parsing of samsung,tmu_cal_type property. Also remove no longer needed platform data structure. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 41 ++++++++---------------------------- drivers/thermal/samsung/exynos_tmu.h | 10 --------- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 262ab41..ab5062b 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -177,7 +177,6 @@ * struct exynos_tmu_data : A structure to hold the private data of the TMU driver * @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_second: base address of the common registers of the TMU controller. * @irq: irq number of the TMU controller. @@ -187,6 +186,7 @@ * @clk: pointer to the clock structure. * @clk_sec: pointer to the clock structure for accessing the base_second. * @sclk: pointer to the clock structure for accessing the tmu special clk. + * @cal_type: calibration type for temperature * @efuse_value: SoC defined fuse value * @min_efuse_value: minimum valid trimming data * @max_efuse_value: maximum valid trimming data @@ -208,7 +208,6 @@ */ struct exynos_tmu_data { int id; - struct exynos_tmu_platform_data *pdata; void __iomem *base; void __iomem *base_second; int irq; @@ -216,6 +215,7 @@ struct exynos_tmu_data { struct work_struct irq_work; struct mutex lock; struct clk *clk, *clk_sec, *sclk; + u32 cal_type; u32 efuse_value; u32 min_efuse_value; u32 max_efuse_value; @@ -266,10 +266,9 @@ static void exynos_report_trigger(struct exynos_tmu_data *p) */ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) { - struct exynos_tmu_platform_data *pdata = data->pdata; int temp_code; - switch (pdata->cal_type) { + switch (data->cal_type) { case TYPE_TWO_POINT_TRIMMING: temp_code = (temp - EXYNOS_FIRST_POINT_TRIM) * (data->temp_error2 - data->temp_error1) / @@ -293,10 +292,9 @@ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) */ static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) { - struct exynos_tmu_platform_data *pdata = data->pdata; int temp; - switch (pdata->cal_type) { + switch (data->cal_type) { case TYPE_TWO_POINT_TRIMMING: temp = (temp_code - data->temp_error1) * (EXYNOS_SECOND_POINT_TRIM - EXYNOS_FIRST_POINT_TRIM) / @@ -536,7 +534,6 @@ static int exynos4412_tmu_initialize(struct platform_device *pdev) static int exynos5433_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); - struct exynos_tmu_platform_data *pdata = data->pdata; struct thermal_zone_device *tz = data->tzd; unsigned int status, trim_info; unsigned int rising_threshold = 0, falling_threshold = 0; @@ -563,14 +560,12 @@ static int exynos5433_tmu_initialize(struct platform_device *pdev) >> EXYNOS5433_TRIMINFO_CALIB_SEL_SHIFT; switch (cal_type) { - case EXYNOS5433_TRIMINFO_ONE_POINT_TRIMMING: - pdata->cal_type = TYPE_ONE_POINT_TRIMMING; - break; case EXYNOS5433_TRIMINFO_TWO_POINT_TRIMMING: - pdata->cal_type = TYPE_TWO_POINT_TRIMMING; + data->cal_type = TYPE_TWO_POINT_TRIMMING; break; + case EXYNOS5433_TRIMINFO_ONE_POINT_TRIMMING: default: - pdata->cal_type = TYPE_ONE_POINT_TRIMMING; + data->cal_type = TYPE_ONE_POINT_TRIMMING; break; } @@ -1151,21 +1146,9 @@ static int exynos_of_get_soc_type(struct device_node *np) return -EINVAL; } -static int exynos_of_sensor_conf(struct device_node *np, - struct exynos_tmu_platform_data *pdata) -{ - of_node_get(np); - - of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type); - - of_node_put(np); - return 0; -} - static int exynos_map_dt_data(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); - struct exynos_tmu_platform_data *pdata; struct resource res; if (!data || !pdev->dev.of_node) @@ -1192,14 +1175,6 @@ static int exynos_map_dt_data(struct platform_device *pdev) return -EADDRNOTAVAIL; } - pdata = devm_kzalloc(&pdev->dev, - sizeof(struct exynos_tmu_platform_data), - GFP_KERNEL); - if (!pdata) - return -ENOMEM; - - exynos_of_sensor_conf(pdev->dev.of_node, pdata); - data->pdata = pdata; data->soc = exynos_of_get_soc_type(pdev->dev.of_node); switch (data->soc) { @@ -1284,6 +1259,8 @@ static int exynos_map_dt_data(struct platform_device *pdev) return -EINVAL; } + data->cal_type = TYPE_ONE_POINT_TRIMMING; + /* * Check if the TMU shares some registers and then try to map the * memory of common registers. diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index 689453d..8f56f86 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -38,14 +38,4 @@ enum soc_type { SOC_ARCH_EXYNOS7, }; -/** - * struct exynos_tmu_platform_data - * @cal_type: calibration type for temperature - * - * This structure is required for configuration of exynos_tmu driver. - */ -struct exynos_tmu_platform_data { - u32 cal_type; -}; - #endif /* _EXYNOS_TMU_H */