From patchwork Thu Apr 18 02:53:18 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: 790007 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) (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 706DB537FC; Thu, 18 Apr 2024 02:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713408331; cv=fail; b=f7HG1Aq7vm9yML5sORymoAw5S8k9iJOyv+lUdnvU2IN3/+cdNWbWnBKPYsFYkMXcvRJ/2vOp5rNMskJEuvuAfwKPQunwjptY3J29TcuBBAuEm07oFGy26FKcFC4SmSyWlmAw4GZpGxQlK5cNCPtfGYA2dJaTHAQADH7i9ZyDi3o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713408331; c=relaxed/simple; bh=Gk4hU2r+iaIIfBmi9wqN/jM0lkrvMeT46nOOAxus8Z8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Tojb3/TtAxdtJgIBTyhm2PVnKo+l1kwB39oNLYdKpkb8EW7ukN0lM4bvgGGhCgrwYmOcpxsEHOH+8v+pkHjBFTdDmDXbVbyfKTdj0OhMZESBVVOPS+Numa6/yf+oIW+pei7FXYrL52i9IjW9jQXveXrqS4gO0ja4o/SNG3k5AYQ= 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=GDNujn8/; arc=fail smtp.client-ip=40.107.22.55 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="GDNujn8/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUcYmNe86cMQ2rtOvc+/XC8tLwX/u3WuQpIW8Xk7xkIaiAWsqU4sBYEDC76l8xNHfDvZJYKi9LJ/jDEaNqrJ/6CX3+34xmP43J57rItmq9lpEuhOSgfX5wLbPFrvgnEI54tqCx/3useFWlgarOfCUC0DUlbYP6hoZh1TsjESqQp/nngfSh8KFMB9VjyL+yYZOJKj5Gfg0qQkSnMW+kz0Cu9A0GzS19ZvDd4Xgirn9r/49GZ8NFoVBurjHmk3Eex3y5V746J2YuV9ZKzxVnQ5WqlduURQFuViPuZMqpJf3qH5rKsSa1XWCzCUXll7u7t7lU50RlJPhuenZlHbcilirQ== 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=NS1364QTWuqHKoS3BSH6dxCAfRcqyGmb5slDWU3QQDs=; b=Azy7O/oMUXZ+9C4/HfKYI5uJIwzvojiO92alKMDPfPigJdFnnrE+ml2aPF1+PjPWF2sODj+1HGRChZOHUsAVwamc7exKFtlCFH4SLn6n84bCiXdxenRkd655IKX5lhZ2S1JFN4DIFiWlgtxrjD42/NbnMXXi4tkW1K5R83ciRBgf09Qji+UWJ95hMCK3atDwpjIqku1kL68tcAaQjA/R9NjMuP8Xv9lzEsBHJb5SQuGNQOdHnIaFteIBHDsuVCDf9APMhYQq/sNvjE4ZTU6IbRwbKNzb1uQ9PPXHBJifIJBL+aOOgQAY6fc5165XrGAq9JIjowhC6sIeku1kTpp/jQ== 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=NS1364QTWuqHKoS3BSH6dxCAfRcqyGmb5slDWU3QQDs=; b=GDNujn8/AtTm9yXVH6I0O/9w4114vTuIhxG9rX8pJt/n3vEsAFr6EkabATCRfsk1B9zKtdVkwXe9kgjPbUJOLwggTlfrCuMJVGW8U2PlPPo8Z9D2iYyVp24lwPcxsgQ8UAFgcmHRVOmrUPwZy6T3vRZZJoDsz/kO8Xth0OL7jFg= 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 DU4PR04MB10401.eurprd04.prod.outlook.com (2603:10a6:10:55e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.37; Thu, 18 Apr 2024 02:45:26 +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.7452.049; Thu, 18 Apr 2024 02:45:26 +0000 From: "Peng Fan (OSS)" Date: Thu, 18 Apr 2024 10:53:18 +0800 Subject: [PATCH v2 2/2] pinctrl: scmi: support i.MX OEM pin configuration type Message-Id: <20240418-pinctrl-scmi-oem-v1-v2-2-3a555a3c58c3@nxp.com> References: <20240418-pinctrl-scmi-oem-v1-v2-0-3a555a3c58c3@nxp.com> In-Reply-To: <20240418-pinctrl-scmi-oem-v1-v2-0-3a555a3c58c3@nxp.com> To: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Peng Fan , Sudeep Holla , Cristian Marussi Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713408808; l=2796; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=zPpDa/61WB4JTsNH+KhyU/5a0m6RG00gkpxSuVKB/Qs=; b=XjNoNjaAaQ6U4pEzMhv/6Trs/JpRlXS2TEntq24sbVtXi+my5O1vvelWeu5ixiym/Aj3lRHkI ITJMMwyOYWZDFrtmJAkLmnPqNg+yDvCyG7C9TevQfyl+V5ic34Qj3c3 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR01CA0020.apcprd01.prod.exchangelabs.com (2603:1096:4:192::6) 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_|DU4PR04MB10401:EE_ X-MS-Office365-Filtering-Correlation-Id: 916dbc2c-4eb7-459f-5f6e-08dc5f519a52 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: vuINNb9gdi9BoHN8PCXpjB5vLlwbe7HYijRJP47t3gImjt+PLOhNAaI+nM0U1LirNSBgzebCxDitSlTWzwLV95HpcucTYcU3NrXk9TvxR7sosRpiyfTA84uN1wYPbAHpHpEHYc8bLRYS1oIiuUwODxSrDKDQaOSQNpqQnWxk8BtPNnuBPp4tPGz4FgIbgpNg9gnS/90L4jjrcyZxx4C2ltZzaNcJAXGuphzBXJRL16WjQw+0IP/mYDfIcYK9I55+EjbEno0P/1k1aQRpjYUGQqFtWUbzd5Tu1BC7Z4vA9d2kPaDCvfIVnoXGCdt9PK0ZNF6EJMDuSOejwOV+kvTlIXTUpvfCtO4PQ1AYQfrrCFF9qHaqsjLusCvzq8fRYIuJnmV9nODpuadHSpqd/odose2208vBTyfKkfNg8Q1MCd/VzUh80u8gHi9kx3v3wPW88ikohpVCoug8fbnXx9Y+0fPJWJm2qaLsBuapG5XLl3ryantS41ZClPdBKuScyHLhfwSG7DmWYaZemshztWzmvnLx2ERkDzpUSn0msUH3OVdPZz152xTJNXwJvE3e6FThPOpHKedontF6Y2SKJHK0m7V5E4lAbKKV7xIZ8SOsbn/vrPtgoXih3pDeUaO/ehIC0CuJTAZKXByzeTcgoFDBT1yMQqQZ8sAA7k3jJ99mx9iwCKtnlYqusWyiSuIHm5Z7UZqg2VO/yESiCR3/iONz4KDtkjnXl10lIH5M2YJMLCU= 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)(7416005)(52116005)(376005)(366007)(921011)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Hr3y+Z5Uc1lgPRBCIWxa6e7GrvHB?= =?utf-8?q?11TlOofOb6eGIgUfh53EzMsZxH9q+mLu+P6SAo+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KYMfjHK?= =?utf-8?q?SNEYI1MBGEIGScSlDpE+ufxXPf+eEe+cZvzmMDmjuiRc5eVRD8r1eUQTEI4FlhTfH?= =?utf-8?q?O92lKD2BLYrsezlYwsQHeyjsojXNQLdIcNZGvkAkFalamsTC6z7y/PWngTg7DyCFr?= =?utf-8?q?Yhq/AOZOsrxIwFwWuJpG8oV9K6pkwpHOHVoNz/NSZdFjE+ck5b2FXF5ETedqru0W4?= =?utf-8?q?8WSTB0iTP7HHmCQJ8nznvbFSts/cTKj+RDoAbP+tBsWgUIMApnPOonndwtKjxhDyp?= =?utf-8?q?UCsV/vjh67yZO7IUtxcs4HcMCglL8jrsLRAbphJnHrVj+bGanqgrw0CDaqYif8fo1?= =?utf-8?q?lCPGo0G9BmfWTbaMCS0712+eb/Te6FYhufmoYm7anCzj8oungAa2c0Nlsy09QYWm2?= =?utf-8?q?9QgkYt0bc4WQmWhLPvwhtk+i7rjDaGHbyfbByCCJAGYHui8fIr9hAe4yezHYFyBZT?= =?utf-8?q?VPQtcOFUxdYG31V9oegLoRJ3tR8YRLCElGfOg9vRZfYgxbQyTYWTyBZ9Jho7et1kc?= =?utf-8?q?ZTh6vrDS58QDXh7cdJFJfWCa5+DGAzlttdXZnmsU/b4S7mLDrC1M68sjR3Chc7dpC?= =?utf-8?q?KZSta6P/VMQl?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 916dbc2c-4eb7-459f-5f6e-08dc5f519a52 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2024 02:45:26.6623 (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: 9s/W9yB1s7WOJaRd9ViX5EpbCGJAI2um5p6twNmTU34MjscQXisdkecEYY3ii7iyDPRJRtj/RpN0UdmLte9PFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10401 From: Peng Fan i.MX95 System Manager FW supports SCMI PINCTRL protocol, but uses OEM Pin Configuration type, so extend the driver to support custom params. Signed-off-by: Peng Fan --- drivers/pinctrl/pinctrl-scmi.c | 23 +++++++++++++++++++++++ drivers/pinctrl/pinctrl-scmi.h | 15 +++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 036bc1e3fc6c..d051fea0dbf5 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" @@ -469,6 +470,23 @@ static const struct pinconf_ops pinctrl_scmi_pinconf_ops = { .pin_config_config_dbg_show = pinconf_generic_dump_config, }; +static const struct pinconf_generic_params pinctrl_scmi_oem_dt_params[] = { + {"nxp,func-id", IMX_SCMI_PIN_MUX, -1}, + {"nxp,daisy-id", IMX_SCMI_PIN_DAISY_ID, -1}, + {"nxp,daisy-conf", IMX_SCMI_PIN_DAISY_CFG, -1}, + {"nxp,pin-conf", IMX_SCMI_PIN_CONF, -1}, +}; + +#ifdef CONFIG_DEBUG_FS +static const +struct pin_config_item pinctrl_scmi_oem_conf_items[ARRAY_SIZE(pinctrl_scmi_oem_dt_params)] = { + PCONFDUMP(IMX_SCMI_PIN_MUX, "FUNC-ID", NULL, true), + PCONFDUMP(IMX_SCMI_PIN_DAISY_ID, "DAISY-ID", NULL, true), + PCONFDUMP(IMX_SCMI_PIN_DAISY_CFG, "DAISY-CFG", NULL, true), + PCONFDUMP(IMX_SCMI_PIN_CONF, "PIN-CONF", NULL, true), +}; +#endif + static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc) { @@ -533,6 +551,11 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) pmx->pctl_desc.pctlops = &pinctrl_scmi_pinctrl_ops; pmx->pctl_desc.pmxops = &pinctrl_scmi_pinmux_ops; pmx->pctl_desc.confops = &pinctrl_scmi_pinconf_ops; + pmx->pctl_desc.custom_params = pinctrl_scmi_oem_dt_params; + pmx->pctl_desc.num_custom_params = ARRAY_SIZE(pinctrl_scmi_oem_dt_params); +#ifdef CONFIG_DEBUG_FS + pmx->pctl_desc.custom_conf_items = pinctrl_scmi_oem_conf_items; +#endif ret = pinctrl_scmi_get_pins(pmx, &pmx->pctl_desc); if (ret) diff --git a/drivers/pinctrl/pinctrl-scmi.h b/drivers/pinctrl/pinctrl-scmi.h new file mode 100644 index 000000000000..fcc61bc19c98 --- /dev/null +++ b/drivers/pinctrl/pinctrl-scmi.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DRIVERS_PINCTRL_SCMI_H +#define __DRIVERS_PINCTRL_SCMI_H + +/* OEM VENDOR Pin Configuration Type */ +#define IMX_SCMI_PIN_MUX 192 +#define IMX_SCMI_PIN_CONF 193 +#define IMX_SCMI_PIN_DAISY_ID 194 +#define IMX_SCMI_PIN_DAISY_CFG 195 + +#endif /* __DRIVERS_PINCTRL_SCMI_H */