Skip to content

Commit cc78880

Browse files
committed
soc: raspberrypi: common: reformat pinctrl include
Signed-off-by: Martin Meyer <[email protected]>
1 parent 5147a62 commit cc78880

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed

soc/raspberrypi/rpi_pico/common/pinctrl_soc.h

+30-33
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
*/
1515
struct rpi_pinctrl_soc_pin {
1616
/** Pin number 0..29 */
17-
uint32_t pin_num : 5;
17+
uint32_t pin_num: 5;
1818
/** Alternative function (UART, SPI, etc.) */
19-
uint32_t alt_func : 5;
19+
uint32_t alt_func: 5;
2020
/** Maximum current used by a pin, in mA */
21-
uint32_t drive_strength : 4;
21+
uint32_t drive_strength: 4;
2222
/** Slew rate, may be either false (slow) or true (fast) */
23-
uint32_t slew_rate : 1;
23+
uint32_t slew_rate: 1;
2424
/** Enable the internal pull up resistor */
25-
uint32_t pullup : 1;
25+
uint32_t pullup: 1;
2626
/** Enable the internal pull down resistor */
27-
uint32_t pulldown : 1;
27+
uint32_t pulldown: 1;
2828
/** Enable the pin as an input */
29-
uint32_t input_enable : 1;
29+
uint32_t input_enable: 1;
3030
/** Enable the internal schmitt trigger */
31-
uint32_t schmitt_enable : 1;
31+
uint32_t schmitt_enable: 1;
3232
/** Output-enable override */
33-
uint32_t oe_override : 2;
33+
uint32_t oe_override: 2;
3434
/** Output override */
35-
uint32_t out_override : 2;
35+
uint32_t out_override: 2;
3636
/** Input override */
37-
uint32_t in_override : 2;
37+
uint32_t in_override: 2;
3838
/** Interrupt override */
39-
uint32_t irq_override : 2;
39+
uint32_t irq_override: 2;
4040
};
4141

4242
typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
@@ -48,20 +48,20 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
4848
* @param prop Property name.
4949
* @param idx Property entry index.
5050
*/
51-
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
52-
{ \
53-
RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
54-
RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
55-
DT_ENUM_IDX(node_id, drive_strength), \
56-
DT_ENUM_IDX(node_id, slew_rate), \
57-
DT_PROP(node_id, bias_pull_up), \
58-
DT_PROP(node_id, bias_pull_down), \
59-
DT_PROP(node_id, input_enable), \
60-
DT_PROP(node_id, input_schmitt_enable), \
61-
DT_PROP(node_id, raspberrypi_oe_override), \
62-
DT_PROP(node_id, raspberrypi_out_override), \
63-
DT_PROP(node_id, raspberrypi_in_override), \
64-
DT_PROP(node_id, raspberrypi_irq_override), \
51+
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
52+
{ \
53+
RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
54+
RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
55+
DT_ENUM_IDX(node_id, drive_strength), \
56+
DT_ENUM_IDX(node_id, slew_rate), \
57+
DT_PROP(node_id, bias_pull_up), \
58+
DT_PROP(node_id, bias_pull_down), \
59+
DT_PROP(node_id, input_enable), \
60+
DT_PROP(node_id, input_schmitt_enable), \
61+
DT_PROP(node_id, raspberrypi_oe_override), \
62+
DT_PROP(node_id, raspberrypi_out_override), \
63+
DT_PROP(node_id, raspberrypi_in_override), \
64+
DT_PROP(node_id, raspberrypi_irq_override), \
6565
},
6666

6767
/**
@@ -70,14 +70,11 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
7070
* @param node_id Node identifier.
7171
* @param prop Property name describing state pins.
7272
*/
73-
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
74-
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \
75-
DT_FOREACH_PROP_ELEM, pinmux, \
73+
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
74+
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), DT_FOREACH_PROP_ELEM, pinmux, \
7675
Z_PINCTRL_STATE_PIN_INIT)}
7776

78-
#define RP2_GET_PIN_NUM(pinctrl) \
79-
(((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
80-
#define RP2_GET_PIN_ALT_FUNC(pinctrl) \
81-
(((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
77+
#define RP2_GET_PIN_NUM(pinctrl) (((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
78+
#define RP2_GET_PIN_ALT_FUNC(pinctrl) (((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
8279

8380
#endif /* ZEPHYR_SOC_ARM_RPI_PICO_RP2_PINCTRL_SOC_H_ */

0 commit comments

Comments
 (0)