From 162f45918b94093a91ddd31e279e77161e165971 Mon Sep 17 00:00:00 2001 From: Jiafei Pan Date: Wed, 19 Mar 2025 16:16:21 +0800 Subject: [PATCH] soc: imx9: fix pinctrl drive strength setting Current code configures the higher bits ahead of drive strength to be "1", this patch fix this issue. Signed-off-by: Jiafei Pan Signed-off-by: Lei Xu --- soc/nxp/imx/imx9/imx91/pinctrl_soc.h | 3 ++- soc/nxp/imx/imx9/imx93/pinctrl_soc.h | 5 +++-- soc/nxp/imx/imx9/imx95/pinctrl_soc.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/soc/nxp/imx/imx9/imx91/pinctrl_soc.h b/soc/nxp/imx/imx9/imx91/pinctrl_soc.h index da79bbfab43a..b168d6457aee 100644 --- a/soc/nxp/imx/imx9/imx91/pinctrl_soc.h +++ b/soc/nxp/imx/imx9/imx91/pinctrl_soc.h @@ -30,7 +30,8 @@ extern "C" { (DT_PROP(node_id, bias_pull_down) << MCUX_IMX_BIAS_PULL_DOWN_SHIFT) | \ (DT_PROP(node_id, bias_pull_up) << MCUX_IMX_BIAS_PULL_UP_SHIFT) | \ (DT_ENUM_IDX(node_id, slew_rate) << MCUX_IMX_SLEW_RATE_SHIFT) | \ - ((~(0xff << DT_ENUM_IDX(node_id, drive_strength))) << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ + ((~(0xffffffff << DT_ENUM_IDX(node_id, drive_strength))) \ + << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ (DT_PROP(node_id, input_enable) << MCUX_IMX_INPUT_ENABLE_SHIFT)) /* This struct must be present. It is used by the mcux gpio driver */ diff --git a/soc/nxp/imx/imx9/imx93/pinctrl_soc.h b/soc/nxp/imx/imx9/imx93/pinctrl_soc.h index 91d06ea9681b..c03a5a045f58 100644 --- a/soc/nxp/imx/imx9/imx93/pinctrl_soc.h +++ b/soc/nxp/imx/imx9/imx93/pinctrl_soc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NXP + * Copyright 2022-2023, 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -30,7 +30,8 @@ extern "C" { (DT_PROP(node_id, bias_pull_down) << MCUX_IMX_BIAS_PULL_DOWN_SHIFT) | \ (DT_PROP(node_id, bias_pull_up) << MCUX_IMX_BIAS_PULL_UP_SHIFT) | \ (DT_ENUM_IDX(node_id, slew_rate) << MCUX_IMX_SLEW_RATE_SHIFT) | \ - ((~(0xff << DT_ENUM_IDX(node_id, drive_strength))) << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ + ((~(0xffffffff << DT_ENUM_IDX(node_id, drive_strength))) \ + << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ (DT_PROP(node_id, input_enable) << MCUX_IMX_INPUT_ENABLE_SHIFT)) /* This struct must be present. It is used by the mcux gpio driver */ diff --git a/soc/nxp/imx/imx9/imx95/pinctrl_soc.h b/soc/nxp/imx/imx9/imx95/pinctrl_soc.h index ecc5fd53db44..6065a5c8a343 100644 --- a/soc/nxp/imx/imx9/imx95/pinctrl_soc.h +++ b/soc/nxp/imx/imx9/imx95/pinctrl_soc.h @@ -43,7 +43,8 @@ extern "C" { (DT_PROP(node_id, bias_pull_down) << MCUX_IMX_BIAS_PULL_DOWN_SHIFT) | \ (DT_PROP(node_id, bias_pull_up) << MCUX_IMX_BIAS_PULL_UP_SHIFT) | \ (DT_ENUM_IDX(node_id, slew_rate) << MCUX_IMX_SLEW_RATE_SHIFT) | \ - ((~(0xff << DT_ENUM_IDX(node_id, drive_strength))) << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ + ((~(0xffffffff << DT_ENUM_IDX(node_id, drive_strength))) \ + << MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \ (DT_PROP(node_id, input_enable) << IOMUXC_INPUT_ENABLE_SHIFT)) /* This struct must be present. It is used by the mcux gpio driver */