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: 10262151 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 0E7E16055D for ; Tue, 6 Mar 2018 15:44:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F15DE29091 for ; Tue, 6 Mar 2018 15:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5D732909D; Tue, 6 Mar 2018 15:44:07 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 26DFB29093 for ; Tue, 6 Mar 2018 15:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=thliTfVSYILbT1xDbgqpjYuXcjiEG85uePAXv4lOBFE=; b=YY0P01G+AIzJhXydhB3go133I0 w3SZ4shUx6Kb5JOB2C0hdn4YeAQZgk+nRUtAbhvEiZ6t8Agv78jGUo7ckj7jzPTjiTFLpyr1HGR1J SASvP/EZY1m5XVdaTqqkM+bty6lXxbyUbRmR+4kzJqn8T8bTfEbcge3r4l/iOjd8RQkd3JdMMmNmq ixRFQffLCIYCWDOEt+aAURxEEhR1BfrlaTaFzSJEGy8Bz0ZQ7W9L40VuEHwZ9szCcdT+Lmz6mHE16 3tJiHdCxKDI7axhs9zOp6T2Za6ttKgr+IiIms6TPrwFAgLr7cqznRlfrhr3SXFMQn9dd6S+/Can/B rKq6pfbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etEku-00008P-UO; Tue, 06 Mar 2018 15:43:56 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etEim-0007Lo-2l for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Mar 2018 15:41:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-reply-to:Message-id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WSIBt26K6P7XyQCypk/gxw4RM5ZA9QATp0c1+5uajAw=; b=Qn1jrSMtZB5BhUj1bP/FK72t/ VBK60z5khYDasuysuarBb2WmJPJ78EC/Tsbnq4V5W1qeYlIOO8aJEZHoZlP6LFNrL2jh+rVxi0mzp EhaNs9/nihA1HIEuTtKVAc1tGzNzIwUR5rKpMIicIBote2+qB2Lou+lMSQHrMuuPaHr8EEf+WcI5D agzB79b7flK8Z9zW2GsRUH4mwv7d6baYmcv3UIfMDx2XoKx9vH6GoG4zakhmMHJrTVJ61NRyPU5JI 6PJ9W4FGIPm0prnqSxI73/FY7nLIZocIvraUV/a6D948WSoefp+L6ZS4xluS4VhfNC5OXXoE0X3wM ZvoSzl85g==; Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etDqB-00026z-4D for linux-arm-kernel@lists.infradead.org; Tue, 06 Mar 2018 14:45:20 +0000 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 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/R0LSEJYIFJi09FrTCA2i4CqRNutu2DNvAIeE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sbIqtSg/vqg0J7X4EKM0B4uSOC9//rFIIYH0xJLU7NTUgtQimCwT B6dUA+OO/53tHGr2nPlX3H8oZOuHK+WKr1r/keHOh1Xb57GJXOjLXfM46VZfqf+MR7GZHfYf 9HM5zoa8V2K6vqiaxW/PRiuVTLf2WYsi5KIUeHuuJmxc8Pv8ed2mVSdu+6xX5P3WK39Rr7ij 7ON7g0cf6wKDJF6rVYlr194PVpj6caFdQHNQ0gv5AiWW4oxEQy3mouJEAHuXUDJJAgAA 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180306_094519_482834_6BB6FFA3 X-CRM114-Status: GOOD ( 21.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, b.zolnierkie@samsung.com, Russell King , Rob Herring , linux-kernel@vger.kernel.org, Kukjin Kim , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 */