From patchwork Sun Apr 28 05:07:47 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: 792958 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2058.outbound.protection.outlook.com [40.107.105.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 D0517748E; Sun, 28 Apr 2024 05:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280407; cv=fail; b=QweK6PQ1gaz1hVk8w7xRSu5vnWoMKU6ldyTpSHkMnXbt6tam3FhRJ3Otja8HxKfnoRpTxm1JGEhB9PjzsnElYsBE8ajIGSZjyBhL48pvAkpZRnXiGl1eAQqO816hiJXSCwZgbP2TtgAaqbQAznTVSoMCAiG+m+jhocfoFzLTQuA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280407; c=relaxed/simple; bh=WTZ7YwNm/8WPxZlzkPznE0QEoAFR6b1n1hH0qOGF9Rg=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=icZRgAEarYtth9e2Yf7LcwiDkqlvmCgXkaZHBRe/EV12/wzHXHhvcEdboeFKG9hPJWYbV4Y2uauiDVjGTOpLyIO97LhvmVzo5m6oBjxAAiAhvJdQj5N6yEZ3MSo4BPR/iV4ogzlB2pyVdoguXfyfinkwEwOmU5Ip9+zopdPXHQI= 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=NVtS5JRj; arc=fail smtp.client-ip=40.107.105.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="NVtS5JRj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JbUrlaaNrigT1acm3Zki0/WI4DIk8d3kGs9bClmG7e0VkPWt+MPVA3+x69nEl2EIBOUZUUQ3854eBzrYXmmNHY9AK99bOkbdilScHken4lKIVYt1IrQLhWSxjv3PZ+uNMmX7DLY/q4snd5jAI+bnxFr+gJ2pdmN7wQ+CvmFkGXFaitNDq/x42Bb7j8roaOIh2a/Hdd3VzHBGfc6PjYlpnUrhudvjNjV6plNlKGR+YqoHCvx6i2Vxb2GxVOWQNalUvUU8dFz6A9iXiRyvcAkO2lhvr31cpxyCz9hosVJw8oNPa4VrFgepWbHAfwOAWPy7zR1rPtgVsqIR7DIMsQVn0Q== 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=12DFYM63ULaEgVDZPXt8ffcWw3R7pE947r7KT9S2Pyk=; b=DVa4acmpQUVk492OawZuGEaYN5SzmOxX0KMZjpcJa7vRdk2KSBlrLKu2yBLeHDomcm0UQdNPa2kfbAvywFrYWTvqtqQUzOoa4oMDTCe7brXCGQfm871p9LHMiuCUWwYaRfm5HpGHW7TlGvFtxZh+Z24FR0hG/K8NpbLGu2klj5+qpO4bWg0dZZZvFnq+c9p74/fM6fPTKSOiXnvnw5EGPlRTsP1dFbnFJ1uQrzTzxsZYJxiEkgUCE0YV6LfosLfTe4ekFcNUjncgvVTW8ZS2oh8S9mYiVc6mFpAEcfBzuox1eD0tZ/7ya6MsHzcqVRlhgcxsOjcYwkTC4tQsnxxraQ== 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=12DFYM63ULaEgVDZPXt8ffcWw3R7pE947r7KT9S2Pyk=; b=NVtS5JRjmSI3SWh+kIs/ykk1QkfJzM5YBiuaASaUZsTBvxc+eao92gPejl1/7T2rbC4+P3zDdpAqoOXGFxKRD4g3PWDDXK6TlI7EYhlXhK93h7+TVdCojcQQldjyB0KjQTjaRBfvXCWwkhhOj4ioXCtAO0LMEGMWAZKgIC0AmpU= 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:03 +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:03 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:47 +0800 Subject: [PATCH v3 1/6] dt-bindings: firmware: arm,scmi: Add properties for i.MX95 Pinctrl OEM extensions Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-1-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=2762; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=07Om+tiXUr57qz8djpSP7JUajKxdHALgoEKb63kMR5U=; b=J1+j4wOe27traC7/Vk46N824kchuD1DuTW9xInAQtGcXdW8OsNfTEPTqr+F1xz8aUmfggw+on yxtXneSafuOB5VG9NUKRPGezU57/JIds11HsAWhxGWnOVO5Fy8Fx3I4 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: bf78fab4-5567-481b-5d7e-08dc67401046 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?0WX/FPBq1Am61+oQlO+5c+awIRHYXhQ?= =?utf-8?q?TA85siEV8HsCV9zNm46IltkGsAxC+KhEoEyoXetXsVCq6H20VEiH4MLn1msZIeJIY?= =?utf-8?q?jS7P1guuHydFkLcMu8N0Bkt3Co2u3MlelE0vHUrkLd8GiFkAOQsV9CYdaFZjVdafn?= =?utf-8?q?jmtt7YZDx05wkr9v4yCM8yzPpsa/y+SUUIRAi4YRPhuq3rprUBeYYsr8RMRH7Fq/V?= =?utf-8?q?A4i0lGC6X0wE/iJ3lkeaziRadbHQPpijRxgRpXFl9/F0R2NKOvpLcyuiq8MZoXU+r?= =?utf-8?q?yuxfm8ii4fMOrf3+qfSWm6GzeAm2QGf1ZF9CaJdPprXty7ejM+Pu26wG9ALKOb4Gr?= =?utf-8?q?726zs7iDWN85wrmEGIxZC/ChDBct5RXIhpck6A2FVCE4iNVELQw0Rgt+8Yh2/NiGj?= =?utf-8?q?vsFx6tNiLZyiaVc+lsz1vsGssvr+Y+Ke3di0w4a6/4MJJbLKKRqZilnkvSXxVoGIQ?= =?utf-8?q?HuWFj84WyKenzhj1OPnDrbmyxJlQggewaxZ8OkVvD72E90VGBOl7dra8tbF/WLnJT?= =?utf-8?q?LMUCUBUOxRajrsubqfHZEQjCBcPxLbI7vZ74cvj/23w3DfhTqwj6y7xpBES+xO9Jg?= =?utf-8?q?xIW2DkGBydfTVT+M4+89Jt3oZMjBQTMgyJIxLHzmyfEeqa8lsd9t2cX8IJmEQWVAz?= =?utf-8?q?kkMvH7152TkdjZy4BJB3tvKRPemeBYjJ/L0TMzcaM2dxoBBMW/tX2u1oGVbwWMlTy?= =?utf-8?q?m6DytlKbfFHFdlQ5ZfLnN6S+bL6m5319zdpCueunwSFc/6uA0YC7S5MVlD9F8PRnJ?= =?utf-8?q?910hBJSQ58x/YWEivCniOMYAi6J2CqxRIm5EVxaTQrnSMwkeJD5I+VWqpjJY5X/wk?= =?utf-8?q?vbZZy6sZc0vk8sFSQcI2zIqEkeJ5no/ckPKzh6RmvizIICUx0yfqVGfRX3vamHQLZ?= =?utf-8?q?KSZBy8JDy9H7iik8tMGKOgjlXdNo1WXZF4J+Kuo0VOOt9Rj/CqCqXFO0I741FDBim?= =?utf-8?q?REXgT28pIonwfQijvu90MpCNOpRlZ2NvJyAslVVQPoP1GsljqNMJRUL4WJ4l3l7+z?= =?utf-8?q?vDCCFTLoyEq+5Wlvc5de0PR2lvhHc/Oh4dTs2DwZDROTUJgThMTTgBihE+9Zkth7i?= =?utf-8?q?dn6jAzucjVoeDEa+IJ+MUhz1D30kVa2e6jYHYaDffdQnohJtp76If80fYLZxvV/Ew?= =?utf-8?q?B1pOh5pU0M7hLpfLS/3hJ4qPUNBzKfUiNzhYcvVaW3b+cfy7jec7hrkZ9OikaNdcL?= =?utf-8?q?l5G1NhOXww1gXEqUivlUkijyoIRKIlHFPCt43nch3n0+MJmoEotcBZiLY=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?Uks2mVStTjteGqC+Clh2s0s0L6a1?= =?utf-8?q?0Y/84gZ+DKcHoxtGEidxDFqj9DcpFHEXqpMnlh8rpCF7xCuQXmkOc3lCG4QGmc8L+?= =?utf-8?q?xOOumXKGLZZV9SZDycF775mgdL8Dnu2HzoiI/bC6c3Itd7CEF9C9dH6ZgH2B9Gf9S?= =?utf-8?q?elACnha4rCZyd3pX1dFPdZ8B42/rB4h6NkPPwPicfZ1AxjE7X9NCmhjXmm1TU6i1L?= =?utf-8?q?gc1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okZF1HP2T4Aj3EaC7X7wh1WI9Q2Ckck5g3CfzivQFd/cjWaTvWo/Ee/aU?= =?utf-8?q?mZlw3ktGR5zFRLQDKCm9NeJhyUrc4PMAuMJPWKCZ2jnvN4qDnmD5mdaZfCqm5zNOO?= =?utf-8?q?0aH7S1owltckrbkhqW/OtcU17RE+wjyTj8HeCT9VGztOb7wVn9eCdZDX6dHAQSalU?= =?utf-8?q?MQqsrbbxNyOnb6JL+XiUYYnP3LjiuD6BW8t3efV1e1NvZeYA/eGUrMSgX1djrguIB?= =?utf-8?q?f3cJuFQC/Eq/XXjz0SW5xeBFDIFhMCIEG0v6qHmRGs1PNaHe23pH7FTV7QbqnQmpj?= =?utf-8?q?ADqTCRz1cU1QGVWnxpG0/xIQnZm9zybp3LwaQBKxvI10Fh7/i1B9+MVTYt40WYssi?= =?utf-8?q?3RVvAfW7WWpHORbtYIX7DtfbP9Q85lmqyBR7F449xTHseQ2qR5WpIBIZNAu0SYyFS?= =?utf-8?q?CBuYFB5LyKWW?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf78fab4-5567-481b-5d7e-08dc67401046 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:02.9349 (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: 0YHBxCDcV958UZAmTVGkuT0FGR/m5avdlraJ3DdeUbYz1fDuDu2kO+cJRijWmkO7bxMocD/DQ9+9v13xS39SnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 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. To reuse generic properties, add the binding to enable pinmux, slew-rate, bias-pull-up and etc, under a subnode of '-pins'. Signed-off-by: Peng Fan --- .../devicetree/bindings/firmware/arm,scmi.yaml | 9 ++++-- .../bindings/firmware/nxp,imx95-scmi-pinctrl.yaml | 37 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 7de2c29606e5..bd4dfd7a85cd 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -262,9 +262,12 @@ properties: patternProperties: '-pins$': type: object - allOf: - - $ref: /schemas/pinctrl/pincfg-node.yaml# - - $ref: /schemas/pinctrl/pinmux-node.yaml# + anyOf: + - $ref: /schemas/firmware/nxp,imx95-scmi-pinctrl.yaml + - allOf: + - $ref: /schemas/pinctrl/pincfg-node.yaml# + - $ref: /schemas/pinctrl/pinmux-node.yaml# + unevaluatedProperties: false description: 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..1a694881f193 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/nxp,imx95-scmi-pinctrl.yaml @@ -0,0 +1,37 @@ +# 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 + +patternProperties: + 'grp[0-9a-f]$': + type: object + unevaluatedProperties: false + + properties: + pinmux: + description: | + An integer array for representing pinmux configurations of + a device. Each integer has the format, pinid[31:21], mux[20:16], + daisy_value[15:12], daisy_valid[11:11], daisy_id[10:0]. + $ref: /schemas/types.yaml#/definitions/uint32-array + + drive-strength: + enum: [ 0, 1, 3, 7, 15, 31, 63 ] + + slew-rate: + enum: [2, 3] + + input-schmitt-enable: true + drive-open-drain: true + bias-pull-up: true + bias-pull-down: true + +additionalProperties: true 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|376005|52116005|7416005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?44vQBCoM0tOrxI5Kx8nvMNDoQ/8ox88?= =?utf-8?q?Zaae8owJfxp/+k4Cfx/1bf1/av/bcOZquTzYzoz2BhvuXbzqxCrlu3RGHxRkgALqU?= =?utf-8?q?3Nadg0+4ExwVf77m7eHqWUQTOIB8xDpHwNDHuurhAegn3NP/DF+WDjlAYloDwMTkD?= =?utf-8?q?k+m0SAx0Xo1URbfhtYj7afGJOaHR6aqrGD0Hp2w52J9OISjUSegZzj761H6g6YAcg?= =?utf-8?q?EdzAexHLA3aO9ECj/fUK3PNjOjjOUsv/98xPii6KFmoIhXaRQWaxKZk8aLueZQi7n?= =?utf-8?q?G/dLrlsogZq1S0HY1/uDeaN/VAgKa5wH8yS+Gm7r5tw0BWkJ3zoGQ4pmhgYaVM2vL?= =?utf-8?q?hw6/Yb+9Pu1xQ3ZOzv2t8kWLq6Fc06lDp3n9UGToR/jcmBYRg3j3rIF1WdgS8Lo8Y?= =?utf-8?q?f0vBYaVNuGX7QVzWlmcIpJTKhsb5YNC9imwty8OEf6eMA+yj6/0wzBuLx4hAxtcqo?= =?utf-8?q?ybSEE4MYT2N/4Bp4zgfPp9FJAMj/ddVEaAVVnD5wxPzYaOuALp/wTV2tVCT/a6G7+?= =?utf-8?q?MfqPHpTOTaBSxt9Ua12l1b3Q+0kCKJ3UY+886f0ZV39BuYiux8xpgKpE62tfiNZMr?= =?utf-8?q?z8Fb7KHnfPbVIERWRTMmYMpAKqaAm0s5tfep/m7LV7jNz6HQZzOsViciZtqSo8Cy8?= =?utf-8?q?DLEAKh7YVkB3SSPF0nqtsRVDFvExhfGeJX7d05CIjiaE4SxyTUWt2is1kCEFnnl3I?= =?utf-8?q?5nUGa4sK8wkN+TGX5FtlFHFolyYBePhvpocDEF1KhS6zIwfxvx3UCi1USltqge8QG?= =?utf-8?q?gUHnfIF+Bh1L1MBPU9FKBFSacD0RRznzlNXf4MfRID1L5ukwcWK32ytkLL15TQISi?= =?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?wFx4bQSnuC02mkwWph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b3gnYVvG35xm2mGOmFdEK7s2jBDygCfw+pXxGwUF?= =?utf-8?q?Tl6RUeb71j83BqYqDezjGtXcHWMlsrt6CaeibogU1FqoPcuy3ke5sLICIfp+jkibd?= =?utf-8?q?dsZ5exG49ZvZMd/0u47cwpffapLkNtT8KU0s5YkVmGX95mkQ+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; From patchwork Sun Apr 28 05:07:49 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: 792957 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2058.outbound.protection.outlook.com [40.107.13.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 9318A748E; Sun, 28 Apr 2024 05:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280419; cv=fail; b=W1Xj6UKNr2girrnovBYhI79cZkOtfL/tgtUaRbqpWo9sQD2H8/RU27YHeBP/6mzSPoMNDPMiiInNtU6D0OsmqzftpS1DEi0sq+OjSl3XHTlLud+mk+hJNCHUzJgRUnvachNDlJpRk7X69wUe5TmRj7pP/Kw3SbYZnmiUa4Ywa7A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280419; c=relaxed/simple; bh=3z+YHXe0W+SVUNhp2rXsnP4H3nC6DsL1oFahCu0qbug=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ILhJ5LSvd5xEWUA3dRsgtBf12BqTe3PzRr1iRBpaAQCDf/+AwnmWBHFsNn3vXBf8cBhcATVWCaGfNkfFPFiOaTsgGYDeKLqvGFa0y6971ECa7AFyxuLd8FYlRcU5DtGlCB2MF+fBo1D1DSMz9G0IcCwVAEPpfNfu0sxwKgSINF4= 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=dA+/y5Bq; arc=fail smtp.client-ip=40.107.13.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="dA+/y5Bq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=USsIbsikW77tA7JU3hD9lwFRLzckmLRlp0TSp87w8UYDYCp2K2Y4/+knqDFnYv8vi3g4KJWXaZ6oY9zJtGXB7lwSFNFhzPF80DbmlgIayLpv+Yr9VlguzvwgedgQxSITz2giYodUGwnKIIJSqnz2gU2nN4RiGQ/OdYwyj/TgU7JWFzizaOn6c2nubWPesb9tebpemHCcuT+gOq9LoUCVuIH0SdWVy26h5scQ17dG7XDytuPuSfys7SX9Ci3RSGB2NmeJf2AG3GPaeStybqOrQmhC7bu+bLUKIrujHweDLLgogjwt+QVcYJV9p8imvqscGdMCj8DD32aPEfrQ2Xt1lA== 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=s/Qo80YZbnDFk34LGa+x0G33rd6iHwJ4pxOLzRc55B0=; b=KnbWOAnbn2+kWcZ8kkPkz1SK4Olk4zzLW00SyYwKMF1ufIXk52Ye7fWEF27vAPh11RjUosrbboIzAlvC7cGX9DORWP3jzLM2ddDQYuCQ+svQWOQ6WR07dua5Nt099f5+IUEUAH7Pjg5x258XTUmXT7BE0dhaItqM7ioWTwgmrd/N4ZNnq2U4U+QN7fcG4SsfiGbBafbdUxEcbIjwq/syrC5z2erhqwkKWooC53MzHSHaHI0lIfCAZa5N54yAIsv4AVmL92Q+cJlKbPUcyiLwVYQQw3znEu66a27R6p1BV11/BCQUBfOj/Z3qVKAbsavd2dq9um4S4BQmnq+wx0c5Kw== 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=s/Qo80YZbnDFk34LGa+x0G33rd6iHwJ4pxOLzRc55B0=; b=dA+/y5Bq6t/FuSjIolR4O0S5NDb3NuGGkVewM8aDsho4N5GhjcsREJzOLZVQoTHILiB0/AYjMPuFWDvbV4QiEhXe/gfhMEh5R3MhSG5G1rf0fEb2D7V/fgq4NNpIXlcRwBrePG8C5SqrdQtUSN3zniQdTCsmlwXfJvUskdwUnkU= 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:14 +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:14 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:49 +0800 Subject: [PATCH v3 3/6] pinctrl: core: guard with __PINCTRL_CORE_H Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-3-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=819; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=39XOS9fDX1rjRHnqlzeUS1tTehfkUhSevikasyRfs0Y=; b=o8HdhUtwoiecxQ1mJR7FP+HASA5ckINjVEjU+abwKeTv12frBFqEiTW4EN+HJKgVF/xKU8/Pd 3yImr2riPCMD+v++fx1bEkb6RPwX+WhQzM5YgXJsAQI1kSQgm9SAU5r 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: 6fb3a55f-6ea2-4b47-10ba-08dc67401734 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?polTyAk4aRQrQ+bfCZ0RrgFd3DzT+2q?= =?utf-8?q?hzzXTU+6kXH0tXAmTA7bvUZzvqGmouhvUEqiiG5weUSV6N8m1hRe0iPrJq5QUp+wM?= =?utf-8?q?Ub7NF1bnZP4EjdqJ6vMCLMGb6Tm7TXmSforHsBmpwI4OGhtrq5fKiGyHA+01oOU5b?= =?utf-8?q?JKbGqwNUWXzO4gNb+qu32OwELFeu9w0GVR0q109O4NFT5LYq/3E+ST1L6h6WyNTZe?= =?utf-8?q?kghbjLhW8JnV75vLVlXD0swUf+clJAdItumVKOxAwefVTcequ6qxVTPHvJhH6qPn3?= =?utf-8?q?UmjRsln5x3s+dsoq2cgwv8qypeDDf3+TyTeGuGDhLuEk7s/dhw3+7Zf89GWDN14HN?= =?utf-8?q?xtcYfqG49OycQ/uF1TvRYBo9/AU7RRos81Gk6MVDy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zd?= =?utf-8?q?zoDc+Cu8ItCrWiM5X7kmKCMtijIAWu2mKfkNzSSjph/qcF4aENmigdHo=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?sshvMHlyxhHF9cgxOYgKUD4IFvV2?= =?utf-8?q?tXWslhxKlUO7SBsGva/SjD/dv/RvnjjWgccqqfPToTM2IUf5r5YVmKQgPUOrnXaqz?= =?utf-8?q?z1wS4qifposT7Tvzk3d3qBxHw7YuJU702cOr9WAUUaOUtlVdOD8Rh7oQHbD9wDBPR?= =?utf-8?q?rg/zbLp96yflhvfdhoqD7xmZJ5JvCfvbLlePFZ81zdBjSDDv7AEPoP7lwmYWp+boJ?= =?utf-8?q?te2eNgmYR+OkJbOm8wK12Nmx1xaMipdpTMadtLQ0BLUVdMn6yf4kt1scfssB4cabK?= =?utf-8?q?pitvmqyBWKWy4KuWw9TLdHEiQlV5uXS/wOLphCin6/a59U/yNt4xQF9R4ScDMGZcb?= =?utf-8?q?Ww84JPoMiPiw+ccR59EmMmry3dZ0TwBW6PC9PcZJX2aJ8JNOwk8JH8bRJYu2E3Xz+?= =?utf-8?q?T6T/F735WS/z6EqFBZwfVeEQhKiWSplIOYIT6yHkF7QnXpMnHcNMp3SDPPCo/IM0g?= =?utf-8?q?CX5Fc8v5kJP4pcnLAqvyWV4JDUD+5xyBDpLD7j922YBVHgYklvFFoYpfNlsSOjcz8?= =?utf-8?q?gtypdAV77sGQ/IU0YOhDuTxinTaPPODx9jHwSCbXsVfdgYh0OF1VunQ+X4C/GJKr2?= =?utf-8?q?i0hsUAp6o1I0nzsAahg4A9Jr1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9v5rXmTLsRvGE/ijP/KUIddWHfuxpZ82KE68Mztw6?= =?utf-8?q?N0pmGUvdlLLM?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fb3a55f-6ea2-4b47-10ba-08dc67401734 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:14.5402 (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: o+4u5ebU0sv1ozLVRVKdYOxajhib6flFIa6z/6fQC2r9xTJTPJYz8vW8T+LwpGTA1DOk8y3UNWUM/9lRIwB4ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 From: Peng Fan Guard the file with __PINCTRL_CORE_H to avoid build failure in case core.h is included multiple times. Signed-off-by: Peng Fan --- drivers/pinctrl/core.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 837fd5bd903d..1da7b0d329bc 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -8,6 +8,9 @@ * Author: Linus Walleij */ +#ifndef __PINCTRL_CORE_H +#define __PINCTRL_CORE_H + #include #include #include @@ -262,3 +265,4 @@ extern struct list_head pinctrl_maps; for (unsigned int __i = 0; \ __i < _maps_node_->num_maps && (_map_ = &_maps_node_->maps[__i]); \ __i++) +#endif 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+ZsKkOzLsqGsVCvlVG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PSxEilqMHV6E8Nyu/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?ekZD1jHfBbirzDzvLiRSy5G8H6cTEMapOx5qSZWbcb8cxbgTP9pZw8WGrQy6HqXP5?= =?utf-8?q?malhnmRgebU/5/e3ETjM8OzgEIRwl4X+3UCJEybIRkN4kKpGoSxIIF05Hu1AQFuHY?= =?utf-8?q?z8RuFgHrPXsREKAGL+IXtN1uNv7pDvRquSLQhX/j+kb5mYMVU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w5NtbApfpUHVWAIGAiT7V?= =?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 */ From patchwork Sun Apr 28 05:07:51 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: 792956 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2051.outbound.protection.outlook.com [40.107.13.51]) (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 5438F10953; Sun, 28 Apr 2024 05:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280431; cv=fail; b=aNdlpRD6qN43hvd8DMWaW/nBClzNalV1He/RYHlbZQLdtPkuVSJaJoZkvwndP57pEXd/jlf2YkWNiBsIQ3NUrSSkmo+xINrn7hCDfulfvi/rWQXP0D9SZTOWr8cL0wUzkI836jGb9qX2B4VnMbb7UVl9B++O8yYoJEkSiDLcwEs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280431; c=relaxed/simple; bh=qT1gMIuECKr4AY1noQu+dj4lD9tdtRmznKszsDoYSKo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=eeor8tCvhBvoJqQBh9zKoBhbLOzVdLyy38Wn1OfnCkycQ6v1qDtdrX3h0p+tuR6kSry2FYOig5J0cEJGgnSFlJJp7xFO5NgHoYuy86tDn50VdMcdF4phii+ROG6k6s5WRRiQjM6wluZKO6/gLnD7/+fJguTLaN/m6vO0NBDgL9w= 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=jlMhic4H; arc=fail smtp.client-ip=40.107.13.51 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="jlMhic4H" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dh2Utdf1hM4MOsbpHHxeN/HF171EsbhgFElcsFDStW7d1jolDCBmrKNFkEP5jpopYeZW76oW43bJBKIthsY5/FnlaLCmz0ITTjd4OaNqK/RKtBUiwNWiXTpiQ3tPCRQQ6D3ARd13aQbtMCQj9o5DtkvrMgbYYkPQZgyN9+O5P8t/tRYna0b1ACZ+OCESayBlhuWW5GEqpSxqXcFM96ZUK1ljkCt2BE8g5X21eHT3B6SEfuYgNWxyunMX4Sf9HCOH7L3h5eD77PtPQOmyU3oUvlmEFIr+vrQ2PUjDCi+XMqLDOUz+9+xjrA3sW5n5ujmPFvQN6Ug7Z1ZYq2FfWDsP5w== 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=/xGma/ISq/IkMsbn1rRp7qErVSMnBd1TEHoCFW0L12U=; b=dodbVpWD95WM/DwGPbZnPMFPDwdXlRqLNItyoaXXzrgM9J1rb1TerCsRDABcNalWPLLtRXro1q4RgZC7qHhoW60hh3DiSvklnzImGpaICY5t/kEzM2Mko+4D0+zoWqDS0mJ+jxkV8SqtbSN9smn6ztHymtB/BahQOm+CwkjDHLJEQ8sE7DQ3HigMwQNVMfEix08yHygJRf7yPm1dmdjb9Qm0jlnobmLpksOTpzQU9h0VyHki2lhPxjYbKtvBKgXTjWR8DyrttLnReQj+Fr0e79AlHifmnb8t+WWloy6u4b5bbo40x/E/FSaXpQajYevjaob6KXhWQFVXhB/jN2CPPw== 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=/xGma/ISq/IkMsbn1rRp7qErVSMnBd1TEHoCFW0L12U=; b=jlMhic4HYRWSXNEYc8KR2wnp15dtQ3fcuLXanU4r278RI/rduV4aHHz9NOnIwnNXVW5hROecmGapuqpYXZhrQ5DiOOXWym4MSWGqjlNi+R8iynSuJhCjUslifCZ8jBb80CjX40qulGWzqKQInqwzdwbbb4HHxgu/J8d/PZDRMIs= 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: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.7519.031; Sun, 28 Apr 2024 05:00:26 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:51 +0800 Subject: [PATCH v3 5/6] pinctrl: scmi: add blocklist Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-5-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=1584; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=GBly3E3FCpamuuNCyb9X5Tw3NOV/O8isPoV7JaTrRkM=; b=HBeNuROaZj91h+BxKGKeL8IdhhCsjaoKD5xXF/cfnJamIG4/bIzd2aTI2SxQ03ubQViSXygvj nJnS8w00ZUQDMgTHvhpKXRzhyaHMwI2ac5Ug4pR6KCisFeRs3g5ptg+ 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: 2a0419b3-e99f-4932-ff95-08dc67401e1d 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?s4lMHCIXS45A6VHV88RaON8ciBxsydS?= =?utf-8?q?eHfGrhQ5sYJa7x+GlGIZrTaCzEL9yLsFjPOgncg84kCAuRG2u64bG20B8jEzKBHmc?= =?utf-8?q?JR5BztKL/RlgKFyYhmB7kVR3Il5nWBQ5A8ytUydBoIu5P7+y4eeMuyw3gDSX2at5u?= =?utf-8?q?tMfb7N3uTdxqZ1U17JB7SkwWxNG7AvA21WsvRPTESPyGK3veFNBE+hBkA0kB0gGbW?= =?utf-8?q?wvYLWa57t62CCTsbeVfVX50o+RlGgi+rY9p8R2yXXfc/tYV5pGIr7dZSkony3G6n1?= =?utf-8?q?vMU1RJ8cltgE4pgMLZ5xyG3UG+Xxf9Xijylf7PBg+++XbJsox4WX6s59KdXA7wqJA?= =?utf-8?q?ZKYbjF0AbNIQWg5g/WEPIzLSPgaXeap4P2rLw+CWMG3wq4mL4Y3rCkcTKVZHVQX8c?= =?utf-8?q?SXFAQyGkOKmhERgKigHhOs58my4y4pOV8OCBUfmGt3s6ye3Y1Ci0gsBxGHwihP9MK?= =?utf-8?q?yvd65CncwHzWJBG6r5xHgVpdi65KRrx2LNQ2iJ7VYniSXloBbuyq8vwXbJDPA1fou?= =?utf-8?q?dSFoestt4g8FYxJ9PEwHXrqe5VtiVMdvBWvBthGzywfrj+001SyZuz0HfuzmsxK8v?= =?utf-8?q?z0tOVVp/AaJq2Tz+cOpzL1zZfi9mvIl2j4ubHoXLsYLe3gviDrqUeweECyZiYCRaN?= =?utf-8?q?D4FaKwNo9mJR7i9ro7TCYbepVRns+M8sEj2LvSlH3NSOZnY5GQo0x/SXJmnO5TxTz?= =?utf-8?q?/xPEBHpgM/SYYjigs+SuUGefKeXE2x4w00Qs2UTiisZozX6OYGHEiZLhxSdnUC4lw?= =?utf-8?q?qPk9Z7sma8PYsaNsElsrEjZqzD+n5h/PILCoXicm3U0WM+ZHNqDi9/Gn1YgyjIGhO?= =?utf-8?q?Xe49DMf06Ys15LBVTd6xbvZy5Vv7oIWSYUwozG8cRQBsWl+OJgz2INP9k41Ynhd9x?= =?utf-8?q?vpoa+235K3smOd/dYx7klUiBddptFpMpigUvWHaU3YUdUHcTUEIth8Az2usi446xl?= =?utf-8?q?aJLRZac78yjMa4RR4AhS1CUHeIyT2C1RBbI/FqkhmU6ABthbHp27fJYIVnLKBbWmn?= =?utf-8?q?8wPMpp3oZxsEecFOcNXIW4g04FFI0K4cIKM+1joIgbDpNDeUtZPWpSQrCNCQg1NTU?= =?utf-8?q?cRweWGJazu2XiQxKBs+s2XDzCcEgGuKO+BzVefdQ8ftd6C1bVCmsfEK4PAFPGLkj3?= =?utf-8?q?Y3wJ3/eOitZXcAs/6d8fX5AzZ4E3qHKmOnAtS/61Sxsa3uReIWFaHsESMeRPXaz3C?= =?utf-8?q?iNa6W43UjWgvVYJnrQtos3dP4nhx1ALMP6YVc2Bcx+ZjFA/MpGuOTdw/vFV8KIVUd?= =?utf-8?q?OYBbLkS20UNV/ATt2hwwJ3KKFPWccP0oRew=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)(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?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Ewov56B3GZU9Li3dzyHp2McY9yfzLx45qi?= =?utf-8?q?2j7dWixPCTLveYiCDRlg+s+QdiEzPlYkqW+uKvkqV3g3NSJ2MI0fsgN/kHUiLyVdM?= =?utf-8?q?d1Uy2D4fqDPEcwqCZEJ/umrll+OkssPfLTPvzC0qyELmKsaDKuUBbeTQiyRPc53Li?= =?utf-8?q?wLAl9HROKXur4T6ggVm69q3hTMIUZhj12fCKwA7yHKq/AFFrJBEfJtR0Q3kRDeWoC?= =?utf-8?q?omXKyatOWq3HRuEA7LM/HHE1HEMl91Yfj9Bnk1t+fLWh8RZa6J4do/mPo6/uO1UOC?= =?utf-8?q?4RmrM5OO6n1UZeBdNKsAKIIQBle451X5HLqz6B2GpNDeONXfTsAMuH5F7K95b8XNg?= =?utf-8?q?8UyNmOL/SSninFmNbVKmFJnNSnxS//3pBIyRsdIMjBul4xe+RnnvxCpRePeyjpM2D?= =?utf-8?q?yo2Hx3u543e/rcfDvGXXLSEi/cdIr9G0fuJzRpkHPC/cW0cZPQio1WDiZYQ+1hfmV?= =?utf-8?q?Ff1kHI2MsQh0r1O6W6nBt7QncZ5l+8/GNRGXawphnuFz35YqSj620ScRiPvbUhr9c?= =?utf-8?q?nSYxVbQxRE9YJFcQK9e4LfWmAznlP26D/oVMmw2eyI//HnZojOjC17RXBNz8oIrge?= =?utf-8?q?J5rTLh7ssgpBTBTs8DbJXEZ9B72ZQgmlmu1oPN3fHAemRpSodNyo/gzvjVMvsQuBJ?= =?utf-8?q?ReUVnMO1hZyV?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a0419b3-e99f-4932-ff95-08dc67401e1d 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:26.1405 (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: 7yyOjzxTEhuTmxEyyaCoi1v4sQwddEvhO6CC/fgOYhuxPvf+OghAxobxNGfwW84FLonmxSo3bTMrccNWvX+KMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 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 --- drivers/pinctrl/pinctrl-scmi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 360b813072df..8ff35869efea 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -492,6 +493,11 @@ int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc) } EXPORT_SYMBOL(pinctrl_scmi_get_pins); +static const struct of_device_id scmi_pinctrl_blocklist[] = { + { .compatible = "fsl,imx95", }, + { } +}; + static int scmi_pinctrl_probe(struct scmi_device *sdev) { int ret; @@ -500,10 +506,14 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) const struct scmi_handle *handle; struct scmi_protocol_handle *ph; const struct scmi_pinctrl_proto_ops *pinctrl_ops; + struct device_node *np __free(device_node) = of_find_node_by_path("/"); if (!sdev->handle) return -EINVAL; + if (of_match_node(scmi_pinctrl_blocklist, np)) + return -ENODEV; + handle = sdev->handle; pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph); From patchwork Sun Apr 28 05:07:52 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: 793163 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2043.outbound.protection.outlook.com [40.107.13.43]) (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 689E820313; Sun, 28 Apr 2024 05:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280437; cv=fail; b=qDPlSnvWoJHEOetcuqYjkV6kb9h6bPbrqg9qcs3VaqnbAjGppOxwSUmpe6g+bI4CxTKuWLoFe574U4Kyev08jIXpwWn5w2U6bCP/WRd1B1Y+aUGy/dUNg4cJJ8ysrJIW12qv2YMxg9TeKIbNnpzs6E2Gu8pTlpQbtcGm8t1Yy48= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714280437; c=relaxed/simple; bh=u2zo87A70Q524uUYu37PgRp46Y/8wvYUyclK1TtgjAk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=bQQNEOy8t3/TgJcANWsY6UMFepM9S20OYUKw7pu9Jgh4/iHu6XTWeetnKh5hxMuKeFKzcH38DYSzJcIoesRapl57XwkJ+dVQyVjYZQLNP3w0DaD4DxHwA9OisbbFZmfKhGbjlW1tv09OzHDlf8UYUdgFpnCjzUS72cNC2U0Y9SE= 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=JZzklQ8I; arc=fail smtp.client-ip=40.107.13.43 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="JZzklQ8I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1H4uUPnSp8oSDZ2f0esfVjGbAfDYSIpeCzKJX7IkbaMILhAGAU6HULB5RDWpBw1z6pfYFCfuKx2df/vNsrUoFkNXQ26IHyU3Wmt4x0aCFqO7GsV0kbrTS/wU/6hVfL+eEVg83aozb90s0yS+beKx3hSezrKznITydDtapj83QYg6j/fftJBjvlXgLOGmO2tbiF1ifuQnaxyZVVPUaWGveLL6bSlYSr0fDjkxdwW9TnGmEmmTxztbV3FIEjOdeNg+olaIxXJycODDHIFlx84FXsicjjWOlfbp0DzeTsaYa9Q0H0aYz9qTM/h731NVNN5B7k+gBFC5jt+fpXznp9Qww== 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=441zx7hphJsY1jNDNq1G1RFMdYNo406aXaxlkaXE8WY=; b=AVw176lN6LolSADN3v1x4Tb9xUDn0PLd+C/MJRuUZ5vG/Hx3PJ1oy6lr0A7mvAiT9ND/iZCHL1s3q96NbzyyYxbeowEQUtlsLLywPz5YtTP0zvnxJc2p/8dnsyBvNAZeVP3QhzEPg5FvHjLYB/gyHtBqy04MIKeCKV8yUWk/mNbzNMK2OSB+wm32EjRLXTZbmyZYXE+bxDZbuTgXLh6Ch41OsNDZXH544SGeTWsXUXYe+i140AqZWjOz5mfnyWgMT/xDyemMo85EoGtTW92YXihuP8f68SikLShAwAfTmL5WV3fZcmn1uSY1zYU/9UijunXA7XEW21JNNpTjviug0A== 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=441zx7hphJsY1jNDNq1G1RFMdYNo406aXaxlkaXE8WY=; b=JZzklQ8IwEhXwfIVr/k/8JfRAJO1hb//lNwJv4R4Fux47FxyrLBDawWGA+nIGVozH/M0t+MwwWDrewqqZqCWUl/8PE2x79zjv2D1ICj5zVnbwNx+aM+iy+neI8dRYQOhLy/EIL/VtLrmNEz8LgmVjc3mpq5t9M0XT4Z2n0i6Moo= 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:32 +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:32 +0000 From: "Peng Fan (OSS)" Date: Sun, 28 Apr 2024 13:07:52 +0800 Subject: [PATCH v3 6/6] pinctrl: imx: support SCMI pinctrl protocol for i.MX95 Message-Id: <20240428-pinctrl-scmi-oem-v3-v3-6-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=18021; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=ej3XyUfHfs0m7EeJwnBpJGh1HUzXr1QHjnWHWK0fA3Q=; b=bt758DRq5byc8V4Wj+NZza5eJ+14h31KbZoDLDH8wSALxbl9HNzsMbYBzSHWrYpAFdewU9fDZ NLn6YKlcPqOD+coj3Bjm412mWWztaS7nJ7/OLd5eJBNFyudHikFUroH 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: 8e37c432-4c32-4930-f5f3-08dc6740219d 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?Imo+DURRyHF8LoewkVzFTx/klsRvm3h?= =?utf-8?q?y3mLweaVpZjdfQ6nTd0OvsXZA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EApiMc0HcLJESz9ZX5owUY48Phx2v2Dcx8q?= =?utf-8?q?Ap3FbbkjVwdE1zPdeZ1giMbXyORVVHVzK+qWMz33RRTHXWRoqPf2coPTZNAX4tHjA?= =?utf-8?q?0BTtysu4kNJxMTc/xbmARRvHkOYL2XHAVUqKfqiCwYyqh2rTpRFPK6IjPyUxmyoQL?= =?utf-8?q?B3tL+T1B8X7agN42fbLukeQzhdh8kcssaLpFY/3ZMLIDWxk6Htfxr38tqfzPRA4aE?= =?utf-8?q?n5d5GWw9OhWZQmiwp4FJeodDafnSdorHbwHiJNMzqtMq1yDkhkIFKDONitTv6mwe2?= =?utf-8?q?bvCkvbRuGTL977gcMEZxVkcXNOhwONS966bjEjSz5V3bNt19cHaGu4WpuNJfNWG91?= =?utf-8?q?4kB2IoRUPvpUoRWufz7BzgbdRpJkySyw8G3xVfsWooFldka2lxAMkcC0=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?GzfEUL1yE2M084BlJ9jVscGSquyh?= =?utf-8?q?AUxt+QrqFecH6fd4W+aMD6HnRFAnWBPst2SgDSKQjm9k4M65L2OhqNrPTET32wSPB?= =?utf-8?q?28ht0TQEg4sGWylg9jpM+wEJQCJLvKVZ3gd9jI5LTnfurYSuFlrQV7ZIu0m3GJ52t?= =?utf-8?q?uz4FF4lyNzZUWXhJTSWMdVdg7ZqJBd8ZkxjoI/1Ehh0EpKlVteoSpPuxlZTt8Z20R?= =?utf-8?q?KGsPUVfe/GmsNEZZKxEZqaC3sbmjm1NbgTw+jBvGqth14cWrR+nKdT444QEkmkqMR?= =?utf-8?q?7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J2KKGJmIEsvxVuZsgojkVS3ZSnz7QAm85fh5KCwd5FXNXi0JSRXPv+?= =?utf-8?q?wu+twdeG6y01JpDsihbRN0+jlLHZvZ/3RjS1bE/25lRIBn3WlB90n4EQUHcm88JOf?= =?utf-8?q?vCWtiITEfZ9EeRm7NRBt/zkc/CB8ipXkD5cwNqayQnrK7rzYJVmUtUDJvxrFdUNcp?= =?utf-8?q?SMiKjXSjSV2P0Qb71Mjh9TruzMLmK10WpYwKPXOi7i5ar9eW0HuSkCNZEZSS568mK?= =?utf-8?q?4SPPdkjynGBP89Hcl0SRVnDMnqSOqrT9AYbbXfi8Hqy4fb5hOYoHkXHzkyAtG/fGB?= =?utf-8?q?NK2GTENMooy4fpiojAygvuOGBEl9lsfchSrehXm8QEYw2l4NLKZPn6U/5Lnq/dOEn?= =?utf-8?q?g3bgB039rNOS?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e37c432-4c32-4930-f5f3-08dc6740219d 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:32.0295 (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: TZxOtPwudfIkbnqtW5X5xETiHDR9PUVQ8fCb4IFIKsbC1gBbslAW9Nvuc6J9kBSjlEA1EBg6i0FGRxFR0b26zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 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 Linux generic pinctrl properties(pinmux, bias-pull-[up, down], and etc), need extract the value from the property and map them to the format that i.MX95 SCMI pinctrl protocol understands, so add this driver. Signed-off-by: Peng Fan --- drivers/pinctrl/freescale/Kconfig | 7 + drivers/pinctrl/freescale/Makefile | 1 + drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 574 +++++++++++++++++++++++++++ drivers/pinctrl/pinctrl-scmi.h | 1 + 4 files changed, 583 insertions(+) diff --git a/drivers/pinctrl/freescale/Kconfig b/drivers/pinctrl/freescale/Kconfig index 27bdc548f3a7..bc23d9f7b5bb 100644 --- a/drivers/pinctrl/freescale/Kconfig +++ b/drivers/pinctrl/freescale/Kconfig @@ -7,6 +7,13 @@ config PINCTRL_IMX select PINCONF select REGMAP +config PINCTRL_IMX_SCMI + tristate "i.MX95 pinctrl driver using SCMI protocol interface" + depends on PINCTRL_SCMI + 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..13c65ba51269 --- /dev/null +++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c @@ -0,0 +1,574 @@ +// 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 "../pinctrl-scmi.h" +#include "../pinctrl-utils.h" +#include "../core.h" +#include "../pinconf.h" +#include "../pinmux.h" + +#define DRV_NAME "scmi-pinctrl-imx" + +#define SCMI_NUM_CONFIGS 4 + +struct imx_pin_group { + struct pingroup data; +}; + +struct scmi_pinctrl_imx_info { + struct device *dev; + struct imx_pin_group *groups; + unsigned int ngroups; + struct pinfunction *functions; + unsigned int nfunctions; + unsigned int grp_index; +}; + +/* 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 + +/* + * pinmux format: + * pin[31:21]|mux[20:16]|daisy_value[15:12]|daisy_valid[11:11]|daisy_id[10:0] + */ +#define IMX_PIN_ID_MASK GENMASK(31, 21) +#define IMX_PIN_MUX_MASK GENMASK(20, 16) +#define IMX_PIN_DAISY_VAL_MASK GENMASK(15, 12) +#define IMX_PIN_DAISY_VALID BIT(11) +#define IMX_PIN_DAISY_ID_MASK GENMASK(10, 0) + +static inline u32 get_pin_no(u32 pinmux) +{ + return FIELD_GET(IMX_PIN_ID_MASK, pinmux); +} + +static inline u32 get_pin_func(u32 pinmux) +{ + return FIELD_GET(IMX_PIN_MUX_MASK, pinmux); +} + +static inline u32 get_pin_daisy_valid(u32 pinmux) +{ + return FIELD_GET(IMX_PIN_DAISY_VALID, pinmux); +} + +static inline u32 get_pin_daisy_val(u32 pinmux) +{ + return FIELD_GET(IMX_PIN_DAISY_VAL_MASK, pinmux); +} + +static inline u32 get_pin_daisy_no(u32 pinmux) +{ + return FIELD_GET(IMX_PIN_DAISY_ID_MASK, pinmux); +} + +static int pinctrl_scmi_imx_map_pinconf_type(enum pin_config_param param, + u32 *mask, u32 *shift) +{ + u32 arg = param; + + switch (arg) { + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: + *mask = BIT(12); + *shift = 12; + break; + case PIN_CONFIG_DRIVE_OPEN_DRAIN: + *mask = BIT(11); + *shift = 11; + break; + case PIN_CONFIG_BIAS_PULL_DOWN: + *mask = BIT(10); + *shift = 10; + break; + case PIN_CONFIG_BIAS_PULL_UP: + *mask = BIT(9); + *shift = 9; + break; + case PIN_CONFIG_SLEW_RATE: + *mask = GENMASK(8, 7); + *shift = 7; + break; + case PIN_CONFIG_DRIVE_STRENGTH: + *mask = GENMASK(6, 1); + *shift = 1; + break; + default: + return -EINVAL; + } + + return 0; +} + +static int pinctrl_scmi_imx_dt_group_node_to_map(struct pinctrl_dev *pctldev, + struct device_node *np, + struct pinctrl_map **map, + unsigned int *reserved_maps, + unsigned int *num_maps, + const char *func_name) +{ + struct device *dev = pctldev->dev; + unsigned long *cfgs = NULL; + unsigned int n_cfgs, reserve = 1; + int i, n_pins, ret; + u32 ncfg, val, mask, shift, pin_conf, pinmux_group; + unsigned long cfg[IMX_SCMI_NUM_CFG]; + enum pin_config_param param; + struct property *prop; + const __be32 *p; + + n_pins = of_property_count_u32_elems(np, "pinmux"); + if (n_pins < 0) { + dev_warn(dev, "Can't find 'pinmux' property in node %pOFn\n", np); + return -EINVAL; + } else if (!n_pins) { + return -EINVAL; + } + + ret = pinconf_generic_parse_dt_config(np, pctldev, &cfgs, &n_cfgs); + if (ret) { + dev_err(dev, "%pOF: could not parse node property\n", np); + return ret; + } + + pin_conf = 0; + for (i = 0; i < n_cfgs; i++) { + param = pinconf_to_config_param(cfgs[i]); + ret = pinctrl_scmi_imx_map_pinconf_type(param, &mask, &shift); + if (ret) { + dev_err(dev, "Error map pinconf_type %d\n", ret); + return ret; + } + + val = pinconf_to_config_argument(cfgs[i]); + + pin_conf |= (val << shift) & mask; + + } + + reserve = n_pins * (1 + n_cfgs); + + ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, num_maps, + reserve); + if (ret < 0) + goto free_cfgs; + + of_property_for_each_u32(np, "pinmux", prop, p, pinmux_group) { + u32 pin_id, pin_func, daisy_id, daisy_val, daisy_valid; + const char *pin_name; + + i = 0; + ncfg = IMX_SCMI_NUM_CFG; + pin_id = get_pin_no(pinmux_group); + pin_func = get_pin_func(pinmux_group); + daisy_id = get_pin_daisy_no(pinmux_group); + daisy_val = get_pin_daisy_val(pinmux_group); + cfg[i++] = pinconf_to_config_packed(IMX_SCMI_PIN_MUX, pin_func); + cfg[i++] = pinconf_to_config_packed(IMX_SCMI_PIN_CONFIG, pin_conf); + + daisy_valid = get_pin_daisy_valid(pinmux_group); + if (daisy_valid) { + cfg[i++] = pinconf_to_config_packed(IMX_SCMI_PIN_DAISY_ID, + daisy_id); + cfg[i++] = pinconf_to_config_packed(IMX_SCMI_PIN_DAISY_CFG, + daisy_val); + } else { + ncfg -= 2; + } + + pin_name = pin_get_name(pctldev, pin_id); + + dev_dbg(dev, "pin: %s, pin_conf: 0x%x, daisy_id: %u, daisy_val: 0x%x\n", + pin_name, pin_conf, daisy_id, daisy_val); + + ret = pinctrl_utils_add_map_configs(pctldev, map, reserved_maps, + num_maps, pin_name, + cfg, ncfg, + PIN_MAP_TYPE_CONFIGS_PIN); + if (ret < 0) + goto free_cfgs; + }; + + +free_cfgs: + kfree(cfgs); + return ret; +} + +static int pinctrl_scmi_imx_dt_node_to_map(struct pinctrl_dev *pctldev, + struct device_node *np_config, + struct pinctrl_map **map, + unsigned int *num_maps) + +{ + unsigned int reserved_maps; + struct device_node *np; + int ret = 0; + + reserved_maps = 0; + *map = NULL; + *num_maps = 0; + + for_each_available_child_of_node(np_config, np) { + ret = pinctrl_scmi_imx_dt_group_node_to_map(pctldev, np, map, + &reserved_maps, + num_maps, + np_config->name); + if (ret < 0) { + of_node_put(np); + break; + } + } + + if (ret) + pinctrl_utils_free_map(pctldev, *map, *num_maps); + + return ret; +} + +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, +#ifdef CONFIG_OF + .dt_node_to_map = pinctrl_scmi_imx_dt_node_to_map, + .dt_free_map = pinconf_generic_dt_free_map, +#endif +}; + +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 *pmx = pinctrl_dev_get_drvdata(pctldev); + enum pin_config_param config_type; + u32 mask, val, shift; + u32 config_value; + + if (!config) + return -EINVAL; + + config_type = pinconf_to_config_param(*config); + + ret = pinctrl_scmi_imx_map_pinconf_type(config_type, &mask, &shift); + if (ret) + return ret; + + ret = pmx->ops->settings_get_one(pmx->ph, pin, PIN_TYPE, + IMX_SCMI_PIN_CONFIG, &val); + /* Convert SCMI error code to PINCTRL expected error code */ + if (ret == -EOPNOTSUPP) + return -ENOTSUPP; + if (ret) + return ret; + + config_value = (val & mask) >> shift; + *config = pinconf_to_config_packed(config_type, config_value); + + dev_dbg(pmx->dev, "pin:%s, conf:0x%x, type: %d, val: %u", + pin_get_name(pctldev, pin), val, config_type, config_value); + + 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 *pmx = pinctrl_dev_get_drvdata(pctldev); + enum scmi_pinctrl_conf_type config_type[SCMI_NUM_CONFIGS]; + u32 config_value[SCMI_NUM_CONFIGS]; + 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 > SCMI_NUM_CONFIGS) { + 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_err(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 const struct pinconf_ops pinctrl_scmi_imx_pinconf_ops = { + .is_generic = true, + .pin_config_get = pinctrl_scmi_imx_pinconf_get, + .pin_config_set = pinctrl_scmi_imx_pinconf_set, + .pin_config_config_dbg_show = pinconf_generic_dump_config, +}; + +static int scmi_pinctrl_imx_parse_groups(struct device_node *np, + struct imx_pin_group *grp, + struct scmi_pinctrl_imx_info *info) +{ + const __be32 *p; + struct device *dev; + struct property *prop; + unsigned int *pins; + int i, npins; + u32 pinmux; + + dev = info->dev; + + dev_dbg(dev, "group: %pOFn\n", np); + + /* Initialise group */ + grp->data.name = np->name; + + npins = of_property_count_elems_of_size(np, "pinmux", sizeof(u32)); + if (npins < 0) { + dev_err(dev, "Failed to read 'pinmux' property in node %s.\n", + grp->data.name); + return -EINVAL; + } + if (!npins) { + dev_err(dev, "The group %s has no pins.\n", grp->data.name); + return -EINVAL; + } + + grp->data.npins = npins; + + pins = devm_kcalloc(info->dev, npins, sizeof(*pins), GFP_KERNEL); + if (!pins) + return -ENOMEM; + + i = 0; + + of_property_for_each_u32(np, "pinmux", prop, p, pinmux) { + pins[i] = get_pin_no(pinmux); + dev_dbg(info->dev, "pin reg: 0x%x", pins[i] * 4); + i++; + } + + grp->data.pins = pins; + + return 0; +} + +static int scmi_pinctrl_imx_parse_functions(struct device_node *np, + struct scmi_pinctrl *pmx, + u32 index) +{ + struct device_node *child; + struct pinfunction *func; + struct imx_pin_group *grp; + const char **groups; + struct scmi_pinctrl_imx_info *info = pmx->priv; + u32 i = 0; + int ret = 0; + + dev_dbg(info->dev, "parse function(%u): %pOFn\n", index, np); + + func = &info->functions[index]; + + /* Initialise function */ + func->name = np->name; + func->ngroups = of_get_child_count(np); + if (func->ngroups == 0) { + dev_err(info->dev, "no groups defined in %pOF\n", np); + return -EINVAL; + } + + groups = devm_kcalloc(info->dev, func->ngroups, sizeof(*func->groups), + GFP_KERNEL); + if (!groups) + return -ENOMEM; + + for_each_child_of_node(np, child) { + groups[i] = child->name; + grp = &info->groups[info->grp_index++]; + ret = scmi_pinctrl_imx_parse_groups(child, grp, info); + if (ret) { + of_node_put(child); + return ret; + } + i++; + } + + func->groups = groups; + + return 0; +} + +static int scmi_pinctrl_imx_probe_dt(struct scmi_device *sdev, + struct scmi_pinctrl *pmx) +{ + int i, ret, nfuncs; + struct device_node *child; + struct scmi_pinctrl_imx_info *info = pmx->priv; + struct device_node *np = sdev->dev.of_node; + + info->dev = &sdev->dev; + + nfuncs = of_get_child_count(np); + if (nfuncs <= 0) { + dev_err(&sdev->dev, "no functions defined\n"); + return -EINVAL; + } + + info->nfunctions = nfuncs; + info->functions = devm_kcalloc(&sdev->dev, nfuncs, + sizeof(*info->functions), GFP_KERNEL); + if (!info->functions) + return -ENOMEM; + + info->ngroups = 0; + for_each_child_of_node(np, child) + info->ngroups += of_get_child_count(child); + + info->groups = devm_kcalloc(&sdev->dev, info->ngroups, + sizeof(*info->groups), GFP_KERNEL); + if (!info->groups) + return -ENOMEM; + + i = 0; + for_each_child_of_node(np, child) { + ret = scmi_pinctrl_imx_parse_functions(child, pmx, i++); + if (ret) { + of_node_put(child); + return ret; + } + } + + return 0; +} + +static const struct of_device_id scmi_pinctrl_imx_allowlist[] = { + { .compatible = "fsl,imx95", }, + { } +}; + +static int scmi_pinctrl_imx_probe(struct scmi_device *sdev) +{ + int ret; + struct device *dev = &sdev->dev; + struct scmi_pinctrl *pmx; + const struct scmi_handle *handle; + struct scmi_protocol_handle *ph; + struct device_node *np __free(device_node) = of_find_node_by_path("/"); + const struct scmi_pinctrl_proto_ops *pinctrl_ops; + + if (!sdev->handle) + return -EINVAL; + + if (!of_match_node(scmi_pinctrl_imx_allowlist, np)) + return -ENODEV; + + handle = sdev->handle; + + 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->priv = devm_kzalloc(dev, sizeof(struct scmi_pinctrl_imx_info), + GFP_KERNEL); + if (!pmx->priv) + 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 = pinctrl_scmi_get_pins(pmx, &pmx->pctl_desc); + if (ret) + return ret; + + ret = scmi_pinctrl_imx_probe_dt(sdev, pmx); + if (ret) + return ret; + + 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"); diff --git a/drivers/pinctrl/pinctrl-scmi.h b/drivers/pinctrl/pinctrl-scmi.h index ae9e0be7c89e..c9a299241d7f 100644 --- a/drivers/pinctrl/pinctrl-scmi.h +++ b/drivers/pinctrl/pinctrl-scmi.h @@ -22,6 +22,7 @@ struct scmi_pinctrl { struct pinctrl_pin_desc *pins; unsigned int nr_pins; const struct scmi_pinctrl_proto_ops *ops; + void *priv; }; int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, struct pinctrl_desc *desc);