drivers/pinmux: stm32: Get remap functions visible across family
Move pinctrl remap functions out of stm32f1 definition in order to get it available to all series. Allows use of more IS_ENABLED macros in calling drivers and make code more readable. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
0143b5e3de
commit
f44e931b0c
6 changed files with 62 additions and 51 deletions
|
@ -412,17 +412,18 @@ static int can_stm32_init(const struct device *dev)
|
|||
|
||||
/* configure pinmux */
|
||||
if (cfg->pinctrl_len != 0U) {
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_pinctrl)
|
||||
int remap;
|
||||
/* Check that remap configuration is coherent across pins */
|
||||
remap = stm32_dt_pinctrl_remap_check(cfg->pinctrl,
|
||||
cfg->pinctrl_len);
|
||||
if (remap < 0) {
|
||||
return remap;
|
||||
}
|
||||
|
||||
stm32_dt_pinctrl_remap_set((uint32_t)cfg->can, remap);
|
||||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_pinctrl) */
|
||||
if (IS_ENABLED(DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_pinctrl))) {
|
||||
int remap;
|
||||
/* Check remap configuration is coherent across pins */
|
||||
remap = stm32_dt_pinctrl_remap_check(cfg->pinctrl,
|
||||
cfg->pinctrl_len);
|
||||
if (remap < 0) {
|
||||
return remap;
|
||||
}
|
||||
|
||||
stm32_dt_pinctrl_remap_set((uint32_t)cfg->can, remap);
|
||||
}
|
||||
|
||||
stm32_dt_pinctrl_configure(cfg->pinctrl, cfg->pinctrl_len);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue