From patchwork Mon Nov 20 14:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40501C5AE5E for ; Mon, 20 Nov 2023 14:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233880AbjKTOwQ (ORCPT ); Mon, 20 Nov 2023 09:52:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233795AbjKTOvz (ORCPT ); Mon, 20 Nov 2023 09:51:55 -0500 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60BFA10FB for ; Mon, 20 Nov 2023 06:51:02 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145100euoutp01ae8450ac9ec6a1d03640d6436d52f5ee~ZXFZM998m2449224492euoutp015 for ; Mon, 20 Nov 2023 14:51:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231120145100euoutp01ae8450ac9ec6a1d03640d6436d52f5ee~ZXFZM998m2449224492euoutp015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491860; bh=eb8mbc98REMcBZ07pJdFy0917NkB5OE4nrZXufMorTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+9OTrlPA0TVYqzDRyOP2E+QeTukIzT9PEqBtz8GdNO1xPWjmOIqxfpL11oW5032u Yvcob87GRdCzS2Onm++jXis27N2f9irtt+lFXwlOt4nj8AZQzuA2QXCqstLY0i5G1s kWy5jncDSMBHjxmYihtL0KwGlRYjNsx8si0/nLx8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231120145059eucas1p1dfb26601aa696ead06ab700690edf8b3~ZXFYhpZZg2521425214eucas1p1v; Mon, 20 Nov 2023 14:50:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BF.9B.09814.3527B556; Mon, 20 Nov 2023 14:50:59 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231120145058eucas1p16db15d5d8822c1ce88d7ae5f5d7298bd~ZXFYKIE9a0302603026eucas1p1V; Mon, 20 Nov 2023 14:50:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145058eusmtrp26f1c7105a59e4c4aad76dbc0312a536d~ZXFYJZ_oH0691806918eusmtrp24; Mon, 20 Nov 2023 14:50:58 +0000 (GMT) X-AuditID: cbfec7f4-711ff70000002656-1f-655b7253207a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.64.09274.2527B556; Mon, 20 Nov 2023 14:50:58 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145057eusmtip2705fe998d7d6d012db917ab736c0f80d~ZXFXQSoMs1142511425eusmtip2g; Mon, 20 Nov 2023 14:50:57 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , Lukasz Luba Subject: [PATCH v5 1/9] thermal: exynos: remove an unnecessary field description Date: Mon, 20 Nov 2023 15:50:41 +0100 Message-ID: <20231120145049.310509-2-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120145049.310509-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGKsWRmVeSWpSXmKPExsWy7djP87rBRdGpBg9P81s8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouFTS3sFhOP TWa2WHvkLrvF3C9TmS2ePOxjcxDwWDNvDaPHzll32T0W73nJ5LFpVSebx51re9g8Ni+p9+jb sorR4/MmuQCOKC6blNSczLLUIn27BK6MU0fmsBWsYq9YvecQSwPjZLYuRg4OCQETiYkriroY OTmEBFYwSixeUdjFyAVkf2GUeH5gAjOE85lRoun6KnaQKpCG/f3/oBLLGSUuHPzHCtHeyiTx 53kCiM0mYCDx4M0ysAYRgVZGiZlN6iANzAJfmSWuvp7PDJIQFgiSeH5yNhuIzSKgKnH08j2w OK+ArcSX121sENvkJfYs+s4EYnMK2Em0HXnOBlEjKHFy5hMWEJsZqKZ562ywiyQEJnNKLF96 BKrZRWL707MsELawxKvjW6BekJH4v3M+E4SdLzFj83sWSFhUSNw96AVhWkt8PMMMYjILaEqs 36UPUewo8W3/MiaICj6JG28FIQ7gk5i0bTozRJhXoqNNCKJaVeL4nknMELa0xJOW21ArPSR+ rDjKPIFRcRaSV2YheWUWwt4FjMyrGMVTS4tz01OLjfJSy/WKE3OLS/PS9ZLzczcxApPa6X/H v+xgXP7qo94hRiYOxkOMEhzMSiK834QiUoV4UxIrq1KL8uOLSnNSiw8xSnOwKInzqqbIpwoJ pCeWpG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hLn9SzoSBQSSE8sSc1OTS1ILYLpY+LglGpg0tr7+PG8 RysMQlhMDt40WchZsoh9yZavM0sK1nROKJsZWhOeFvfS69/y0m1bn5fwfRK+YvGvmXfPC4Yd F6/mbuFbYKMq8VnidXfa0k8qgqmPv/hIPHc+ZLiISSL4w292plnRWe9P/y1L7it9LXpIb9al x6e/2xh90uFtOZx3+U5y7GMjr8bcrOIFJfZKC99c5Tm0ykng5FYfjd+qm1SndK0p8L6oa1yh J3I29cj5Q5GLTrU996n4lP+m6pkJQ+Cp96K+k3LnnxG68f7pNpeZaycxir+6cO3H4Z7PUT/X KSWtu7I6O/GJSeiG1epsG6e7cN5njetJ/fuLu+PkzomuG+/6h/Bt/2iTpObK+K5iJYcSS3FG oqEWc1FxIgBeRX6DTAMAAA== X-CMS-MailID: 20231120145058eucas1p16db15d5d8822c1ce88d7ae5f5d7298bd X-Msg-Generator: CA X-RootMTR: 20231120145058eucas1p16db15d5d8822c1ce88d7ae5f5d7298bd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145058eucas1p16db15d5d8822c1ce88d7ae5f5d7298bd References: <20231120145049.310509-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It seems that the field has been removed in one of the previous commits, but the description has been forgotten. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 123ec81e1943..187086658e8f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -160,7 +160,6 @@ enum soc_type { * in the positive-TC generator block * 0 < reference_voltage <= 31 * @regulator: pointer to the TMU regulator structure. - * @reg_conf: pointer to structure to register with core thermal. * @tzd: pointer to thermal_zone_device structure * @ntrip: number of supported trip points. * @enabled: current status of TMU device From patchwork Mon Nov 20 14:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73675C2BB3F for ; Mon, 20 Nov 2023 14:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233506AbjKTOwW (ORCPT ); Mon, 20 Nov 2023 09:52:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233949AbjKTOwB (ORCPT ); Mon, 20 Nov 2023 09:52:01 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 358101718 for ; Mon, 20 Nov 2023 06:51:08 -0800 (PST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145105euoutp02b14aca2a1956606869dab37ec39176d5~ZXFeHX61i2495924959euoutp02L for ; Mon, 20 Nov 2023 14:51:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231120145105euoutp02b14aca2a1956606869dab37ec39176d5~ZXFeHX61i2495924959euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491865; bh=SZ2xtU4liTdPRXyiaem1RPsDZRIMzUg5tNmbRIlLQxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MRkMYLgECGbDZuAC16i7Z074sz03zc/RS5f2Hw8GceDNDV+vlQL3f6Hz6B8dZLFXg dfoFQE2ehoktZUrvfmHDgeoqbYwA8/yNkVQ/mae6RfjuVu61l1X5XzSACBiIhs6E9x Fbx5M0f4jWAylM8bNH40D+mGJz4m9lQ/O1RkrF/I= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231120145104eucas1p20f74dc6a127503ebc00e387d9a634902~ZXFdrO2ae2766127661eucas1p2J; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 26.A8.09552.8527B556; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231120145104eucas1p122668d13b89b1f65356ab7cb717e9a5e~ZXFdOx-sO2333923339eucas1p13; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145104eusmtrp25207acc34ecc76f70f09d81a87362d22~ZXFdOCmlr0700707007eusmtrp2p; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) X-AuditID: cbfec7f5-83dff70000002550-88-655b72587fd2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 28.C3.09146.8527B556; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145103eusmtip2b3b3275f2c9b17d5489c7bc9310ab4d1~ZXFcYf-wn1340113401eusmtip2D; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , Lukasz Luba Subject: [PATCH v5 5/9] thermal: exynos: simplify regulator (de)initialization Date: Mon, 20 Nov 2023 15:50:45 +0100 Message-ID: <20231120145049.310509-6-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120145049.310509-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOKsWRmVeSWpSXmKPExsWy7djP87oRRdGpBkf+a1s8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouFTS3sFhOP TWa2WHvkLrvF3C9TmS2ePOxjcxDwWDNvDaPHzll32T0W73nJ5LFpVSebx51re9g8Ni+p9+jb sorR4/MmuQCOKC6blNSczLLUIn27BK6M7xc2shSskKuYPHkVYwPjbokuRk4OCQETiXNX77GA 2EICKxglGl8A2VxA9hdGiYMN7xghnM+MEpNnvWGH6diydz8rRGI5o8TzC0eZIZxWJolty6+C zWITMJB48GYZWIeIQCujxMwmdZAiZoGvzBJXX89nBkkICwRITP17E6yBRUBV4uSzhWwgNq+A rUT/g8dMEOvkJfYs+g5mcwrYSbQdeQ5VIyhxcuYTsF5moJrmrbPBrpAQ6OeU6Pp6BqrZRWL7 44dQtrDEq+NboH6Qkfi/cz5UPF9ixub3QIM4gOwKibsHvSBMa4mPZ5hBTGYBTYn1u/Qhoo4S Z8/XQJh8EjfeCkLs55OYtG06M0SYV6KjTQhisqrE8T2TmCFsaYknLbehNnpI/H+/lmkCo+Is JJ/MQvLJLIS1CxiZVzGKp5YW56anFhvnpZbrFSfmFpfmpesl5+duYgSmtdP/jn/dwbji1Ue9 Q4xMHIyHGCU4mJVEeL8JRaQK8aYkVlalFuXHF5XmpBYfYpTmYFES51VNkU8VEkhPLEnNTk0t SC2CyTJx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6EgUEkhPLEnNTk0tSC2C6WPi4JRqYFomfiSu J/b5u26hB9wTbVm0KztKJsdl2R8zXzpP769w9O7kDQ0TLkTn5GjrMbxs8PPjkfgUEnTrw7NI 8z3pf2VTeif7KOnZxS9YacJV13L6ayBTuP/3MPWA86ZpCeHa3csqbQqmG20INr4w+QbTNf5l SYxbquX1Tj1KUJGqOahW8EXG8g6bnPyaH/9VRTbJf75pbX4uuKam0tD6usilyQ+Ts8Kva7JE GX4tEZh9u7Zq35qrwtHHG+3Yr96/0enY9u/toefrvs/PaEld6Hll0pWIgz753qV/gnQXnZMy 2f1KJO+CFMulbaGlTLtOXdbmdLE51tpb+G6z7bNb5rx8L73PZ/+9F3fxSPHVGvFNSizFGYmG WsxFxYkASoVY4kwDAAA= X-CMS-MailID: 20231120145104eucas1p122668d13b89b1f65356ab7cb717e9a5e X-Msg-Generator: CA X-RootMTR: 20231120145104eucas1p122668d13b89b1f65356ab7cb717e9a5e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145104eucas1p122668d13b89b1f65356ab7cb717e9a5e References: <20231120145049.310509-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org We rewrite the initialization to enable the regulator as part of devm, which allows us to not handle the struct instance manually. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- v3 -> v4: Resolved merge conflict and moved info about not outputting error to the correct commit message. v2 -> v3: Fixed error handling of devm_regulator_get_optional to handle the case in which the regulator is available, but enabling it fails. Also removed the error message, split into two commits and reworded the commit message. drivers/thermal/samsung/exynos_tmu.c | 49 +++++++++------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 8bcad8a70dc5..3bdcbab7466f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -157,7 +157,6 @@ enum soc_type { * @reference_voltage: reference voltage of amplifier * in the positive-TC generator block * 0 < reference_voltage <= 31 - * @regulator: pointer to the TMU regulator structure. * @tzd: pointer to thermal_zone_device structure * @ntrip: number of supported trip points. * @enabled: current status of TMU device @@ -183,7 +182,6 @@ struct exynos_tmu_data { u16 temp_error1, temp_error2; u8 gain; u8 reference_voltage; - struct regulator *regulator; struct thermal_zone_device *tzd; unsigned int ntrip; bool enabled; @@ -994,50 +992,40 @@ static int exynos_tmu_probe(struct platform_device *pdev) * TODO: Add regulator as an SOC feature, so that regulator enable * is a compulsory call. */ - data->regulator = devm_regulator_get_optional(&pdev->dev, "vtmu"); - if (!IS_ERR(data->regulator)) { - ret = regulator_enable(data->regulator); - if (ret) { - dev_err(&pdev->dev, "failed to enable vtmu\n"); - return ret; - } - } else { - ret = PTR_ERR(data->regulator); - switch (ret) { - case -ENODEV: - break; - case -EPROBE_DEFER: - return -EPROBE_DEFER; - default: - dev_err(&pdev->dev, "Failed to get regulator: %d\n", - ret); - return ret; - } + ret = devm_regulator_get_enable_optional(&pdev->dev, "vtmu"); + switch (ret) { + case 0: + case -ENODEV: + break; + case -EPROBE_DEFER: + return -EPROBE_DEFER; + default: + dev_err(&pdev->dev, "Failed to get enabled regulator: %d\n", + ret); + return ret; } ret = exynos_map_dt_data(pdev); if (ret) - goto err_sensor; + return ret; data->clk = devm_clk_get(&pdev->dev, "tmu_apbif"); if (IS_ERR(data->clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); - ret = PTR_ERR(data->clk); - goto err_sensor; + return PTR_ERR(data->clk); } data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif"); if (IS_ERR(data->clk_sec)) { if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) { dev_err(&pdev->dev, "Failed to get triminfo clock\n"); - ret = PTR_ERR(data->clk_sec); - goto err_sensor; + return PTR_ERR(data->clk_sec); } } else { ret = clk_prepare(data->clk_sec); if (ret) { dev_err(&pdev->dev, "Failed to get clock\n"); - goto err_sensor; + return ret; } } @@ -1107,10 +1095,6 @@ static int exynos_tmu_probe(struct platform_device *pdev) err_clk_sec: if (!IS_ERR(data->clk_sec)) clk_unprepare(data->clk_sec); -err_sensor: - if (!IS_ERR(data->regulator)) - regulator_disable(data->regulator); - return ret; } @@ -1124,9 +1108,6 @@ static void exynos_tmu_remove(struct platform_device *pdev) clk_unprepare(data->clk); if (!IS_ERR(data->clk_sec)) clk_unprepare(data->clk_sec); - - if (!IS_ERR(data->regulator)) - regulator_disable(data->regulator); } #ifdef CONFIG_PM_SLEEP From patchwork Mon Nov 20 14:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DA08C5AD4C for ; Mon, 20 Nov 2023 14:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232435AbjKTOwU (ORCPT ); Mon, 20 Nov 2023 09:52:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233707AbjKTOv6 (ORCPT ); Mon, 20 Nov 2023 09:51:58 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56E1171E for ; Mon, 20 Nov 2023 06:51:08 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145107euoutp02c363bd6c27739b18615c527dfdf386b1~ZXFgIhG8a2495724957euoutp02X for ; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231120145107euoutp02c363bd6c27739b18615c527dfdf386b1~ZXFgIhG8a2495724957euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491867; bh=HFjJa1RguNICip8Nann+GThTo5GBNLI3URdePUvmffE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJROzEWzw/z52hXiYkUqtHSJy1qUZmagNu441oM1lCR0PAkDjIPfvzGJMw8LeExcf +UIfz6npQX6ZmbqLO67shH1rbHaVrBcWc+8NGowkPxxHwsz4sXNMUwVfHhOiHTqj8L JAr7xC4ep1zmK26cWtBGqBGZBhq49zZvtty1e8nE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231120145107eucas1p257acb28f624092f513f92bdf4e3402ef~ZXFf0tf1y0521605216eucas1p2z; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A8.A8.09552.A527B556; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231120145106eucas1p1964c7fdc0297d538faa0aeb20190d178~ZXFfYQS382504625046eucas1p17; Mon, 20 Nov 2023 14:51:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145106eusmtrp20de9c8945620aecf4b00892a3f597c11~ZXFfXl5eb0691806918eusmtrp2P; Mon, 20 Nov 2023 14:51:06 +0000 (GMT) X-AuditID: cbfec7f5-853ff70000002550-8f-655b725a9c69 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1B.C3.09146.A527B556; Mon, 20 Nov 2023 14:51:06 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145105eusmtip270942d3c46daa8e61451e3142463bd41~ZXFegph5a1340013400eusmtip2C; Mon, 20 Nov 2023 14:51:05 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , Lukasz Luba Subject: [PATCH v5 7/9] thermal: exynos: split initialization of TMU and the thermal zone Date: Mon, 20 Nov 2023 15:50:47 +0100 Message-ID: <20231120145049.310509-8-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120145049.310509-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGKsWRmVeSWpSXmKPExsWy7djPc7rRRdGpBl+7GC0ezNvGZnF4foXF 1IdP2Cy+b7nOZDHvs6zF3tdb2S2+Xelgstj0+BqrxeVdc9gsPvceYbSYcX4fk8XCphZ2i4nH JjNbrD1yl91i7pepzBZPHvaxOQh4rJm3htFj56y77B6L97xk8ti0qpPN4861PWwem5fUe/Rt WcXo8XmTXABHFJdNSmpOZllqkb5dAlfG+tcNjAV31Cs63ts0MC5T6GLk4JAQMJGYd1Kri5GL Q0hgBaPExF0LWSCcL4wSr5qbWCGcz4wS3w9eY+pi5ATruHroIxNEYjmjxOeOPcwQTiuTxL3f 99lAqtgEDCQevFnGDmKLCLQySsxsUgcpYhb4yixx9fV8ZpCEsEC0xJpX/SwgNouAqsThZdPA bF4BW4kzh7eyQKyTl9iz6DvYak4BO4m2I8/ZIGoEJU7OfAJWwwxU07x1NtgVEgL9nBKP7y5n hmh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HEgzfL2EESIgKdjBJdm88xgSSYBf4zS3ydCbZCWCBS out6PyOIzSKgKnF42TQWEJtXwFbizOGtLBAb5CX2LPoO1sspYCfRduQ50DYOoG22Eh13NSDK BSVOznzCAjFeXqJ562zmCYwCs5CkZiFJLWBkWsUoklpanJueW2yoV5yYW1yal66XnJ+7iREY hduO/dy8g3Heq496hxiZOBgPMUpwMCuJ8H4TikgV4k1JrKxKLcqPLyrNSS0+xGgKdPZEZinR 5HxgGsgriTc0MzA1NDGzNDC1NDNWEuf1LOhIFBJITyxJzU5NLUgtgulj4uCUamCarMR+/d+D VT+mBU7awyW46T6PVYvgt6qtn7l0erjzVy8pnc1++cDv/VPXpks4+mkbnpn2/K3yX9lr0x7b HFG7GOn4zU+ewVRpW7PfKZ6aiLlGrnyMKgkSM3geds5iqr62Ret+EKeypHTg5YyqaRMu/VY6 eqs6su51e9e10yt+bW+WO+fV43b01/36X8pTfi7uXjk/ry2UocRTZ+tG/RtVyk94NxQLLnxo JcxSXrtl9aYnz38ws7ofaMh64fz+v2E/46m1Z5XW3WhXy4uO4pPSPsTG6K9yx5olaeK9rD4W HauQP1rPJNdaSep9lvrw537E7g/BD/9oRl07Uf0sVsElyrJBP6Wk6Zj6zvuyzbOUWIozEg21 mIuKEwHgfQqfSwMAAA== X-CMS-MailID: 20231120145106eucas1p1964c7fdc0297d538faa0aeb20190d178 X-Msg-Generator: CA X-RootMTR: 20231120145106eucas1p1964c7fdc0297d538faa0aeb20190d178 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145106eucas1p1964c7fdc0297d538faa0aeb20190d178 References: <20231120145049.310509-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This will be needed in the future, as the thermal zone subsystem might call our callbacks right after devm_thermal_of_zone_register. Currently we just make get_temp return EAGAIN in such case, but this will not be possible with state-modifying callbacks, for instance set_trips. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- v3 -> v4: Reordered calls done while leaving exynos_tmu_initialize so that they mirror the calls done while entering this function. v1 -> v2: We take clocks into account; exynos_tmu_initialize needs both clocks, as tmu_initialize might use the base_second registers. However, exynos_thermal_zone_configure only needs clk. drivers/thermal/samsung/exynos_tmu.c | 104 +++++++++++++++------------ 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index d918bf6d5359..6b3a7dd05c68 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -251,25 +251,8 @@ static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info) static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); - struct thermal_zone_device *tzd = data->tzd; - int num_trips = thermal_zone_get_num_trips(tzd); unsigned int status; - int ret = 0, temp; - - ret = thermal_zone_get_crit_temp(tzd, &temp); - if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */ - dev_err(&pdev->dev, - "No CRITICAL trip point defined in device tree!\n"); - goto out; - } - - if (num_trips > data->ntrip) { - dev_info(&pdev->dev, - "More trip points than supported by this TMU.\n"); - dev_info(&pdev->dev, - "%d trip points should be configured in polling mode.\n", - num_trips - data->ntrip); - } + int ret = 0; mutex_lock(&data->lock); clk_enable(data->clk); @@ -280,32 +263,63 @@ static int exynos_tmu_initialize(struct platform_device *pdev) if (!status) { ret = -EBUSY; } else { - int i, ntrips = - min_t(int, num_trips, data->ntrip); - data->tmu_initialize(pdev); - - /* Write temperature code for rising and falling threshold */ - for (i = 0; i < ntrips; i++) { - - struct thermal_trip trip; - - ret = thermal_zone_get_trip(tzd, i, &trip); - if (ret) - goto err; - - data->tmu_set_trip_temp(data, i, trip.temperature / MCELSIUS); - data->tmu_set_trip_hyst(data, i, trip.temperature / MCELSIUS, - trip.hysteresis / MCELSIUS); - } - data->tmu_clear_irqs(data); } + + if (!IS_ERR(data->clk_sec)) + clk_disable(data->clk_sec); + clk_disable(data->clk); + mutex_unlock(&data->lock); + + return ret; +} + +static int exynos_thermal_zone_configure(struct platform_device *pdev) +{ + struct exynos_tmu_data *data = platform_get_drvdata(pdev); + struct thermal_zone_device *tzd = data->tzd; + int i, num_trips = thermal_zone_get_num_trips(tzd); + int ret = 0, temp; + + ret = thermal_zone_get_crit_temp(tzd, &temp); + + if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */ + dev_err(&pdev->dev, + "No CRITICAL trip point defined in device tree!\n"); + goto out; + } + + mutex_lock(&data->lock); + + if (num_trips > data->ntrip) { + dev_info(&pdev->dev, + "More trip points than supported by this TMU.\n"); + dev_info(&pdev->dev, + "%d trip points should be configured in polling mode.\n", + num_trips - data->ntrip); + } + + clk_enable(data->clk); + + num_trips = min_t(int, num_trips, data->ntrip); + + /* Write temperature code for rising and falling threshold */ + for (i = 0; i < num_trips; i++) { + struct thermal_trip trip; + + ret = thermal_zone_get_trip(tzd, i, &trip); + if (ret) + goto err; + + data->tmu_set_trip_temp(data, i, trip.temperature / MCELSIUS); + data->tmu_set_trip_hyst(data, i, trip.temperature / MCELSIUS, + trip.hysteresis / MCELSIUS); + } + err: clk_disable(data->clk); mutex_unlock(&data->lock); - if (!IS_ERR(data->clk_sec)) - clk_disable(data->clk_sec); out: return ret; } @@ -1044,10 +1058,12 @@ static int exynos_tmu_probe(struct platform_device *pdev) break; } - /* - * data->tzd must be registered before calling exynos_tmu_initialize(), - * requesting irq and calling exynos_tmu_control(). - */ + ret = exynos_tmu_initialize(pdev); + if (ret) { + dev_err(&pdev->dev, "Failed to initialize TMU\n"); + return ret; + } + data->tzd = devm_thermal_of_zone_register(&pdev->dev, 0, data, &exynos_sensor_ops); if (IS_ERR(data->tzd)) { @@ -1058,9 +1074,9 @@ static int exynos_tmu_probe(struct platform_device *pdev) goto err_sclk; } - ret = exynos_tmu_initialize(pdev); + ret = exynos_thermal_zone_configure(pdev); if (ret) { - dev_err(&pdev->dev, "Failed to initialize TMU\n"); + dev_err(&pdev->dev, "Failed to configure the thermal zone\n"); goto err_sclk; } From patchwork Mon Nov 20 14:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00DF6C2BB3F for ; Mon, 20 Nov 2023 14:57:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233855AbjKTO5q (ORCPT ); Mon, 20 Nov 2023 09:57:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233901AbjKTO5p (ORCPT ); Mon, 20 Nov 2023 09:57:45 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2781E1728 for ; Mon, 20 Nov 2023 06:51:10 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145108euoutp0213dc6160efbc3e4469a6576c4de63644~ZXFhi5SGb2495724957euoutp02b for ; Mon, 20 Nov 2023 14:51:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231120145108euoutp0213dc6160efbc3e4469a6576c4de63644~ZXFhi5SGb2495724957euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491869; bh=jBlF0oIpiv9kwW8O5r6u3KvNxtWfNTZv3UQkUphMQXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzvNfT6QqjiCcvDlgcuoYYZEs+upT7SsibZv9+uDvizJO0r5bWlRbDYZBd0DgAJQz +a2JimbJGIt8qX0mkAyILFK1UD9wB9wcQqdN6hSwNDvDCQJbJrmd14S4qQ1Iltpo/d 34Y35F//S3FuBDKRaPTGVTgnw2AfDU3YEF75X5DI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231120145108eucas1p1d9c037fcf01ad33abd2b3989162654a6~ZXFg9bU5I0563605636eucas1p14; Mon, 20 Nov 2023 14:51:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F1.47.09539.C527B556; Mon, 20 Nov 2023 14:51:08 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231120145107eucas1p13ed9ea8772346c404d2d7f47d4c80f5a~ZXFgkKmmp1856818568eucas1p1X; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145107eusmtrp226def54ebb6b30123443d1e83bd2ee74~ZXFgeg9HP0691806918eusmtrp2V; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) X-AuditID: cbfec7f2-52bff70000002543-67-655b725c09c2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5D.C3.09146.B527B556; Mon, 20 Nov 2023 14:51:07 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145106eusmtip299c0f9402e9af46c179a8f5dfe7b646e~ZXFfmg4Cr1340013400eusmtip2D; Mon, 20 Nov 2023 14:51:06 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski , Lukasz Luba Subject: [PATCH v5 8/9] thermal: exynos: use BIT wherever possible Date: Mon, 20 Nov 2023 15:50:48 +0100 Message-ID: <20231120145049.310509-9-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120145049.310509-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBKsWRmVeSWpSXmKPExsWy7djPc7oxRdGpBp3X+C0ezNvGZnF4foXF 1IdP2Cy+b7nOZDHvs6zF3tdb2S2+Xelgstj0+BqrxeVdc9gsPvceYbSYcX4fk8XCphZ2i4nH JjNbrD1yl91i7pepzBZPHvaxOQh4rJm3htFj56y77B6L97xk8ti0qpPN4861PWwem5fUe/Rt WcXo8XmTXABHFJdNSmpOZllqkb5dAlfGjHXrmAvOiVY8OfyVvYFxj2AXIyeHhICJxMWvE5i7 GLk4hARWMEo83DydFcL5wijx5dwWdgjnM6PErTm9LDAt6xcuYgaxhQSWM0rsvu4LUdTKJLG7 eSYbSIJNwEDiwZtl7CC2iEAro8TMJnWQImaBr8wSV1/PB+sWFnCS+PDzPJjNIqAq8XfPASYQ m1fAVmLyi2ZWiG3yEnsWfQeLcwrYSbQdec4GUSMocXLmE7CLmIFqmrfOBntCQqCbU+LVngNs EM0uEpNnLYQaJCzx6vgWdghbRuL/zvlMEHa+xIzN74EGcQDZFRJ3D3pBmNYSH88wg5jMApoS 63fpQxQ7Skw6foIJooJP4sZbQYgD+CQmbZvODBHmlehoE4KoVpU4vmcSM4QtLfGk5TbUSg+J tVvvM09gVJyF5JVZSF6ZhbB3ASPzKkbx1NLi3PTUYsO81HK94sTc4tK8dL3k/NxNjMDEdvrf 8U87GOe++qh3iJGJg/EQowQHs5II7zehiFQh3pTEyqrUovz4otKc1OJDjNIcLErivKop8qlC AumJJanZqakFqUUwWSYOTqkGphjPih/O5UvCHf2XTiqwebSlzXGyi9b+7vNZj/+vSozbpmvG JtVlMq3CWE+vzTRLgPmjS82PZ+WRnmGZvqdj3qy0fn/zq7vzjG3pBxd1aVzYWMX8oDXp+On+ /7tyP5zdMStMo/la/KdvD/ZdOihiZc3nZ/I45HHynXcKL+753Guez8y5w1ZW9oxKy/lk7c/b dzodSFz2p3Xz9rBJjPFXYixC7Kczf64Mz+SR0ri3OG3ahQd2CmwZ706dS+LoC1/71fPoN6Xz 697N8VBeL/Ppxb983+q0CV8Z93+64/g9Z4J2bKyr2x/bs79ryvyrbBwZpvK+1Vc9e+9Gtdwh 2fPrgua+fGqwb/aKx5YM5vHLnyuxFGckGmoxFxUnAgDjMhOn2wMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsVy+t/xe7rRRdGpBgfX61s8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouFTS3sFhOP TWa2WHvkLrvF3C9TmS2ePOxjcxDwWDNvDaPHzll32T0W73nJ5LFpVSebx51re9g8Ni+p9+jb sorR4/MmuQCOKD2bovzSklSFjPziElulaEMLIz1DSws9IxNLPUNj81grI1MlfTublNSczLLU In27BL2MGevWMRecE614cvgrewPjHsEuRk4OCQETifULFzF3MXJxCAksZZQ49KSZFSIhLXH4 yxR2CFtY4s+1LjaIomYmideHDoMl2AQMJB68WcYOkhAR6GSU6Np8jgkkwSzwn1ni60wFEFtY wEniw8/zzCA2i4CqxN89B8BqeAVsJSa/gNkmL7Fn0XewOKeAnUTbkedA2ziAttlKdNzVgCgX lDg58wkLxHh5ieats5knMArMQpKahSS1gJFpFaNIamlxbnpusaFecWJucWleul5yfu4mRmAc bjv2c/MOxnmvPuodYmTiYDzEKMHBrCTC+00oIlWINyWxsiq1KD++qDQntfgQoynQ2ROZpUST 84GJIK8k3tDMwNTQxMzSwNTSzFhJnNezoCNRSCA9sSQ1OzW1ILUIpo+Jg1OqgSnUaX3iRYf8 d9nNJzb0r3qknaPfePFM1TX2LlZXv9jFeu3Pe/I2xR8RPVXqmj43vlTj6qGH9jq+nnwfm23f LAxaohOpvf9/4mxR2QuT3Db/Dfgs+Nd38ew9V/uNn0Ruu+5v6NPAJFyp/7xI3aPsQIi/f+N5 XsNNrAnXtB8v5dsi9GBb5smateaedu8qY+0fdBopNi67YVvzpN5DVK5lruh+q9Rf7Al2aWKX Nu57yDFzle+jdiPTbz4XrxtmLq7iXPo3O+Taxm/vPC4IVS1/sMhg52/V83MlPnyTWvjI8OJZ tr/h3JcTHzUUSuY9fz5/5uzubk7nFRwSqT/VmW4siGdhf+is6bY+4/k76eS2e0osxRmJhlrM RcWJALSRTsRMAwAA X-CMS-MailID: 20231120145107eucas1p13ed9ea8772346c404d2d7f47d4c80f5a X-Msg-Generator: CA X-RootMTR: 20231120145107eucas1p13ed9ea8772346c404d2d7f47d4c80f5a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145107eucas1p13ed9ea8772346c404d2d7f47d4c80f5a References: <20231120145049.310509-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The original driver did not use that macro and it allows us to make our intentions slightly clearer. Signed-off-by: Mateusz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 6b3a7dd05c68..40e250c815f8 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -388,7 +388,7 @@ static void exynos4412_tmu_set_trip_temp(struct exynos_tmu_data *data, if (trip == 3) { con = readl(data->base + EXYNOS_TMU_REG_CONTROL); - con |= (1 << EXYNOS_TMU_THERM_TRIP_EN_SHIFT); + con |= BIT(EXYNOS_TMU_THERM_TRIP_EN_SHIFT); writel(con, data->base + EXYNOS_TMU_REG_CONTROL); } } @@ -559,16 +559,16 @@ static void exynos4210_tmu_control(struct platform_device *pdev, bool on) continue; interrupt_en |= - (1 << (EXYNOS_TMU_INTEN_RISE0_SHIFT + i * 4)); + BIT(EXYNOS_TMU_INTEN_RISE0_SHIFT + i * 4); } if (data->soc != SOC_ARCH_EXYNOS4210) interrupt_en |= interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT; - con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); + con |= BIT(EXYNOS_TMU_CORE_EN_SHIFT); } else { - con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT); + con &= ~BIT(EXYNOS_TMU_CORE_EN_SHIFT); } writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN); @@ -590,15 +590,15 @@ static void exynos5433_tmu_control(struct platform_device *pdev, bool on) continue; interrupt_en |= - (1 << (EXYNOS7_TMU_INTEN_RISE0_SHIFT + i)); + BIT(EXYNOS7_TMU_INTEN_RISE0_SHIFT + i); } interrupt_en |= interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT; - con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); + con |= BIT(EXYNOS_TMU_CORE_EN_SHIFT); } else - con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT); + con &= ~BIT(EXYNOS_TMU_CORE_EN_SHIFT); pd_det_en = on ? EXYNOS5433_PD_DET_EN : 0; @@ -622,17 +622,17 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on) continue; interrupt_en |= - (1 << (EXYNOS7_TMU_INTEN_RISE0_SHIFT + i)); + BIT(EXYNOS7_TMU_INTEN_RISE0_SHIFT + i); } interrupt_en |= interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT; - con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); - con |= (1 << EXYNOS7_PD_DET_EN_SHIFT); + con |= BIT(EXYNOS_TMU_CORE_EN_SHIFT); + con |= BIT(EXYNOS7_PD_DET_EN_SHIFT); } else { - con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT); - con &= ~(1 << EXYNOS7_PD_DET_EN_SHIFT); + con &= ~BIT(EXYNOS_TMU_CORE_EN_SHIFT); + con &= ~BIT(EXYNOS7_PD_DET_EN_SHIFT); } writel(interrupt_en, data->base + EXYNOS7_TMU_REG_INTEN);