Skip to content

Commit f371ae3

Browse files
gmarullcfriedt
authored andcommitted
drivers: pinmux: stm32: remove pre-DT API
Remove APIs used in the pre-DT era. In case manual access is required, `stm32_dt_pinctrl_configure` can still be used as a shortcut with data initialized in the expected format. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent d99f35e commit f371ae3

File tree

2 files changed

+0
-69
lines changed

2 files changed

+0
-69
lines changed

drivers/pinmux/pinmux_stm32.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -428,42 +428,3 @@ int stm32_dt_pinctrl_remap(const struct soc_gpio_pinctrl *pinctrl,
428428
return 0;
429429
}
430430
#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_pinctrl) */
431-
432-
433-
/**
434-
* @brief pin setup
435-
*
436-
* @param pin STM32PIN() encoded pin ID
437-
* @param func SoC specific function assignment
438-
* @param clk optional clock device
439-
*
440-
* @return 0 on success, error otherwise
441-
*/
442-
int z_pinmux_stm32_set(uint32_t pin, uint32_t func)
443-
{
444-
const struct device *port_device = gpio_ports[STM32_PORT(pin)];
445-
446-
/* make sure to enable port clock first */
447-
if (gpio_stm32_clock_request(port_device, true)) {
448-
return -EIO;
449-
}
450-
451-
return stm32_pin_configure(pin, func, func & STM32_AFR_MASK);
452-
}
453-
454-
/**
455-
* @brief setup pins according to their assignments
456-
*
457-
* @param pinconf board pin configuration array
458-
* @param pins array size
459-
*/
460-
void stm32_setup_pins(const struct pin_config *pinconf,
461-
size_t pins)
462-
{
463-
int i;
464-
465-
for (i = 0; i < pins; i++) {
466-
z_pinmux_stm32_set(pinconf[i].pin_num,
467-
pinconf[i].mode);
468-
}
469-
}

drivers/pinmux/pinmux_stm32.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
extern "C" {
2424
#endif
2525

26-
struct pin_config {
27-
uint8_t pin_num;
28-
uint32_t mode;
29-
};
30-
3126
/**
3227
* @brief structure to convey pinctrl information for stm32 soc
3328
* value
@@ -86,31 +81,6 @@ struct soc_gpio_pinctrl {
8681
#define STM32_PIN(__pin) \
8782
((__pin) & 0xf)
8883

89-
/**
90-
* @brief helper for configuration of IO pin
91-
*
92-
* @param pin IO pin, STM32PIN() encoded
93-
* @param func IO function encoded
94-
* @param clk clock control device, for enabling/disabling clock gate
95-
* for the port
96-
*/
97-
int z_pinmux_stm32_set(uint32_t pin, uint32_t func);
98-
99-
/**
100-
* @brief helper for obtaining pin configuration for the board
101-
*
102-
* @param[out] pins set to the number of pins in the array
103-
*
104-
* Obtain pin assignment/configuration for current board. This call
105-
* needs to be implemented at the board integration level. After
106-
* restart all pins are already configured as GPIO and can be skipped
107-
* in the configuration array. Pin numbers in @pin_num field are
108-
* STM32PIN() encoded.
109-
*
110-
*/
111-
void stm32_setup_pins(const struct pin_config *pinconf,
112-
size_t pins);
113-
11484
/**
11585
* @brief helper for converting dt stm32 pinctrl format to existing pin config
11686
* format

0 commit comments

Comments
 (0)