Skip to content

Commit c64a6a0

Browse files
coibylinusw
authored andcommitted
pinctrl: amd: use higher precision for 512 RtcClk
RTC is 32.768kHz thus 512 RtcClk equals 15625 usec. The documentation likely has dropped precision and that's why the driver mistakenly took the slightly deviated value. Cc: [email protected] Reported-by: Andy Shevchenko <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Suggested-by: Hans de Goede <[email protected]> Signed-off-by: Coiby Xu <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/linux-gpio/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 06abe82 commit c64a6a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/pinctrl-amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
156156
pin_reg |= BIT(DB_TMR_OUT_UNIT_OFF);
157157
pin_reg &= ~BIT(DB_TMR_LARGE_OFF);
158158
} else if (debounce < 250000) {
159-
time = debounce / 15600;
159+
time = debounce / 15625;
160160
pin_reg |= time & DB_TMR_OUT_MASK;
161161
pin_reg &= ~BIT(DB_TMR_OUT_UNIT_OFF);
162162
pin_reg |= BIT(DB_TMR_LARGE_OFF);

0 commit comments

Comments
 (0)