From patchwork Fri Jul 1 08:19:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902900 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 AE573C433EF for ; Fri, 1 Jul 2022 08:22:07 +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=zewzc0kLHxyo/gIToOrqa1YUkNBuqOzE48AC0jI7iNc=; b=EtGp00LDHAKeH4 mQQANSS94yQAk7TJpJ6/icNKZU4xDs7UHrpNk9lJCe2WkqvFQz+uuXh1AsRWoGuABZSqS3gIHklmm 5znm2xtjm8cNiu4hUUQYLF4sQzHs/wbsuWcACY3M+Rv0dORiC4fKlVWIMNzWcohUphIL7VnADTQSg v3pKCYcY048HvFcZ8GYvumvqYkuPZLY7zAcEfd7DlDnfOH5lKVeDkcptKepK0VVaUWgXolD7oZJHD fFc3uDNmEe00Md6YwDbgXaep4b/obMC1KCu1qib8iMMZJR7h9/oYXYNSf8kgCd/qv8jRTVm5JvL0U tgZqbNNT5Vwuczy8Z17Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Btb-003bNO-VC; Fri, 01 Jul 2022 08:21:00 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7BtY-003bFM-Aq for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:20:57 +0000 Received: by mail-pj1-x102b.google.com with SMTP id l2so1942273pjf.1 for ; Fri, 01 Jul 2022 01:20:56 -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=cgbOoygWZaIIuor1RyiZGwebLyI7PYxrQBZVGVTI33I=; b=obCdm4rJzIAby9ExFqqvOXIVGWgQpZy95pRUIC38dC0eIr+MePjuGhl1A0Zzh7axhV oBTLRLs1niE+fF8sOtY4QAoyO5VqRj4FZiAT4ciUZy89txYOpFTijV/C8PXTfU3HfjBh l/A2STUX1L+mLvU2uMHF5BI4sqqxkKPFGsm6AtheWMfuRp1xCzdvxgUG9Q9xcntIlAa9 3cLH720S30gUMnG57CrFy2k9ohBVVKyh7eHcCQ0amnV0ErJt5H3RfocVMUm0iG68H4qz oYjM28jiKUptzVA7+M27RYNIWBIAcLj3CtdfPEc5KNkLMZj6C6JBlREteUNoz2tdZWXI VI6w== 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=cgbOoygWZaIIuor1RyiZGwebLyI7PYxrQBZVGVTI33I=; b=8MdL8J9aY0SaVjND8FmhS9tXRMbDf4/iXXYVw/NIm59e4acBlMLD+H6j4GWiQCd72A xWGYk2KYm+vireTWdw+19Yu+ZejRoRxiaaSEHk3xHPVcUFSQw3UtMhpmJi3R2x6vCSKx C3C+dbQmj3ijNmuMFz9X7gRtPKwoi2iFJszX0ODmnXpgyWApp9ftYn4W4q2wBru+47Nd QfMbADh9Kcj7ceRmOh67nnB+KNrqW6N2Ai4JVUNCc/nJywEy5uyuKYpfNnfPFOx699NQ WjL/Z3ESjPftOKW3N90S4KQDlhVlhfBolZgPIwT7v5qzgObJpDMVYdtWX8u94ucqOEMb QGXg== X-Gm-Message-State: AJIora/NYlf9xggQxUoLusmmKArnE39JDq7wlybmNdW81Gr7/Y9qNvcP BhnBzgfuJHLr2dF2K+GRG1hxRw== X-Google-Smtp-Source: AGRyM1tqcjCws6zg/SRdbpK7iJxqkiNnbiwu1OmSnN8KGWw1G6+vGEDusVUxK4VpgHd/fEzFYQ04bA== X-Received: by 2002:a17:90b:4b48:b0:1ec:fc87:691c with SMTP id mi8-20020a17090b4b4800b001ecfc87691cmr17043869pjb.120.1656663655997; Fri, 01 Jul 2022 01:20:55 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id a3-20020a1709027e4300b0016b8b35d725sm7861957pln.95.2022.07.01.01.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:20:55 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 04/30] cpufreq: imx: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:49:59 +0530 Message-Id: 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_012056_416503_5FFFE193 X-CRM114-Status: GOOD ( 14.49 ) 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/cpufreq/imx-cpufreq-dt.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 3fe9125156b4..8104fed4ff7c 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -31,8 +31,8 @@ /* cpufreq-dt device registered by imx-cpufreq-dt */ static struct platform_device *cpufreq_dt_pdev; -static struct opp_table *cpufreq_opp_table; static struct device *cpu_dev; +static int cpufreq_opp_token; enum IMX7ULP_CPUFREQ_CLKS { ARM, @@ -86,6 +86,10 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) u32 cell_value, supported_hw[2]; int speed_grade, mkt_segment; int ret; + struct dev_pm_opp_config config = { + .supported_hw = supported_hw, + .supported_hw_count = ARRAY_SIZE(supported_hw), + }; cpu_dev = get_cpu_device(0); @@ -153,17 +157,17 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) dev_info(&pdev->dev, "cpu speed grade %d mkt segment %d supported-hw %#x %#x\n", speed_grade, mkt_segment, supported_hw[0], supported_hw[1]); - cpufreq_opp_table = dev_pm_opp_set_supported_hw(cpu_dev, supported_hw, 2); - if (IS_ERR(cpufreq_opp_table)) { - ret = PTR_ERR(cpufreq_opp_table); - dev_err(&pdev->dev, "Failed to set supported opp: %d\n", ret); + cpufreq_opp_token = dev_pm_opp_set_config(cpu_dev, &config); + if (cpufreq_opp_token < 0) { + ret = cpufreq_opp_token; + dev_err(&pdev->dev, "Failed to set Opp config: %d\n", ret); return ret; } cpufreq_dt_pdev = platform_device_register_data( &pdev->dev, "cpufreq-dt", -1, NULL, 0); if (IS_ERR(cpufreq_dt_pdev)) { - dev_pm_opp_put_supported_hw(cpufreq_opp_table); + dev_pm_opp_clear_config(cpufreq_opp_token); ret = PTR_ERR(cpufreq_dt_pdev); dev_err(&pdev->dev, "Failed to register cpufreq-dt: %d\n", ret); return ret; @@ -176,7 +180,7 @@ static int imx_cpufreq_dt_remove(struct platform_device *pdev) { platform_device_unregister(cpufreq_dt_pdev); if (!of_machine_is_compatible("fsl,imx7ulp")) - dev_pm_opp_put_supported_hw(cpufreq_opp_table); + dev_pm_opp_clear_config(cpufreq_opp_token); else clk_bulk_put(ARRAY_SIZE(imx7ulp_clks), imx7ulp_clks); From patchwork Fri Jul 1 08:20:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902901 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 C59F4CCA479 for ; Fri, 1 Jul 2022 08:22:15 +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=USc/VohfU1F4xWvTCapeJHBDhAYp1hkqRnu4QkP2zoA=; b=Wy4c6ouwzlkJjL D0cgqf4lMEdcrUxgv7NS4IyHBfHWPPU466lYd048Ivl2S3Mj5QvLi7FT4ALL8qwDAGMa10/ISdaFZ Wl/PfASP+IzxY0aMJsmoL0wZhRQetbbMdntbC0MDPyHgd9CEPyyKuXBGGIaV8Hf1bAgr052rV4KjG uRUAX/kJefHe2qz4zx2r6/Zp5B5EnGXF2lTCeLv9xq0cLo0ivWzc+BeCTmH/HaWPd0a58xh5kcvxd czlWoAEYx5d2e7wL0e2MyYIVTtBbj2c/Ezhh8vmavuzhhbGh5kZtMGTE8q5TjZWHnkTgR1Onm34eU zx32eSikCkH/fhuhPzDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Btl-003bSt-W6; Fri, 01 Jul 2022 08:21:10 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Bth-003bOe-A1 for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:21:06 +0000 Received: by mail-pf1-x435.google.com with SMTP id k9so1786333pfg.5 for ; Fri, 01 Jul 2022 01:21:01 -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=KxgLelNuWT5l4LKZo/aKRP7N8N8MOwnW7uf8T3lO5YM=; b=RIqayPswkbEVZ3ZMVbRpS2q5QXKz8JXz6cJQ0EH2xhUIXtemnD0X2jEy+t2eVl5yw+ Hv/MQd/ESQj1lVAskkrBZtJ0rVB4O4HlGHVnxXYl2oImWDBc2nfZQ3VQ5yVBW8Nnlgg2 CQpYfPbVjOwBZn1jLGEYCFpe10LcwFlRAD96bVL4s/HjdnEIPkwM/YwqUFRk/oFtR2SC dDiZuIRbpV3mdvTYtRPeG1C2V//NGF+iS0NZhzKFEmhrVJobhNhRYHMgJ5Sp7WjyRsyC hRq3+tYiH4bHY6QiL6Pi84K0JliTjskicQ8c83gZg6kkT+OtTVAiqzNVRrPyU8tMic/i lVgA== 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=KxgLelNuWT5l4LKZo/aKRP7N8N8MOwnW7uf8T3lO5YM=; b=1LFn51kD/261k/kK1Qwy4k03iFFNc1ZIY1tsJTurqM+HOdHpBs8JnHUwmYpInuMxG3 YuAsUV600i3rRJz3lfWk1xv7l/nkpi+dQeNaXt8DZRCTHL9AkJC4lYHabTUhVgUtvFal NeSn8AYM0I+VEU1MZW5FSnhBQThTJIOIq5+ML460S9zB4RjLICISVu5LSl6kxf1TeX4S 0JgonQBH18jCifYJ/AzjJC6Jv+RycYUW4n5VMzeJvb1qvqiz9PtZT57vBhKAshWqAqMP Xa/brvgEeuIbjJVKSBjlXjqZaRfekirrhaiP1DEtzGeLr63TcKZGIeJYCls/c15k7XTy S3yQ== X-Gm-Message-State: AJIora8Bnm6D/5qeVUAOVtDE3q/K0wnk0SiW7jsDPasHzQiT+TFsLobC nfuwHdWe+NScy2Y4aN/4ukmV5w== X-Google-Smtp-Source: AGRyM1uXq5wOQbUjInZMGnjqZB6uOUcrrsaHSAqLeSNKbmgBCDl3OTWafESheg7frLTic7Ml4STGXw== X-Received: by 2002:a05:6a00:10d0:b0:4f7:5af4:47b6 with SMTP id d16-20020a056a0010d000b004f75af447b6mr20268070pfu.6.1656663661463; Fri, 01 Jul 2022 01:21:01 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id u10-20020a170902714a00b001693bd7427asm14959831plm.170.2022.07.01.01.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:21:01 -0700 (PDT) From: Viresh Kumar To: Patrice Chotard , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 06/30] cpufreq: sti: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:50:01 +0530 Message-Id: <808b80fad5be3ca92c3b873d8943a85e9ceb0215.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_012105_380711_1DC18BED X-CRM114-Status: GOOD ( 13.38 ) 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/cpufreq/sti-cpufreq.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c index fdb0a722d881..a67df90848c2 100644 --- a/drivers/cpufreq/sti-cpufreq.c +++ b/drivers/cpufreq/sti-cpufreq.c @@ -156,9 +156,13 @@ static int sti_cpufreq_set_opp_info(void) unsigned int hw_info_offset; unsigned int version[VERSION_ELEMENTS]; int pcode, substrate, major, minor; - int ret; + int opp_token, ret; char name[MAX_PCODE_NAME_LEN]; - struct opp_table *opp_table; + struct dev_pm_opp_config config = { + .supported_hw = version, + .supported_hw_count = ARRAY_SIZE(version), + .prop_name = name, + }; reg_fields = sti_cpufreq_match(); if (!reg_fields) { @@ -210,21 +214,14 @@ static int sti_cpufreq_set_opp_info(void) snprintf(name, MAX_PCODE_NAME_LEN, "pcode%d", pcode); - opp_table = dev_pm_opp_set_prop_name(dev, name); - if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set prop name\n"); - return PTR_ERR(opp_table); - } - version[0] = BIT(major); version[1] = BIT(minor); version[2] = BIT(substrate); - opp_table = dev_pm_opp_set_supported_hw(dev, version, VERSION_ELEMENTS); - if (IS_ERR(opp_table)) { - dev_err(dev, "Failed to set supported hardware\n"); - ret = PTR_ERR(opp_table); - goto err_put_prop_name; + opp_token = dev_pm_opp_set_config(dev, &config); + if (opp_token < 0) { + dev_err(dev, "Failed to set OPP config\n"); + return opp_token; } dev_dbg(dev, "pcode: %d major: %d minor: %d substrate: %d\n", @@ -233,10 +230,6 @@ static int sti_cpufreq_set_opp_info(void) version[0], version[1], version[2]); return 0; - -err_put_prop_name: - dev_pm_opp_put_prop_name(opp_table); - return ret; } static int sti_cpufreq_fetch_syscon_registers(void) From patchwork Fri Jul 1 08:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902902 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 E4176C43334 for ; Fri, 1 Jul 2022 08:22:32 +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=iSRYdmksfOSS66Chwaz/EWXMgI/xcjH7h2Az/q7pX64=; b=wF9Ymk3Eqnv/we QdLRgAC2cx5mozFIY2oYVbVWOpjlcAs3g52UodOeBESbPoo/hsGhTKa6isxLzxOO2paj43EzOzSkO 3GzqC5WmYnHYH/BPiemPQ1o4LBlgv0yLA7ZH+ewDi8bXP2VRyrNFsf9RmgHz75xkwdU2GQP8snzDp rNtWUx5S41FDPsaMp3GlpsLxiSNzWp9FZb01J2EeXCRiaOxHWsRDOewqYdxJ20Dyl+44Ei54v8X7b VKRxgg3rUvjVGmdPwk72N1FUAYtvRSl60nbmGaNqhdxIVEsQnqbSf9jcx5qohQhu/hmbjhG4UwTiQ /qaeS38JybALdR0Mcqqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Bu0-003bao-3L; Fri, 01 Jul 2022 08:21:24 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Bth-003bPK-V1 for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:21:07 +0000 Received: by mail-pl1-x633.google.com with SMTP id o18so1725345plg.2 for ; Fri, 01 Jul 2022 01:21:04 -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=UP0yoNhFLIHXiHpKMoJOvGvXM3qtPgVsBeDYDxFaexg=; b=qqFUbB4lPwvbdMFxiQhId3PlyWslWgqsVhgJF1Bry2po60wBJ5SBPQVqo0Efv5yhwX EouPmk6sI8onPh1qSQa0sspYochs4rfrmIwTSZfgcS/kud3GriovNPYKQ4kxBGLzPqkY 0mgFYO8PU8nd0RfJTa4Yyhd/lMBpJswGvBwoqT0LZbZmi2Mx8KyBw94j3834LusE68UQ lHNHmyn3ROVMfXLfS1VUiN5GkyacbAifavQnqeCnYU6FFrgyUiL+ObpmOlzPPvlk00Ub ixm3g8LFPtUiOah0AW2j4fkTGCApWETRqm4Y2SyKR0PvBIJlrh7C7BpT4jM2dgsq+h0D nt4w== 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=UP0yoNhFLIHXiHpKMoJOvGvXM3qtPgVsBeDYDxFaexg=; b=dK6I0+HgRKRO3eO1TH6jUJH9zK8gzGqFzaws/Ygglgnz13ZA+sGz8x8wLZ8QmLCuG+ 3MZs4DEaV4PuUjZrLY8vSGKIxNRr1XZ1axHFTTbyWL9EzrQVTSA8PWdMv8F93CrGBpJH 3hVtKLlFhkALbIrVOW5ppRKPdo3k/+PL/dHORHHLy793TNP9rVcWiG4e66bS2sT82mUX VuSmz1fYxGaC7VKAgx3NID0IgvF5KrocL7DkCJ3/bXhGeaAEsRT4CdKDu4SRfBEnKBVj xoWirBEKWpLNgafVQhfKjU+Id7elHjXGXV5xzZwLG8hOiOsxXhhmHdoki3WZ4Nc5U5J9 yxeg== X-Gm-Message-State: AJIora9c/eEC8Wa4/zszWhvp9QFm6Y4HNI81VjjXn9y35tiZ0I7zn37U eoW/z1m10Dv/1yUnz51QSQA43g== X-Google-Smtp-Source: AGRyM1td7OiTDDJKC5UOCJKA2KSSdhXte5R0MVbBPWtzUOmmETfHP5pTi96toOOFE2DuqbeHR+O24A== X-Received: by 2002:a17:90b:1e47:b0:1ed:2723:981a with SMTP id pi7-20020a17090b1e4700b001ed2723981amr17170127pjb.144.1656663664161; Fri, 01 Jul 2022 01:21:04 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id h18-20020a170902f7d200b001624cd63bbbsm14841818plw.133.2022.07.01.01.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:21:03 -0700 (PDT) From: Viresh Kumar To: Yangtao Li , "Rafael J. Wysocki" , Viresh Kumar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V2 07/30] cpufreq: sun50i: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:50:02 +0530 Message-Id: <195383ea6386102e430140f14d349769f6893fd6.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_012106_025794_884273B3 X-CRM114-Status: GOOD ( 16.21 ) 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/cpufreq/sun50i-cpufreq-nvmem.c | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 75e1bf3a08f7..afb1a11f781c 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -86,26 +86,29 @@ static int sun50i_cpufreq_get_efuse(u32 *versions) static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) { - struct opp_table **opp_tables; + int *opp_tokens; char name[MAX_NAME_LEN]; unsigned int cpu; u32 speed = 0; int ret; - opp_tables = kcalloc(num_possible_cpus(), sizeof(*opp_tables), + opp_tokens = kcalloc(num_possible_cpus(), sizeof(*opp_tokens), GFP_KERNEL); - if (!opp_tables) + if (!opp_tokens) return -ENOMEM; ret = sun50i_cpufreq_get_efuse(&speed); if (ret) { - kfree(opp_tables); + kfree(opp_tokens); return ret; } snprintf(name, MAX_NAME_LEN, "speed%d", speed); for_each_possible_cpu(cpu) { + struct dev_pm_opp_config config = { + .prop_name = name, + }; struct device *cpu_dev = get_cpu_device(cpu); if (!cpu_dev) { @@ -113,10 +116,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) goto free_opp; } - opp_tables[cpu] = dev_pm_opp_set_prop_name(cpu_dev, name); - if (IS_ERR(opp_tables[cpu])) { - ret = PTR_ERR(opp_tables[cpu]); - pr_err("Failed to set prop name\n"); + opp_tokens[cpu] = dev_pm_opp_set_config(cpu_dev, &config); + if (opp_tokens[cpu] < 0) { + ret = opp_tokens[cpu]; + pr_err("Failed to set OPP config\n"); goto free_opp; } } @@ -124,7 +127,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0); if (!IS_ERR(cpufreq_dt_pdev)) { - platform_set_drvdata(pdev, opp_tables); + platform_set_drvdata(pdev, opp_tokens); return 0; } @@ -132,27 +135,24 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) pr_err("Failed to register platform device\n"); free_opp: - for_each_possible_cpu(cpu) { - if (IS_ERR_OR_NULL(opp_tables[cpu])) - break; - dev_pm_opp_put_prop_name(opp_tables[cpu]); - } - kfree(opp_tables); + for_each_possible_cpu(cpu) + dev_pm_opp_clear_config(opp_tokens[cpu]); + kfree(opp_tokens); return ret; } static int sun50i_cpufreq_nvmem_remove(struct platform_device *pdev) { - struct opp_table **opp_tables = platform_get_drvdata(pdev); + int *opp_tokens = platform_get_drvdata(pdev); unsigned int cpu; platform_device_unregister(cpufreq_dt_pdev); for_each_possible_cpu(cpu) - dev_pm_opp_put_prop_name(opp_tables[cpu]); + dev_pm_opp_clear_config(opp_tokens[cpu]); - kfree(opp_tables); + kfree(opp_tokens); return 0; } 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; } From patchwork Fri Jul 1 08:20:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12902944 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 3A443C43334 for ; Fri, 1 Jul 2022 08:23: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=UpFP/x+OXlU6qsDjTvmVHSb7hvOTvuxJGFUeWXkrJ2k=; b=4mMCUjCNrDSTxm 7t2NuPghM1kNtMB7ElwCw/LDkAmxU83Vjn6nkEPv+ZCbZhFhIOB9y2djNsaVRv0A40u9ewmsqu0bu cjjMRrVFNcCJivjcAOxekiD+zuiCwt/4UHK8wyfMIrq1uIVAJWDuAc8vqBj96VjnfNR8qAhbjJbby DHYbidTOdcfWjeNtKQhTH6YnspIhFyFSLEmv7UYZ1nK1t9sKcz2BH8otV6+l6uhv0/zrW89qICgHw vvP3OReoneDN6IYHgbXxVqY90HADhqUXpULCauyTsHVPDk4Nkfdse02t3uy3IFTp5ip9NiNKBQdEr SuyPFFbkUzchjNFkcj9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Bup-003c4g-0q; Fri, 01 Jul 2022 08:22:15 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7Btt-003bWA-7Y for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 08:21:18 +0000 Received: by mail-pj1-x1032.google.com with SMTP id n16-20020a17090ade9000b001ed15b37424so1966488pjv.3 for ; Fri, 01 Jul 2022 01:21:15 -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=aJVM4zFbFbhC4PcmmIcXH43PSItTV2w1+waf0FbvJO8=; b=ac3+8dQHtEe1GOgSD/+czOHQobsLexnh9mWvBEggRIwxaSkJBUDtOkg+DdQaX5UU4E /gF3RRVm1g4RdX3XjTJQAcgHRHoZT54dk8B20CgpadbZbkeIczX08V0uSVwJZ/2fHpOc BrxDO5WkUpbdEm5ZsGV4KXnf8tLMdR9fC5obVM1zvtSDdtsWzQqeuANKELx6Z0FiWqeh Xpy4r/vAGHlZOBjNPfjrlhLmEIdrQaRr2fS57CCpFMYLsBczqnDWqCURvTumj1Y6c1Mb sac7u8Q5HUOdteP+2VnJmr6qovBq50d5MAhM1sgP+0JN/+NPK4UjkYBMtVaMxEyWS+KA FaDA== 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=aJVM4zFbFbhC4PcmmIcXH43PSItTV2w1+waf0FbvJO8=; b=YZGcxHfzS7pv3C7O4kQBf1RL+XWLjXbOrzfhT8LCyHNW+iipY9cAZVJpxjo+zILDC8 HS4DG2ZLnrveiHQttjTAA20sfo0ApFz3ibhnhoBSF+SpPr30EBDDKzlgxkqYA68VWiVU SldCN1ip7g4oBI3GCdU64LKBMz6KLbOMgaIwnXLVKarFnrCOnAzfvjzGnS/MHMuv70+k NP7krbRcZBaP70AzVE1X4RFkftRO/vv/QHk/Tl+Q/Cx52HRpDMXYdVZTTcOGXLAbPT3F 3FgEIEGd6Q1N8nuZUdqnYINJB2UcByizLI7PKmgtBns83pyquY8zpMw3CzmANDDLVznC E97A== X-Gm-Message-State: AJIora+m1VMAcKwVFj/mWH/6LyrT83ZPe8wy25XCwZq7RuDFpwyCiMYY a5uJGF1YZmZKVeQRHIUgG4JXUA== X-Google-Smtp-Source: AGRyM1vu5xQ/FaApTDjk/0jnEWXTkKjAl95QQ8Gbqhs9UyvgMPjWnaNlxNRSi4k/foLg6slD829VNA== X-Received: by 2002:a17:902:f650:b0:15f:3a10:a020 with SMTP id m16-20020a170902f65000b0015f3a10a020mr18701639plg.61.1656663675180; Fri, 01 Jul 2022 01:21:15 -0700 (PDT) Received: from localhost ([122.172.201.58]) by smtp.gmail.com with ESMTPSA id n17-20020a056a0007d100b0051bada81bc7sm14907263pfu.161.2022.07.01.01.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 01:21:14 -0700 (PDT) From: Viresh Kumar To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Stephen Boyd , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V2 11/30] devfreq: sun8i: Migrate to dev_pm_opp_set_config() Date: Fri, 1 Jul 2022 13:50:06 +0530 Message-Id: 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_012117_331458_9B98998C X-CRM114-Status: GOOD ( 14.16 ) 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/sun8i-a33-mbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/sun8i-a33-mbus.c b/drivers/devfreq/sun8i-a33-mbus.c index 13d32213139f..0dcc13cae7d7 100644 --- a/drivers/devfreq/sun8i-a33-mbus.c +++ b/drivers/devfreq/sun8i-a33-mbus.c @@ -337,6 +337,10 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev) unsigned int max_state; const char *err; int i, ret; + struct dev_pm_opp_config config = { + .clk_names = (const char *[]){ "dram" }, + .clk_count = 1, + }; variant = device_get_match_data(dev); if (!variant) @@ -404,9 +408,9 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev) priv->profile.freq_table = priv->freq_table; priv->profile.max_state = max_state; - ret = devm_pm_opp_set_clkname(dev, "dram"); + ret = devm_pm_opp_set_config(dev, &config); if (ret) { - err = "failed to add OPP table\n"; + err = "failed to set OPP config\n"; goto err_unlock_mbus; }