Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3342119imm; Tue, 17 Jul 2018 03:13:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgperczoU2Xdw3vQrXGSmDlOg3ceVlEkXFRjL5XZGP5Y/2pX6Oy4mimwUfqxPrhIaReYACdMv X-Received: by 2002:a63:9a01:: with SMTP id o1-v6mr960126pge.439.1531822433555; Tue, 17 Jul 2018 03:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531822433; cv=none; d=google.com; s=arc-20160816; b=ppeQu0CoA/lNqcRxfVesbW4neaQKciRd9PVRxK8Ye7RcYqS+9qE8XJvF2RXgafEyGl heNuDI3FwMTnJ/5TrFgvA2QFEj1O1k5FJiahYpSFXIM3nANFvCn0V76+tX03rIFVy+BK uyw0m8aNlo1GP1jm+vCklnrb9rVvvOuUj6GM1yB9xBqNxzE6mtyz1In0juFss3cvX7Mz A/I3dew6ZA4z7gtrkMKAPDmFKJJkSbzEzIkZf3x5mspl2sSdvLx+POwFIMN432mKTCRs JctVgHuePjajZbqN6hfVCobnSiSOb7e1pYUKzLtqRcFHDtQ84kmKLRc5Qlx8Ux02c845 VBrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6v7xIcQtev6PS5EdUYoy4t3aEJvp+7bKhBuKy52r3wQ=; b=ixKnWE0X2/dBGcj1WwemknF+MKHi8p6An2qF74O3Kfro9psIu2qjVsQskiNXhuc+Mt w25I9SiQHko/R3xh6N0mKl6JMAXlgddv84e/YDBAg0GmpOM+ulFBG8CGJATaYZr0573n KGfyqXeRuHz2abEZOq2IsL3niXUtziloRIEeAVZTB9mQJ713NT3x0T8qkSpPfZ1CDuDZ yZfZCGatJxsFOv5joG8veoks2gDU5rNr1VE8P/VnFIw6IQ6xVcm+cu/qDp4KnVhF51HT KHU/pjAfKlLavi5JQZ7Gi1nsw8HfYqzgtXJc0w/hpf8mKeBC0lXT5M9nco92ezyJPpcE c/9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IdFwpuGD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si558274pgn.194.2018.07.17.03.13.38; Tue, 17 Jul 2018 03:13:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IdFwpuGD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730614AbeGQKor (ORCPT + 99 others); Tue, 17 Jul 2018 06:44:47 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33565 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbeGQKor (ORCPT ); Tue, 17 Jul 2018 06:44:47 -0400 Received: by mail-pf0-f193.google.com with SMTP id b17-v6so291194pfi.0; Tue, 17 Jul 2018 03:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6v7xIcQtev6PS5EdUYoy4t3aEJvp+7bKhBuKy52r3wQ=; b=IdFwpuGDd57ZEnUjVtBKYmhX5PfEtkt9DrxENoHk6wxl8WJS+aO4P8MUz+cU2QIku0 bQ/Tv29sScMbpGNlp3H7Agy2s45xOC9AzmcFx2hMhKAp1vBSxiBdq0jEFdM+d+lEmx+F CDFd7L+LISJGHnRGBhSWxF1b7af/As6D+kjoOIMsBvtAemUXZ6HrxGD0ab0DAwlif4Hw 1wypjNCZe3CysIYmxdDHQIAy+ZM+HLUM9FZ7zE16LN0ImWJsTeETC0QYk2MMUNqtn3l/ B8mUirdAPlkPBhaBTILEdihRblSl6I31030gn5BLFfM9/8Y9sZiyGjANWE3EpQaaxTOf L6pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6v7xIcQtev6PS5EdUYoy4t3aEJvp+7bKhBuKy52r3wQ=; b=I2k8sqJ2ogBUdMD+TKlz7cdcCX6kX9/xvVikEBbG+gL16+A3deFFWQPScPFt2Nd+aP gkfw7DrSFy7q/s6XzVJ6IGv3aQWVph9/tRhWH41zM3YO0YcvN7d3vAx+bTcmewjMSdoP qWYhczukZIM0RQv92ZpQ7wMwX2GAa0XhS1jAVQCPn23sLCmPffz9G08xLPYuhxmRnOhU mf5+0NRdwtJlHd9V++Y9XNzwK659E2kCCRinMhF8d/KHIKUneT+bglbAMOmcyO4zgn5X bGiTxQEeauTQ2M7/qKUuZhh7+k1Yxi7ujaJLrU+HHx4BT0as66Anro84FSEgQxkfsze/ WhXQ== X-Gm-Message-State: AOUpUlHjLyoNq4Ub6x125luxV47vU9DO8TSc+lcxXZ45odFNmE128Fnd tH7Ys6ET41kZ9mdL5HBYcjA= X-Received: by 2002:a63:1403:: with SMTP id u3-v6mr982494pgl.13.1531822375048; Tue, 17 Jul 2018 03:12:55 -0700 (PDT) Received: from localhost.localdomain ([103.51.74.210]) by smtp.gmail.com with ESMTPSA id 203-v6sm2809963pgb.14.2018.07.17.03.12.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 03:12:54 -0700 (PDT) From: Anand Moon To: Bartlomiej Zolnierkiewicz , Zhang Rui , Eduardo Valentin , Kukjin Kim , Krzysztof Kozlowski , Rob Herring , Mark Rutland Cc: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anand Moon Subject: [PATCH 1/5] thermal: exynos: enable core tmu clk on exynos platform Date: Tue, 17 Jul 2018 10:12:18 +0000 Message-Id: <1531822342-4293-1-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clk_summary do not show tmu_apbif clk enable, so replace the clk_prepare with clk_prepare_enables to enable tmu clk. simplify the enable of tmu_triminfo_apbif clk, also fixed the order of goto error for failed cases. CC: Bartlomiej Zolnierkiewicz Signed-off-by: Anand Moon --- before: cat /sys/kernel/debug/clk/clk_summary | grep tmu tmu_gpu 0 2 66600000 0 0 tmu 0 6 66600000 0 0 after: cat /sys/kernel/debug/clk/clk_summary | grep tmu tmu_gpu 2 2 0 66600000 0 0 tmu 6 6 0 66600000 0 0 --- drivers/thermal/samsung/exynos_tmu.c | 45 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index a992e51..0164c9e 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1060,41 +1060,40 @@ 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(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(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; + } else { + ret = clk_prepare_enable(data->clk_sec); + if (ret) { + dev_err(&pdev->dev, "Failed to get clock\n"); + goto err_clk; + } + } + 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"); - 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; @@ -1134,11 +1133,11 @@ static int exynos_tmu_probe(struct platform_device *pdev) thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd); err_sclk: clk_disable_unprepare(data->sclk); -err_clk: - clk_unprepare(data->clk); err_clk_sec: if (!IS_ERR(data->clk_sec)) - clk_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); +err_clk: + clk_disable_unprepare(data->clk); err_sensor: if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); @@ -1155,9 +1154,9 @@ static int exynos_tmu_remove(struct platform_device *pdev) exynos_tmu_control(pdev, false); clk_disable_unprepare(data->sclk); - clk_unprepare(data->clk); + clk_disable_unprepare(data->clk); if (!IS_ERR(data->clk_sec)) - clk_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); -- 2.7.4