From patchwork Sun Apr 28 05:07:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 793165 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2080.outbound.protection.outlook.com [40.107.6.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B737B663; Sun, 28 Apr 2024 05:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280414; cv=fail; b=aeBkvhg7fwM/8xUmT4Hj0EveuAVxJTqoWdRYvfonKzUZ0CqZxbbwn0kMezoZWR0Q622ii2so1QMrDG8kdcb8ekf4Jok1qltaXnRWAdH+Vflr0Uxkez0bDctW4JWctDBsq9Dzrt2K/CPBiiBgeXWGMycUekOWufvv9uTIzmll3oY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280414; c=relaxed/simple; bh=AR6kiusDLkfh+A6OLjLwtpne7gglgInzOQHLRaTw9Fs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=FtwR+dyZKw5wnKEVP9eXL4HjJU8YwowAVxH7aNb+gTXDjsfHTTxBYDpFp+KhROcQ7WB9ALi8VCsdeNhR9saS+esx7D2Q6otsKi0EJxrB5PnUjsdk2YIIXOAoVDoV7MWaU1+JxDIqBwwPn+vbvoGV6HynaWNl/UT3P7lJfpRmLWg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=VFrTgeSz; arc=fail smtp.client-ip=40.107.6.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="VFrTgeSz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mx+DCpByzfKYEJfMULPhp6N5gqbeD0OdrZIVII0dPTArCa/1paFQDBlHt94IqUl26BvOXQkY5vzTYrIM6hcMv1O21/GAK0fOlnFFnhYYfYr037JCG0Z4hlO7wsaRvXAdOkeACz38iO5GOvQ5vi8jnCE0qCZ9Dlj6f2eSBdLfsJTOxlLm1rYs+wmHxpmbec/xk6OTJJI+7+Yuh4rnj5Yb3halZnO6GHmRKRS8mIU+IIGrDHO8cGH01QXwwgGDY8gjolQ8Osf33AxVfMhinrAEePcdyA9w4+S2XuxxvlfpWXozWFFarwCu2xh8gVkpZ6LpwQst22zQzdppDd9lG6h/FQ== 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=gmv0TXEoEYQi+cIOrv/pfZ4XqxwkZdNLFRqldRipnFw=; b=cLFvx+z5JjpIV5hjjuxTnLwfRKMhx/qUgv4nw8G3U+vfH4Q1k1B7jkR7lGQJZ+FQWxfu714TQT7/P0J6Jdf+11Zbgb0WkZ2I3t9OXkzauvFUaRl0Z2zwseiHXnj7B3qeTCHz68f5joHsBPSo556v7jrAT79kFLyrPYHQKeF+oeatxdedEOni4aN0dGPkqDtnVu62H5iET5AEctyC7rShIQIM5kL1GyY5tPCNysRNJzj2EAeYStdaPKUTMrshxb9Ykh+Czs14CUM64l+aN+UBkZu9z/k+mHMcOQU4zMuEUOuDPdgTghRidnfs7yPkXVsktyuRuCrsRDJm8C62nbB8WQ== 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=gmv0TXEoEYQi+cIOrv/pfZ4XqxwkZdNLFRqldRipnFw=; b=VFrTgeSzL8dXJvZq2l9y/JacoU4YUR0c/RiZOSgWIsp3fWoiGX3Q3o09oO8MIoTrxs6/xbn0nEAVeX1ceExRgMjc724yDt+WSkkTJ0csClqDzAC89+1KPk/YxY/UhJUirNtsctNZBW65v3ITEApFkSpSydbIB7QB54A2gPYXNko= 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 DU2PR04MB8552.eurprd04.prod.outlook.com (2603:10a6:10:2d7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.32; Sun, 28 Apr 2024 05:00:09 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d%4]) with mapi id 15.20.7519.031; Sun, 28 Apr 2024 05:00:08 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:48 +0800 Subject: [PATCH v3 2/6] pinctrl: scmi: move pinctrl_ops to scmi_pinctrl Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-2-eda341eb47ed@nxp.com> References: <20240428-pinctrl-scmi-oem-v3-v3-0-eda341eb47ed@nxp.com> In-Reply-To: <20240428-pinctrl-scmi-oem-v3-v3-0-eda341eb47ed@nxp.com> To: Sudeep Holla , Cristian Marussi , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Linus Walleij , Dong Aisheng , Jacky Bai Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-gpio@vger.kernel.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714280885; l=6917; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=uQ+UyN3OQXsoKXjUcPK+tkyvL3dflmZ9owBjbexvs44=; b=mWjTDtoTCbTvU892dhBJV3z0aJBkVcDn31GPhHubmXb0wlFduJidfNBDA2kyI1F0TMCsDZGbN XieL7cMQ4mVAJsxLnVJVeVJrN36zpLXYZBKwLQuJ9yd3wi+xMauj0RF X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR06CA0245.apcprd06.prod.outlook.com (2603:1096:4:ac::29) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DU2PR04MB8552:EE_ X-MS-Office365-Filtering-Correlation-Id: 38a37e14-7efa-4f8e-7cbe-08dc674013c0 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|376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wcWK32ytkLL15TQISi?= =?utf-8?q?NMwZJxO/9omrkpsCL12bSwxKn3IiN1mAGUqq8QBMsVssIkSF3SP1PjOqhuum4zqfG?= =?utf-8?q?qlhm+2VHL5Eblk39MfYd9QaIanq6KZpuD/dwl7E31AKWS7hW8U8P6Ph9N4ZhF9Qvs?= =?utf-8?q?7VsUBNC1bGSpkEVc/JjsF/C+xiXtHbniT4pNl/etKjPIw4NamSzh+kQbqyGEcmZAS?= =?utf-8?q?6XzrVUC8fehZij2E/s3NBAmP0Rur5h5MoWH5/v/9hsNcg8uXKGrT4uWfdyYjvBqGP?= =?utf-8?q?X7283z44iZQdoXp2RaoirImh+EoiNGdBrmVFAI2oMTijIV2uENVZ4sMnATO3C5nkK?= =?utf-8?q?eT/8oCQlCjcBDDumM488/TOdtqRO6ryN05napkKlunCPkPO/M1IO5N7XTvWJ40mZx?= =?utf-8?q?NtnOCpduATSkA8nYa1QJTDB6dXVrjZxthdIAULiLCME2dVkzRms1r0TGX/V6BkAa6?= =?utf-8?q?au/pTGJRe4Fe4h6ve/yiU/w7WtBoFRFyvqalX5XxCy71Ceh4A060+meY=3D?= 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)(1800799015)(376005)(52116005)(7416005)(366007)(921011)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fOqL0sBUfXvD2rbgFKqTb/il5y1G?= =?utf-8?q?wFx4bQSnuC02mkwWphHIKHfAwxSBusrNeRuGlBMmGISzJ6h3rFzj951JOTv03lnyl?= =?utf-8?q?NkggMr/6mqYP6cpYvP5uiylccRA6JGzi4mh+EySWGkF4xdseymxw2jy8jb16nBqCq?= =?utf-8?q?/SU4E1XNo3eubo9ngtKBO72PvLed/idduSQ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YkVmGX95mkQ+21TmuMOeI0SqyjVg?= =?utf-8?q?bWRe4/e0KM1gxwrkhKUxQ+FZl7Mm9z8tH+WW3TNuiKQnO5w+QLa3ruFhea5cibuY+?= =?utf-8?q?3Z3p/L/c6mYq/sbo004Zw3qKTyrttZFUqUOgUcXHE1ECQeK5gvfJ5EQP6UkpvAM1C?= =?utf-8?q?7SU521Tq4mrWm3CxNuAXYh6z5a4n/rOSdbTnON5o3ge92/BABqkTtvRDj5QbQ9SNi?= =?utf-8?q?JdSlw+1L1DDjn6TdO3EuDX/iB8BRU0vYv3vbrQ1B925sl5tzZsdRm913Fs5xs7eeN?= =?utf-8?q?6y8VqiYPvCB+FFYp/Lfx28tcgndrgF0xc3/VlY9peJvNppLOknDBpxr0LJObsHaTH?= =?utf-8?q?JUF0rqHx7BlECnGFrHqOGSHcm1otMmrt8cLQCEM8OaCFRUtkf44u6BuZH3EhhlnbY?= =?utf-8?q?ECgvbbhldSj/J4ZbltO7AXKbP/lROwFjGlJPkKX2tGKiukrqPQSqFscc+XbDd00tW?= =?utf-8?q?PwQoRY6gGVET?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38a37e14-7efa-4f8e-7cbe-08dc674013c0 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2024 05:00:08.7478 (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: 1r73bZrxteo7sxSVEwthSB6g1Fpz1I/Sgf3ezMzvmHZ+81QgA/761ZrV6SsblnbNtIEtFbO33K1O2S6CKmJm8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 From: Peng Fan Make pinctrl_ops a global variable not able to support multiple protocol@19 nodes, so make it per scmi_pinctrl. Signed-off-by: Peng Fan --- drivers/pinctrl/pinctrl-scmi.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 036bc1e3fc6c..682ff595c3c7 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -30,8 +30,6 @@ /* Define num configs, if not large than 4 use stack, else use kcalloc() */ #define SCMI_NUM_CONFIGS 4 -static const struct scmi_pinctrl_proto_ops *pinctrl_ops; - struct scmi_pinctrl { struct device *dev; struct scmi_protocol_handle *ph; @@ -41,13 +39,14 @@ struct scmi_pinctrl { unsigned int nr_functions; struct pinctrl_pin_desc *pins; unsigned int nr_pins; + const struct scmi_pinctrl_proto_ops *ops; }; static int pinctrl_scmi_get_groups_count(struct pinctrl_dev *pctldev) { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->count_get(pmx->ph, GROUP_TYPE); + return pmx->ops->count_get(pmx->ph, GROUP_TYPE); } static const char *pinctrl_scmi_get_group_name(struct pinctrl_dev *pctldev, @@ -57,7 +56,7 @@ static const char *pinctrl_scmi_get_group_name(struct pinctrl_dev *pctldev, const char *name; struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - ret = pinctrl_ops->name_get(pmx->ph, selector, GROUP_TYPE, &name); + ret = pmx->ops->name_get(pmx->ph, selector, GROUP_TYPE, &name); if (ret) { dev_err(pmx->dev, "get name failed with err %d", ret); return NULL; @@ -73,7 +72,7 @@ static int pinctrl_scmi_get_group_pins(struct pinctrl_dev *pctldev, { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->group_pins_get(pmx->ph, selector, pins, num_pins); + return pmx->ops->group_pins_get(pmx->ph, selector, pins, num_pins); } static const struct pinctrl_ops pinctrl_scmi_pinctrl_ops = { @@ -90,7 +89,7 @@ static int pinctrl_scmi_get_functions_count(struct pinctrl_dev *pctldev) { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->count_get(pmx->ph, FUNCTION_TYPE); + return pmx->ops->count_get(pmx->ph, FUNCTION_TYPE); } static const char *pinctrl_scmi_get_function_name(struct pinctrl_dev *pctldev, @@ -100,7 +99,7 @@ static const char *pinctrl_scmi_get_function_name(struct pinctrl_dev *pctldev, const char *name; struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - ret = pinctrl_ops->name_get(pmx->ph, selector, FUNCTION_TYPE, &name); + ret = pmx->ops->name_get(pmx->ph, selector, FUNCTION_TYPE, &name); if (ret) { dev_err(pmx->dev, "get name failed with err %d", ret); return NULL; @@ -131,7 +130,7 @@ static int pinctrl_scmi_get_function_groups(struct pinctrl_dev *pctldev, if (func->ngroups) goto done; - ret = pinctrl_ops->function_groups_get(pmx->ph, selector, &num_groups, + ret = pmx->ops->function_groups_get(pmx->ph, selector, &num_groups, &group_ids); if (ret) { dev_err(pmx->dev, "Unable to get function groups, err %d", ret); @@ -171,7 +170,7 @@ static int pinctrl_scmi_func_set_mux(struct pinctrl_dev *pctldev, { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->mux_set(pmx->ph, selector, group); + return pmx->ops->mux_set(pmx->ph, selector, group); } static int pinctrl_scmi_request(struct pinctrl_dev *pctldev, @@ -179,14 +178,14 @@ static int pinctrl_scmi_request(struct pinctrl_dev *pctldev, { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->pin_request(pmx->ph, offset); + return pmx->ops->pin_request(pmx->ph, offset); } static int pinctrl_scmi_free(struct pinctrl_dev *pctldev, unsigned int offset) { struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); - return pinctrl_ops->pin_free(pmx->ph, offset); + return pmx->ops->pin_free(pmx->ph, offset); } static const struct pinmux_ops pinctrl_scmi_pinmux_ops = { @@ -295,7 +294,7 @@ static int pinctrl_scmi_pinconf_get(struct pinctrl_dev *pctldev, if (ret) return ret; - ret = pinctrl_ops->settings_get_one(pmx->ph, pin, PIN_TYPE, type, + ret = pmx->ops->settings_get_one(pmx->ph, pin, PIN_TYPE, type, &config_value); /* Convert SCMI error code to PINCTRL expected error code */ if (ret == -EOPNOTSUPP) @@ -372,7 +371,7 @@ static int pinctrl_scmi_pinconf_set(struct pinctrl_dev *pctldev, p_config_value[i] = pinconf_to_config_argument(configs[i]); } - ret = pinctrl_ops->settings_conf(pmx->ph, pin, PIN_TYPE, num_configs, + ret = pmx->ops->settings_conf(pmx->ph, pin, PIN_TYPE, num_configs, p_config_type, p_config_value); if (ret) dev_err(pmx->dev, "Error parsing config %d\n", ret); @@ -415,7 +414,7 @@ static int pinctrl_scmi_pinconf_group_set(struct pinctrl_dev *pctldev, p_config_value[i] = pinconf_to_config_argument(configs[i]); } - ret = pinctrl_ops->settings_conf(pmx->ph, group, GROUP_TYPE, + ret = pmx->ops->settings_conf(pmx->ph, group, GROUP_TYPE, num_configs, p_config_type, p_config_value); if (ret) @@ -447,7 +446,7 @@ static int pinctrl_scmi_pinconf_group_get(struct pinctrl_dev *pctldev, return ret; } - ret = pinctrl_ops->settings_get_one(pmx->ph, group, GROUP_TYPE, type, + ret = pmx->ops->settings_get_one(pmx->ph, group, GROUP_TYPE, type, &config_value); /* Convert SCMI error code to PINCTRL expected error code */ if (ret == -EOPNOTSUPP) @@ -476,7 +475,7 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, unsigned int npins; int ret, i; - npins = pinctrl_ops->count_get(pmx->ph, PIN_TYPE); + npins = pmx->ops->count_get(pmx->ph, PIN_TYPE); /* * npins will never be zero, the scmi pinctrl driver has bailed out * if npins is zero. @@ -491,7 +490,7 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, * The memory for name is handled by the scmi firmware driver, * no need free here */ - ret = pinctrl_ops->name_get(pmx->ph, i, PIN_TYPE, &pins[i].name); + ret = pmx->ops->name_get(pmx->ph, i, PIN_TYPE, &pins[i].name); if (ret) return dev_err_probe(pmx->dev, ret, "Can't get name for pin %d", i); @@ -511,6 +510,7 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) struct scmi_pinctrl *pmx; const struct scmi_handle *handle; struct scmi_protocol_handle *ph; + const struct scmi_pinctrl_proto_ops *pinctrl_ops; if (!sdev->handle) return -EINVAL; @@ -526,6 +526,7 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) return -ENOMEM; pmx->ph = ph; + pmx->ops = pinctrl_ops; pmx->dev = dev; pmx->pctl_desc.name = DRV_NAME;