Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932585AbdHWQLh (ORCPT ); Wed, 23 Aug 2017 12:11:37 -0400 Received: from mail-by2nam03on0041.outbound.protection.outlook.com ([104.47.42.41]:27136 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932381AbdHWQK3 (ORCPT ); Wed, 23 Aug 2017 12:10:29 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Dong Aisheng To: CC: , , , , , , , , , Dong Aisheng Subject: [PATCH 3/7] PM / OPP: rename opp_table->clk to opp_table->cur_clk Date: Thu, 24 Aug 2017 00:10:06 +0800 Message-ID: <1503504610-12880-4-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503504610-12880-1-git-send-email-aisheng.dong@nxp.com> References: <1503504610-12880-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479782271224484;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(50226002)(53936002)(68736007)(356003)(8936002)(36756003)(97736004)(189998001)(498600001)(110136004)(50986999)(50466002)(305945005)(4326008)(626005)(8656003)(54906002)(105606002)(6666003)(104016004)(86362001)(6916009)(48376002)(7416002)(85426001)(5660300001)(47776003)(2950100002)(33646002)(2351001)(106466001)(77096006)(81166006)(8676002)(5003940100001)(2906002)(76176999)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR03MB2259;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD039;1:M7IMGIRa1ZxERsCyPFiH7+BaCXFWIccBuTckQzIfUG0vgOkADzF1xRoh4TFeqX5RR1AUHy2n8bNis/dL3ryInGslKBuKKENVrM7f/DbnlsFithsSLfH8nqbSqgQ5EYEn MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 005a80b1-22cb-4b07-a943-08d4ea4177e0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603186)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN3PR03MB2259; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB2259;3:oujXw+zD9rnAbvIev4hNQ3p8/3byoD1L1HM7MNpzJDj9+NyN5hTDME1DZ6j5U4BcAcyW1Ht1SR0b+2fGmwju9cq8RIFsKUUXULGVkrcRpeO35/aHMlqrkEp2xT98Ei+mtciOkjs6qCJOFHEqTKHxIRS4Z4edXNhWsulWiHn9ERGISkhJzt8SGtPUl3knTCQigyNSGdRaV3o0r6HIR2rAyQwO8KfcK+1BGJZeAxr5u10yJu+9PjMmdY4ZCzphagyH7JYOsqjS2G9LJwbO3rxZTVok/j8ZMTWKuPVdja/ore7Shu8An7KyOWqF4/qmbGqeOiex+2XVmTA1Iq1pBUCqXISErEHxnGz/zaUrW64zzds=;25:b0uozATUT1bIfZ8fejRJH9ny+XC4LolwmMGVuxNbJSvqV81PgzDLP5PSA7ECp+znCyeWhWVUF7qlh3QBLQlt9yjpLh5AVRH1LgXDP9TI0vdn1x0N0CrJ+ny89Hf7Fp381aY7k0AkJ01rJ4rg0pOrSvvrN9+hQNpumguyJHYU93eLbZ7E7gtzN+OaGKl+nk83VsXTXtSKMyPqH04DTMtWuPyBwmksEs9gGXaD8zgtLzVR4gKaU/Tx6nC+n2FZB/m/H+MrepCj534y3UrFzKQF1g2O2ao5kg9LGOe2JbfBNQaaFo1MnRVSMZnjzALgOtUPewA24MPQD3theratYCICxQ== X-MS-TrafficTypeDiagnostic: BN3PR03MB2259: X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB2259;31:rAmpcY273SK7pLW4296RT1bv5d2JQuw4vpeQqj+o3qOtjX91xINN9e2AA9HH6Gpfwx/tKmyKgLDgYExZLfPEZamlklyOcFC1s6x/nZfamofjR6Kuj+7CDFLAxKjDx3czczrL8sMMctCXrKddGpqRgTGu/wxW6FctJOwL/HgoqIVvgDRgaf60tVQedAGeoLo4JGEJ4uPM2rvtZvZjihvqANxFb96imwnb5ZHv3fVbTZ8=;4:/ooH4W4+/wuRa1k99hwH6z2DQo4yq85g/AT15bztdsITDc/Tdgrma/HOO/0XN00XZGndbsxvrvqQyJ3VxzPRVAryrsQmcZntXxVsd+toCFhO09oaIsFKTAT2xUaL+asQMWunuy/m5Z5wv++E4jC0XSPSn58XURuwXZhN1/CB7vXDIXyYv5nCAI/sM75q06Nk/EFhfNhENjYN4bBL4NC13ggwmQZGJGwsV08y2deKVsfI4Pg/iOezSwm94poN+V4YudG8TMPl1jDeBwy6b2DPd5xoPLLeQly+2SBA2Cj1hPJ7gMUAs4Oh+0SBIzlnSfYgklLnNV48Bd29fkNi/xQgoeJcIVOJWemh84KfmZuHe87tB2ETDTnJrXDOh93o9G99 X-Exchange-Antispam-Report-Test: UriScan:(31051911155226)(131327999870524)(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR03MB2259;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR03MB2259; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR03MB2259;23:+DEUbPK245tgpmB0p/98o7Nbx8kDoCmr8tddCOsoN?= =?us-ascii?Q?Kc8OwRw8RYAXFltlK6Bp0C9LMMlAVS5UoGWZzcpRt/yxgMQHVSac85cWyXYy?= =?us-ascii?Q?mpJTt5cTnhalPaRCEUAWcVyfDgLXwfvW2z2W0iGlqzH28WrcK3Gl1C4nINK1?= =?us-ascii?Q?TAwgHvfLbosZI6+qQ8sBaM8PYrxTaOgLPn/PcJtoeKfzLwhr4bbV4Gs0wM2R?= =?us-ascii?Q?lNrXmbR0iq5fCQh2KDqn/NfX38xB01huLDLUH6SLyoPMYxQWUpF2LXBnzbqv?= =?us-ascii?Q?aqWVu6mr1eo19jAD3rhOrXDh+itadWeFjiTgKluxdxxWrk2u7TdMaw+l1YHu?= =?us-ascii?Q?9dBRtCZ9xVp/+x2V2tKZGDkyb/jIhanfCpE/fFfjxf94T3i5gEudobwX12rR?= =?us-ascii?Q?vLyFtkU1Whs5TtR4dX25qRHp4qj3tJ/Gw2W1nSByRuQzF5uihB7hS7QC95ku?= =?us-ascii?Q?WcOByl+hFXG2wn44OIIeh7amSjrYR5opedSkaaGfxIrAyNwrQNHKh9+jNwe1?= =?us-ascii?Q?2IK6WJ7ypz0D5iZ82jqbOgtYgJSuCTDgN+N2O3qFvZwmcV8OWA6Hn5MPFlke?= =?us-ascii?Q?o+1RhdJMPRqewrEXndqZGPG+lH7ciJLr2nmog7VL9YwCcmW6/VYvdr7PFfxq?= =?us-ascii?Q?rklVzTKW/1igHyseZWVkEZtSgGI45OVPYTF33mF5cbB4oCu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Br/rJmvyEV3xEwAsa++23oUhnZ2Tsw==;24:w5nv5bIdZ5SSm3R5pGERbmA3WMxaiLvPNSBckqGm9njMGxg5LksrQrffL7X7VnXlDFQJgubgDIkURxMavkQcrtuB7yxyXUb3jKKmEX8g0dk=;7:TyM2U2hXS7tKXFZhrDZv16NEJ1xjduw7ppY1gll5/JgU6QbrMCMWh4k90dvRvK05o75yDDFYVvaTOdY0Pgezxr5ysqEyr5krepCtqBqQVUsCmFPPtSlvgCNs4ULuHAmvrBBFyMDQC6mSkT3kh0MyPUvGqUspYsLX8IkRphuuZdRRNiLxPJeycsTkRhewvtjDW+IFj5AxaCnpDlnC22q+EdEG1YV1Eq99gLIC/ibyqgs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 16:10:26.7948 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2259 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4228 Lines: 118 Since we now support per OPP clocks, we rename opp_table->clk to opp_table->cur_clk to make it less confusing as the opp_table->clk will become only represent the current clock of the current OPP on which the device is running. Cc: Viresh Kumar Cc: Nishanth Menon Cc: Stephen Boyd Cc: "Rafael J. Wysocki" Signed-off-by: Dong Aisheng --- drivers/base/power/opp/core.c | 30 +++++++++++++++--------------- drivers/base/power/opp/opp.h | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 37cf970..2579401 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -527,9 +527,9 @@ _generic_set_opp_clk_only(const struct opp_table *opp_table, struct device *dev, int ret; if (opp_table->set_clk) - return opp_table->set_clk(dev, opp_table->clk, old_freq, freq); + return opp_table->set_clk(dev, opp_table->cur_clk, old_freq, freq); - ret = clk_set_rate(opp_table->clk, freq); + ret = clk_set_rate(opp_table->cur_clk, freq); if (ret) { dev_err(dev, "%s: failed to set clock rate: %d\n", __func__, ret); @@ -615,7 +615,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) return PTR_ERR(opp_table); } - clk = opp_table->clk; + clk = opp_table->cur_clk; if (IS_ERR(clk)) { dev_err(dev, "%s: No clock available for the device\n", __func__); @@ -750,9 +750,9 @@ static struct opp_table *_allocate_opp_table(struct device *dev) _of_init_opp_table(opp_table, dev); /* Find clk for the device */ - opp_table->clk = clk_get(dev, NULL); - if (IS_ERR(opp_table->clk)) { - ret = PTR_ERR(opp_table->clk); + opp_table->cur_clk = clk_get(dev, NULL); + if (IS_ERR(opp_table->cur_clk)) { + ret = PTR_ERR(opp_table->cur_clk); if (ret != -EPROBE_DEFER) dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret); @@ -799,8 +799,8 @@ static void _opp_table_kref_release(struct kref *kref) struct opp_device *opp_dev; /* Release clk */ - if (!IS_ERR(opp_table->clk)) - clk_put(opp_table->clk); + if (!IS_ERR(opp_table->cur_clk)) + clk_put(opp_table->cur_clk); opp_dev = list_first_entry(&opp_table->dev_list, struct opp_device, node); @@ -1393,13 +1393,13 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name) } /* Already have default clk set, free it */ - if (!IS_ERR(opp_table->clk)) - clk_put(opp_table->clk); + if (!IS_ERR(opp_table->cur_clk)) + clk_put(opp_table->cur_clk); /* Find clk for the device */ - opp_table->clk = clk_get(dev, name); - if (IS_ERR(opp_table->clk)) { - ret = PTR_ERR(opp_table->clk); + opp_table->cur_clk = clk_get(dev, name); + if (IS_ERR(opp_table->cur_clk)) { + ret = PTR_ERR(opp_table->cur_clk); if (ret != -EPROBE_DEFER) { dev_err(dev, "%s: Couldn't find clock: %d\n", __func__, ret); @@ -1425,8 +1425,8 @@ void dev_pm_opp_put_clkname(struct opp_table *opp_table) /* Make sure there are no concurrent readers while updating opp_table */ WARN_ON(!list_empty(&opp_table->opp_list)); - clk_put(opp_table->clk); - opp_table->clk = ERR_PTR(-EINVAL); + clk_put(opp_table->cur_clk); + opp_table->cur_clk = ERR_PTR(-EINVAL); dev_pm_opp_put_opp_table(opp_table); } diff --git a/drivers/base/power/opp/opp.h b/drivers/base/power/opp/opp.h index c85405e..30a637c 100644 --- a/drivers/base/power/opp/opp.h +++ b/drivers/base/power/opp/opp.h @@ -132,7 +132,7 @@ enum opp_table_access { * @supported_hw: Array of version number to support. * @supported_hw_count: Number of elements in supported_hw array. * @prop_name: A name to postfix to many DT properties, while parsing them. - * @clk: Device's clock handle + * @cur_clk: Current device's clock handle * @regulators: Supply regulators * @regulator_count: Number of power supply regulators * @set_opp: Platform specific set_opp callback @@ -169,7 +169,7 @@ struct opp_table { unsigned int *supported_hw; unsigned int supported_hw_count; const char *prop_name; - struct clk *clk; + struct clk *cur_clk; struct regulator **regulators; unsigned int regulator_count; -- 2.7.4