From patchwork Tue Mar 6 14:43:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10262149 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 3A3FB6016D for ; Tue, 6 Mar 2018 15:43:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E3628C82 for ; Tue, 6 Mar 2018 15:43:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CE6928C85; Tue, 6 Mar 2018 15:43:32 +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 92B5228C83 for ; Tue, 6 Mar 2018 15:43:31 +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=4+EkUJvNYndTMwM47jkJt5SuWZHQmTGLSTGXIC2E4Ss=; b=RJFR9f6oadHbPh3iObSCnifVZR fWEFsBI9tK8VMzmeAM52EbLMFYoinxohSBMJMLYKjtW0x5CLRhkzqevnbAX20KyNrdNPspbB/ZNLd fHnXZKWl5YiBXwix2MkWrCtcrMJpiPYA849NVUhnCGzb8zWHKSE50G4fY+oqLbtzWryT9EgmCdXo8 vkOVOZD42+8+ddm5B9NTuD3X5NRNqlsAbm3leVZA0PGCbJCwCmx4IYUreUMWrfHLpijUXpvnsjEIR C1UvFGgm2HNfmPFbQx8Ud5odwHCSnh30S63RU7tADGhLS4NUYB58Xmym/1unSz5ylNijzYGleyNa5 FK7J+SUQ==; 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 1etEkM-0008G6-3i; Tue, 06 Mar 2018 15:43:22 +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 1etEik-0007Lo-Cz for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Mar 2018 15:41:42 +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=6DwqwIxuT+66WsPVMBODJzY6RbUTpZjspw+Dvdar3HM=; b=s1c2ADH4QOdWMXDGdJxF+1L7C OlMLFsnfnw2ei4erhgm+9n7v9XceEI2GLVxc9TO8MBEuUo5fem1iioiymcaovFWozI5vd78NaiK6Q pKiUOLPdj6ne07y0DOwBxaH9d40LtbZpr45lu6owJTLqYE6q0yBSwiyUHbQ31qaWlE+aP4j2M2+z3 eLHbekOnUsM1S97XJzpYPvF/MU7FSbVizN4gYpV83YFoF0D7oCX5FMbq7a+LH1u73KDsIOF4mIbA3 yBYzr9MuxzTO7XCsqJfKrre5IDiO0vWXtVmksN+NJrZI3tDx1sGWqqTTWdzLQTzJa5Gba3UGA2TzB Oaz1yMJXA==; Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etDq5-00026s-UY for linux-arm-kernel@lists.infradead.org; Tue, 06 Mar 2018 14:45:21 +0000 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180306144500epoutp028a03bfaf4a7e539ccc06563c42fd6435~ZW-8kitTd1274612746epoutp02b; Tue, 6 Mar 2018 14:45:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180306144500epoutp028a03bfaf4a7e539ccc06563c42fd6435~ZW-8kitTd1274612746epoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520347500; bh=6DwqwIxuT+66WsPVMBODJzY6RbUTpZjspw+Dvdar3HM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=jwy/fWuY4t4IAPBVcS4w7wXfI2G8rJTQiGXSd59sDtAy/iDCpontTxhROnCJgjEWB xF2fO11mTh1xtF3mLeNb2hkpKpN3Y1CAtq/xaDlUyFhCCoDr+OH4wFsJKJTXPTrYPM U2P1oHaG+wSuNud5P1Kr+jyWy2QRgE5gqL082XBA= Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180306144459epcas2p19eeb540c257f29154f260d195ad02add~ZW-7k_PUD2385623856epcas2p1N; Tue, 6 Mar 2018 14:44:59 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id DC.5C.04108.B69AE9A5; Tue, 6 Mar 2018 23:44:59 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180306144458epcas2p1102a06fa3e58b88cad914be624e0c1db~ZW-6qF48a0853508535epcas2p1p; Tue, 6 Mar 2018 14:44:58 +0000 (GMT) X-AuditID: b6c32a47-19fff7000000100c-72-5a9ea96b2736 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id CD.C3.03890.A69AE9A5; Tue, 6 Mar 2018 23:44:58 +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:44:58 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Zhang Rui , Eduardo Valentin , Krzysztof Kozlowski Subject: [PATCH 07/12] thermal: exynos: remove parsing of samsung,tmu_gain property Date: Tue, 06 Mar 2018 15:43:50 +0100 Message-id: <1520347435-22970-8-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+NgFnrAIsWRmVeSWpSXmKPExsWy7bCmqW72ynlRBp/XS1hsnLGe1WL+kXNA 4so1Vov+x6+ZLc6f38BusekxkHt51xw2i8+9RxgtZpzfx2RxaOpeRoul1y8yWbTuPcJu8eRh H5sDr8eaeWsYPS5fu8jssXPWXXaPxXteMnlsWtXJ5rF5Sb1H35ZVjB6fN8kFcERx2aSk5mSW pRbp2yVwZVz99ZO14I9qxdKGdpYGxiPyXYycHBICJhK7Pj5i72Lk4hAS2MEo8eH8VWYI5zuj xPxpE4EcDrCqM4tVIeK7GSUWPJ/IBOH8YpTY2XuRDWQUm4CVxMT2VYwgtohAicS0Vb2MIEXM AmeZJHZsf8cCkhAWCJVoWb2dGcRmEVCVeDhxISv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WZValB9fVJqTWnyIUZqDRUmclz//WKSQQHpiSWp2ampBahFMlomD U6qBcYq5xaFbTCuaOlIWNQfv6JquZ26pG6VWtj6qPODp68kHrhwWdrDNONwxkZdPs/BKtJbR XTMl0bh4vwV2z7yMjSY9W9TQMqdqPd/mXfZuqlzsP6uMYs/5sdxYNN3x3iXPHeH28ybJyjU+ 4M6+GpsQ7bfu5J2zh1Mjpin+NRdkuySypbAk99JPJZbijERDLeai4kQANDFNHEkCAAA= X-CMS-MailID: 20180306144458epcas2p1102a06fa3e58b88cad914be624e0c1db X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180306144458epcas2p1102a06fa3e58b88cad914be624e0c1db X-RootMTR: 20180306144458epcas2p1102a06fa3e58b88cad914be624e0c1db 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_094514_481204_A8EAC16A X-CRM114-Status: GOOD ( 17.68 ) 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 pdata gain values are SoC (not platform) specific just move it from platform data to struct exynos_tmu_data instance. Then remove parsing of samsung,tmu_gain property. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 18 +++++++++--------- drivers/thermal/samsung/exynos_tmu.h | 4 ---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 12bbf79..262ab41 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -192,6 +192,8 @@ * @max_efuse_value: maximum valid trimming data * @temp_error1: fused value of the first point trim. * @temp_error2: fused value of the second point trim. + * @gain: gain of amplifier in the positive-TC generator block + * 0 < gain <= 15 * @reference_voltage: reference voltage of amplifier * in the positive-TC generator block * 0 < reference_voltage <= 31 @@ -218,6 +220,7 @@ struct exynos_tmu_data { u32 min_efuse_value; u32 max_efuse_value; u16 temp_error1, temp_error2; + u8 gain; u8 reference_voltage; struct regulator *regulator; struct thermal_zone_device *tzd; @@ -386,8 +389,6 @@ static int exynos_tmu_initialize(struct platform_device *pdev) static u32 get_con_reg(struct exynos_tmu_data *data, u32 con) { - struct exynos_tmu_platform_data *pdata = data->pdata; - if (data->soc == SOC_ARCH_EXYNOS4412 || data->soc == SOC_ARCH_EXYNOS3250) con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_MUX_ADDR_SHIFT); @@ -396,7 +397,7 @@ static u32 get_con_reg(struct exynos_tmu_data *data, u32 con) con |= data->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT; con &= ~(EXYNOS_TMU_BUF_SLOPE_SEL_MASK << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT); - con |= (pdata->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT); + con |= (data->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT); con &= ~(EXYNOS_TMU_TRIP_MODE_MASK << EXYNOS_TMU_TRIP_MODE_SHIFT); con |= (EXYNOS_NOISE_CANCEL_MODE << EXYNOS_TMU_TRIP_MODE_SHIFT); @@ -1153,14 +1154,8 @@ static int exynos_of_get_soc_type(struct device_node *np) static int exynos_of_sensor_conf(struct device_node *np, struct exynos_tmu_platform_data *pdata) { - u32 value; - int ret; - of_node_get(np); - ret = of_property_read_u32(np, "samsung,tmu_gain", &value); - pdata->gain = (u8)value; - of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type); of_node_put(np); @@ -1214,6 +1209,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_read = exynos4210_tmu_read; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; data->ntrip = 4; + data->gain = 15; data->reference_voltage = 7; data->efuse_value = 55; data->min_efuse_value = 40; @@ -1231,6 +1227,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; data->ntrip = 4; + data->gain = 8; data->reference_voltage = 16; data->efuse_value = 55; if (data->soc != SOC_ARCH_EXYNOS5420 && @@ -1247,6 +1244,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; data->ntrip = 8; + data->gain = 8; if (res.start == EXYNOS5433_G3D_BASE) data->reference_voltage = 23; else @@ -1262,6 +1260,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_set_emulation = exynos5440_tmu_set_emulation; data->tmu_clear_irqs = exynos5440_tmu_clear_irqs; data->ntrip = 4; + data->gain = 5; data->reference_voltage = 16; data->efuse_value = 0x5d2d; data->min_efuse_value = 16; @@ -1274,6 +1273,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; data->ntrip = 8; + data->gain = 9; data->reference_voltage = 17; data->efuse_value = 75; data->min_efuse_value = 15; diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index 9f4318c..689453d 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -40,15 +40,11 @@ enum soc_type { /** * struct exynos_tmu_platform_data - * @gain: gain of amplifier in the positive-TC generator block - * 0 < gain <= 15 * @cal_type: calibration type for temperature * * This structure is required for configuration of exynos_tmu driver. */ struct exynos_tmu_platform_data { - u8 gain; - u32 cal_type; };