From patchwork Sun May 15 06:41:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 12850000 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FE35C433EF for ; Sun, 15 May 2022 06:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BXynZrOPQwZD4V0hsgKbtWQrm/pzw77zEl3gLg7ik4A=; b=gLLYmYnTVrTppm a4JtXumM0Ih9r+agRmakiZ+ww1Tyk98426StVdBF5f1p8X2uESpQHuHZRS/CF0ymAosr2mSay2nVx MF+4xStBVaaHDuOwY09MV7ZtlO1ofODTiW2elbIaMOwJjTYYpnLQOGZTH3wPU7rdHMqsOpt+wU2Xk GLV35siQIHOJJ9POHjv7XTm9RB8rH/3pLfJYd7SLxrL85IuDx4AWLRa59SG5FwhWyT0h/wISpQu/L 51HqabRXyoCKn8I9bgWWXkDW1oUcW0OYKO53UumARVP6RGZRBq3X7ryjGfz07vnhHhMK+1Dsj/VX4 j6vEJei/EvcjZI2HG2vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq7xM-003JoJ-Jj; Sun, 15 May 2022 06:42:20 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq7xI-003Jm7-0L for linux-arm-kernel@lists.infradead.org; Sun, 15 May 2022 06:42:17 +0000 Received: by mail-pj1-x1033.google.com with SMTP id cu23-20020a17090afa9700b001d98d8e53b7so10916338pjb.0 for ; Sat, 14 May 2022 23:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RNX8IttIs7gPKZ/ZnlljxMvfqRG5qWD1gnAXVMMqp+0=; b=XEBWuyekW9Udsy/Vmpi4TY/XNvR6qWx5rXCSqsQu38ntjFvrZ7UBEto6MpPBdQJnzp H/QYIJJVqffc+impBIGZY/MgvA6BcxfpypE61Mv5qsOkhdyooPNwgtunUKmau/HX6NHB jlmk2eGVS+8L5jSUCeHPBenPyLuAWSCf5azOXgnp06e7zouH7VdOzz2MHJyrJbnkAEHs pKZtPck8GEuNzxbYjkerb3Y4Ob2PUYY3uBLf4/WDR5fHiVARgxItMmdrluI7oX0g8+Wy QGGGu4wbaA83ceJnAikUtq37nFoDIa9sRNceKxsp2XAzM5oTC9mCnlyesgVnHxR9FBKC AOvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RNX8IttIs7gPKZ/ZnlljxMvfqRG5qWD1gnAXVMMqp+0=; b=X9ShFLQq/Il+Zlq87k2Hw/gYe+USWq2C2A0kQzZvfL88zEHaiJVjek52vipnKUCqpd 26XlQoEbFyAaIqt1i4RXa04xNgUMC2EGzii1vUHtYGNo7ru+u54PQ/laJyjOIH/R4FqL ad4zpsF5qkBvd5mkxLu7OvXyNcLLA91gUWWkBHhpFi90/0g/EZA7+hVUEN98n849UweY 13dPajdfRcT/9kJdUst0CWu5NIRdI07iReR/XjdRyxSfyVN1lKXG8C5rlsjSbklIAEmI YvkiHzq4oIxQ8MOpNivh0BjMkNxu5gU7Lq5MmM3feesJ8EwxWW64CK6f5lz+tflW3H1n mXcw== X-Gm-Message-State: AOAM530QKgvWn685Uwq7MoSMqTmgUR9zClKxMDDOBqc/j9u4aKqP4VpK ZYQ0zH5U8TE4WcIJ3BYyaiI= X-Google-Smtp-Source: ABdhPJyT8+/XLu+q/7btdUnRMr1o9G/m+//8acAzxbS43SlpLD4HVZDMbTlxRTchAJLWw+4FK5O7pQ== X-Received: by 2002:a17:90a:f2ce:b0:1d9:a18f:87f3 with SMTP id gt14-20020a17090af2ce00b001d9a18f87f3mr24550386pjb.213.1652596934488; Sat, 14 May 2022 23:42:14 -0700 (PDT) Received: from alarm.. ([103.51.72.28]) by smtp.gmail.com with ESMTPSA id g24-20020a170902d5d800b0015e8d4eb2e3sm4568687plh.301.2022.05.14.23.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 23:42:14 -0700 (PDT) From: Anand Moon To: Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Anand Moon Subject: [PATCHv2 2/6] thermal: exynos: Reorder the gpu clock initialization for exynos5420 SoC Date: Sun, 15 May 2022 06:41:19 +0000 Message-Id: <20220515064126.1424-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515064126.1424-1-linux.amoon@gmail.com> References: <20220515064126.1424-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220514_234216_087208_7238A3E1 X-CRM114-Status: GOOD ( 16.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Reorder the tmu_gpu clock initialization for exynos5422 SoC. Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Anand Moon --- v1: split the changes and improve the commit messages --- drivers/thermal/samsung/exynos_tmu.c | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 75b3afadb5be..1ef90dc52c08 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1044,42 +1044,41 @@ static int exynos_tmu_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to get clock\n"); ret = PTR_ERR(data->clk); goto err_sensor; - } - - 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; - } } else { - ret = clk_prepare_enable(data->clk_sec); + ret = clk_prepare_enable(data->clk); if (ret) { dev_err(&pdev->dev, "Failed to get clock\n"); goto err_sensor; } } - ret = clk_prepare_enable(data->clk); - if (ret) { - dev_err(&pdev->dev, "Failed to get clock\n"); - goto err_clk_sec; - } - switch (data->soc) { + case SOC_ARCH_EXYNOS5420_TRIMINFO: + data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif"); + if (IS_ERR(data->clk_sec)) { + dev_err(&pdev->dev, "Failed to get triminfo clock\n"); + ret = PTR_ERR(data->clk_sec); + goto err_clk_apbif; + } else { + ret = clk_prepare_enable(data->clk_sec); + if (ret) { + dev_err(&pdev->dev, "Failed to get clock\n"); + goto err_clk_apbif; + } + } + break; case SOC_ARCH_EXYNOS5433: case SOC_ARCH_EXYNOS7: data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk"); if (IS_ERR(data->sclk)) { dev_err(&pdev->dev, "Failed to get sclk\n"); ret = PTR_ERR(data->sclk); - goto err_clk; + goto err_clk_sec; } else { ret = clk_prepare_enable(data->sclk); if (ret) { dev_err(&pdev->dev, "Failed to enable sclk\n"); - goto err_clk; + goto err_clk_sec; } } break; @@ -1119,13 +1118,13 @@ static int exynos_tmu_probe(struct platform_device *pdev) err_thermal: thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd); -err_sclk: - clk_disable_unprepare(data->sclk); -err_clk: - clk_disable_unprepare(data->clk); err_clk_sec: if (!IS_ERR(data->clk_sec)) clk_disable_unprepare(data->clk_sec); +err_sclk: + clk_disable_unprepare(data->sclk); +err_clk_apbif: + clk_disable_unprepare(data->clk); err_sensor: if (!IS_ERR(data->regulator)) regulator_disable(data->regulator);