From patchwork Fri Jul 1 08:20:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902903 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 83FFECCA479 for ; Fri, 1 Jul 2022 08:23:05 +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=9/2IfrbAlJ0qUKeiHT7/Y9wwA1eNPQv/yJrWsDIBtEw=; b=zXGlwOh24YKJUf VLVygSczPcvCWsLUsP4NDBaEYo5vgRrsMnBlRHtUoTrM1ZTf9Mi40txJqrg4AXOvP8lHzUby2CiZb VunMT6BUvtaIdAWigZdr5ba6gtsEvEjGRtAoL1MVlSG41lYd5/1PiAc3kpD/7utpQRqJ1uxYhV3T8 N+/lhv0xCkZfnk/Ai0SFWptd3l6nw0y4hn/ZxlN6+Ks4H06/PpDWpyr+PzA3Qw00hSjUrcz7VzRfi N9obBBAkrtx9i+336bSx+hrhvPAcHBBiiw92SoYMYk3DKbxgyO8aDq5vL10YYcephfOr9WWLYEvP0 J2xxALW8XxpNseU3fYdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7BuY-003bu5-4s; Fri, 01 Jul 2022 08:21:58 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Btq-003bUj-El for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:21:15 +0000 Received: by mail-pl1-x62d.google.com with SMTP id m2so1722311plx.3 for ; Fri, 01 Jul 2022 01:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qsU9wtO366QGqn2stFTSeEtjcXZrw3Fi++5zsewllw4=; b=mYbS8wl99X3HCAP868Vx551nyMcsU2v27Yzpw3q4wB28iGCSEzCU3T0L8B0sy6bCqv 9aJFzKf3Vy6vNlnXsdYt/mCa4W/t+sqSy3Pmq9d4xWm5xNJjSPgyulzm9a9b59WMhV3d 7XQGmImKOgc+60IYmIPEAY6dCC83cYEJEoNsFbS+XNuKPQD/938dZxx7pqInsIkjx/nO +ppaJFCWTUvdJj66YGKGgpj4WgDu3Cey9bLwQsUKp/R50GCosKHyQq2bPAxjY+UP2v7/ wzjNBbh3hGEdsoHbuc0EIBBu4sPWBFfKorijzTYSyLupD4nRXlDPybYJnS/jvV+8s4a1 rjcQ== 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=qsU9wtO366QGqn2stFTSeEtjcXZrw3Fi++5zsewllw4=; b=vm6OaOzRwOfeZwZg9pz/67lzOjvkI96xq7ftDJy60ReJY/8XnH+CvQ34tPJ4Kv3ysf f4BEwJBBnBi5q6PcnL/+XIaNz9kwPlmHIM01UhAiudw6LV1c6+gG8JS8UNYif/OTpubv 6NdkPTIlKmYRCnHXBh+9mJR9gwrOWv0ptu6Nr8/+QAHYciJIKsycwSB35KJiSbQaT1HW lLkOJVUGBjt/iWpq4M1oQvtj9/t6S3lVAlWxbbQ+f3EAOFPpB6u50iFIaHQDeQ/72GlR +xeZiXbJXqeZPToiq4idoe0/DdJeLgP+Scv2nIW1hf0QkJ5HU6mDZJ1UHAzLBZbaHIpB Rohw== X-Gm-Message-State: AJIora9sfJLu92WuP753XoBRBEMI4AETUO2F5mw6bK+pvJ4MJCZJ+xbW 5k/INkK0byog3gsHrr/wQNCIpA== X-Google-Smtp-Source: AGRyM1sFl5EDfJmLxUmQIL9clpelCvUmhUe8DIu10IpEDNEAFe1uijgj4nsnsYzo39Vt/eVZslGEtA== X-Received: by 2002:a17:902:e546:b0:16b:8f8a:3344 with SMTP id n6-20020a170902e54600b0016b8f8a3344mr18796467plf.130.1656663672403; Fri, 01 Jul 2022 01:21:12 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id h8-20020a056a00170800b0050dc762819bsm15055700pfc.117.2022.07.01.01.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:21:12 -0700 (PDT) From: Viresh Kumar To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Stephen Boyd , Nishanth Menon , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 10/30] devfreq: exynos: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:50:05 +0530 Message-Id: <14d236f519900b7bb7859b4690aca62979b78ce6.1656660185.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220701_012114_556728_A01F0476 X-CRM114-Status: GOOD ( 17.52 ) 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 The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar --- drivers/devfreq/exynos-bus.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index e689101abc93..b5615e667e31 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -33,7 +33,7 @@ struct exynos_bus { unsigned long curr_freq; - struct opp_table *opp_table; + int opp_token; struct clk *clk; unsigned int ratio; }; @@ -161,8 +161,7 @@ static void exynos_bus_exit(struct device *dev) dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); - dev_pm_opp_put_regulators(bus->opp_table); - bus->opp_table = NULL; + dev_pm_opp_clear_config(bus->opp_token); } static void exynos_bus_passive_exit(struct device *dev) @@ -179,18 +178,20 @@ static int exynos_bus_parent_parse_of(struct device_node *np, struct exynos_bus *bus) { struct device *dev = bus->dev; - struct opp_table *opp_table; const char *vdd = "vdd"; int i, ret, count, size; + struct dev_pm_opp_config config = { + .regulator_names = &vdd, + .regulator_count = 1, + }; - opp_table = dev_pm_opp_set_regulators(dev, &vdd, 1); - if (IS_ERR(opp_table)) { - ret = PTR_ERR(opp_table); - dev_err(dev, "failed to set regulators %d\n", ret); + ret = dev_pm_opp_set_config(dev, &config); + if (ret < 0) { + dev_err(dev, "failed to set OPP config %d\n", ret); return ret; } - bus->opp_table = opp_table; + bus->opp_token = ret; /* * Get the devfreq-event devices to get the current utilization of @@ -236,8 +237,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np, return 0; err_regulator: - dev_pm_opp_put_regulators(bus->opp_table); - bus->opp_table = NULL; + dev_pm_opp_clear_config(bus->opp_token); return ret; } @@ -459,8 +459,7 @@ static int exynos_bus_probe(struct platform_device *pdev) dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); err_reg: - dev_pm_opp_put_regulators(bus->opp_table); - bus->opp_table = NULL; + dev_pm_opp_clear_config(bus->opp_token); return ret; }