Skip to content

Commit

Permalink
drivers: pinctrl: wch_afio: fix afio remap
Browse files Browse the repository at this point in the history
Enable the AFIO clock before remap.

Signed-off-by: Jianxiong Gu <[email protected]>
  • Loading branch information
recalci authored and kartben committed Jan 2, 2025
1 parent 2158400 commit 948fbac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pinctrl/pinctrl_wch_afio.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintp
uint32_t pcfr1 = AFIO->PCFR1;
uint8_t cfg = 0;

if (remap != 0) {
RCC->APB2PCENR |= RCC_AFIOEN;
}

if (pins->output_high || pins->output_low) {
cfg |= (pins->slew_rate + 1);
if (pins->drive_open_drain) {
Expand Down

0 comments on commit 948fbac

Please sign in to comment.