Skip to content

Commit 375695e

Browse files
committed
drivers: gpio: fix compliance check for clang-format
fix the clang compliance check using inling, clang-format drivers/gpio/gpio_mspm0.c -i as the changes are beyond what is changed as part of L series addition, fix all at once with independent commit. Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
1 parent 1b59b25 commit 375695e

File tree

1 file changed

+41
-57
lines changed

1 file changed

+41
-57
lines changed

drivers/gpio/gpio_mspm0.c

Lines changed: 41 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
4848
IOMUX_PINCM5, IOMUX_PINCM6,
4949
};
5050
#elif CONFIG_SOC_SERIES_MSPM0L /* if CONFIG_SOC_SERIES_MSPM0L */
51-
#define GPIOA_NODE DT_NODELABEL(gpioa)
51+
#define GPIOA_NODE DT_NODELABEL(gpioa)
5252
#define NUM_GPIOA_PIN 31
5353
#define gpioa_pins NUM_GPIOA_PIN
5454
static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
@@ -57,8 +57,7 @@ static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
5757
IOMUX_PINCM38, IOMUX_PINCM39, IOMUX_PINCM40, IOMUX_PINCM41, IOMUX_PINCM42, IOMUX_PINCM49,
5858
IOMUX_PINCM50, IOMUX_PINCM51, IOMUX_PINCM52, IOMUX_PINCM56, IOMUX_PINCM57, IOMUX_PINCM67,
5959
IOMUX_PINCM68, IOMUX_PINCM69, IOMUX_PINCM73, IOMUX_PINCM74, IOMUX_PINCM3, IOMUX_PINCM4,
60-
IOMUX_PINCM5
61-
};
60+
IOMUX_PINCM5};
6261
#else
6362
#error "Series lookup table not supported"
6463
#endif /* if CONFIG_SOC_SERIES_MSPM0G */
@@ -77,7 +76,7 @@ static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
7776
IOMUX_PINCM52, IOMUX_PINCM56, IOMUX_PINCM57, IOMUX_PINCM58,
7877
};
7978
#elif CONFIG_SOC_SERIES_MSPM0L /* if CONFIG_SOC_SERIES_MSPM0L */
80-
#define GPIOB_NODE DT_NODELABEL(gpiob)
79+
#define GPIOB_NODE DT_NODELABEL(gpiob)
8180
#define NUM_GPIOB_PIN 32
8281
#define gpiob_pins NUM_GPIOB_PIN
8382
static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
@@ -86,8 +85,7 @@ static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
8685
IOMUX_PINCM33, IOMUX_PINCM34, IOMUX_PINCM35, IOMUX_PINCM36, IOMUX_PINCM37, IOMUX_PINCM53,
8786
IOMUX_PINCM54, IOMUX_PINCM55, IOMUX_PINCM62, IOMUX_PINCM63, IOMUX_PINCM64, IOMUX_PINCM65,
8887
IOMUX_PINCM66, IOMUX_PINCM70, IOMUX_PINCM71, IOMUX_PINCM72, IOMUX_PINCM21, IOMUX_PINCM22,
89-
IOMUX_PINCM23, IOMUX_PINCM24
90-
};
88+
IOMUX_PINCM23, IOMUX_PINCM24};
9189
#endif /* CONFIG_SOC_SERIES_MSPM0G */
9290
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(gpiob), okay) */
9391

@@ -113,8 +111,7 @@ static int gpio_mspm0_port_get_raw(const struct device *port, uint32_t *value)
113111
return 0;
114112
}
115113

116-
static int gpio_mspm0_port_set_masked_raw(const struct device *port,
117-
uint32_t mask, uint32_t value)
114+
static int gpio_mspm0_port_set_masked_raw(const struct device *port, uint32_t mask, uint32_t value)
118115
{
119116
const struct gpio_mspm0_config *config = port->config;
120117

@@ -123,8 +120,7 @@ static int gpio_mspm0_port_set_masked_raw(const struct device *port,
123120
return 0;
124121
}
125122

126-
static int gpio_mspm0_port_set_bits_raw(const struct device *port,
127-
uint32_t mask)
123+
static int gpio_mspm0_port_set_bits_raw(const struct device *port, uint32_t mask)
128124
{
129125
const struct gpio_mspm0_config *config = port->config;
130126

@@ -133,8 +129,7 @@ static int gpio_mspm0_port_set_bits_raw(const struct device *port,
133129
return 0;
134130
}
135131

136-
static int gpio_mspm0_port_clear_bits_raw(const struct device *port,
137-
uint32_t mask)
132+
static int gpio_mspm0_port_clear_bits_raw(const struct device *port, uint32_t mask)
138133
{
139134
const struct gpio_mspm0_config *config = port->config;
140135

@@ -143,8 +138,7 @@ static int gpio_mspm0_port_clear_bits_raw(const struct device *port,
143138
return 0;
144139
}
145140

146-
static int gpio_mspm0_port_toggle_bits(const struct device *port,
147-
uint32_t mask)
141+
static int gpio_mspm0_port_toggle_bits(const struct device *port, uint32_t mask)
148142
{
149143
const struct gpio_mspm0_config *config = port->config;
150144

@@ -153,9 +147,7 @@ static int gpio_mspm0_port_toggle_bits(const struct device *port,
153147
return 0;
154148
}
155149

156-
static int gpio_mspm0_pin_configure(const struct device *port,
157-
gpio_pin_t pin,
158-
gpio_flags_t flags)
150+
static int gpio_mspm0_pin_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags)
159151
{
160152
const struct gpio_mspm0_config *config = port->config;
161153
/* determine pull up resistor value based on flags */
@@ -172,17 +164,13 @@ static int gpio_mspm0_pin_configure(const struct device *port,
172164
/* Config pin based on flags */
173165
switch (flags & (GPIO_INPUT | GPIO_OUTPUT)) {
174166
case GPIO_INPUT:
175-
DL_GPIO_initDigitalInputFeatures(config->pincm_lut[pin],
176-
DL_GPIO_INVERSION_DISABLE,
177-
pull_res,
178-
DL_GPIO_HYSTERESIS_DISABLE,
167+
DL_GPIO_initDigitalInputFeatures(config->pincm_lut[pin], DL_GPIO_INVERSION_DISABLE,
168+
pull_res, DL_GPIO_HYSTERESIS_DISABLE,
179169
DL_GPIO_WAKEUP_DISABLE);
180170
break;
181171
case GPIO_OUTPUT:
182-
DL_GPIO_initDigitalOutputFeatures(config->pincm_lut[pin],
183-
DL_GPIO_INVERSION_DISABLE,
184-
pull_res,
185-
DL_GPIO_DRIVE_STRENGTH_LOW,
172+
DL_GPIO_initDigitalOutputFeatures(config->pincm_lut[pin], DL_GPIO_INVERSION_DISABLE,
173+
pull_res, DL_GPIO_DRIVE_STRENGTH_LOW,
186174
DL_GPIO_HIZ_DISABLE);
187175

188176
/* Set initial state */
@@ -204,10 +192,8 @@ static int gpio_mspm0_pin_configure(const struct device *port,
204192
return 0;
205193
}
206194

207-
static int gpio_mspm0_pin_interrupt_configure(const struct device *port,
208-
gpio_pin_t pin,
209-
enum gpio_int_mode mode,
210-
enum gpio_int_trig trig)
195+
static int gpio_mspm0_pin_interrupt_configure(const struct device *port, gpio_pin_t pin,
196+
enum gpio_int_mode mode, enum gpio_int_trig trig)
211197
{
212198
const struct gpio_mspm0_config *config = port->config;
213199

@@ -229,11 +215,10 @@ static int gpio_mspm0_pin_interrupt_configure(const struct device *port,
229215
}
230216

231217
if (pin < MSPM0_PINS_LOW_GROUP) {
232-
DL_GPIO_setLowerPinsPolarity(config->base,
233-
polarity << (2 * pin));
218+
DL_GPIO_setLowerPinsPolarity(config->base, polarity << (2 * pin));
234219
} else {
235-
DL_GPIO_setUpperPinsPolarity(config->base,
236-
polarity << (2 * (pin - MSPM0_PINS_LOW_GROUP)));
220+
DL_GPIO_setUpperPinsPolarity(
221+
config->base, polarity << (2 * (pin - MSPM0_PINS_LOW_GROUP)));
237222
}
238223

239224
DL_GPIO_clearInterruptStatus(config->base, BIT(pin));
@@ -246,8 +231,7 @@ static int gpio_mspm0_pin_interrupt_configure(const struct device *port,
246231
return 0;
247232
}
248233

249-
static int gpio_mspm0_manage_callback(const struct device *port,
250-
struct gpio_callback *callback,
234+
static int gpio_mspm0_manage_callback(const struct device *port, struct gpio_callback *callback,
251235
bool set)
252236
{
253237
struct gpio_mspm0_data *data = port->data;
@@ -267,9 +251,9 @@ static void gpio_mspm0_isr(const struct device *port)
267251
struct gpio_mspm0_data *data;
268252
const struct gpio_mspm0_config *config;
269253
const struct device *dev_list[] = {
270-
DEVICE_DT_GET_OR_NULL(GPIOA_NODE),
271-
DEVICE_DT_GET_OR_NULL(GPIOB_NODE),
272-
DEVICE_DT_GET_OR_NULL(GPIOC_NODE),
254+
DEVICE_DT_GET_OR_NULL(GPIOA_NODE),
255+
DEVICE_DT_GET_OR_NULL(GPIOB_NODE),
256+
DEVICE_DT_GET_OR_NULL(GPIOC_NODE),
273257
};
274258

275259
for (uint8_t i = 0; i < ARRAY_SIZE(dev_list); i++) {
@@ -282,13 +266,11 @@ static void gpio_mspm0_isr(const struct device *port)
282266
data = dev_list[i]->data;
283267
config = dev_list[i]->config;
284268

285-
status = DL_GPIO_getRawInterruptStatus(config->base,
286-
0xFFFFFFFF);
269+
status = DL_GPIO_getRawInterruptStatus(config->base, 0xFFFFFFFF);
287270

288271
DL_GPIO_clearInterruptStatus(config->base, status);
289272
if (status != 0) {
290-
gpio_fire_callbacks(&data->callbacks,
291-
dev_list[i], status);
273+
gpio_fire_callbacks(&data->callbacks, dev_list[i], status);
292274
}
293275
}
294276
}
@@ -306,8 +288,8 @@ static int gpio_mspm0_init(const struct device *dev)
306288
if (init_irq) {
307289
init_irq = false;
308290

309-
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
310-
gpio_mspm0_isr, DEVICE_DT_INST_GET(0), 0);
291+
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), gpio_mspm0_isr,
292+
DEVICE_DT_INST_GET(0), 0);
311293
irq_enable(DT_INST_IRQN(0));
312294
}
313295

@@ -326,21 +308,23 @@ static const struct gpio_driver_api gpio_mspm0_driver_api = {
326308
.get_pending_int = gpio_mspm0_get_pending_int,
327309
};
328310

329-
#define GPIO_DEVICE_INIT(n, __suffix, __base_addr) \
330-
static const struct gpio_mspm0_config gpio_mspm0_cfg_##__suffix = { \
331-
.common = { .port_pin_mask = \
332-
GPIO_PORT_PIN_MASK_FROM_NGPIOS(gpio##__suffix##_pins), \
333-
}, \
334-
.base = (GPIO_Regs *)__base_addr, \
335-
.pincm_lut = gpio##__suffix##_pincm_lut, \
336-
}; \
337-
static struct gpio_mspm0_data gpio_mspm0_data_##__suffix; \
338-
DEVICE_DT_DEFINE(n, gpio_mspm0_init, NULL, &gpio_mspm0_data_##__suffix, \
339-
&gpio_mspm0_cfg_##__suffix, PRE_KERNEL_1, CONFIG_GPIO_INIT_PRIORITY, \
311+
#define GPIO_DEVICE_INIT(n, __suffix, __base_addr) \
312+
static const struct gpio_mspm0_config gpio_mspm0_cfg_##__suffix = { \
313+
.common = \
314+
{ \
315+
.port_pin_mask = \
316+
GPIO_PORT_PIN_MASK_FROM_NGPIOS(gpio##__suffix##_pins), \
317+
}, \
318+
.base = (GPIO_Regs *)__base_addr, \
319+
.pincm_lut = gpio##__suffix##_pincm_lut, \
320+
}; \
321+
static struct gpio_mspm0_data gpio_mspm0_data_##__suffix; \
322+
DEVICE_DT_DEFINE(n, gpio_mspm0_init, NULL, &gpio_mspm0_data_##__suffix, \
323+
&gpio_mspm0_cfg_##__suffix, PRE_KERNEL_1, CONFIG_GPIO_INIT_PRIORITY, \
340324
&gpio_mspm0_driver_api)
341325

342-
#define GPIO_DEVICE_INIT_MSPM0(__suffix) \
343-
GPIO_DEVICE_INIT(DT_NODELABEL(gpio##__suffix), __suffix, \
326+
#define GPIO_DEVICE_INIT_MSPM0(__suffix) \
327+
GPIO_DEVICE_INIT(DT_NODELABEL(gpio##__suffix), __suffix, \
344328
DT_REG_ADDR(DT_NODELABEL(gpio##__suffix)))
345329

346330
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpioa), okay)

0 commit comments

Comments
 (0)