Skip to content

Commit 0971240

Browse files
JiafeiPandkalowsk
authored andcommitted
drivers: gpio: rgpio: use default pad config value for SCMI platform
If the platform uses SCMI pinctrl driver, pinctrl regitster can't accessed by CPU Core directly, and currently SCMI pinctrl driver has no API to read back the register value, so use default pad config value for GPIO pad configuration, and in theory we could use a fixed pad config value in this driver as each new GPIO configuration has no relation with previous configuration. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
1 parent 42ae45c commit 0971240

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/gpio/gpio_mcux_rgpio.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024, NXP
2+
* Copyright 2023-2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -21,6 +21,12 @@
2121
((const struct mcux_rgpio_config *)(_dev)->config)
2222
#define DEV_DATA(_dev) ((struct mcux_rgpio_data *)(_dev)->data)
2323

24+
/*
25+
* Default PAD config value for SCMI pinctrl:
26+
* Pull down, Slight Fast Slew Rate, X4 driver strength.
27+
*/
28+
#define GPIO_PIN_DEFAUT_PAD_VAL 0x0000051e
29+
2430
struct mcux_rgpio_config {
2531
/* gpio_driver_config needs to be first */
2632
struct gpio_driver_config common;
@@ -68,10 +74,15 @@ static int mcux_rgpio_configure(const struct device *dev,
6874
return -ENOTSUP;
6975
}
7076

77+
#if defined(CONFIG_PINCTRL_IMX_SCMI)
78+
/* For SCMI Pinctrl platform, set default PAD config value for SCMI pinctrl. */
79+
uint32_t reg = GPIO_PIN_DEFAUT_PAD_VAL;
80+
#else
7181
/* Set appropriate bits in pin configuration register */
7282
volatile uint32_t *gpio_cfg_reg = (volatile uint32_t *)
7383
((size_t)config->pin_muxes[cfg_idx].config_register);
7484
uint32_t reg = *gpio_cfg_reg;
85+
#endif
7586

7687
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
7788
/* PUE/PDRV types have the same ODE bit */

0 commit comments

Comments
 (0)