Skip to content

Commit 83f22e0

Browse files
committed
drivers: pinctrl: wch_20x_30x_afio: fix afio remap
Enable the AFIO clock before remap. Otherwise, remap will not work. Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
1 parent 05c3775 commit 83f22e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pinctrl/pinctrl_wch_20x_30x_afio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintp
3333
uint32_t pcfr = pcfr_id == 0 ? AFIO->PCFR1 : AFIO->PCFR2;
3434
uint8_t cfg = 0;
3535

36+
if (remap != 0) {
37+
RCC->APB2PCENR |= RCC_AFIOEN;
38+
}
39+
3640
if (pins->output_high || pins->output_low) {
3741
cfg |= (pins->slew_rate + 1);
3842
if (pins->drive_open_drain) {

0 commit comments

Comments
 (0)