From patchwork Tue Oct 3 11:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13407514 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DABCFE7544F for ; Tue, 3 Oct 2023 11:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjJCLo3 (ORCPT ); Tue, 3 Oct 2023 07:44:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240515AbjJCLo2 (ORCPT ); Tue, 3 Oct 2023 07:44:28 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2042.outbound.protection.outlook.com [40.107.20.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D195BA3; Tue, 3 Oct 2023 04:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXLmMHT6OVxFYfRxwc3x5aYXe6x7qevIas4wgOymcsazjSOamV20vr1o1CEgdfP9nOQhytIvPrPmoNxNfuxTdIWOEcaFJX0wUWK3HJet1huGYZy2AkW/jVvMPK5ypZplTjdAMphz473S68I8iTnZ1UJDREp7r4lQ+49Hl2Ob1G6xnO/RQuyp3Tp2zYb+OmBxWoAIqdzERTCAI38/zgoe8gGe3JqgKt9/nin8v4U6x7OsURTF4IWT83hxHBAvXJ+YSxlKxtVrTipJULw539vW9uIfVfnVsNoxeITZheUy5SuQw7P8tXcA3XiC150QJazXaOvhr6Q0UDCAnXAPVfuRag== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qDaMTsSdyXwdGgx/APFq6ktvOfPiHQM8TN3MqsyHXZc=; b=Ca7GMSoSluJdzDhePrLTTJuYuFhzklhfR2pnK1eps3FDnIUL5Gur66fDiIIMhs6NedEl3UMOBOWVSAnX/bVeM9yh8B162tjCBW54ZRWLxkiVv1WH771726BP4TXmOjehR8xM1KXBJ291w3d+uBUdNzpVx7e6vNUL2x6v95dSy8C50+EJn0z2ai6zRt1KuzAM1Y4Z9x2+CGxAP7pmj5DyJv0s6vZgRLgwA76ym1YF6euAdpF6FyvoxB8tK8EgHPJYtegih6bwE0gS5k4W/1QlXU951DW/4zSemufSK0RzD5vjGs2kivGnLElBx91t4VoVeM9mMVGAGfSW4RdtRqNxNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qDaMTsSdyXwdGgx/APFq6ktvOfPiHQM8TN3MqsyHXZc=; b=Ks7UL1kbI7s1xtjLnV8byCI+Im/9xG3m+Ku4CqEcEOtdIpyLxO7AUdbZQcq14zAwTzVFIpJe3TYkXrfj9z8Qc0ci0N5dSvSdtX5XxAA5LIPaacv+TGXf636nRYHw1FwjlWug3umMpcCLB7TuTWq4in8/kFuGBHojqPnBStWaO2E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DB9PR04MB10067.eurprd04.prod.outlook.com (2603:10a6:10:4c8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Tue, 3 Oct 2023 11:44:20 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b%3]) with mapi id 15.20.6838.024; Tue, 3 Oct 2023 11:44:20 +0000 From: "Peng Fan (OSS)" Date: Tue, 03 Oct 2023 19:48:48 +0800 Subject: [PATCH v4 1/2] firmware: arm_scmi: clock: support clock parents Message-Id: <20231003-scmi-clock-v3-v4-1-358d7f916a05@nxp.com> References: <20231003-scmi-clock-v3-v4-0-358d7f916a05@nxp.com> In-Reply-To: <20231003-scmi-clock-v3-v4-0-358d7f916a05@nxp.com> To: Sudeep Holla , Cristian Marussi , Michael Turquette , Stephen Boyd Cc: Peng Fan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696333746; l=8554; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=c/OXxmNAJsNthHXSHkouIaDUXrqUc8uJxtJutrOHMO0=; b=3AJQzEVipLlguU+PHpnE3usfcokTObd5HPnPS9gjV3j+IGTIg3AYtVKQjvv14vzgFJcOg8v1a RVLFVN2eD3WBi932Ura0K/fx8wQnqaYJ4cPWyRhj6p9jVx8aPcmdtdx X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2P153CA0002.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::16) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DB9PR04MB10067:EE_ X-MS-Office365-Filtering-Correlation-Id: d6b7be88-1a46-4cb5-36f6-08dbc40614b4 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a52m+Iof117uijwyam+EiOjFxjHWApbOBt/IqvdPLx+i8m35IiU5GL2ab04COx80rP3+0Id5m7QdsO84bTCgrZrlTDojf4SmmgTGYH6vC+CjzuU295y+RNLhKk30IGcUEsKLllf02m8dnrWiSmdjJ/Nyhbo6BfvTv2kQi025HGxiK7k80siNQ5XGnsiFRpiTt8EG7yBKutrOvwoCr3G+T5wsFtzJyQTDvQO3cqs80BfgGIA57ZpUEKlYbPE+PhuBh2IiaMkU8m4GjdKlIXf4bJHC8Mm+1ooEteUtzPjI4MceFau3lp0yOoZxmGiLbx9gLiwr3HLLKSDG8E365RCP282xHAPWYIpdg0n6jDT0iKtoVr2t50ZALUg92kdQY9G/NLqPStn4JwKinRZicklp+dwlrdq9H74OFCRvMXT/gRdnG1IQo8zog8s0Rbaab6B3WuTnx0VB+XD1+7AOzpv3KbKS9m/ARdXYrqTwRSiyvRYQQedANVAT060jGoWF61Amc+gJ/CVJ2NOGY2vJaJgJZgOMgqVOvAmsOboWPMf28QIUGJTnQ+jsXGGfEitGj1cS0Sw5hLZ7HHh6dDXdPH9xdGxmUODhT3kgN71LZxu5AGb0swZE7SJVPqZCE5nouWxb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(366004)(396003)(376002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(8936002)(316002)(66556008)(478600001)(66476007)(83380400001)(9686003)(66946007)(4326008)(26005)(36756003)(41300700001)(8676002)(6486002)(6506007)(6666004)(86362001)(52116002)(38100700002)(6512007)(38350700002)(110136005)(2906002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?w1c1wz4dngMGrUeMgm31LJTFlIw+?= =?utf-8?q?ICn7Fxovs70NpXr9hoGkz2Pvq2zi6r5yUuW/+HfBs/eh2rQce8kTW0Rd68TPUhyDs?= =?utf-8?q?JVLBi9JNO0BO9pRb5TTbIRjcQTvLnS3NWVIgLsSYXE54hq0Mu+r8nAQUGYqoqSgS1?= =?utf-8?q?4Id4lAizelpohZ7Xoyk9g9spKd6+15mjtYAxaKh6IHHB3rhTrht8jdI+xdpfDeSfU?= =?utf-8?q?nyUDkbJRnWDqZBnnmDfNJEwbQohgivmNWMZb6iXXHEU3vAH2FzjUbInOnGKf7z9Oh?= =?utf-8?q?Be5Bh3y2KmAKZym00ej7uGLVS6pkI4b5n1llAZgT2AW2tVJX1jRg5K7s/GyXDmhjU?= =?utf-8?q?3r33gHusrg3EB3U8FUki+y+Bxa5W4XgJOmBhXZ0oLWzEN9gq6L18V+xcpvwa5t91T?= =?utf-8?q?rR6Q21qFidoxztFJl3GYIK1e0vQouceULwDyWDKWYjw2itCcsmQEOnuQM4Nse2Mz+?= =?utf-8?q?wx9J3S7fJCg3uyee66JxKwNr57P3F8kWF/VNcd2Oscv47hBxDq3REMbJpsIQd0JAC?= =?utf-8?q?E1nqgjaxPodhwf3mCIOww94mdSz9+INxlIn0GNQh0AiKLRP120ARGo1IXUyCx0htK?= =?utf-8?q?bEBFYzHHylHDDlswuN/Btqw3M4egDF8Vdh3Go2kJe83xxYPS4+0K0up9ADUDmlNa8?= =?utf-8?q?mT5RVv6E45us+UbskFlDYpGYpuW7PRuhCf1MI0ukM9p3gWfgwrtVIX2yXlLPoYlJz?= =?utf-8?q?dfAtjPa4wAUQn4MkPT+c/Umxwb8TAfUG86f0w3O1y3wziUqkJcCNpuqw04jXQcQbl?= =?utf-8?q?go6KMbvcstoyBajhXbQK6K3QP1gSB8ciD0xikRtYSmFPmTMqSQ/jjMKPRcxAJAJTR?= =?utf-8?q?DkTCNwc8f5gsXDsVQ41IBIYq+rxDcSZYb9tVl2Ca0Fer8Yph4BpBQr0UU3FdDX4/F?= =?utf-8?q?qYtmcV/BxxLXH4pfzE3b/tFxNN3Fg9liQehYS4QFYrqNefnmqER2zkJnpmV5LWK+G?= =?utf-8?q?fGF0zVFGC3Mw+1IVI1dvyh9ChqcHnMh8864/yjtO/PTgLUgGpC65645cfj7wWEED2?= =?utf-8?q?xEVOQuP8CZnYKWJCm1ODg9qv44MnvaiF3kNfuaBjLNxYE5lCYpVVz62siyxbjW7of?= =?utf-8?q?oOuugsUxK6N4UkQl4UfF7q9s7xI7VAqVshIVXvCkp0D9ILUZKiFpt6Yfwl5dZ0xey?= =?utf-8?q?wVa7DB8o48HhRCfr6OF5WKUkW21dXBqkBoEeWFYwqehk802Ryfn1iguYVFJ7Oa4wC?= =?utf-8?q?PHBokD4N/oBMXW7J+HdlOZT84CKCu8CPpvrzUqU+/ia8mz2rR7HWXHIlWqGmXBPmP?= =?utf-8?q?+1KVoMnZGU9imjv4yG5PMLIzveXk80AiIpTFHXlpeuDuJnv8HCi+YGZhPuo6IyJ4/?= =?utf-8?q?nQ7arh5v57mVqv0gxV8QTAvPcOH/4UsRlG+KdkU7RtmdTtB3JYhZLNRrNa6VfPrOp?= =?utf-8?q?JMDhWVdgqocPQBDfTq3uaTLTXIekyEqkSy//r//kT4jc/c9Nb/7Ifj5S/137XFHgT?= =?utf-8?q?+16H/RklpPX/Kc+7XLp/NKuD3i2w9dzIm9eJ4UPLnP+id9X46r31Jpw3DlCA2AOCH?= =?utf-8?q?EO6LKgQ4kCyX?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6b7be88-1a46-4cb5-36f6-08dbc40614b4 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 11:44:20.0414 (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: QSTku0kcwphQ/hdYL9hAum8oKeaoVQDFbCXDIbyUDc7JHcURYXXQ+5xpSW/kriGDOU0FDIV7BGkR9Nmbpjfjlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB10067 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Peng Fan SCMI v3.2 spec introduces CLOCK_POSSIBLE_PARENTS_GET, CLOCK_PARENT_SET and CLOCK_PARENT_GET. This patch is to add the upper three new commands. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan --- drivers/firmware/arm_scmi/clock.c | 182 ++++++++++++++++++++++++++++++++++++-- include/linux/scmi_protocol.h | 6 ++ 2 files changed, 182 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c index 9c0e33c1efab..ddaef34cd88b 100644 --- a/drivers/firmware/arm_scmi/clock.c +++ b/drivers/firmware/arm_scmi/clock.c @@ -22,6 +22,9 @@ enum scmi_clock_protocol_cmd { CLOCK_RATE_NOTIFY = 0x9, CLOCK_RATE_CHANGE_REQUESTED_NOTIFY = 0xA, CLOCK_CONFIG_GET = 0xB, + CLOCK_POSSIBLE_PARENTS_GET = 0xC, + CLOCK_PARENT_SET = 0xD, + CLOCK_PARENT_GET = 0xE, }; enum clk_state { @@ -42,10 +45,28 @@ struct scmi_msg_resp_clock_attributes { #define SUPPORTS_RATE_CHANGED_NOTIF(x) ((x) & BIT(31)) #define SUPPORTS_RATE_CHANGE_REQUESTED_NOTIF(x) ((x) & BIT(30)) #define SUPPORTS_EXTENDED_NAMES(x) ((x) & BIT(29)) +#define SUPPORTS_PARENT_CLOCK(x) ((x) & BIT(28)) u8 name[SCMI_SHORT_NAME_MAX_SIZE]; __le32 clock_enable_latency; }; +struct scmi_msg_clock_possible_parents { + __le32 id; + __le32 skip_parents; +}; + +struct scmi_msg_resp_clock_possible_parents { + __le32 num_parent_flags; +#define NUM_PARENTS_RETURNED(x) ((x) & 0xff) +#define NUM_PARENTS_REMAINING(x) ((x) >> 24) + u32 possible_parents[]; +}; + +struct scmi_msg_clock_set_parent { + __le32 id; + __le32 parent_id; +}; + struct scmi_msg_clock_config_set { __le32 id; __le32 attributes; @@ -168,6 +189,99 @@ scmi_clock_protocol_attributes_get(const struct scmi_protocol_handle *ph, return ret; } +struct scmi_clk_ipriv { + struct device *dev; + u32 clk_id; + struct scmi_clock_info *clk; +}; + +static void iter_clk_possible_parents_prepare_message(void *message, unsigned int desc_index, + const void *priv) +{ + struct scmi_msg_clock_possible_parents *msg = message; + const struct scmi_clk_ipriv *p = priv; + + msg->id = cpu_to_le32(p->clk_id); + /* Set the number of OPPs to be skipped/already read */ + msg->skip_parents = cpu_to_le32(desc_index); +} + +static int iter_clk_possible_parents_update_state(struct scmi_iterator_state *st, + const void *response, void *priv) +{ + const struct scmi_msg_resp_clock_possible_parents *r = response; + struct scmi_clk_ipriv *p = priv; + struct device *dev = ((struct scmi_clk_ipriv *)p)->dev; + u32 flags; + + flags = le32_to_cpu(r->num_parent_flags); + st->num_returned = NUM_PARENTS_RETURNED(flags); + st->num_remaining = NUM_PARENTS_REMAINING(flags); + + /* + * num parents is not declared previously anywhere so we + * assume it's returned+remaining on first call. + */ + if (!st->max_resources) { + p->clk->num_parents = st->num_returned + st->num_remaining; + p->clk->parents = devm_kcalloc(dev, p->clk->num_parents, + sizeof(*p->clk->parents), + GFP_KERNEL); + if (!p->clk->parents) { + p->clk->num_parents = 0; + return -ENOMEM; + } + + st->max_resources = st->num_returned + st->num_remaining; + }; + + return 0; +} + +static int iter_clk_possible_parents_process_response(const struct scmi_protocol_handle *ph, + const void *response, + struct scmi_iterator_state *st, + void *priv) +{ + const struct scmi_msg_resp_clock_possible_parents *r = response; + struct scmi_clk_ipriv *p = priv; + + u32 *parent = &p->clk->parents[st->desc_index + st->loop_idx]; + + *parent = le32_to_cpu(r->possible_parents[st->loop_idx]); + + return 0; +} + +static int scmi_clock_possible_parents(const struct scmi_protocol_handle *ph, u32 clk_id, + struct scmi_clock_info *clk) +{ + struct scmi_iterator_ops ops = { + .prepare_message = iter_clk_possible_parents_prepare_message, + .update_state = iter_clk_possible_parents_update_state, + .process_response = iter_clk_possible_parents_process_response, + }; + + struct scmi_clk_ipriv ppriv = { + .clk_id = clk_id, + .clk = clk, + .dev = ph->dev, + }; + void *iter; + int ret; + + iter = ph->hops->iter_response_init(ph, &ops, 0, + CLOCK_POSSIBLE_PARENTS_GET, + sizeof(struct scmi_msg_clock_possible_parents), + &ppriv); + if (IS_ERR(iter)) + return PTR_ERR(iter); + + ret = ph->hops->iter_response_run(iter); + + return ret; +} + static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph, u32 clk_id, struct scmi_clock_info *clk, u32 version) @@ -212,6 +326,8 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph, clk->rate_changed_notifications = true; if (SUPPORTS_RATE_CHANGE_REQUESTED_NOTIF(attributes)) clk->rate_change_requested_notifications = true; + if (SUPPORTS_PARENT_CLOCK(attributes)) + scmi_clock_possible_parents(ph, clk_id, clk); } return ret; @@ -229,12 +345,6 @@ static int rate_cmp_func(const void *_r1, const void *_r2) return 1; } -struct scmi_clk_ipriv { - struct device *dev; - u32 clk_id; - struct scmi_clock_info *clk; -}; - static void iter_clk_describe_prepare_message(void *message, const unsigned int desc_index, const void *priv) @@ -458,6 +568,64 @@ scmi_clock_config_set(const struct scmi_protocol_handle *ph, u32 clk_id, return ret; } +static int +scmi_clock_set_parent(const struct scmi_protocol_handle *ph, u32 clk_id, + u32 parent_id) +{ + int ret; + struct scmi_xfer *t; + struct scmi_msg_clock_set_parent *cfg; + struct clock_info *ci = ph->get_priv(ph); + struct scmi_clock_info *clk; + + if (clk_id >= ci->num_clocks) + return -EINVAL; + + clk = ci->clk + clk_id; + + if (parent_id >= clk->num_parents) + return -EINVAL; + + ret = ph->xops->xfer_get_init(ph, CLOCK_PARENT_SET, + sizeof(*cfg), 0, &t); + if (ret) + return ret; + + t->hdr.poll_completion = false; + + cfg = t->tx.buf; + cfg->id = cpu_to_le32(clk_id); + cfg->parent_id = cpu_to_le32(clk->parents[parent_id]); + + ret = ph->xops->do_xfer(ph, t); + + ph->xops->xfer_put(ph, t); + + return ret; +} + +static int +scmi_clock_get_parent(const struct scmi_protocol_handle *ph, u32 clk_id, + u32 *parent_id) +{ + int ret; + struct scmi_xfer *t; + + ret = ph->xops->xfer_get_init(ph, CLOCK_PARENT_GET, + sizeof(__le32), sizeof(u32), &t); + if (ret) + return ret; + + put_unaligned_le32(clk_id, t->tx.buf); + + ret = ph->xops->do_xfer(ph, t); + if (!ret) + *parent_id = get_unaligned_le32(t->rx.buf); + + ph->xops->xfer_put(ph, t); + return ret; +} + /* For SCMI clock v2.1 and onwards */ static int scmi_clock_config_set_v2(const struct scmi_protocol_handle *ph, u32 clk_id, @@ -650,6 +818,8 @@ static const struct scmi_clk_proto_ops clk_proto_ops = { .state_get = scmi_clock_state_get, .config_oem_get = scmi_clock_config_oem_get, .config_oem_set = scmi_clock_config_oem_set, + .parent_set = scmi_clock_set_parent, + .parent_get = scmi_clock_get_parent, }; static int scmi_clk_rate_notify(const struct scmi_protocol_handle *ph, diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 27bfa5a65b45..f2f05fb42d28 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -58,6 +58,8 @@ struct scmi_clock_info { u64 step_size; } range; }; + int num_parents; + u32 *parents; }; enum scmi_power_scale { @@ -83,6 +85,8 @@ struct scmi_protocol_handle; * @state_get: get the status of the specified clock * @config_oem_get: get the value of an OEM specific clock config * @config_oem_set: set the value of an OEM specific clock config + * @parent_get: get the parent id of a clk + * @parent_set: set the parent of a clock */ struct scmi_clk_proto_ops { int (*count_get)(const struct scmi_protocol_handle *ph); @@ -104,6 +108,8 @@ struct scmi_clk_proto_ops { bool atomic); int (*config_oem_set)(const struct scmi_protocol_handle *ph, u32 clk_id, u8 oem_type, u32 oem_val, bool atomic); + int (*parent_get)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 *parent_id); + int (*parent_set)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 parent_id); }; struct scmi_perf_domain_info {