From patchwork Tue May 21 06:25:57 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: 1937220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-NXP1-onmicrosoft-com header.b=ItDc4xAR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-gpio+bounces-6492-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vk43c2qsSz20KF for ; Tue, 21 May 2024 16:17:32 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 906C11F21D60 for ; Tue, 21 May 2024 06:17:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E55214776E; Tue, 21 May 2024 06:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="ItDc4xAR" X-Original-To: linux-gpio@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) (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 AAB084654D; Tue, 21 May 2024 06:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272233; cv=fail; b=DKRdMeR2gA7CDNCjjI5/UTnD8g+yH8FjL82yCjjaWF4mgtcFvTDw/FZaDR6+CNFBHLrExsD93x01f6j2gWDpQyGj/1Z5VYlRNBpFghib4JDXSq/QCkG5EMvNpOZvwvT99DAoN0l6V56OHSv3Fqq9u7zfXd2ealskTxRv0f0plg0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272233; c=relaxed/simple; bh=kUDyfShYF7JrZDUmxwzTe1qPj5uz10mA2YNteMnGVgU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ox84uCE8wGopGzvR4yj4DWadqRR+C4LpGRzlhY4lZPFg18MKJzKraT1jX99QzHevirVmDYWwYdBIFwaW+TPUq+9gwCWfzMhxpz9IAlEeusdoz7kKNCeq5sKXHTkgMCvyfnNSbObpfAmU3rdA2ZFkE6OZFKY/VQbrxXeHMQt0QNw= 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=ItDc4xAR; arc=fail smtp.client-ip=40.107.22.40 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YP7FG3b3Int0usDXZ+yEm6G6m92ZKsqfDpweiWHwMFAx32vZ85Ux0p6VR+TLfvPLp5xBXlHdCbFNfyQNRGKk8pbRidqwB9if0NALrHpzbTmOy34/kT0bWPWzdF22oWszQoRHo4bHE7lM2suI93IqjBCp1269zokpsGtRBuItbNFFNVmfRYE2bZzJe0GMY4CIgT0bqTapiRrUqyCitdgiEzw4gJwO+h4vC1XqzQU5AqShl84l0iCgTB+UklUUm2C7hUi3RInRw24Xcs3OeV8NWYESj0qNQls2k6NNZlcI7Q45ASQjrLEXfCmAToHirsKyykCFg6GtQ+aiHpE4zbhGEg== 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=MpXBiIgbYCAtKoFhcnbORe050Lv/JcH44XQ+lBbuE8k=; b=U+5WzpMqEeuMYp2NSIKyxsEbZ497MNTEqkSWXYjQXq5Di5ewTHA7ydJsR0q5bO9XFwIT93AyTBPOrfYRWBHQQt7CkkyproddgLBxOFKZUJ2U4BxJ6/x8bwcRK+WthWq/rOopFkOwZMIK6rxMjtSAb30M41zm+x0fMa8O4t1BrbO4pSTguXPGLK1MjxIHkwDakReREZlI350AXat5Yrd3AljgtSUKuDLQpCqne9rJhso8KQBWniTutrA8BabdjJCX9yRBPYZ+4FczGKxkAKYmd4736FL1L6BAoB7Dr6gy+DMoK1Smn/Tun2cad1xLLKTTo41ARu5e4s94e9MTSk2Hwg== 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=MpXBiIgbYCAtKoFhcnbORe050Lv/JcH44XQ+lBbuE8k=; b=ItDc4xARlShgDMALGaMrDWAdQm6XEM9eHmThMH2e03Sc18smlY/ehfpBK+9wNoVulBs+CfUyUHsIpJft1YotqGurms0zLhobvLsBv0/SW4hmoRa9p0J68dFnP/MC/3E9rVovrdERuOG46LXu9RJzuPodHuh8J8TuuqvpdN7K178= 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 GVXPR04MB10705.eurprd04.prod.outlook.com (2603:10a6:150:223::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 06:17:08 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c%6]) with mapi id 15.20.7587.035; Tue, 21 May 2024 06:17:08 +0000 From: "Peng Fan (OSS)" Date: Tue, 21 May 2024 14:25:57 +0800 Subject: [PATCH 1/3] dt-bindings: firmware: arm,scmi: Add properties for i.MX95 Pinctrl OEM extensions Message-Id: <20240521-pinctrl-scmi-imx95-v1-1-9a1175d735fd@nxp.com> References: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@nxp.com> In-Reply-To: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@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=1716272771; l=3521; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=4NBdBZb+JxQbTSMhFLS6V2WIVMWWZosI0xnylrS5Bzc=; b=GrnP8BNxanU4hAKt8btQRr5rEaMDHu/6804ktSa4QBb0nc5C2UA2BfumGLOMGinmQsE9qvn1L I+uPTui6NN6Da2rl5Wxs6DtjS8lLARBRQPL0DemfesmsCwu5kxEhLKr X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR01CA0157.apcprd01.prod.exchangelabs.com (2603:1096:4:28::13) 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_|GVXPR04MB10705:EE_ X-MS-Office365-Filtering-Correlation-Id: 745f14f9-9f82-44f3-7893-08dc795da4df 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|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?RK/JWcBY2hlEj/tuo+FxgCpveZS+ffu?= =?utf-8?q?qeJX5W/pGikHIJL2XTuzxxWRPtf2EOLPlhyZuS2S+FMOJWQ18atQ4hYWmC0aJa5Y4?= =?utf-8?q?Hfn5jg4K8yln2UkPIozxI/KAoKpsyj8B3iXIEqeO/RbmW4Ft43kXzyPdYgB09rQ5v?= =?utf-8?q?6dnOm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Gqplp24sa6hdULp16fkJngmcihMrCq/Mxrilm30nheSMa6RjqDgeOUsmg?= =?utf-8?q?a0/FHT+hrT1zokPqs/iyA9u4kWOJLwnN/jbBVbybwylOefwG9X0auMMZLqkWbAMbG?= =?utf-8?q?ODHqMIDKTvSspw/QQd+XnnV3273A3w/Brz0qrEq/CPsT78D+4gxsroL3uByjZGEm1?= =?utf-8?q?8gBK9Q65KMFp0XZJKnkZ6lgHi2GX84T1CeBLxzGhrJdQ1iccNOLODsDpw=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)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5QVDQZu8aNw6jdbpMEbHJkutl6V1?= =?utf-8?q?UzN3RtGC+pOpIC0bh2QxtfhcIhjBsgBhbYGgr6UT8oA6dW7pqH2hU8mROVBPLvIwa?= =?utf-8?q?61RCpkxy/5DyHmM4frElJ4aiy59fQuVQXuvPiuKoYrt3TpIPmt2nXyo0v3eb5sqh5?= =?utf-8?q?kg+W3DGSjzQkOy1v9A02KdRB3JtoZG5TIN6YlxH9dT65tOKd46v1IbnKIdDviwRbl?= =?utf-8?q?ipDh6MtW9mi/clw6y2LxZEXlLNcx5aRrfoMCr9mDR/HD/mOnzJzdX25ukw9e/Q7Tq?= =?utf-8?q?n0atQ2cGn4n7yLcJMnEyG4fR6ykhzaItOL0fqvYFsfQIc8WXDwhOpeaYtn5fye49c?= =?utf-8?q?pP/ZJMKX0VMR2lLZVVBAMlfsY+CItcXZ45O6M6AO2HjzPTQa5klHAnjikcNpzoFPY?= =?utf-8?q?PFf5DDQ7XDpyIISsHErGWtTWqRq5+qLZKwZ8+ZNe5u7jzGqWp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8?q?Q+tzYpJVEtjD6YFkapgsooWbyiI+o81/O3AjKJ9JCTBl6J2ArlVAoppUBBIk0dCii?= =?utf-8?q?R6LAS9igzBWmi8Jij4P9AZnAG2f+E37aLepdwLk+9s6XAs85N1pCI9jjvx2X5XdTm?= =?utf-8?q?8ICsioikA6Ljx7bWbNplJEMsE1rtsNzmEXsix4C7JfvrcCjGZ+0ud6RzBGiNX/3zK?= =?utf-8?q?dtIjMV73mHFp?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 745f14f9-9f82-44f3-7893-08dc795da4df X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 06:17:08.6297 (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: quMTld/tXhScsPICEJDsNp5SME8hxm5iOezp66f9Yw8+cmCL7SZRwjAWNojccWTHAxyWfCfDyK904duTkV1KCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10705 From: Peng Fan i.MX95 Pinctrl is managed by System Control Management Interface(SCMI) firmware using OEM extensions. No functions, no groups are provided by the firmware. So add i.MX95 specific properties. To keep aligned with current i.MX pinctrl bindings, still use "fsl,pins" for i.MX95. Signed-off-by: Peng Fan Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/firmware/arm,scmi.yaml | 4 +- .../bindings/firmware/nxp,imx95-scmi-pinctrl.yaml | 53 ++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 7de2c29606e5..f7a48b1e9f62 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -251,7 +251,9 @@ properties: type: object allOf: - $ref: '#/$defs/protocol-node' - - $ref: /schemas/pinctrl/pinctrl.yaml + - anyOf: + - $ref: /schemas/pinctrl/pinctrl.yaml + - $ref: /schemas/firmware/nxp,imx95-scmi-pinctrl.yaml unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/firmware/nxp,imx95-scmi-pinctrl.yaml b/Documentation/devicetree/bindings/firmware/nxp,imx95-scmi-pinctrl.yaml new file mode 100644 index 000000000000..a96fc6cce502 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/nxp,imx95-scmi-pinctrl.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2024 NXP +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/nxp,imx95-scmi-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: i.MX System Control and Management Interface (SCMI) Pinctrl Protocol + +maintainers: + - Peng Fan + +allOf: + - $ref: /schemas/pinctrl/pinctrl.yaml + +patternProperties: + 'grp$': + type: object + description: + Pinctrl node's client devices use subnodes for desired pin configuration. + Client device subnodes use below standard properties. + + unevaluatedProperties: false + + properties: + fsl,pins: + description: + each entry consists of 6 integers and represents the mux and config + setting for one pin. The first 5 integers are specified using a PIN_FUNC_ID macro, which can + be found in . The last + integer CONFIG is the pad setting value like pull-up on this pin. + Please refer to i.MX95 Reference Manual for detailed CONFIG settings. + $ref: /schemas/types.yaml#/definitions/uint32-matrix + items: + items: + - description: | + "mux_reg" indicates the offset of mux register. + - description: | + "conf_reg" indicates the offset of pad configuration register. + - description: | + "input_reg" indicates the offset of select input register. + - description: | + "mux_val" indicates the mux value to be applied. + - description: | + "input_val" indicates the select input value to be applied. + - description: | + "pad_setting" indicates the pad configuration value to be applied. + + required: + - fsl,pins + +additionalProperties: true From patchwork Tue May 21 06:25:58 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: 1937222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-NXP1-onmicrosoft-com header.b=Zrp3rQJd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-gpio+bounces-6493-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vk43r0xpfz20KF for ; Tue, 21 May 2024 16:17:44 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AB05F282336 for ; Tue, 21 May 2024 06:17:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CF6E4595D; Tue, 21 May 2024 06:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="Zrp3rQJd" X-Original-To: linux-gpio@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2087.outbound.protection.outlook.com [40.107.22.87]) (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 90C43481CE; Tue, 21 May 2024 06:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272239; cv=fail; b=kKcqdlfEDK6e3BISztCf2CDhsFsrmVNPFnsFAxLBn8qUrwH7On0ezVIe9Gi0tpbEDNVM6CsgVavSeEm/Wx50sVO1/se2oZpsDcmOStWVFd2kbbrMwUR1IbsWA32POOOBNdiyyO/Lid1js6H4lfTcZbB89U4pjCGyuTqM/fE7rR0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272239; c=relaxed/simple; bh=6vI6esihawUEAsMpS5AmmUzpDZmYxlKj+KMmJXgWIqo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=pcHN4oYCkjuIRqPaDUIK6Tj7J9P/0W1ISu0c52PdiiCjcSJ7Hhj5f/chwUXM1pldoKY1gSekevQ1N+rSGtWkFX4C+2PFbj8VQl93ZxpQ+Pc308RhkxVkq82Dpb5RKg0j8UKy670AWHhfqLCs0ACtCWbjCII7QZ++a9sgslPIBUU= 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=Zrp3rQJd; arc=fail smtp.client-ip=40.107.22.87 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNbl3qJHGgtEsYaqbqzGlQ0den+yV06EBMO8PjxfKH3OagdGK5KH7pEiQEUvgXLCTFZhlnEDKPiNta2WkWba6QR67/YcNvF0Uw1MWGs0pKvj/4t2YlAFL6ncEOruTrR/rtPiKp2Xr/kw/SgzUD2ZBhVGAQwmGXgr8v7aXHfozk2cKO6jTNRiSiPh8eulTuXhAAZ5ORlE/v9zBeZkmvq3m2duetMfOtm5sGBnpeQBzjxB4Q1yBXL7zuMg3cSUfuoUGxhupGndsrK2lQczh/CtNejxUrHqUUbau5qv3rDLHughfmYbV+P3EHllIIoBx1dhHCuc2jO18ulLKIaoIuSG6A== 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=BSpuIAfuDc9u8B2QwCMoSNaXFE4wvMyesjB0lNEUwr0=; b=SUAbZHL7Atyga3h8kw0h35dPPc6fGZL06HAbacBT/4jc1UZiBBCJGujS2oj/O3rtCvR9AclRfby9mz9nQp0IsndIpTqssk8FmCjIt62Wd/UpSdBMJicGgRk0AiT2eL//yAvwceZJGnKqu1845hTQvVxQ64fXlZkzN8I/PyyZPeye05zTb/GExGG/iZQnInPdvktlBV67/rceLvzinVcwNsMjpX4S3SbOlKcbirIFF0RDDyrnXc6EbHgYuRWCMTLNVeKINJ0q3Blh+3rnUbWzfG3gu8Sm8Pad7V3BvtWERBngSrL5igrlSgARUAn+lJXTDQZJDHCPUe3WS4KHc03x+w== 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=BSpuIAfuDc9u8B2QwCMoSNaXFE4wvMyesjB0lNEUwr0=; b=Zrp3rQJdpkNnhh+OOqRo7gqjthVzWw1WwWizzKZKRFvb25m/nOfJP0FqndQvzy5K+yGxO5AT6NtUI1Lq+4zy464LCNJCV03evvO24EZX8c4CdpA6OLtHurgWoOVq4PVI87zMkaDz0yd2vM/TfYAl94nwSAzjGDTjGo/mkv34ZaE= 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 GVXPR04MB10705.eurprd04.prod.outlook.com (2603:10a6:150:223::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 06:17:14 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c%6]) with mapi id 15.20.7587.035; Tue, 21 May 2024 06:17:14 +0000 From: "Peng Fan (OSS)" Date: Tue, 21 May 2024 14:25:58 +0800 Subject: [PATCH 2/3] pinctrl: scmi: add blocklist Message-Id: <20240521-pinctrl-scmi-imx95-v1-2-9a1175d735fd@nxp.com> References: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@nxp.com> In-Reply-To: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@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=1716272771; l=1313; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=gKhGtuOf4rXyBBJYl1QLNqh0NrD/5voNP3TjnJqoeg4=; b=OsBq554hEU0Fke9Vk3d4Oqc9PBA/AOjXjq02YWJAVWTGD8f00W0ddkpJbSs8irlghBr7sjxQ/ z03ZhgcQHJMDVR/jXSC6UG2eQ35J3b7i2eA66uLKWNt7OPtEewAPTkV X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR01CA0157.apcprd01.prod.exchangelabs.com (2603:1096:4:28::13) 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_|GVXPR04MB10705:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a36c743-bf89-4aca-babe-08dc795da856 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|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VYeBflyiOm/kSraFJ+ALuigAWroP74g?= =?utf-8?q?t7qR8P+V9vhUYmT7W88xDO2nGKJdQrKh6aQXjqQklaYow7HqHjknIvD583O4xBKyU?= =?utf-8?q?uZeWzE/08l/Bf14s2PYM/1wdiQJ0YPf9MD4grxNkU64LTvpyXJ73dNg1+oRizs1Vb?= =?utf-8?q?GUz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Pn?= =?utf-8?q?mogukskpO79+TQQ94W+2jvFAwUVlz3L1Vr4mQgdN499dfolqc0Z9kGMRiwL7kKHz+?= =?utf-8?q?nGVmJ7x7MKCfA4lXLTDykyfwRpJOHkndzKmcYaUWZU98gfCkcVjJwLue/zAhoVUZ8?= =?utf-8?q?N1IdpTPF3Byp0lTPBNILjB6hIq+Zo9Oq21ASTLfxA1wGLuBQVcGHVzyRTxqd9vqjr?= =?utf-8?q?jNqAuKAJnTORXS1jFP8eMNOb+WvEZr97aHxzFVmF1HheM6jAy1Vbaw1p+ck9P6iz9?= =?utf-8?q?W1/Uzyo9YavQ6SFGF4FNvZnbS2mZNesl8cw=3D=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)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?B8MBW640xypqKuzZL1Q+AqNqOSAr?= =?utf-8?q?/wwrzPbDYP0+WzuBTd0LVldbKUiWSdxcrRXyedjePUaEfq91OozlPkLQ33BNtbWKr?= =?utf-8?q?XlTuTIyaX/5spZF7VkgeTdHnbcuLdVYD84L8bEn54SkhXva3C/XFnmAiAKvkav9Sq?= =?utf-8?q?0NUxc1Jthp5tQIFgW35bT28TxrZjD+ewtn7sBo56SNe2w68bZLDiSSH/LvOIGTyXa?= =?utf-8?q?e2mYaEu5Vm7BuN6wRAUoAOCsHze++DyR2tVRC2RPGFhh2jwlgIWtZ/obBXyyMmRxQ?= =?utf-8?q?Y8aRnrHZ+gZAY8fxzTPhl89A0iOFZp/iek6jJhURr4KnZQ3AN7Geup9kR8EGverrC?= =?utf-8?q?zqTqobikw9QGh40BFD7pAFY4lN9EvAFUdBpRoOp8Is0E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JSqgSKdfgtP2FHkezGrVh1G2Uc?= =?utf-8?q?hdjNsw/+CnUdfn3Rt2ykrs/wsAta3EWiuCc/RRXcBOf/l2BbwmKQYtVwrCGaE6A4V?= =?utf-8?q?DMQbrQVB/lBaFmqRKc+6JidYX+atFcCIt3EGIgWkMeMnEaoPycOfYYET+CdXHDbTa?= =?utf-8?q?VC8ws74LUKqCLLXeyg2CUBOFt5rMhsU9pHWjVtIvkqedgXv4Ou7RMgudDHdzVQl8+?= =?utf-8?q?dDL+yO/5iFE2DJCT03vJBLWc1DwCgFUMQ8qKPfPKCBDv4QzDyWcDjfGpQduFwEhIB?= =?utf-8?q?Mq9zlVaAhL/e?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a36c743-bf89-4aca-babe-08dc795da856 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 06:17:14.3738 (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: 6SYd9LaKeJ63Zi8Zt9wqtVyJFBcwNSX6ZE7ffchvwsp58NF4dlUAm95coNtLIalo56HnWfeV/At/JLx3BFM3sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10705 From: Peng Fan i.MX95 will have its own pinctrl scmi driver, so need block pinctrl-scmi driver for i.MX95, otherwise there will be two pinctrl devices for a single scmi protocol@19. Signed-off-by: Peng Fan Acked-by: Sudeep Holla --- drivers/pinctrl/pinctrl-scmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 036bc1e3fc6c..df4bbcd7d1d5 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -504,6 +505,11 @@ static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, return 0; } +static const char * const scmi_pinctrl_blocklist[] = { + "fsl,imx95", + NULL +}; + static int scmi_pinctrl_probe(struct scmi_device *sdev) { int ret; @@ -515,6 +521,9 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) if (!sdev->handle) return -EINVAL; + if (of_machine_compatible_match(scmi_pinctrl_blocklist)) + return -ENODEV; + handle = sdev->handle; pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph); From patchwork Tue May 21 06:25:59 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: 1937224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-NXP1-onmicrosoft-com header.b=Fm2o0gXy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-gpio+bounces-6494-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vk4483fF1z20dK for ; Tue, 21 May 2024 16:18:00 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1FD0B1C20D4D for ; Tue, 21 May 2024 06:17:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F9AE481CE; Tue, 21 May 2024 06:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="Fm2o0gXy" X-Original-To: linux-gpio@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) (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 937974D5BD; Tue, 21 May 2024 06:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272245; cv=fail; b=EwMVGiDxALyNhtqZpasQjT1hF13Y9wcPWsqx1sZhwkKSkQj3dwCe8gcKHMVY10/lvGi7nDvcrZcOZ937xY7A5X3jZsOBjQSBbHeJxltUYQF9bTiPS/ryLDjuE/pPaVj5+tek+qZqltSYXvJckVP0QLleAW55FSnqYlKru4huHsc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716272245; c=relaxed/simple; bh=E+f5BzOEob/3ydVV0uzsJAZ9sf/7UXgZ06CwIQ+z2B0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=A3NbJaGTY95JEt79zBFTkAQtFeA11QSHMBT0NvCEWtYa7oSI9A3zKV4nzjd2pgrl6/S6YyFcytVoVivELFok2L+eFaI7p+BuHIKdSZGVX4jON8L0RP5zK6D69FkXaCHSKlqzWLHATnhe72OG+fphhwoOxqKJs7HmxjjR2kzP8LI= 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=Fm2o0gXy; arc=fail smtp.client-ip=40.107.22.58 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xh0ACmYRykvUPveYwIJy09P/UufZBl/o2wB8wOw8Oc0TdXhE+6BXMnVpLPLVojl3DUaR8pFcD/IrASLCosu2ur0p5J8axJSZTZQtykVXPoj0qybN99008yFk8lkquILs/ZRnFxGKNiKST3diegeC9n14Bu2YVe99972tIgGlcQdfkovRU2oCLw5XvUzFZ+qcUc9Cu2m9nA3OFqXJlPcUw5m+DfsHviuNBMqx+LhAxxCUqRnw/ey0jBdtetzZ4Tf2s9NYarA33WB8JptiXyFgZHvF50jcphjBwBKmpwj8H2hVKh9OL+loxw2RJCe6/6Mw9QmwTNCCLQgkKeYgRA/r9g== 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=KmD0YFXDYJh6S05DmzfZsFHpX49Q7e8f8bFQm4qkEvE=; b=BQ0gKMpmLEZcs1f2z87p3Xy1kHMdC4NRTmWvVCNgCwdWxX9UpK4Y6cwaEb8rAtx3Aqy6DY7QeJIYrX/23IGNmsgi/SpkVyGgkNr3Jmxkjp3XRXr5bH8b8ediB8ax98GCCqYA6VgM4hddpJYwnBCjXGRvwmqLUrsODix9XmKaQaJ7NaO7nn8W2MyhgiArJzNbWaXyYghtCVG+Sqo1U3yaiPoFPZvv5HahK+yfPFVlcjleODgUV8koT/8DmmgmxVZh8ERDxqa5guiuhoIIH3G8hhCNO73zjSnMv4g2N6PvxNUQSLhO3/rRf4U1HsUYpQksUSirFTevlaFKD19OxMlH0Q== 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=KmD0YFXDYJh6S05DmzfZsFHpX49Q7e8f8bFQm4qkEvE=; b=Fm2o0gXyK3sf9VkLx4+deL8gdW8nGwMJlod5gHcNhVSMKVay/PNsKgdBG7TV0mtS83zroykf1y31YaPs1qg8eKHTcZkdYZnnlSkal5UkKkCF5sCLnZ1GMYNui81XnVA9r05qUmHqJvpkxh/PT+MOMb9o3ZFdo58bHzPWxH70M/g= 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 GVXPR04MB10705.eurprd04.prod.outlook.com (2603:10a6:150:223::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 06:17:20 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c%6]) with mapi id 15.20.7587.035; Tue, 21 May 2024 06:17:20 +0000 From: "Peng Fan (OSS)" Date: Tue, 21 May 2024 14:25:59 +0800 Subject: [PATCH 3/3] pinctrl: imx: support SCMI pinctrl protocol for i.MX95 Message-Id: <20240521-pinctrl-scmi-imx95-v1-3-9a1175d735fd@nxp.com> References: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@nxp.com> In-Reply-To: <20240521-pinctrl-scmi-imx95-v1-0-9a1175d735fd@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=1716272771; l=12502; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=l+00njiRg3DuMhS2ZjmxnpkN5gbVjq8Dvu96gz/WGts=; b=FvJBdBNtn/WV7NZIirZThYu9UIkMTNlIsrNwYM2bYxhjMrVwFZnH/XzNySq0LzbiJfktl3AlD +PQL1Kv+WChDlWzZaym9ZDd0KD/KwAv2cMtMvW+iWQUDAeJrbdNHXho X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR01CA0157.apcprd01.prod.exchangelabs.com (2603:1096:4:28::13) 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_|GVXPR04MB10705:EE_ X-MS-Office365-Filtering-Correlation-Id: fd5ef55a-528c-4836-77f9-08dc795dabd3 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|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?UOpdkJcUj8fBe9g+tIuesC1P96bKXLU?= =?utf-8?q?E2B1Qbgt5e4npeq/qzyoyDX6iEGy3Gw4OGJKNocNAb6VXub0YKyWy3BsRmGla2n9U?= =?utf-8?q?2il2CXNyHbX+Tn6UlzTTnDotCWBonDnTPEdcDEpQfldES0SWgLIbBqTNsOTdX/Lsy?= =?utf-8?q?pAAxZSkA8aFNGjqKs+FHb+k0Olp8teGEyHTZCAVxzflgThmgVqIGhe28L88V0mkxa?= =?utf-8?q?ST7MDoNJLebA/tim4Uu0xnuoFEjp/Yjf1FzRep1M8GJhLG5nBHVJVqIIygfRCwRAz?= =?utf-8?q?Re4x+F+r0nIE/Z8QpRwqTYY7fYvr423z+iwDME2cyBiB+HmxhO4AKVbuiwrmLa4K+?= =?utf-8?q?afRyW7AOxEBm0IuudUHR1Olb7v+gSoPFxhH9V7izFO3990RtdGkt6rG73IhLXjhrh?= =?utf-8?q?cvYFMK2IrRnz+n1NCQg6uh4I0TjPghv3u/YCsixhijXKE+cPwQ54enYMVTtRyO4Hl?= =?utf-8?q?U1nJQFe2MBuhzk9LCkhnq0+LKgwK1Yh5rtv5JDAYchMSA5gmMMtTZ9z1UVWul96Hr?= =?utf-8?q?CKzFWnuj83GEoyXxv+boK1xpC+60zwJdlDa+bCOyMjGVNed8vYY0QLA/64G3HGMgU?= =?utf-8?q?ufF8VQ+KpZpKJC6briKXxXQUPPWBI9mHF1BqON9UWdY5X00V5r9UtuIU9/Wge/Pcz?= =?utf-8?q?A0p5lkNTHxdVeExKheM14Fs+ayQz1Hra/UvO8/ufyKYPcfkBMSasPxMq+h3+0zB1D?= =?utf-8?q?O6zBA95bWfkKnJiHV09Xpw0QhInO64M2E0WQSODwJevmoU9g2FIcLeL/C4fHR0By4?= =?utf-8?q?qgNEaHrAI1YpRwhJ334qlkLTigewx1wvH1pcicXoezyZOux496AiZDiityGee5Wn7?= =?utf-8?q?R73pK1lnbURqoIVWncAtcxJ/o1aYzQeaeIelBHZenu9WRkzd9qEyuIc6Fa5Sf4tof?= =?utf-8?q?AHlkIsmirKtoDkmKEZF/C18GDTeJK3F1zWyDd4GGJVt1OgrwzOptKfc2l/zJodq5b?= =?utf-8?q?VsH8I5K580Y6A8AI7SHM1+pJ7py1DfvkeNubSBsw1ItSbL4fz1d6ogcUkVjqdDiw2?= =?utf-8?q?k/lcNB+TD9cu847krYgqJS+6gFHtb+P8ZSEyt9Enb+2K+4jnqAYAPBQIAdCvh0BNS?= =?utf-8?q?2mZso7NHTEC0XorXVc+GrKOx8dNK2Y4wMNItbt0G7DnErOYie+9/JtEoGkzQROCK3?= =?utf-8?q?zWwUCTLvsFqTUkbnuQW3VOrCTYsHPbCKQE/6qf2FqflpotffTDEhZE28NnkX1bj01?= =?utf-8?q?NG5anPkO7nQmQoskgt0WhOhekabwBBf7eiCHElsezmNd7Q82I/pDRqXKs/iLCZBUC?= =?utf-8?q?2NOB6Llv9r5fYqLNVVJW2uyK/qJggUM23EPDYNQDRaydcxvPKnGJndxQ=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)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ee03TGNHVHLakMHyFIAu68QJa9zo?= =?utf-8?q?zFFb8EzPycH1U37Q8dwCRg5BsiitiQRwBeD79Q1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FPiSGNU4W2GKnSzU?= =?utf-8?q?crSmbLqTO4X+4CFG7Kp0yimD3ZY+StF3Drl8FIbO5SthfWc35e/TJHSVKjzA70TZV?= =?utf-8?q?NQHe2560ME2z24uHtCfpgeL4u6xW8+EZnrLxA0h5BhynFpM6+rWSy6BIG/M9Liqpj?= =?utf-8?q?tbJAu/I/tJzP5zCrB01Ee93B2jomt6fxThmP1ZB+XMMYB//RwvZJHuRWgFlTGLmWv?= =?utf-8?q?ripqPdXznsFwuEbTzYwMhibD2ju36Uagh1sJPLw9Yrod8JCPNUjWE2WGEamuAvHWl?= =?utf-8?q?/k9kSmS/0a50kWDeDNsf4nuVUBrOEk3xAgHSTaiD4p5xLM5xw6J3Z4VahAro9hDyp?= =?utf-8?q?dfZ95Apfhki4mQxCC3HJ2A1t9o/bPtK6Cw12NSWMi3f/F3gVgmScd+aw0gk+1mgbe?= =?utf-8?q?TAN9V8RMVUgO9Ilot+VJmUnAiuIFAGM7O67bDGj10wnGlnBABEYfjG6gLFouq7tJL?= =?utf-8?q?CU2DggiC761ASL7ogzxQjLsqYKOD9OmxJDgylwZxs4AWq/+f5pDit+o8vi/DHClEx?= =?utf-8?q?OzmDIepcXM6GnzvI/osuWOipsas8TLYjh45iNhDasDMujui+xJkPs7RnvP0Gw46oy?= =?utf-8?q?Ecnw5RNUm0gj?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd5ef55a-528c-4836-77f9-08dc795dabd3 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 06:17:20.2536 (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: 5GlEU/kGWQ8dw1KB/DjBmBphhB/4YcIquLe4d4nOmFNqDk8qP9eO5xcdmHNWTOLcSol383BxaMNm1V1Muusbjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10705 From: Peng Fan The generic pinctrl-scmi.c driver could not be used for i.MX95 because i.MX95 SCMI firmware not supports functions, groups or generic 'Pin Configuration Type and Enumerations' listed in SCMI Specification. i.MX95 System Control Management Interface(SCMI) firmware only supports below pin configuration types which are OEM specific types: 192: PIN MUX 193: PIN CONF 194: DAISY ID 195: DAISY VAL To Support fsl,pins property together with SCMI OEM protocol, add this driver. Signed-off-by: Peng Fan Reviewed-by: Cristian Marussi Acked-by: Sudeep Holla --- drivers/pinctrl/freescale/Kconfig | 9 + drivers/pinctrl/freescale/Makefile | 1 + drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 357 +++++++++++++++++++++++++++ 3 files changed, 367 insertions(+) diff --git a/drivers/pinctrl/freescale/Kconfig b/drivers/pinctrl/freescale/Kconfig index 27bdc548f3a7..711a5ab3ceb1 100644 --- a/drivers/pinctrl/freescale/Kconfig +++ b/drivers/pinctrl/freescale/Kconfig @@ -7,6 +7,15 @@ config PINCTRL_IMX select PINCONF select REGMAP +config PINCTRL_IMX_SCMI + tristate "i.MX95 pinctrl driver using SCMI protocol interface" + depends on ARM_SCMI_PROTOCOL && OF || COMPILE_TEST + select PINMUX + select GENERIC_PINCONF + help + i.MX95 SCMI firmware provides pinctrl protocol. This driver + utilizes the SCMI interface to do pinctrl configuration. + config PINCTRL_IMX_SCU tristate depends on IMX_SCU diff --git a/drivers/pinctrl/freescale/Makefile b/drivers/pinctrl/freescale/Makefile index 647dff060477..e79b4b06e71b 100644 --- a/drivers/pinctrl/freescale/Makefile +++ b/drivers/pinctrl/freescale/Makefile @@ -2,6 +2,7 @@ # Freescale pin control drivers obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX_SCU) += pinctrl-scu.o +obj-$(CONFIG_PINCTRL_IMX_SCMI) += pinctrl-imx-scmi.o obj-$(CONFIG_PINCTRL_IMX1_CORE) += pinctrl-imx1-core.o obj-$(CONFIG_PINCTRL_IMX1) += pinctrl-imx1.o obj-$(CONFIG_PINCTRL_IMX27) += pinctrl-imx27.o diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c new file mode 100644 index 000000000000..2991047535bc --- /dev/null +++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c @@ -0,0 +1,357 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * System Control and Power Interface (SCMI) Protocol based i.MX pinctrl driver + * + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "../pinctrl-utils.h" +#include "../core.h" +#include "../pinconf.h" +#include "../pinmux.h" + +#define DRV_NAME "scmi-pinctrl-imx" + +struct scmi_pinctrl_imx { + struct device *dev; + struct scmi_protocol_handle *ph; + struct pinctrl_dev *pctldev; + struct pinctrl_desc pctl_desc; + const struct scmi_pinctrl_proto_ops *ops; +}; + +/* SCMI pin control types, aligned with SCMI firmware */ +#define IMX_SCMI_NUM_CFG 4 +#define IMX_SCMI_PIN_MUX 192 +#define IMX_SCMI_PIN_CONFIG 193 +#define IMX_SCMI_PIN_DAISY_ID 194 +#define IMX_SCMI_PIN_DAISY_CFG 195 + +#define IMX_SCMI_NO_PAD_CTL BIT(31) +#define IMX_SCMI_PAD_SION BIT(30) +#define IMX_SCMI_IOMUXC_CONFIG_SION BIT(4) + +#define IMX_SCMI_PIN_SIZE 24 + +#define IMX95_DAISY_OFF 0x408 + +static int pinctrl_scmi_imx_dt_node_to_map(struct pinctrl_dev *pctldev, + struct device_node *np, + struct pinctrl_map **map, + unsigned int *num_maps) +{ + struct pinctrl_map *new_map; + const __be32 *list; + unsigned long *configs = NULL; + unsigned long cfg[IMX_SCMI_NUM_CFG]; + int map_num, size, pin_size, pin_id, num_pins; + int mux_reg, conf_reg, input_reg, mux_val, conf_val, input_val; + int i, j; + uint32_t ncfg; + static uint32_t daisy_off; + + if (!daisy_off) { + if (of_machine_is_compatible("fsl,imx95")) { + daisy_off = IMX95_DAISY_OFF; + } else { + dev_err(pctldev->dev, "platform not support scmi pinctrl\n"); + return -EINVAL; + } + } + + list = of_get_property(np, "fsl,pins", &size); + if (!list) { + dev_err(pctldev->dev, "no fsl,pins property in node %pOF\n", np); + return -EINVAL; + } + + pin_size = IMX_SCMI_PIN_SIZE; + + if (!size || size % pin_size) { + dev_err(pctldev->dev, "Invalid fsl,pins or pins property in node %pOF\n", np); + return -EINVAL; + } + + num_pins = size / pin_size; + map_num = num_pins; + + new_map = kmalloc_array(map_num, sizeof(struct pinctrl_map), + GFP_KERNEL); + if (!new_map) + return -ENOMEM; + + *map = new_map; + *num_maps = map_num; + + /* create config map */ + for (i = 0; i < num_pins; i++) { + j = 0; + ncfg = IMX_SCMI_NUM_CFG; + mux_reg = be32_to_cpu(*list++); + conf_reg = be32_to_cpu(*list++); + input_reg = be32_to_cpu(*list++); + mux_val = be32_to_cpu(*list++); + input_val = be32_to_cpu(*list++); + conf_val = be32_to_cpu(*list++); + if (conf_val & IMX_SCMI_PAD_SION) + mux_val |= IMX_SCMI_IOMUXC_CONFIG_SION; + + pin_id = mux_reg / 4; + + cfg[j++] = pinconf_to_config_packed(IMX_SCMI_PIN_MUX, mux_val); + + if (!conf_reg || (conf_val & IMX_SCMI_NO_PAD_CTL)) + ncfg--; + else + cfg[j++] = pinconf_to_config_packed(IMX_SCMI_PIN_CONFIG, conf_val); + + if (!input_reg) { + ncfg -= 2; + } else { + cfg[j++] = pinconf_to_config_packed(IMX_SCMI_PIN_DAISY_ID, + (input_reg - daisy_off) / 4); + cfg[j++] = pinconf_to_config_packed(IMX_SCMI_PIN_DAISY_CFG, input_val); + } + + configs = kmemdup(cfg, ncfg * sizeof(unsigned long), GFP_KERNEL); + + new_map[i].type = PIN_MAP_TYPE_CONFIGS_PIN; + new_map[i].data.configs.group_or_pin = pin_get_name(pctldev, pin_id); + new_map[i].data.configs.configs = configs; + new_map[i].data.configs.num_configs = ncfg; + } + + return 0; +} + +static void pinctrl_scmi_imx_dt_free_map(struct pinctrl_dev *pctldev, + struct pinctrl_map *map, unsigned int num_maps) +{ + kfree(map); +} + +static const struct pinctrl_ops pinctrl_scmi_imx_pinctrl_ops = { + .get_groups_count = pinctrl_generic_get_group_count, + .get_group_name = pinctrl_generic_get_group_name, + .get_group_pins = pinctrl_generic_get_group_pins, + .dt_node_to_map = pinctrl_scmi_imx_dt_node_to_map, + .dt_free_map = pinctrl_scmi_imx_dt_free_map, +}; + +static int pinctrl_scmi_imx_func_set_mux(struct pinctrl_dev *pctldev, + unsigned int selector, unsigned int group) +{ + /* + * For i.MX SCMI PINCTRL , postpone the mux setting + * until config is set as they can be set together + * in one IPC call + */ + return 0; +} + +static const struct pinmux_ops pinctrl_scmi_imx_pinmux_ops = { + .get_functions_count = pinmux_generic_get_function_count, + .get_function_name = pinmux_generic_get_function_name, + .get_function_groups = pinmux_generic_get_function_groups, + .set_mux = pinctrl_scmi_imx_func_set_mux, +}; + +static int pinctrl_scmi_imx_pinconf_get(struct pinctrl_dev *pctldev, + unsigned int pin, unsigned long *config) +{ + int ret; + struct scmi_pinctrl_imx *pmx = pinctrl_dev_get_drvdata(pctldev); + u32 config_type, val; + + if (!config) + return -EINVAL; + + config_type = pinconf_to_config_param(*config); + + ret = pmx->ops->settings_get_one(pmx->ph, pin, PIN_TYPE, config_type, &val); + /* Convert SCMI error code to PINCTRL expected error code */ + if (ret == -EOPNOTSUPP) + return -ENOTSUPP; + if (ret) + return ret; + + *config = pinconf_to_config_packed(config_type, val); + + dev_dbg(pmx->dev, "pin:%s, conf:0x%x", pin_get_name(pctldev, pin), val); + + return 0; +} + +static int pinctrl_scmi_imx_pinconf_set(struct pinctrl_dev *pctldev, + unsigned int pin, + unsigned long *configs, + unsigned int num_configs) +{ + struct scmi_pinctrl_imx *pmx = pinctrl_dev_get_drvdata(pctldev); + enum scmi_pinctrl_conf_type config_type[IMX_SCMI_NUM_CFG]; + u32 config_value[IMX_SCMI_NUM_CFG]; + enum scmi_pinctrl_conf_type *p_config_type = config_type; + u32 *p_config_value = config_value; + int ret; + int i; + + if (!configs || !num_configs) + return -EINVAL; + + if (num_configs > IMX_SCMI_NUM_CFG) { + dev_err(pmx->dev, "num_configs(%d) too large\n", num_configs); + return -EINVAL; + } + + for (i = 0; i < num_configs; i++) { + /* cast to avoid build warning */ + p_config_type[i] = + (enum scmi_pinctrl_conf_type)pinconf_to_config_param(configs[i]); + p_config_value[i] = pinconf_to_config_argument(configs[i]); + + dev_dbg(pmx->dev, "pin: %u, type: %u, val: 0x%x\n", + pin, p_config_type[i], p_config_value[i]); + } + + 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 set config %d\n", ret); + + return ret; +} + +static void pinctrl_scmi_imx_pinconf_dbg_show(struct pinctrl_dev *pctldev, + struct seq_file *s, unsigned int pin_id) +{ + unsigned long config = pinconf_to_config_packed(IMX_SCMI_PIN_CONFIG, 0); + int ret; + + ret = pinctrl_scmi_imx_pinconf_get(pctldev, pin_id, &config); + if (ret) + config = 0; + else + config = pinconf_to_config_argument(config); + + seq_printf(s, "0x%lx", config); +} + +static const struct pinconf_ops pinctrl_scmi_imx_pinconf_ops = { + .pin_config_get = pinctrl_scmi_imx_pinconf_get, + .pin_config_set = pinctrl_scmi_imx_pinconf_set, + .pin_config_dbg_show = pinctrl_scmi_imx_pinconf_dbg_show, +}; + +static int +scmi_pinctrl_imx_get_pins(struct scmi_pinctrl_imx *pmx, struct pinctrl_desc *desc) +{ + struct pinctrl_pin_desc *pins; + unsigned int npins; + int ret, i; + + npins = pmx->ops->count_get(pmx->ph, PIN_TYPE); + pins = devm_kmalloc_array(pmx->dev, npins, sizeof(*pins), GFP_KERNEL); + if (!pins) + return -ENOMEM; + + for (i = 0; i < npins; i++) { + pins[i].number = i; + /* no need free name, firmware driver handles it */ + 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); + } + + desc->npins = npins; + desc->pins = pins; + dev_dbg(pmx->dev, "got pins %u", npins); + + return 0; +} + +static const char * const scmi_pinctrl_imx_allowlist[] = { + "fsl,imx95", + NULL +}; + +static int scmi_pinctrl_imx_probe(struct scmi_device *sdev) +{ + struct device *dev = &sdev->dev; + const struct scmi_handle *handle = sdev->handle; + struct scmi_pinctrl_imx *pmx; + struct scmi_protocol_handle *ph; + const struct scmi_pinctrl_proto_ops *pinctrl_ops; + int ret; + + if (!handle) + return -EINVAL; + + if (!of_machine_compatible_match(scmi_pinctrl_imx_allowlist)) + return -ENODEV; + + pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph); + if (IS_ERR(pinctrl_ops)) + return PTR_ERR(pinctrl_ops); + + pmx = devm_kzalloc(dev, sizeof(*pmx), GFP_KERNEL); + if (!pmx) + return -ENOMEM; + + pmx->ph = ph; + pmx->ops = pinctrl_ops; + + pmx->dev = dev; + pmx->pctl_desc.name = DRV_NAME; + pmx->pctl_desc.owner = THIS_MODULE; + pmx->pctl_desc.pctlops = &pinctrl_scmi_imx_pinctrl_ops; + pmx->pctl_desc.pmxops = &pinctrl_scmi_imx_pinmux_ops; + pmx->pctl_desc.confops = &pinctrl_scmi_imx_pinconf_ops; + + ret = scmi_pinctrl_imx_get_pins(pmx, &pmx->pctl_desc); + if (ret) + return ret; + + pmx->dev = &sdev->dev; + + ret = devm_pinctrl_register_and_init(dev, &pmx->pctl_desc, pmx, + &pmx->pctldev); + if (ret) + return dev_err_probe(dev, ret, "Failed to register pinctrl\n"); + + return pinctrl_enable(pmx->pctldev); +} + +static const struct scmi_device_id scmi_id_table[] = { + { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" }, + { } +}; +MODULE_DEVICE_TABLE(scmi, scmi_id_table); + +static struct scmi_driver scmi_pinctrl_imx_driver = { + .name = DRV_NAME, + .probe = scmi_pinctrl_imx_probe, + .id_table = scmi_id_table, +}; +module_scmi_driver(scmi_pinctrl_imx_driver); + +MODULE_AUTHOR("Peng Fan "); +MODULE_DESCRIPTION("i.MX SCMI pin controller driver"); +MODULE_LICENSE("GPL");