soc: raspberrypi: common: reformat pinctrl include
Apply clang-format on source files. Signed-off-by: Martin Meyer <meyer.m90@gmail.com>
This commit is contained in:
parent
5d39cc1eea
commit
010d7d1b9a
1 changed files with 30 additions and 33 deletions
|
@ -14,29 +14,29 @@
|
|||
*/
|
||||
struct rpi_pinctrl_soc_pin {
|
||||
/** Pin number 0..29 */
|
||||
uint32_t pin_num : 5;
|
||||
uint32_t pin_num: 5;
|
||||
/** Alternative function (UART, SPI, etc.) */
|
||||
uint32_t alt_func : 5;
|
||||
uint32_t alt_func: 5;
|
||||
/** Maximum current used by a pin, in mA */
|
||||
uint32_t drive_strength : 4;
|
||||
uint32_t drive_strength: 4;
|
||||
/** Slew rate, may be either false (slow) or true (fast) */
|
||||
uint32_t slew_rate : 1;
|
||||
uint32_t slew_rate: 1;
|
||||
/** Enable the internal pull up resistor */
|
||||
uint32_t pullup : 1;
|
||||
uint32_t pullup: 1;
|
||||
/** Enable the internal pull down resistor */
|
||||
uint32_t pulldown : 1;
|
||||
uint32_t pulldown: 1;
|
||||
/** Enable the pin as an input */
|
||||
uint32_t input_enable : 1;
|
||||
uint32_t input_enable: 1;
|
||||
/** Enable the internal schmitt trigger */
|
||||
uint32_t schmitt_enable : 1;
|
||||
uint32_t schmitt_enable: 1;
|
||||
/** Output-enable override */
|
||||
uint32_t oe_override : 2;
|
||||
uint32_t oe_override: 2;
|
||||
/** Output override */
|
||||
uint32_t out_override : 2;
|
||||
uint32_t out_override: 2;
|
||||
/** Input override */
|
||||
uint32_t in_override : 2;
|
||||
uint32_t in_override: 2;
|
||||
/** Interrupt override */
|
||||
uint32_t irq_override : 2;
|
||||
uint32_t irq_override: 2;
|
||||
};
|
||||
|
||||
typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
|
||||
|
@ -48,20 +48,20 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
|
|||
* @param prop Property name.
|
||||
* @param idx Property entry index.
|
||||
*/
|
||||
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
|
||||
{ \
|
||||
RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
|
||||
RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
|
||||
DT_ENUM_IDX(node_id, drive_strength), \
|
||||
DT_ENUM_IDX(node_id, slew_rate), \
|
||||
DT_PROP(node_id, bias_pull_up), \
|
||||
DT_PROP(node_id, bias_pull_down), \
|
||||
DT_PROP(node_id, input_enable), \
|
||||
DT_PROP(node_id, input_schmitt_enable), \
|
||||
DT_PROP(node_id, raspberrypi_oe_override), \
|
||||
DT_PROP(node_id, raspberrypi_out_override), \
|
||||
DT_PROP(node_id, raspberrypi_in_override), \
|
||||
DT_PROP(node_id, raspberrypi_irq_override), \
|
||||
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
|
||||
{ \
|
||||
RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
|
||||
RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
|
||||
DT_ENUM_IDX(node_id, drive_strength), \
|
||||
DT_ENUM_IDX(node_id, slew_rate), \
|
||||
DT_PROP(node_id, bias_pull_up), \
|
||||
DT_PROP(node_id, bias_pull_down), \
|
||||
DT_PROP(node_id, input_enable), \
|
||||
DT_PROP(node_id, input_schmitt_enable), \
|
||||
DT_PROP(node_id, raspberrypi_oe_override), \
|
||||
DT_PROP(node_id, raspberrypi_out_override), \
|
||||
DT_PROP(node_id, raspberrypi_in_override), \
|
||||
DT_PROP(node_id, raspberrypi_irq_override), \
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -70,14 +70,11 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
|
|||
* @param node_id Node identifier.
|
||||
* @param prop Property name describing state pins.
|
||||
*/
|
||||
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
|
||||
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \
|
||||
DT_FOREACH_PROP_ELEM, pinmux, \
|
||||
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
|
||||
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), DT_FOREACH_PROP_ELEM, pinmux, \
|
||||
Z_PINCTRL_STATE_PIN_INIT)}
|
||||
|
||||
#define RP2_GET_PIN_NUM(pinctrl) \
|
||||
(((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
|
||||
#define RP2_GET_PIN_ALT_FUNC(pinctrl) \
|
||||
(((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
|
||||
#define RP2_GET_PIN_NUM(pinctrl) (((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
|
||||
#define RP2_GET_PIN_ALT_FUNC(pinctrl) (((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
|
||||
|
||||
#endif /* ZEPHYR_SOC_ARM_RPI_PICO_RP2_PINCTRL_SOC_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue