Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp394373ybv; Wed, 19 Feb 2020 01:43:07 -0800 (PST) X-Google-Smtp-Source: APXvYqytDHaREFU5bLCxJU4cvO5c/WW67nOBEvHZ6KswrByINlDF+UCFUtfOC8I0QHIpu8UktpcW X-Received: by 2002:a05:6830:1050:: with SMTP id b16mr19256998otp.140.1582105387503; Wed, 19 Feb 2020 01:43:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1582105387; cv=pass; d=google.com; s=arc-20160816; b=NCDMD5oEmCJFwHcm1WSk9cSJCLneAg+ZvP3zen6QQM9FUImbry7tUwjAouiCREMkvM yRCZGSLocrl/Fm+LujpR96ALAcBuRn+U27vquSWkg4DFkPZc/GcfwH5uyRwG/q4RbcGK eCLdSiGqdSi8eXmNIya1+ztP7TQecjnVVHw/g6j4PjmBsf2Cq6SIY1UYTX7edy4meQAe zkTRTCh2KQ7tyNKSIZpyAQ8RrKcB8QbY3R9tUc85Bm85v1b1LxbEJ43dZFhp2A74b5gr WlCK2dKz8P5yqnV3kK/yyBt+BAik2aZGAwHg3PGx508RiLB2BoJX+pHzIwMtyLJjXBSP 361g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=qaFhKPAI4FHDu0V11FpwCLk2Ij29NBV4bSSiYM0sU0I=; b=Hcdxizwtsa1mOS/7T+emn6QLIJuj96MIs3Y7WIUMFn4smY2utwgE7c5bZD7V3MR4cS v0Tft8XVczs6RvJ9tQ4zwfnHqwt+glzPf/JZhAMAHl97oNIP3MYkmbEyyq/vhAXYoCii gsovvvdbEZshC/OE8tC9vY3a3ouTRmgNH86WSyCJhYNCEyBmmziKbijBBDMt5WfDpiPi JoXARVf4ydr8yP/6i1eElNEr8eaH6tPVF0nJklz7BRbPjvuS/1EvmmH31UnFXMWKVUQp NuaS3m7MzS+3wkY/r3TmszrvMLyva4uxEjbjdr4yH5wnqPNDem+jE0EKtdU/V379UJlJ Sx1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=TemYpHrz; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si828577otq.112.2020.02.19.01.42.54; Wed, 19 Feb 2020 01:43:07 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=TemYpHrz; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgBSJmg (ORCPT + 99 others); Wed, 19 Feb 2020 04:42:36 -0500 Received: from mail-eopbgr60052.outbound.protection.outlook.com ([40.107.6.52]:4541 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726210AbgBSJmg (ORCPT ); Wed, 19 Feb 2020 04:42:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D4YRdq7+pMm/ITpXYg+rrOCY2cBNbY45ZYMATV6RDBASisIyhWFoXqFzVAi7jkYH/NWfNviu8dcUBARkloCqoTRg9t00h/nLWqsToOZZi4XvJ3f7h+VOWgp2LfcaRrpXB1cNWE2oQB8I6kj7pLNNQHQDrJ+j9RotuhqKaAiq1eNXybfeGLqP7rFrW0eaJ9BBRiHig3aoOkTnUojjnlnRujzydo+Kp7BRIWU3x1NpYHaEUDX2fE32Dv1GG+XwpYuA/1sydN4NGARv4GuQDW1YD3XsOS5pKxieboI3aRU3Iutfo2Kg/5twq/hykDerAmKOPL4bFr3xJ1k/Q9mxa3zP6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qaFhKPAI4FHDu0V11FpwCLk2Ij29NBV4bSSiYM0sU0I=; b=h0g7caXE4e5pt3ygdT3mqzBdlIwUk+uj/s7hOREHqT3dz3E6EZPOPymblp989emAkuf2fWU/aWMnTe2vc4H9NYSV1gIGIpNe25XBSIaIqYkiGq2jNd61rmnEgA8qpKZ2D5zrjSc0pB0x0/8z4SrMGyyFPFlzyY+BmC1ed6Kv76fUCkOZT213trFu6YYoJ858DJKDbfzY6e1rs+7EAuJT0bVIiWCjXKZTA4xUSAPrisbPBeJpqjeVzz0A4ZHVqolf05wKryQPaIG9OBV7t1cz9lPxW7P7/3Pje0Cck68Ol+TV5CMabX0KfnXAOp5O8Ip1V3OZrXQd+1gKZHLLu0tn+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qaFhKPAI4FHDu0V11FpwCLk2Ij29NBV4bSSiYM0sU0I=; b=TemYpHrzOlJR3e7HIweKRlAOXS6bnr3p/2MfSKeGpANWXnvjUhJOlQIPkv2kHg1QQBFbD0ZwuH8VsMIZlhFSzX/eiNpEOmxhRAAVT2NjASfvjVFtSUSOiS4pVZlJbHWZ3O96JcseNrnY2ZkOTVLaP7E9hGOd2uuDaFoU2DtyQHw= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4564.eurprd04.prod.outlook.com (52.135.149.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Wed, 19 Feb 2020 09:41:53 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::91e2:17:b3f4:d422%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 09:41:53 +0000 From: Peng Fan To: Viresh Kumar CC: "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "sboyd@kernel.org" , "robh+dt@kernel.org" , "rjw@rjwysocki.net" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , Anson Huang , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Abel Vesa Subject: RE: [PATCH v2 10/14] cpufreq: dt: Allow platform specific intermediate callbacks Thread-Topic: [PATCH v2 10/14] cpufreq: dt: Allow platform specific intermediate callbacks Thread-Index: AQHV5vuGM17dCu5aOkOrNUFZCKyD1qgiQd0AgAAA43A= Date: Wed, 19 Feb 2020 09:41:53 +0000 Message-ID: References: <1582099197-20327-1-git-send-email-peng.fan@nxp.com> <1582099197-20327-11-git-send-email-peng.fan@nxp.com> <20200219093526.hexyzhfuirb2lg4m@vireshk-i7> In-Reply-To: <20200219093526.hexyzhfuirb2lg4m@vireshk-i7> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-originating-ip: [119.31.174.68] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 173cc744-cd56-4344-6a77-08d7b51ff3c0 x-ms-traffictypediagnostic: AM0PR04MB4564:|AM0PR04MB4564: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(396003)(376002)(136003)(366004)(199004)(189003)(26005)(6916009)(33656002)(7416002)(6506007)(86362001)(8936002)(53546011)(44832011)(5660300002)(52536014)(2906002)(66946007)(66476007)(66556008)(64756008)(66446008)(76116006)(186003)(316002)(4326008)(9686003)(478600001)(81156014)(55016002)(71200400001)(8676002)(81166006)(7696005)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4564;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4gSHCALnEEfDSAnQcDTjdfKSSVNFTYO2eU7QSaMmUJOoytw3RrdiAfJ3K1BDqHQjenlMADMDw6f9hj1Cb5Lgb05VzUUZvC1l66afBhJQLnLYnZaErXJJj7wkcI9fnm+ZGhqfucmM1ZQYC8oVAXefoRjSN5BZSZaUfaX0GhJx72LZnCfcFR8SsSDlbeGQN49kjys5vLr0ulscYvOsHImBY4itvJhBe9ZFBWb0jKBkNGpyCgmtGJD7arM5/SUQANlz5He7Grwrp698dh0r4vPcRALeV4+ar8ZLkdFnPfPNkQP9jqfl72N86vZRJqyLgDkZLSN0lHeIsPfTE0mW8pGBmiwh7r6BXJaV5du/DojzBkJSY0y42UgVdWFVizsaj6RvGp7Z+6UHOJCXVk9M6aJPOnk9c0JVMDERJHFMpxLSCtw2C6h9TSLoElGsWTYQGA9F x-ms-exchange-antispam-messagedata: QEWWOHAUVbonBvA4heJXODSstTtsrfXH0CIxaYaX/7ErfZSxJwrFmCYAyC1aY8IKTAYXgs72I7mzPyUt/Yl3r3u0F2qhSel4HE9BDOpasoHbWIX4rWUMNEbP4+kQq8D9KkE7Zf2kLK3Bla0hixvWiA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 173cc744-cd56-4344-6a77-08d7b51ff3c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 09:41:53.2902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6EXLl127p1E5jS7OmMwFRONYNWuT9gpxAFvESLH9A3JXOWSwKxPOu1hMfScqQwpkjRjpF8LFidocgX+XsuEn9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4564 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, > Subject: Re: [PATCH v2 10/14] cpufreq: dt: Allow platform specific > intermediate callbacks >=20 > On 19-02-20, 15:59, peng.fan@nxp.com wrote: > > From: Peng Fan > > > > Platforms may need to implement platform specific get_intermediate and > > target_intermediate hooks. > > > > Update cpufreq-dt driver's platform data to contain those for such > > platforms. > > > > Signed-off-by: Peng Fan > > --- > > drivers/cpufreq/cpufreq-dt.c | 4 ++++ drivers/cpufreq/cpufreq-dt.h | > > 4 ++++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/drivers/cpufreq/cpufreq-dt.c > > b/drivers/cpufreq/cpufreq-dt.c index d2b5f062a07b..26fe8dfb9ce6 100644 > > --- a/drivers/cpufreq/cpufreq-dt.c > > +++ b/drivers/cpufreq/cpufreq-dt.c > > @@ -363,6 +363,10 @@ static int dt_cpufreq_probe(struct platform_device > *pdev) > > dt_cpufreq_driver.resume =3D data->resume; > > if (data->suspend) > > dt_cpufreq_driver.suspend =3D data->suspend; > > + if (data->get_intermediate) { > > + dt_cpufreq_driver.target_intermediate =3D > data->target_intermediate; > > + dt_cpufreq_driver.get_intermediate =3D data->get_intermediate; > > + } > > } > > > > ret =3D cpufreq_register_driver(&dt_cpufreq_driver); > > diff --git a/drivers/cpufreq/cpufreq-dt.h > > b/drivers/cpufreq/cpufreq-dt.h index a5a45b547d0b..28c8af7ec5ef 100644 > > --- a/drivers/cpufreq/cpufreq-dt.h > > +++ b/drivers/cpufreq/cpufreq-dt.h > > @@ -14,6 +14,10 @@ struct cpufreq_policy; struct > > cpufreq_dt_platform_data { > > bool have_governor_per_policy; > > > > + unsigned int (*get_intermediate)(struct cpufreq_policy *policy, > > + unsigned int index); > > + int (*target_intermediate)(struct cpufreq_policy *policy, > > + unsigned int index); >=20 > Who calls them ? In drivers/cpufreq/cpufreq.c, function __target_index. Line 2065, see below= : 2062 notify =3D !(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATIO= N); 2063 if (notify) { 2064 /* Handle switching to intermediate frequency */ 2065 if (cpufreq_driver->get_intermediate) { 2066 retval =3D __target_intermediate(policy, &freq= s, index); 2067 if (retval) 2068 return retval; 2069 2070 intermediate_freq =3D freqs.new; 2071 /* Set old freq to intermediate */ 2072 if (intermediate_freq) 2073 freqs.old =3D freqs.new; 2074 } Inspired from tegra20-cpufreq.c, use target_intermediate could handle i.MX7ULP cpufreq easier. Thanks, Peng.=20 >=20 > -- > viresh