From patchwork Sun Apr 28 05:07:50 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: 793164 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2079.outbound.protection.outlook.com [40.107.6.79]) (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 06CE8FC08; Sun, 28 Apr 2024 05:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280425; cv=fail; b=JJkE1bGWWp00bj8CN62KfvGmaxt82gr9ON0t/ZeL+eO3fULCo3o5jsHgZScb9FH9ZBYY9Wj4btX5Jau/NfUDAQb5J6N+k/xkDs9ans2vU/YVnAf7s+3qoqzRMhcRc9v2UoUjUkvp2MH3li0i6CJPqqufJD2KIuMH8/cRyhaxU5s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280425; c=relaxed/simple; bh=79FZFIm+UI/swyRovAdUaSRowcqXXxkfq39uBQ9wZ8w=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=uUKvpCS7Ec6V0IW3uT3PfIq1PpFd44pZMacCkiYg1uskK9BK1Qd3rZS+x3Wg9YmoKbnioHu2GuxMyVJMZ8BPQ/6oKEmUJWxOV7NABU6ayWizWIxO1F90KV5+uXqAKxHkrVBsdxTWypXuhpNh+Gv23g/Hrudpg8oxMrwCm89iGEc= 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=Ck/kXeNf; arc=fail smtp.client-ip=40.107.6.79 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="Ck/kXeNf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mb1z16Gl+q4FP8f+/bJNdcQgpCqnV1sdXl1wPFjIOwQt+bzmKusbCZHpzerVU9AEy9btDLg68eUGoZBHwLUyLctwDyMT6VnLFs/t8Gx178Q5mYc9asO+KS/nwZGzYmBwXib1T59nQlE3BX1QFll8gnKg9/05GN/8I6XWVQnsZApOlk7Gz+RU14Cjt1ZDKwk+7zPqKK7uXr3daYq1wlocwSpsZ2NSu6ZM77mPB1MqpmCpEB2s1DWAijRX2wuNLtriH2nhlRhGAUnV38xvulMVZU1EcsAlrKqGuuUVCOfJG+zanMn2KO0/0+9UP3dX6rToP01ur93Sgs7WeOX5c3di3w== 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=vafZpEqtNaKDk6F/kMMvF8+XnITNUFDcv+gFv3/KQg8=; b=iMl4LGk9TmFUjeGPxboxs+Envob+PeFQloTtDfx2bQZmSveGbGAAkbEJ2XoN81ndQ6fCYQgGl5RxeARUeVBgydfwOsajiKTuoNWk2Sq9YQRG3P3FpKPinbnioJ5R7u9dg1s+1zzX82DMT98K1yp1ZxG57M9Chgaz9PwwJLO9IuqPhVLK5E6dWVQYXFrJWjL0LfS6I61QoEHfCcf9KdzlRLhoCft+kh4fAkacEUMgyINh+SYdeXiE7ZpUdNkCFefZraJxbyIsbLr+FxsrEHkHN/rgjFJjhEdu6XxPlB8yx5AIqbL9h0DkMDr17ChCAmOMeAMpCGPkiZZU9xA6HqYDSw== 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=vafZpEqtNaKDk6F/kMMvF8+XnITNUFDcv+gFv3/KQg8=; b=Ck/kXeNfUXFti/a+cUbro4+7oZi2qh5TsRV/xKy0uvMddKPYW1ClSwsCjFt72XFyFCx9QvGSxwo1z9Her0b8JoYhyZgShFj1jzDa8rnxPWqIMgVWt367tVit5DCVZIUsTaG6kQehzFDM9qa4g9stOsGvcx3zVnIO3x44raj1jTs= 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:20 +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:20 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:50 +0800 Subject: [PATCH v3 4/6] pinctrl: scmi: export pinctrl_scmi_get_pins Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-4-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=2903; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=kIt33zJPUCQ57EVxkObHnmfgwRn9lRtI9Vr48NhCXKg=; b=8SIjTFnkJgLdOExT92Fmcj4VEXYHbd2mZwP2gWdWk2JAtmmW7lqdMZAWAdJtLvgKZqVDVbNPB blqMudnlW1lDXFKKotRIHQGADNf1UdqyNES7nhgjzysUif71eZ7TGhd 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: 909a55cd-ab9d-4a02-24bf-08dc67401aa8 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|376005|52116005|7416005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?snp178JzM5Bet/gbWlNshgiYm9kbg6R?= =?utf-8?q?fpHxYUpJRMe524mn4N35TxxZZfpXggR2JWcvXL8rycesK+ZsKkOzLsqGsVCvlVGs3?= =?utf-8?q?rZsEAJ59E48BS6sFXxuEL7IJu8gfGQKKiI3BzzGBjCvmyTXGqvSwk2W+MhRLrvLj1?= =?utf-8?q?lv14xS4F+zs0ybm8J2TpckdRQtzIxdqrc2ukuStmbI4wVESxR3i6TxgftR/wqf75B?= =?utf-8?q?IOSQaAob1RoRjSYo+6gsW0m80bfnrQRl+jldiKjQgbafqU69BU1GGLqGtVsU0+qx+?= =?utf-8?q?tIISbq+m543uUY/+npYfNZTzIDNh5Xr6jri8NzuGXLcJsutC9YC+/95sW4yV798cY?= =?utf-8?q?d8mawGu1bv6A7qVQ6cKMqU7Xj9jD7mHzJfrQM2u9xH3Qg/sbxqn4aJTeKVHNOvyHY?= =?utf-8?q?kGDSZfh/hsCBaiMf/8+FZ2AH63WiUSB5C5X2Tc834XiFDWsKgu86jvNsC6HXxpfW+?= =?utf-8?q?K8cKCyFPAJurLBhGO2kqAJ8M0PcNyfSXzZIdzU/Tbsp7JLJyJZn8XksrLOChhoyjz?= =?utf-8?q?vsdGQBidpqh9/u3zObnVJxBersUXYz2KDOAkl3vx9sHSqkDTC3rb0wytu9KBr5k3o?= =?utf-8?q?AaCdcg2X8slr1+1awHhH4HiQbmCxC30620fQS1obiQyerb3CZVdw9CK97c5xCe6cv?= =?utf-8?q?DSGPzm9OKPV3rV+XUtYduFsNw3nElq02gHJr8yss7NRVD8jQOofNs+93HkMWWazxb?= =?utf-8?q?Ai+4CIP4ACPyjhylb2olE08XCqxfU1aTM/FyirNRb5AiWBUP02fsMi5KkVV7xWjxw?= =?utf-8?q?7ewdzuG+nYhgR4/nBP6W/glRB3KVCf9uvVqn8+Wi+ayeJMsbclpBURysOcHN8zp9p?= =?utf-8?q?JHS375034UXIVe1212dnHp/IadRS9s6hNhW7+kzAOtvI3/c12wMasxhdgNTmCOYDn?= =?utf-8?q?TPKnkecMSS6ap1s+le3GRabcaZTwSWtgbEwTlCKT4/3W1gzAn1Syxmdt+W5a5bXPp?= =?utf-8?q?JrpRb7vPSxEilqMHV6E8Nyu/6V4d6Bjv9DKfcOcKtmerzXtv1ClmqBewxLwXnBaTs?= =?utf-8?q?eUxARnNaMJUCST7oI7HuwiiPke7DlamYDlJ0QQuZPBAGZCwJiKUSKDXfcoffSTpNX?= =?utf-8?q?aR50ZaXjXOBROp/iQooxfyMSrB0SVB5wPfJXKtbYzK+1J/0lRFx3a/h+S02ENsgDx?= =?utf-8?q?clEmM94tutL2r0dke/oZ5O8Hdx1VoKWyrazsr/YS/4oXXWxS5Hg1f4lMNgeA8WACw?= =?utf-8?q?79CKlc/1DKAo9qTCYLlq/qijTB9n8evPHEMJEpcHYygvseIaO+RQsHRLPdY1xGF54?= =?utf-8?q?3wKNBVLcG0CV2fNddqYVHChfL6QeYsOmCjNxlUWhK37cNYxba/CjrU1E=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?W21XQsJ7u9S0lVaiEmSlr3GfH99r?= =?utf-8?q?2Pm7srFbRFbihP02AAQPb92D8H16UoCjh8c6AQEpi8Sb5U00PvC4abnHR2Iv2n4ne?= =?utf-8?q?b2ZUsfqNw3WZAN8NMhX1UtjZEbFbMJT1qBnVDduuJ0Vhl/t2NsN07Kmi5SovtPvEe?= =?utf-8?q?ekZD1jHfBbirzDzvLiRSy5G8H6cTEMapOx5qSZWbcb8cxbgT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dC/VO4plGN1Xfk/GMNcokH?= =?utf-8?q?wrF6i7G3SqFYF43QRyepQDdoXUORHnQ92YJW6TjrosmkLod/t4Qk4kN/mtBdsXlG8?= =?utf-8?q?dwgK6kKRH/4FDJTCY8MNqfuTo66rAlYOly4wAg6CX4+Rw5NtbApfpUHVWAIGAiT7V?= =?utf-8?q?FABmkUCcv+kHD1t/NsLyy8crC05fpLl07t/hXmeWeO3l2Lcrc4rHbhWcfOPmbZrQp?= =?utf-8?q?6uY+W3AugWFh/wTve4yEnpNlpbb+GlH4MNiYmACeQslNeF1MAMrQoSLXUAaQutDpT?= =?utf-8?q?FL5Mcl+vNrzfeFwpkY99WUOsJXLIfX+rrCDSTwuKsrtvDcDLXXm0L60E3HAzCpzfV?= =?utf-8?q?j4O7rXNkGi8w/NdlzGYHIHl62dqowHBxePm+cNd5LLtis+4Eu5uVImydtITPkRoLA?= =?utf-8?q?PeY6jU3dtNBvrBVrrlguTitbPthtFanB4VGszjHGj9GrbEHC9b/HD1k3kMLXGj5qi?= =?utf-8?q?pXwpWV3q9WNf?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 909a55cd-ab9d-4a02-24bf-08dc67401aa8 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:20.3393 (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: 3LU/VB2lQg7PEOF2bu9tNZcn1aqduLxuHDQ4yfqbI1taoHgWRAHqYVPW3KWQxn/ViTKe151IOsbwk197jtmlyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 From: Peng Fan Add pinctrl-scmi.h to include the function prototype and 'struct scmi_pinctrl' to export pinctrl_scmi_get_pins, so other drivers could use it. Signed-off-by: Peng Fan --- drivers/pinctrl/pinctrl-scmi.c | 17 +++-------------- drivers/pinctrl/pinctrl-scmi.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 682ff595c3c7..360b813072df 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -21,6 +21,7 @@ #include #include +#include "pinctrl-scmi.h" #include "pinctrl-utils.h" #include "core.h" #include "pinconf.h" @@ -30,18 +31,6 @@ /* Define num configs, if not large than 4 use stack, else use kcalloc() */ #define SCMI_NUM_CONFIGS 4 -struct scmi_pinctrl { - struct device *dev; - struct scmi_protocol_handle *ph; - struct pinctrl_dev *pctldev; - struct pinctrl_desc pctl_desc; - struct pinfunction *functions; - 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); @@ -468,8 +457,7 @@ static const struct pinconf_ops pinctrl_scmi_pinconf_ops = { .pin_config_config_dbg_show = pinconf_generic_dump_config, }; -static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, - struct pinctrl_desc *desc) +int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc) { struct pinctrl_pin_desc *pins; unsigned int npins; @@ -502,6 +490,7 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, return 0; } +EXPORT_SYMBOL(pinctrl_scmi_get_pins); static int scmi_pinctrl_probe(struct scmi_device *sdev) { diff --git a/drivers/pinctrl/pinctrl-scmi.h b/drivers/pinctrl/pinctrl-scmi.h new file mode 100644 index 000000000000..ae9e0be7c89e --- /dev/null +++ b/drivers/pinctrl/pinctrl-scmi.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DRIVERS_PINCTRL_SCMI_H +#define __DRIVERS_PINCTRL_SCMI_H + +#include +#include +#include + +#include "core.h" + +struct scmi_pinctrl { + struct device *dev; + struct scmi_protocol_handle *ph; + struct pinctrl_dev *pctldev; + struct pinctrl_desc pctl_desc; + struct pinfunction *functions; + unsigned int nr_functions; + struct pinctrl_pin_desc *pins; + unsigned int nr_pins; + const struct scmi_pinctrl_proto_ops *ops; +}; + +int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc); + +#endif /* __DRIVERS_PINCTRL_SCMI_H */