From patchwork Fri Feb 23 07:15: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: 13568580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09A2AC5478C for ; Fri, 23 Feb 2024 07:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7b2QqW1nPdvR+2OX/3Oxa5mcX72CVEq2BeJKuW85jv8=; b=PxzW45YmWoR5El roiDNx9cX14B59esgTIWuZcz8A4MbB0Lcp+6Yxv+llR7OQBkuPPavphOYiP6TsrFIiaJlIE8BmIVb EybiyGlt8atMsZtqkYl2Byt1jb7dzFkruxz64aG1bWtYhCFigBaRo4ocLwMxIctoMuKAygbzLzlPq TuRZKHt4iBEsDL1vlqbAV3dBF4z/pxvO7dMo3DTth9fsYXAQ4gi2XbsTTJ4RFf4glcCaZQTX1KVky SODbufutvoSvQZKGiaCPKeNbUI1m4l80fC4y/ChixrYUUED4KVjz/lA+n4Pg8kp9TKTatxmBFgRus HyVcaUlC2LQSZbK4d+rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdPfa-00000008Fzk-3ZE3; Fri, 23 Feb 2024 07:08:32 +0000 Received: from mail-am0eur02on20600.outbound.protection.outlook.com ([2a01:111:f403:2606::600] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdPfF-00000008Fuw-1w1G for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 07:08:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jaYUZPklmxM426S03e5rp+fdy5+U9nlCd3hmx5E8K1iaQyGvhRTUcGKNYTGDZh6Q+/e8wC8NsS3n/xdsGoKboGBoXXKQSC403RNvZGq4oKi8VxmCK/ghCxTX+KOWQpymX5TYFE6NWh4nsTYZu0BFE76yUpsX0reKDog8JxpxM0WWNW+i8KYU1gNI7ZuSByv5RaKLhGaLgje37vuqJ2wC1nNI/kJr13//ZMzRHO8ZT8/ja1173vax5Jow0x77t849S7xiaP4xJ+zXyUGdnC87OIDX5cTRVfA7OeEcDOgMXfxttIkNw/fWwNkH7Tqk1LQ38QcKQrohjtHbwey/jp9bLg== 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=2IULnDMdSt6WJwg+Taf/HHBWqcec6eoVyfZLSyNxiOU=; b=W0l5ojqYZYfr+0ne9s22Ovl4X6u9b8G+JeLsgkuHyYA+NXIMcjC9AbgxuCTl0LiilUmLrR6Q23n/pBZaxosJmJhMKfPkYHntvEjLHwLRhwRXDWVlaUxk8X5m8j4IV1gG+CROFdUi0cxv11tfKN2acDlk7NNos/jQ+xgJ20uRXvZ7i+YbByU7kwNxn1XT4Ng+AgQccA6dqwlADGYLNT471Gh9T6TYkSAReRl8fnxBzGfJksUySIsy2QrgcH/+f3CUCERJu7hqw1Z0HmppmyaTvzNPZW+pn8aFcuAPugj5GMoTSzAC1TDKsONLKs31/wcl8JxW5W9kxnfWT3XPDa82Bw== 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=2IULnDMdSt6WJwg+Taf/HHBWqcec6eoVyfZLSyNxiOU=; b=DXXe1wLXTQWEAevCge0OFVCaBXxemN7ElIgSm14HRWTVERWMTiCabLZG8fy2xf5McRPjDwQOJsHGve63YfBbU/nIR6eH1JstVcCoBUoOk18OmFAV3R7tKm3nLPbXr+bL9cXOtUDwlO8BTbM8MQAH+f80/zmS6vHCJEER0wbofrE= 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 AM8PR04MB8051.eurprd04.prod.outlook.com (2603:10a6:20b:241::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.37; Fri, 23 Feb 2024 07:07:49 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::4ac3:3559:4200:38e1]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::4ac3:3559:4200:38e1%4]) with mapi id 15.20.7292.036; Fri, 23 Feb 2024 07:07:49 +0000 From: "Peng Fan (OSS)" To: sudeep.holla@arm.com, cristian.marussi@arm.com, linus.walleij@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, aisheng.dong@nxp.com, nitin.garg_3@nxp.com, ranjani.vaidyanathan@nxp.com, ye.li@nxp.com, Peng Fan Subject: [PATCH] pinctrl: scmi: support i.MX OEM pin configuration type Date: Fri, 23 Feb 2024 15:15:57 +0800 Message-Id: <20240223071557.2681316-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SI2PR01CA0005.apcprd01.prod.exchangelabs.com (2603:1096:4:191::23) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM8PR04MB8051:EE_ X-MS-Office365-Filtering-Correlation-Id: 36d3bb90-ad0e-4a7e-800c-08dc343e250a X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UiXob72qTnPXIxNQiZbiMMxVSu9diUm3BDxeg20LOpQGs2aCDvNS7wnIoZoNADbL1HfkEcg8tLAdctK4f/N7DJO+um0rZQR9SPJv4dkREJTfFpFJydqAxMXDJpfkASxYb08wXwj4hynF7e+Qyq90J1a7O406VLR5aDm4dL1kHwlumNFunSHEJrS2ljO+TcGpUUjJj74zB01o44wq0G/cGX0PyGkcLfJfrkBxNBAmiUCM2xRIBOi0NInhPKB7OX56wmdCIQXie0NG1QxEfanQk7gP4h7N/FeMlIly/9YCm+erPkjSEbbSzoJC/RduMze4zq+mEUFi38CYIqmCaJA9TBdr9aLWFGn9ou/fVy89ICgpRwddQv65KlTG3DDOetOHlg493nLyVl/j7ptsjRKpbTjHDa1Bb10mfMKjZdlyvJ+PhfnxvvDv0nSU5PyLOAsPdHt2zCfPdmjczVSWBQtUw6K0ATzlhS9X+bO1JhJGD6vemXP5lfYuJTL8dXnfaxPc1Q6jW4aOl+0jNR3i4ZZOqiCbhl7J16zGCmTIJp47eXTlX0KIl7p87uE+6GyUUVzLYXeBSBQu98oLw+Hvf7TejM69MAsgat9Q3KY6VU+8Yi4= 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)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +OM36pD3QbzyHYZ3IznLtTdoGKE/bmdSBqyMgwnhnWyjx3huragDPd8vRoo8fGKvfJxlKIudKtdRUtES6Lbvl6V78En4L1DVhhLBdn8qn9XmKoxRMt1llurJLtoMlulsuAF5jaMndFjMEc7zxMJGvuUkFSQMTf0xewbrySgNeVAcakbEVqOrRxXsuDOckDnNgaVuhmCUkiNNroj39frVwGFFTizoqFeD0BGBz5sCS8ffxwzgFhQENgnTkqcsqAYf4sSViuR7Vm7VfovVHYO3x6tkySuKYKHfY+jEuL0tchcJXeZbMQAWZJnKkk3f+v44AEqHISJxTmS4hhMTYT60ihQ87m5NJurYcTFX28mJ1rlvl6kcmRffQ1Qy7RbGBAa0Q4x+X4UKpTqHyMotHX8AR5lwOi8QFCm46zKcto9a/uqQtqWUOQlY5KHUgMaebXPfLy5IMiXiFQW7/j4osECFQ14sGSDhAP/IYFrYCbrmqw3dz9Q0I6IDn5vRz3ZrQfhurykzu7GtMfGmPNrarQgPoYdZmlmURb4CV/tokipVc7PHzGm6y39yUgju6u5bGLJkXXQEFK0Op5DJRwvU0hBR0V6gljDKYkTB7+KwH3OSggeN6Lh4jCkuulThp9ad3BD2spLq1TqaCi5XLeHFE7uWE1+4bdr6gEg2PTwCxGnomak5dvsRCj+RP7h1xXs4lic+knXQO9omNw1utiaQkfxi27oxnmFX01gh48JvT+yBQTe1xDu61klIZcQAAJvUmCEPeARV8sIj+SYRq3ewgCBCM+/H28XELk88YEvH2m1/to+QwSIfygnUzZlAUu80HNJwTKyXVlJ4G0L3SyiYRRfvXBcUD8r9IdbIfr0uDfZyxsmZtGh2f/8boTF5ycMhFcbs8XfygI/hfWoAn1pxUQ+5cj/RKC9aT+cOC6EQoEIutorkAlJR2hXnBhXWXMhuDg0V+hrRUGvmbJH35ePyy7AlnVt4zeYDiYDXFXDNRZ1NoS8fw+AX9zE3qT/uqeRoy1vSUycXtLJ3CAOqJiQOwr50N7WSHddTICteVjicizACKmJl/po7UQjQM3OLfVrMyiYUBhDfNLBxo7HPKEXPM32T+3ffzYXTtja5Spbwu0aswbIuHLEWgLD8iOYrf6McbfZ5p+rahINo+a/ntfJh5pzeu8vb4PWahkzKJZ+wV5erpn087QnBE1AqnrjwMlCb1uJ/Mgwrqh/0hSyrsVfODbQxRGJ8onY9geQVlyPIhMBkAxn2BIwmvxt6lwyS/3qkUnehcRB5rTKdAV4SYEMu67ERa25zbYbPuA7pYmpZ78oKuh6illPd8EKx3XpZZ9rxr+1xNZANB5PNdK3o+T4dQWdgIWkl8EjeL7P6ryeARq+IHVtmFCXwkiYacsdn3JU69pE4R9v+9S5agQs0ZW/29SJKnVd6h+yVNb2PxwQm++n18sqZVxa4khe4uQolg49eeK+OMIf40Rg4Rj1g6hxwu0KdKAtPxpETcOmVGB9OYxIWHlit1f9LaTgHwtnb9u/gxsuFXpiMfYVKksJ92BFiQ3WmC1n21gTdHQlGFVQjgfg7MfRvwDG80DfPUV9Zw51Z7jGy X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36d3bb90-ad0e-4a7e-800c-08dc343e250a X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 07:07:49.7566 (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: FqEXUMXVUeEeM+ioSX0fP+Gd8i1KEpO6ampx3TrLeBkVgnqc0XZSOusoA0TMEI4QZJFykdwI8YUwq1GAYufqqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8051 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240222_230809_675091_DBD7E3EF X-CRM114-Status: GOOD ( 14.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan i.MX95 System Manager FW supports SCMI PINCTRL protocol, but uses OEM Pin Configuration type, so extend the driver to support custom params. Signed-off-by: Peng Fan --- V1: Based on https://lore.kernel.org/all/20240223-pinctrl-scmi-v4-0-10eb5a379274@nxp.com/ This is an reimplementation for supporting i.MX95 OEM settings. With this patch, the dts will be like: +#define IMX95_PAD_SD1_CLK__USDHC1_CLK(val) \ + sd1clk { \ + pins = "sd1clk"; \ + imx,func-id = <0>; \ + imx,pin-conf = ; \ + } .... + + pinctrl_usdhc1: usdhc1grp { + IMX95_PAD_SD1_CLK__USDHC1_CLK(0x158e); + IMX95_PAD_SD1_CMD__USDHC1_CMD(0x138e); .... + }; drivers/pinctrl/pinctrl-scmi.c | 10 ++++++++++ drivers/pinctrl/pinctrl-scmi.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-scmi.h diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index f2fef3fb85ae..e58f1aaf9963 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -19,6 +19,7 @@ #include #include +#include "pinctrl-scmi.h" #include "pinctrl-utils.h" #include "core.h" #include "pinconf.h" @@ -472,6 +473,13 @@ static const struct pinconf_ops pinctrl_scmi_pinconf_ops = { .pin_config_config_dbg_show = pinconf_generic_dump_config, }; +static const struct pinconf_generic_params pinctrl_scmi_oem_dt_params[] = { + {"imx,func-id", IMX_SCMI_PIN_MUX, -1}, + {"imx,daisy-id", IMX_SCMI_PIN_DAISY_ID, -1}, + {"imx,daisy-conf", IMX_SCMI_PIN_DAISY_CFG, -1}, + {"imx,pin-conf", IMX_SCMI_PIN_CONF, -1}, +}; + static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx, unsigned int *nr_pins, const struct pinctrl_pin_desc **pins) @@ -548,6 +556,8 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev) pmx->pctl_desc.pctlops = &pinctrl_scmi_pinctrl_ops; pmx->pctl_desc.pmxops = &pinctrl_scmi_pinmux_ops; pmx->pctl_desc.confops = &pinctrl_scmi_pinconf_ops; + pmx->pctl_desc.custom_params = pinctrl_scmi_oem_dt_params; + pmx->pctl_desc.num_custom_params = ARRAY_SIZE(pinctrl_scmi_oem_dt_params); ret = pinctrl_scmi_get_pins(pmx, &pmx->pctl_desc.npins, &pmx->pctl_desc.pins); diff --git a/drivers/pinctrl/pinctrl-scmi.h b/drivers/pinctrl/pinctrl-scmi.h new file mode 100644 index 000000000000..fcc61bc19c98 --- /dev/null +++ b/drivers/pinctrl/pinctrl-scmi.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DRIVERS_PINCTRL_SCMI_H +#define __DRIVERS_PINCTRL_SCMI_H + +/* OEM VENDOR Pin Configuration Type */ +#define IMX_SCMI_PIN_MUX 192 +#define IMX_SCMI_PIN_CONF 193 +#define IMX_SCMI_PIN_DAISY_ID 194 +#define IMX_SCMI_PIN_DAISY_CFG 195 + +#endif /* __DRIVERS_PINCTRL_SCMI_H */