From 83c031556b68f8120acedc61f47772d3543f815b Mon Sep 17 00:00:00 2001 From: Jose Alberto Meza Date: Mon, 21 Aug 2023 14:09:40 -0700 Subject: [PATCH] soc: arm: microchip: mec172x: Add macro to get pin mux value Add macro to read pin mux control value Signed-off-by: Jose Alberto Meza --- soc/microchip/mec/mec172x/reg/mec172x_gpio.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soc/microchip/mec/mec172x/reg/mec172x_gpio.h b/soc/microchip/mec/mec172x/reg/mec172x_gpio.h index 39ed59d279..f013ba69ac 100644 --- a/soc/microchip/mec/mec172x/reg/mec172x_gpio.h +++ b/soc/microchip/mec/mec172x/reg/mec172x_gpio.h @@ -92,6 +92,9 @@ #define MCHP_GPIO_CTRL_MUX_F7 SHLU32(7, MCHP_GPIO_CTRL_MUX_POS) #define MCHP_GPIO_CTRL_MUX(n) SHLU32(((n) & 0x7u), MCHP_GPIO_CTRL_MUX_POS) +#define MCHP_GPIO_CTRL_MUX_GET(x) (((uint32_t)(x) >> MCHP_GPIO_CTRL_MUX_POS)\ + & MCHP_GPIO_CTRL_MUX_MASK0) + /* * bit[15] Disables input pad leaving output pad enabled * Useful for reducing power consumption of output only pins.