From patchwork Fri Apr 12 00:29:27 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: 13626674 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2045.outbound.protection.outlook.com [40.107.15.45]) (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 23B8FDF58 for ; Fri, 12 Apr 2024 00:21:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.15.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712881302; cv=fail; b=LTT076FyfV839TchU/TW6dPALG9fnLz8AgG+Bo8yrc318yfLUs+3gBHKlEhAPVcfVr/3ltwJIcAwF0Rtt+1jHm7XOsMvq/8XB5pHM2ifFVajpfkskQBsmCEwo2d2f5B/vIobjQMLxm1NHkgiudAkq56uajTxJp86UDXZnizSgKU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712881302; c=relaxed/simple; bh=sTbjkh5a4aL+MAQ/wjB1CKkR1t4PZQRgc81I9MVcnXg=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=LJ/i6ouGNh+mU/JZgTu4oq4hFrLq6hlVwuc/E0EpeZXmJ7sZGS6Z2hIOmZcoukaicztZRxaDJ9/DcMXxqY7zl+3TMBk7lv2jw165h2tAd3lzCMfJd9AA7v48FGGvey4aOyoWGkRDEqiZYd2/IM1wj8fRpJKkASzJW0zQqbcGgLQ= 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=J9QDXMGX; arc=fail smtp.client-ip=40.107.15.45 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="J9QDXMGX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PC7/mTKekyxxnYc/zoJLoq+EVI2X5xf9RXQMEaURp1JfQv/1WgPM55Mmn9EJvm0oh2E6OvU3m4zfXAMv5yppxVEsb2PQS0MhyAQES1dYpFtqOFpgYkYZBKg54hmEIR+H/dY42Rsp86Bwa8VN8QGNaxljjUs2/+Qi3Guopqxa3Thh2F31M9c2gO3QhZJN0duhS8+AzAtP7iZyHCCa299SDNSwIH8NKOvt8UeqE1AvzQ5aw6RCp4/rgpz+UPsVY0qAY44R9MGeEbU6ffFOcTCmZ2Dc4oq4Ialn/Tpv06+7pAv8vX0WPRaGlqnMY7zKijqb7Xot/gNHSaa2aKNXVDy7Ug== 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=IXgMZQkn8/FX0xym20E8GQT5ndZobjEeQMFpgLdI5/0=; b=eDZHXTa9jAj46uaaXofmPX+OLCLwETh/VT2cRvgJ2Hy6p026yzSDyxBdJjrFchn9wELUWJeugkBx9sXrgQZHWGz3KlcapnrOFIusQ2WvjsTqDIdReNpHseonIZDdED9YMDLCYZ9pmlaz5wDtsC8DaNMhIxMmUxh7Ksd+w6wCp/DymOvxBHvE3ImWewhDlFhZCHm1oUav0wZeGrpKmOkvimEiS0Fl5qtIK890OzN8/UIv5f5rveBrxseY+J0dSHII0fUp3PWsICrhjbYIo+04h20+gQTZCd+0JPeLebydWesDSAwtICDtcTPtvD8wyvQKxbYELKOSVOAptwqJ+DVMzg== 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=IXgMZQkn8/FX0xym20E8GQT5ndZobjEeQMFpgLdI5/0=; b=J9QDXMGXfCIqnRnu2hgt4upxNnKISZmgx9UWMNpi1wHjsZGOCqCmwhGBEWMVrLMzhoCrisi36pytTA8UZpg5PAuxMQo4wNb5Mh4QAkJqLRsp71A//UfZtcSGFaqdi+rl0AXLcKKpT7JMKkVy7NAvWeZKp+/gYjmA44zpNVDJz2k= 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 AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Fri, 12 Apr 2024 00:21:37 +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.7386.037; Fri, 12 Apr 2024 00:21:37 +0000 From: "Peng Fan (OSS)" Date: Fri, 12 Apr 2024 08:29:27 +0800 Subject: [PATCH 3/3] pinctrl: scmi: support i.MX OEM pin configuration type Message-Id: <20240412-pinctrl-scmi-oem-v1-v1-3-704f242544c1@nxp.com> References: <20240412-pinctrl-scmi-oem-v1-v1-0-704f242544c1@nxp.com> In-Reply-To: <20240412-pinctrl-scmi-oem-v1-v1-0-704f242544c1@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=1712881775; l=2796; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=Tzl0BI+t0SHnhwCwshMQRPsrD5//1fkJuvy5P2j38Qw=; b=U8QZ0gz5dmnXOpcBoRMlG0SqXZMbJHlRQrzOm3IdqicR2+AGnAGWKcEeKxfieDMDY6jm5+nZe lLpidbGXt0EC+z2xoV54NEIm/H9Ev9zJ5P+PPm67iG1t/I+1Xg+Sqap X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: bce5f7d8-d249-466b-1a81-08dc5a868465 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: 4kvyoMR6JtEaeCcNw43N4gTq24QTR21nFWNnSwcFR2Bp5WVcHkqO8fv6jk5NyYii3gpcT6OFSc04l7/Z/Gw66Jukw4Owg75Zy7UqS0R67GGcRAwPLfm5/K4r+/Uygp5Es9x72+e7J66dfob6OFC4XEAJhCNQriEHlpg1hxBq4LtXXA/ykQfQYLj8IVXys8UDECGjIfVSl3VTyfyvTB8e6sBWAdJvkXarqZT9oR3NXBLRg08kisY+qcUWn1GPaigHBuzU/IZDDwwRzUEwfjVi/LEEffDbf1NQ1n4rY5DEuqNQsv7LJkpViwcuiWvmxkGXPst2PfvlxERiYObyUJ72JfmtzXLqVBxHtpPKSwFuPT/ZQd5PsOW8LJYb5fGAVMj0rSmvdQc+Ae2TJZ10gxHQNcX/YurLOeb+/uXd+TtzfeSOhNMH9Lz27JUUHmpqxF4kamoE98ENQqwOdcM1Q1rm2cKg19oULi7HednkaNTY5F9GlG8thmaaREgxYeyBG1uPABY60W2uNq40VSRSQvqTJHNwy/Kx4CCXXDVl9MMUIhjgsFJEsqdJetONtLUQDWwFAvOQ9MYIJk6GpHk0Mt3ToJKNaiagxVCMbDj+NcG/5INzjjN53VE5TZZhnCM6Enl7tyx03vlkkbItQyGunahkUrmOuL7JrAt8UWk+IMtVJmK4X+UuvtNM28fsDbp6uqbemhxNbFOqBIflIUGfcBkkkaPW+R85jv4KaTmx+f66qLw= 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)(366007)(1800799015)(52116005)(7416005)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kdyfqL0NRcW+DxHpj9xqEgPdq1rW?= =?utf-8?q?U7kae/86VaWMvU0ev/3Wd+Dx8tjfP3AtiRf7LdDI30BvKh1Udi3Se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Mus5t?= =?utf-8?q?SNIqzl5TJTGU/8+CFxYyJr6xKM/sc0slQqCKt+Asc1uAKElrCX5SXKF0cFt8p5zEq?= =?utf-8?q?njK9rzPl7MWTsh2XTuYl1Ut7ou+gLxZLoBTplGKB+YfrmJWnUnS86CmrXW4kN2/op?= =?utf-8?q?oq6mNdNlgg5EukIqlvr6uQpBig/2SEv0bWCNryc4HXhHsSOyV9o6kq1dIL/TNfPH3?= =?utf-8?q?VT5iEORlxPOKYH2M1GyB2tfpmc1F5h5aMuZRiy/kJ+3R/U/UxvqsmR65YCjTycJnc?= =?utf-8?q?44hZjvA2z4BQCnw8FYW+kRfzYbuGipsPBEw8o7m6RPBR2jEN+R17y3fzz5Vg10r52?= =?utf-8?q?Jbxcv9cD7TjZNXpXKP35oE1grh3M6w2dJ7h0BYc2vJQE+xQUif8csMMgPX8cLkgP2?= =?utf-8?q?Lo6f/kpPWJkwyXMoXRVW3TKTeEk1u+/5pOKdDhraXPJW8/P44xdY77LOjDTCwk6+Z?= =?utf-8?q?563flGuWi9QumBohFuY0w3nPTLIhZA0zT8UW5BoaaQ9VpAKhKwX8QfZVW9CJjNI9m?= =?utf-8?q?uMWCmiBjj31qUjSOfKnPC4/2De3ojWJmq0mefl0cA4c8NcS2gfiuGgwiixZYbonrU?= =?utf-8?q?ZUIAVcr7Wfhf?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bce5f7d8-d249-466b-1a81-08dc5a868465 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 00:21:37.4007 (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: keGm/0zTyPPysGP2SYw5Je4wbwNkoPPi/UNipdYfBBAwlmw0/fellq0R1SV04sH672b704XndmEjMg8iiGRCpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 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 0f55f000a679..97c3d9d4634b 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -20,6 +20,7 @@ #include #include +#include "pinctrl-scmi.h" #include "pinctrl-utils.h" #include "core.h" #include "pinconf.h" @@ -462,6 +463,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) { @@ -526,6 +544,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 */