Skip to content

Commit 455e76f

Browse files
parthitcenashif
authored andcommitted
drivers: gpio: fix pincm lut size
LUT sizes directly reflects the global data when enabled in dts (even if no or few pins are really consumed). Also the PINCM numbering across the series (g, l and c) is within 255, so fix to use uint8_t to save the global space. Signed-off-by: Parthiban Nallathambi <[email protected]>
1 parent 7a70fab commit 455e76f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpio/gpio_mspm0.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct gpio_mspm0_config {
2121
/* port base address */
2222
GPIO_Regs *base;
2323
/* port pincm lookup table */
24-
uint32_t *pincm_lut;
24+
uint8_t *pincm_lut;
2525
};
2626

2727
struct gpio_mspm0_data {
@@ -39,7 +39,7 @@ struct gpio_mspm0_data {
3939
#if CONFIG_SOC_SERIES_MSPM0G
4040
#define NUM_GPIOA_PIN 32
4141
#define gpioa_pins NUM_GPIOA_PIN
42-
static uint32_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
42+
static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
4343
IOMUX_PINCM1, IOMUX_PINCM2, IOMUX_PINCM7, IOMUX_PINCM8, IOMUX_PINCM9, IOMUX_PINCM10,
4444
IOMUX_PINCM11, IOMUX_PINCM14, IOMUX_PINCM19, IOMUX_PINCM20, IOMUX_PINCM21, IOMUX_PINCM22,
4545
IOMUX_PINCM34, IOMUX_PINCM35, IOMUX_PINCM36, IOMUX_PINCM37, IOMUX_PINCM38, IOMUX_PINCM39,
@@ -51,7 +51,7 @@ static uint32_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
5151
#define GPIOA_NODE DT_NODELABEL(gpioa)
5252
#define NUM_GPIOA_PIN 31
5353
#define gpioa_pins NUM_GPIOA_PIN
54-
static uint32_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
54+
static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
5555
IOMUX_PINCM1, IOMUX_PINCM2, IOMUX_PINCM7, IOMUX_PINCM8, IOMUX_PINCM9, IOMUX_PINCM10,
5656
IOMUX_PINCM11, IOMUX_PINCM14, IOMUX_PINCM19, IOMUX_PINCM20, IOMUX_PINCM25, IOMUX_PINCM26,
5757
IOMUX_PINCM38, IOMUX_PINCM39, IOMUX_PINCM40, IOMUX_PINCM41, IOMUX_PINCM42, IOMUX_PINCM49,
@@ -69,7 +69,7 @@ static uint32_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
6969
#ifdef CONFIG_SOC_SERIES_MSPM0G
7070
#define NUM_GPIOB_PIN 28
7171
#define gpiob_pins NUM_GPIOB_PIN
72-
static uint32_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
72+
static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
7373
IOMUX_PINCM12, IOMUX_PINCM13, IOMUX_PINCM15, IOMUX_PINCM16, IOMUX_PINCM17, IOMUX_PINCM18,
7474
IOMUX_PINCM23, IOMUX_PINCM24, IOMUX_PINCM25, IOMUX_PINCM26, IOMUX_PINCM27, IOMUX_PINCM28,
7575
IOMUX_PINCM29, IOMUX_PINCM30, IOMUX_PINCM31, IOMUX_PINCM32, IOMUX_PINCM33, IOMUX_PINCM43,
@@ -80,7 +80,7 @@ static uint32_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
8080
#define GPIOB_NODE DT_NODELABEL(gpiob)
8181
#define NUM_GPIOB_PIN 32
8282
#define gpiob_pins NUM_GPIOB_PIN
83-
static uint32_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
83+
static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
8484
IOMUX_PINCM12, IOMUX_PINCM13, IOMUX_PINCM15, IOMUX_PINCM16, IOMUX_PINCM17, IOMUX_PINCM18,
8585
IOMUX_PINCM27, IOMUX_PINCM28, IOMUX_PINCM29, IOMUX_PINCM30, IOMUX_PINCM31, IOMUX_PINCM32,
8686
IOMUX_PINCM33, IOMUX_PINCM34, IOMUX_PINCM35, IOMUX_PINCM36, IOMUX_PINCM37, IOMUX_PINCM53,
@@ -96,7 +96,7 @@ static uint32_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
9696
#ifdef CONFIG_SOC_SERIES_MSPM0L
9797
#define NUM_GPIOC_PIN 10
9898
#define gpioc_pins NUM_GPIOC_PIN
99-
static uint32_t gpioc_pincm_lut[NUM_GPIOC_PIN] = {
99+
static uint8_t gpioc_pincm_lut[NUM_GPIOC_PIN] = {
100100
IOMUX_PINCM43, IOMUX_PINCM44, IOMUX_PINCM45, IOMUX_PINCM46, IOMUX_PINCM47,
101101
IOMUX_PINCM48, IOMUX_PINCM58, IOMUX_PINCM59, IOMUX_PINCM60, IOMUX_PINCM61,
102102
};

0 commit comments

Comments
 (0)