From patchwork Tue Jul 23 13:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 814043 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012025.outbound.protection.outlook.com [52.101.66.25]) (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 2EE9D15442A; Tue, 23 Jul 2024 13:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740799; cv=fail; b=H30SYQ+b56GhJAwhnBNq5w57MN11SvnJ14mQ83mpiq8nKFWSo4OTARKFxcw5JP8IpacsiGnyCeMHXqCeqh+BeAM7Dv+pDtZEHCuq9rkn4tuYBg0n+s9Kn6hazv2ZKoq3Hq4A+48cCPjmDhSRuKYZYrrJxx8NEvQOU2iNnQNHeHw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740799; c=relaxed/simple; bh=2NdiY+T3N9IcorQfLiDyGR/+JqBOfZq2H1rJqijaljE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=u0Eu3Sxllm15FWJlKIUByXfbfWUnvxbJdmoBEXTkr6lZSzTExmzFQB+a0F+oNfTCfTvifiEkkb4Zg3GX89R3VH3Ww/PXgcS2IFqQfLcffglx3xsr0bwm0WbDmab26FXO/TyoosGmFns3PNcQxjRA0KflSW/wXDEQjotUOgCi2Rs= 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=g8amCbL7; arc=fail smtp.client-ip=52.101.66.25 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="g8amCbL7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BxAFK8lQ6Xyp48GqjFTnZrGdLJK/yCulCClmm2k5jtWMDSTgCLTzt27+sOmrACB8OBj7Kto7BoiVOVvopQpDXvFJs4+3onIHOTzngBUwsuTUVvOa2oOBcYCN4gxZnkfGFuF3WBgjQOrLD6yZNXaoeFpKmbGG5TCg5tb66yKN8ynK05TPM95YkzW/nOtx4EiJN51Nl98FerSWQlS+vo7DsU6UzdGforUM9OHm6y/CQqLbZQkIIuQjYMIMpAqLnSOz4tUpR5mU9ySbEhcHKL7dkcUpkkYaTBXntGj5xA0j4doZtbvvw59wWzY9YAX0gfgXbvbWbps/Wzxd+HA88hK6Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KZmlq/AZNxoGPdGzwa05dL1hWgBWRU/ZlkGDI4yIPQ0=; b=Jc5g0MwMm5aoNPoIMyMf2FOXpg45lP9F4E9C48jH3+Lr/ej1uN1FQD5YWdNyDb7vXJMOUvmz06rinxhrfIL/c7p2NI0S0Lfn7kNQchkyhDCdCKJ4hfIzMPiXBdwwiWxlKHh3SkgErSoxBZ7qeuOk/M65Vd2vWzr6ae+fu6XURK5rcSD2nQRPZF/ehzUgI3gjZhvKhqv662lR9rn4pey0oIPuOUjs5kSKvY7MR5wGe/5DYIxf0tDoMdGMva2xIaw9fFZfuYpAAFNcpoBfPVYNi06kTo+AqRaAgOpsF0BVFkfYL0YQIWuQoGknGS9zJrUEvT2ykfFogDBjDo7UUTp4Gw== 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=KZmlq/AZNxoGPdGzwa05dL1hWgBWRU/ZlkGDI4yIPQ0=; b=g8amCbL7wmOt66lxGiK3CILFGkm8sISwNpddSsKeUtnhlQRI3xaI/rpv555+d9MlcVFqKMX4N52+IREWdDAnFIgScruxTv0B4ZUo/HOG8InKuPu+Yyt3cG7ZYxTaK2UsLwdWkeWyRfEIbDp7XYaBCQmKIF+BCE4s7Vbgacbn3i8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PR3PR04MB7258.eurprd04.prod.outlook.com (2603:10a6:102:80::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Tue, 23 Jul 2024 13:19:54 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%5]) with mapi id 15.20.7784.013; Tue, 23 Jul 2024 13:19:54 +0000 From: Andrei Stefanescu To: Linus Walleij , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , Ghennadi Procopciuc Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux Team , Andrei Stefanescu , Florin Buica Subject: [PATCH 1/3] pinctrl: s32cc: enable the input buffer for a GPIO Date: Tue, 23 Jul 2024 16:18:30 +0300 Message-ID: <20240723131832.1171036-2-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> References: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AS4PR09CA0016.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::8) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) 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: AM9PR04MB8487:EE_|PR3PR04MB7258:EE_ X-MS-Office365-Filtering-Correlation-Id: df165f30-729d-4797-9ed5-08dcab1a23f9 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?sGjl+GRQ1/AsLq/DCeAEGGk2KHJrW52?= =?utf-8?q?Vbbf9wxPY6MVJprAogkBJBGMr5Kj48/RhVdFVDYdlZnNSnJDF+QVyyteWh6mmWiDq?= =?utf-8?q?5AZRQSjcOMYXn6LR13lf13Wt4ZiMRdouMH6EIvh2GymaCrKjG12Yt8d9jHh3nFto4?= =?utf-8?q?GwDa2OiAntQIt+Mo9PtoIrgZ9sznlB3WPhjiy3WtXYqoOnNc1LP48BFjt9ZEVLfFg?= =?utf-8?q?2QAPAS/98MPiUOeBJDrsithUSX8fM/tp1JJTfVmezp7/pYJmry7U0LYHT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?utf-8?q?WyPXji6k3DXjUpMV2sjwT17yHrvqOjRujiTR2sacERgEM9GUe3AXsSdcQl8Q5a3k+?= =?utf-8?q?QlHime5Z6tx2g1+Suqfkapp0c1MW6lxgQNge5g4xxbFlyI4JV0mmw4Fa7SKuRULri?= =?utf-8?q?fvbcPlat6DJjO1nsNg2Tx+3EgS46WxzT8IGvLW9yGtW7RAepbiOmHukIVfM7Dt1IZ?= =?utf-8?q?Um9jgstCTTWjRY3ikc8WUJNiTymm4Sh4CQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8487.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?huj7WaUffUUexxVqC8xS5+zRS+2K?= =?utf-8?q?q/NCHYRsTs4ttQROYMCnY3oaEjBaXI0kYOPkI7rDODwupvubur9VX74Tr2eQX4m1v?= =?utf-8?q?Tvmnbu0pZC65hljmGfjNUMzg8ldlsaU40FdTtwNRykRgIvaa/OaWBouZU8uRlMFiA?= =?utf-8?q?DUjpUO37sFwi3P/Kibydr43PZnTmjosWHHcd9KE9uDBlIkFylLiDpSOr8/5AJBEky?= =?utf-8?q?dl8gK1f12G57dsIksi+JVIj+SEU2Scbhm7atuN3DLjZDEBvuEsua/fxH1hNb+QyZq?= =?utf-8?q?cwhJbbeTjDPSdAmdyk30ZPZP6g9tXsAxuCr8E7QgFRSE73eZzCle2qeWAFfTTd/Pk?= =?utf-8?q?/AL73Be2tpCuWdKXeOu+ITVr3LeZadsKRV20wc4rm+ycpHBB0/9uh2/K4OuDyyXNf?= =?utf-8?q?7eYkCuj+a80NxKA+T0tqdAJIMcGKIr/JWUldKZXLolaQp8MbpbDsPG4H13SmLymC1?= =?ut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= =?utf-8?q?T7fMRCfz2ivMM7Ue/xA6D+mAjdX5mPo/dKiBUKyFzat360Ekwe/jJomIWKn9K09NB?= =?utf-8?q?AYUsisWY62k/rgS0Rb7u6exYAgP7TO9wJ+g35b4Whmo7ESatkPvYTkf2p1u06VqnE?= =?utf-8?q?4/StcWIhmmS9oeJuaX71CPEXfFHmGJZ2GyCKNz60T+uOU608T6phXw1vjlyACauuI?= =?utf-8?q?uh/MqdG404PxeMBtn0RPeM5BOmBB/tcA3Q=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: df165f30-729d-4797-9ed5-08dcab1a23f9 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 13:19:54.2458 (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: iH+o3YPJmkbbO+kEXBTAZzi2KiVeVyS+ImVaNH9qFxWAoALmmO7t4+pBz3EgRYn95wEVR3a9NiMA/LwS1d7wI5rsUeh4YdGKtxAijiYUHCQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7258 The IBE (input buffer enable) should be enabled for a GPIO. Reading the value will return the one from the input register, writing the value will return the one from the output register. This offers the flexibility to check if the value intended to be set matches the actual physical one. Signed-off-by: Florin Buica Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index f0cad2c501f7..1f58772c472e 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -2,7 +2,7 @@ /* * Core driver for the S32 CC (Common Chassis) pin controller * - * Copyright 2017-2022 NXP + * Copyright 2017-2022,2024 NXP * Copyright (C) 2022 SUSE LLC * Copyright 2015-2016 Freescale Semiconductor, Inc. */ @@ -436,16 +436,15 @@ static int s32_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, unsigned int offset, bool input) { - unsigned int config; + /* Always enable IBE for GPIOs. This allows us to read the + * actual line value and compare it with the one set. + */ + unsigned int config = S32_MSCR_IBE; unsigned int mask = S32_MSCR_IBE | S32_MSCR_OBE; - if (input) { - /* Disable output buffer and enable input buffer */ - config = S32_MSCR_IBE; - } else { - /* Disable input buffer and enable output buffer */ - config = S32_MSCR_OBE; - } + /* Enable output buffer */ + if (!input) + config |= S32_MSCR_OBE; return s32_regmap_update(pctldev, offset, mask, config); } From patchwork Tue Jul 23 13:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 814475 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013013.outbound.protection.outlook.com [52.101.67.13]) (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 F20DC1534EA; Tue, 23 Jul 2024 13:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740809; cv=fail; b=fgi0xT8J2q4sPzXuAg1jD0VJUa8bzQ9KUpa0iVIcqQslNcTE14yuk6BGDvWWNo6QGmqwmLYebyh3uw88eWb+cA7l4xSyoTAwLTpIYpYdt67DkiFBA65aJz4lAENc0q5TT00JeXL3COZbe3N1hilI1/9HWV5eP0iOgsgXeQxfscs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740809; c=relaxed/simple; bh=BxeyC++ixUQ/DDPMQruJne9IXCa1QLDuiukr9AcWjfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gNOHu6DWRtAopBDdnhuzBmb5UqJ4zNeTqty+7CVONMpRv1ku3ZG5d+kWu7//YeRKGIvAKDa9nvVoIFkmj4rN7i2IJVfZ1jYq1qlr9jUj8dhO7cov1b5QnGKTAZi4cxpwVvcx1b/YLqiYs18cxb9ZgGfKUBfSpnaTTh8wxwFwau4= 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=J9H3+6ZS; arc=fail smtp.client-ip=52.101.67.13 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="J9H3+6ZS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xSO7gEgDE8YTT4XBsOJs1b6f3RcmpNrv4rzVBrU7dv25scftQ7Rcj5mQsCxkIE1V5KGzwPYDQKZVwufFpIdNDDpuarjTIO+nX/UlXq5cAjefN4k77NNkckxwejYdoxDnKALblXfXuhxjwK81c0ub7fiKYWO83ByaE8VVwyYg8ApNhGv/yv93JrKDcf9IjrmL3x6mX0POqTZEHe4dU8j9HgKmScGu+unuhWzMvvaIt+WWhhzfTumHg0ELEkwDBmsg/1yevXiWZY+NTVJQ7PyLNTjzmDI70Ofl3Gb4u8grNS7Lm77sB0JYIR5N4fu4pcGPXtGt/gjNN5bhyYHd5kJlHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PyfZsYjdSbViPO0x0p7LWcKlsSwIsX5zoGU9VGGgztI=; b=k9CVR1CWMPAmKtE0EsinlWxkCo2n8lrWzvWB0Oa2Y1mWQvmJp/cVBXNz+TB5KXjN3s7jngsYpEUU2cL/BBpC9QSUZwHnZWTprxGh/Co4nptISn8IfPGMUhQYqN+3oXll+WPNZ5nsdOpz1z+s+ythxEpSHdXINiMkNSOtkWZAEuiE9sWo0pTzYN4z5FpSh45ORVngwpoLJ2GJ968ZbFaxyMC8iSkfnd6Id4864nDvfs2Fc6ljDcd51y2IlHXOmqIdir/FE09c/EdX31KMjzUrx84Tm7KCm7KNah3Mr84LYU4Bd3UgxKc4X3XCk8RFVq24rNhvlHq/P1/+EI66fkWWMg== 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=PyfZsYjdSbViPO0x0p7LWcKlsSwIsX5zoGU9VGGgztI=; b=J9H3+6ZStyvyKXstiYgqFgwxkShO9JQQZmk32VvKRo/Nbic6SoA6nXPuibO2nohVkoch/0VU8YxwJJDeKbHJt7QKW62koGjZbggMCdpEwM67Z1vxv2fg7y5/Y9+ZfzSKVC0PY6BXrFm1jx781zCqkZDO3V9ewlFm6LNDmz327M4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PR3PR04MB7258.eurprd04.prod.outlook.com (2603:10a6:102:80::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Tue, 23 Jul 2024 13:20:03 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%5]) with mapi id 15.20.7784.013; Tue, 23 Jul 2024 13:20:03 +0000 From: Andrei Stefanescu To: Linus Walleij , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , Ghennadi Procopciuc Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux Team , Andrei Stefanescu , Florin Buica Subject: [PATCH 2/3] pinctrl: s32cc: configure PIN_CONFIG_DRIVE_PUSH_PULL Date: Tue, 23 Jul 2024 16:18:31 +0300 Message-ID: <20240723131832.1171036-3-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> References: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AS4PR09CA0016.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::8) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) 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: AM9PR04MB8487:EE_|PR3PR04MB7258:EE_ X-MS-Office365-Filtering-Correlation-Id: c758b6c0-01b6-44f4-0433-08dcab1a29be X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?0Emme2Y9jUIKX//MWqHamQtLcYjG4AH?= =?utf-8?q?O0uREtCQjYrouQj3dH8uZphK0B/bkntGmxsrRZ0/mGgCMZyzcQMtZ6l9Ng8vfEvN4?= =?utf-8?q?rc98rRbP1fZG0VGZ79tNml0mhgYLBzEtG5a7b0J8LsK6QdJbQLpQV0eLIC6NlvCDb?= =?utf-8?q?glkv0HX24AnsD5St2DfrK/oJDneV//0uGvwoeqO7VOdNZJP2ZIEsM05Ar1zd/ZtrS?= =?utf-8?q?7Qn3xIvT3Ccx0xffv7pTikdxJgzQoxZg7Yxw0OkwWrCOxPKWBU32wT4QRwb5BFF/6?= =?utf-8?q?0bMEPtWMH4W8zROv8ogQBNhvBWiUkLTVNEb8ZwJA5EAzzNgsP/ivig1mFTWwnkM3l?= =?utf-8?q?iZqICor06xJXg38m3jByYPvlC4PFMHcI1p7RgqJlCv7m8JDsAt8QkSbV+reZ4Oat6?= =?utf-8?q?fOsSqjc/1sWl8IzUg2ILN5a3b5YSMBgqctE2o/xJZ2CvoGc95x6o5ke1qcavOESYa?= =?utf-8?q?fzfERJsc7KC/vnaLmgBHcOS12B3icXdBntIDAU5ERHVsCUgZvW0uDgt3R3Cvz5hjU?= =?utf-8?q?Vf7B+gLQmK/KhapWCuTMk2tsqLizmEHqqRDEUJkF9It/lW8SSid2UJc+o91R5c4iL?= =?utf-8?q?RG6g8WJREn96wIJm+aeGAdjLK8OHGricU8Tdi3lUBZy3AoHsvpv9DpB5i76mLqkw+?= =?utf-8?q?xzoDYt/7IoR12STCP93I3walYsPQblRobOFuvhiFKrx/IKoe9CmSVNsdLxVVRYMQn?= =?utf-8?q?8q4Uy2bNtObXVGk+GIqqtzMUX2ToFmHz4t9FaGAIFVd+KR/x83Bf+7oP1k0/F9n7w?= =?utf-8?q?3gGTTkd87tvqr7yT8j1x1Jbdhn8VTSETeEL9ZxOUl0D8xzdvwsl/87rhTL8Srxe1F?= =?utf-8?q?zxIq+h1YgjhjsHNsVSn+EVHB9YDqjULl6fFBCHSTGcBNWOnDg6VEGeVD40ul2YAgR?= =?utf-8?q?LDTRFBYBGPo7+yMgXG+OQXzwvkT6/07cT2SVJkigvBzafN25+h9av0v6GhEihcUEL?= =?utf-8?q?l2YTKypPgbIYc+AeWWj3XMkrBeiUdnrnZj7OlQeK92LzELuVkK3Nx0S2MmcMjryTC?= =?utf-8?q?b7nwYSgzKKWIgfc58MTKC15P7jmGaAe5WDdN5gRhfGMcZeuMFyAi3bC1zLfT/DUaE?= =?utf-8?q?2ZHgILEw5mkm/dGlcBXGyohoV1HsZdii5HRVpGZOshWFcjgFtAtISAgBdIan/cA0M?= =?utf-8?q?cKnZ4PPrn6KxFdtZTg3f7iN9/Z7PjvvTKvM3//TMoZvON9nklQag8YW6EjGAi+euE?= =?utf-8?q?WS/qaSUrcfbKt610ajGHVCsKR9jIEins4N2vWGrgglz71VhameSi03tTL01aaFACg?= =?utf-8?q?C/Ti0fAmnzSr+c1pPeZ/zVsXbuEDQZfJMRj+tQpakVsnCT/PAA3fl7LCtIkKGraPu?= =?utf-8?q?a4RxR/+kHLpXS0PllY1+EnCXdlA/zr7VuQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8487.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Hw6iTeTBaefzxFBvzs18g+dtbdVN?= =?utf-8?q?wT1yWR6CO2rY3fVuBN3zuQE2fs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ts+MW6m1p2a8m/9iLOtVvsdZYADne8ME5G7Phz2yQZ1jL?= =?utf-8?q?ymHF0hzRbupktPR6qMU0MLy74O3ndqLL7vtq9uThJ5NXb/rajb0XPuDiYuoZ7hWik?= =?utf-8?q?b6j6h5TSHuOxB7hokmrmlIiB6MwzqXP9CHNy014cE0+e1ct/2X9cXNp546wQH36rL?= =?utf-8?q?yg1yg/WDWJos1WywsCmIDud0RyaVM+ZkLnfwnZvE1dn8ggquoJx7c8iPDXatK8evk?= =?utf-8?q?iEkbdKfBG8+KikiQter0q+ZQffQwKwJCkZx3P+lNBEWjxqxVM7BobAGCgy1Ju+1W8?= =?utf-8?q?I3Qtg3UPEnbZzWLuRszauZb3l+XykvbYjLWCt/V0srJBYedQF6953li2yA3R3qjG/?= =?utf-8?q?6UNFJ09XvI8W3F3zrEJpFNstA0Ihojnhkqa13lnFBKlYZiHMRwjDeH1PH7TJFsET1?= =?utf-8?q?uq5/0spZBtgU5IIGfCkGZwd2gpoS7Ssbuu5zlOMPZOOVQA0CHswN2EUd1E7eT4m6Y?= =?utf-8?q?rTjVam/NCteZ5Sj56E0sF6NbaUUJQNj6GkEPKEYk9rv+f/62SFIb+/oz2kCfvHy6L?= =?utf-8?q?cKcnDd4t/TpmaejiAtg5zqvGnHeK+HNA/7j2vA4U9oPxzp0uUnpC84djdWXRZOxke?= =?utf-8?q?wnR40sZshm3z1pYwkgYV3QLvUVQM7waTGQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c758b6c0-01b6-44f4-0433-08dcab1a29be X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 13:20:03.8886 (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: dAi6P1IMNeMsyCytVmZnCWTE6mV9v7f83GgFEZz7y5D7zbWDf7Mez8LIKcIIotooBStdALUgQLbrGFeyKQguhH3XDCQs557Agc6EVA9r2Jg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7258 Previously, it was possible to only configure the open-drain for a pin. However, after a pin got configured with open-drain, there wasn't any way to disable it. Add the push-pull configuration in order to reverse the open-drain configuration. Signed-off-by: Florin Buica Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 1f58772c472e..48d9d6df953f 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -515,6 +515,10 @@ static int s32_parse_pincfg(unsigned long pincfg, unsigned int *mask, *config |= S32_MSCR_ODE; *mask |= S32_MSCR_ODE; break; + case PIN_CONFIG_DRIVE_PUSH_PULL: + *config &= ~S32_MSCR_ODE; + *mask |= S32_MSCR_ODE; + break; case PIN_CONFIG_OUTPUT_ENABLE: if (arg) *config |= S32_MSCR_OBE; From patchwork Tue Jul 23 13:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 814042 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013037.outbound.protection.outlook.com [52.101.67.37]) (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 39F00155310; Tue, 23 Jul 2024 13:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740815; cv=fail; b=mfx8RcnS66UbVbDjGtnJrIYXiffeLhk6ZpcVzFQcY0133b1LAEDo0ZFGNs0jw/LHAdYPjdGNI2yke7YB1q5aNvhFEWQWFY83s3VS3BQ5jD0/MPA6w6B50ktetORZekEq7HnBp18wZfPHjBk0vRq0nVu7qqsmhpMzQz2Nit1pmn4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721740815; c=relaxed/simple; bh=gO2mjjguCnlspKAgAp5/kj62pKS/cJBaAhDvBZl4lUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=J+DLTYJ1CsWHt3Ri75G9eEvMJNFVpelIsp5861u1nNFUJpXUScmuB3IGZCduQGPBSZauWl8T5WbV3c93PuPxG7jPccKIRb1qxIex3jsQb7EeWZoq/5XeHbqfzPVCwri7NR1hXx258l23jqnZuXMCMKZwj2VJDqD81wJfo+fzh7I= 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=PCt33HSU; arc=fail smtp.client-ip=52.101.67.37 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="PCt33HSU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VWxmIQxbwvyJ1VRSr8ghVN6PPppGUZ8TvRomGvGl0ZgKGi6ovWsvNleNkEOf5vxt6JSzqIxiUt5rGgKYzQ34004RrHFZ0bT/2XG6x0WwP6Rkd7f3dsg7xyhiDTe73hvfUHmibmFGL1a7ZGXxE9DDc41T8Fc9TPrlW3mVJYQgkQWDe02KMbirQyq2mtkJFn3yOMrzP5S1u1cfLDjCKhk4NIKg2A2u/8vTgBCrtmGhsQEa0NKHFZUxR2BBUAgGut9VrHXX/19BYOM5cQ9smiP9fy569qAwpIdS0UJwqjd8Xif7S25T/ZWiStLACcdVGB3b0/BbqeE88dYoBeXIKQCKjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6egOWLKVhVFBVORRxktMQIkTrxVwpPnvW+W4Nj5dG9Q=; b=fa10DT5wJkuUi+bQ8GeAtvtXWdPlhpLrmudJcX2XrRwoFiBrjr9qe5ggmS5rg47pm92gYIOeM9JbQ4o8PINQ0OrmGGabILvV8rSxrtqKYGlHiwts1MRn1Kv4tAZ3K/GHlI5E1bZ8hYdj11XNFauNM3U3B7yFMh/tXpct153z0WJQ2SVvwTTJcCsr/FmKscqx2aplQgWqzqIM4m+Kf0NdwMv4wlhYIbsrV0/1Z1gi75/tP4u/96VbyVbBPgmeC87hOGS6fi0ESOJ7+y3l3JicnnB8gb9VkTkHVu4q6WM3/s7eJDpBuJlPj+44hX099pfoZNh7CzhyO5oyl6DEG/XVWQ== 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=6egOWLKVhVFBVORRxktMQIkTrxVwpPnvW+W4Nj5dG9Q=; b=PCt33HSUBkJIChCBnc1U1uFe2GNREm6kmAfc28BcA2Pi22b4O7TXOsK+9+IuV5/T7t2/w5L6Dntp29e0ChfoqjlBrmRAAhdwXvkOD0fOavILSK4PYRhVnbizp0XXQSfTc/a8I7XCPtzBAKXTjDfwkeNF9KfPYG7+fRFSiXiBFQk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PR3PR04MB7258.eurprd04.prod.outlook.com (2603:10a6:102:80::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Tue, 23 Jul 2024 13:20:10 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%5]) with mapi id 15.20.7784.013; Tue, 23 Jul 2024 13:20:10 +0000 From: Andrei Stefanescu To: Linus Walleij , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , Ghennadi Procopciuc Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, NXP S32 Linux Team , Andrei Stefanescu , Radu Pirea , Florin Buica Subject: [PATCH 3/3] pinctrl: s32cc: add update and overwrite options when setting pinconf Date: Tue, 23 Jul 2024 16:18:32 +0300 Message-ID: <20240723131832.1171036-4-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> References: <20240723131832.1171036-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AS4PR09CA0016.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::8) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) 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: AM9PR04MB8487:EE_|PR3PR04MB7258:EE_ X-MS-Office365-Filtering-Correlation-Id: 525944ba-cc69-4c3b-f036-08dcab1a2d95 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?JIRa2zntYt16sw3QVEOWj56ZYdySWLb?= =?utf-8?q?ZOgEOpDpNM77VGwXmwM2pkKL+PfUbXHrOtrvFoLwVB3R7JG59wG1XITmOAi4X9Gf7?= =?utf-8?q?vbE2Myqmr6PPu/1q39DK8VNIJTj+HI6qY3P3T89Wpl6sCM1xk7APSzYeKW8lekzTW?= =?utf-8?q?oOskGE9mVMVo02zmezkOFkJWKhmkqM9cOn2skJ7Xx56HHZ+fno0DiXw4BcsAS5hiM?= =?utf-8?q?NkSy4Ae2xLHr/XN7a6K/X+UmuT/c8wVCquHAKZ6my7bDcpLzN4MwZ4S38JMZhq1EE?= =?utf-8?q?PiNo8uZXdJcJxUx3e9Y+z9YfPKkzFkQIJUOW399UAkORp1Sp9P0ErnP+GNmL0Yz6/?= =?utf-8?q?cKt7WFkg1WgZyz3ZLS1GmQ8zJIiTTijAKKixaRdaNWZzf6md8oMJcVyZ3cAnRxVXe?= =?utf-8?q?vXtnVI0juJOz1GghSAmb6HAln7dgtF0PneCdEHgXYtiZaAGTCb/nunETWe124OcfS?= =?utf-8?q?abNY4qxpWdalko/jlsFBhJJSbqKhVh62vvf7D0UW40s7d5ZfqRhidrRlzsGOQzknl?= =?utf-8?q?KH1S1hdMLdDPaXCRW92pXDfKoJ9NN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SFV:NSPM; H:AM9PR04MB8487.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5k9/klixwQbDU1G4K6iueH9aozkA?= =?utf-8?q?13bBN67hE5Y6w5m3sGLScSU6K1R1ofr/7K61VlYv5Lk9roADRVfDVaOjP8cgma8uV?= =?utf-8?q?E8CXCHLAo5XpAsJVBs9MNmmp6cPWqqIJ0NPDHxeZMK6N1Lbm0adqr1bFEcIDFomDb?= =?utf-8?q?03OyZCl+z3nf4NzrFY4irClS15Hajj4CadhmJEs7r6cbwF3A0TKjZSV6vTS2A4hCL?= =?utf-8?q?vwqYKA+qcPiyVdW4n4En97v5wfKok7b4cv+V2+FK8nAcQcd41HvDXIp8dDre84ENC?= =?utf-8?q?Mbpuq/p/brsxaZNLCS2vDX34/dttKUtDXySvs4Z7GbtAntk2Rrkcg/lMS9TyABhMs?= =?utf-8?q?WCmVtxngHbabXOC3QnlOrDAzs0IP3QF0djN4c615fWKJ0z0oMRm2BysjPUEweCGrt?= =?utf-8?q?10417pU9T2lOc2g9uzOygecDJzwaAODxGkxvqajwtX2qyU9CkrYzHqNK7i2kkYtyP?= =?utf-8?q?zuGi0wwdvoYAFmSFDOws6e/Ivnb0wh71QfzzaoxOllfSC9NOjthqOhJ2cICxkj2ki?= =?utf-8?q?zYIqIafjWDmPdy9dfaVOkLzGg04G7kAvd13BitZgIDG23ihCxHj6iviTo7vOIBe9v?= =?utf-8?q?UhASSHwNc03x6Xj4BaU3IiA1P1VkYR7klm+hCMTJTl3fjDvK7fEoGPNSRXnQhXyLv?= =?utf-8?q?f/VOXwkcttAlvqhgr8h+qKDFxWJIOUGLcMuoQJNTEJ/9DmR9ETWHSgdQxL4Fx9m+F?= =?utf-8?q?+6CxqypPuJzLg6Ab6ZZ+Kq5jAAB67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c3b-f036-08dcab1a2d95 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 13:20:10.3729 (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: +Tf3dJshMKM/ooKQpmkaiEY5cL9zYk+bG2kBSY+N9eaR2aLr3VcKwl6XJlRnRhROoiY3XjRluaJpOdD4ZxoJjmpI+Qz2pgeiNMMQ27zDLM4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7258 The previous pinconf settings(made by the bootloader) need to be overwritten when configuring the pinctrl of a driver during the boot process. Configuring the bias of a GPIO at runtime (e.g. pull-up) needs to preserve the other settings unaltered. This patch introduces changes to differentiate between the two cases. Signed-off-by: Radu Pirea Signed-off-by: Florin Buica Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 48d9d6df953f..9c730f2ca172 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -39,6 +39,11 @@ #define S32_MSCR_ODE BIT(20) #define S32_MSCR_OBE BIT(21) +enum s32_write_type { + S32_PINCONF_UPDATE_ONLY, + S32_PINCONF_OVERWRITE, +}; + static struct regmap_config s32_regmap_config = { .reg_bits = 32, .val_bits = 32, @@ -557,10 +562,11 @@ static int s32_parse_pincfg(unsigned long pincfg, unsigned int *mask, return 0; } -static int s32_pinconf_mscr_update(struct pinctrl_dev *pctldev, +static int s32_pinconf_mscr_write(struct pinctrl_dev *pctldev, unsigned int pin_id, unsigned long *configs, - unsigned int num_configs) + unsigned int num_configs, + enum s32_write_type write_type) { struct s32_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); unsigned int config = 0, mask = 0; @@ -579,10 +585,20 @@ static int s32_pinconf_mscr_update(struct pinctrl_dev *pctldev, return ret; } + /* If the MSCR configuration has to be written, + * the SSS field should not be touched. + */ + if (write_type == S32_PINCONF_OVERWRITE) + mask = (unsigned int)~S32_MSCR_SSS_MASK; + if (!config && !mask) return 0; - dev_dbg(ipctl->dev, "update: pin %u cfg 0x%x\n", pin_id, config); + if (write_type == S32_PINCONF_OVERWRITE) + dev_dbg(ipctl->dev, "set: pin %u cfg 0x%x\n", pin_id, config); + else + dev_dbg(ipctl->dev, "update: pin %u cfg 0x%x\n", pin_id, + config); return s32_regmap_update(pctldev, pin_id, mask, config); } @@ -598,8 +614,8 @@ static int s32_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id, unsigned long *configs, unsigned int num_configs) { - return s32_pinconf_mscr_update(pctldev, pin_id, configs, - num_configs); + return s32_pinconf_mscr_write(pctldev, pin_id, configs, + num_configs, S32_PINCONF_UPDATE_ONLY); } static int s32_pconf_group_set(struct pinctrl_dev *pctldev, unsigned int selector, @@ -612,8 +628,8 @@ static int s32_pconf_group_set(struct pinctrl_dev *pctldev, unsigned int selecto grp = &info->groups[selector]; for (i = 0; i < grp->data.npins; i++) { - ret = s32_pinconf_mscr_update(pctldev, grp->data.pins[i], - configs, num_configs); + ret = s32_pinconf_mscr_write(pctldev, grp->data.pins[i], + configs, num_configs, S32_PINCONF_OVERWRITE); if (ret) return ret; }