Skip to content
Commit 541a1649 authored by Michael Walle's avatar Michael Walle Committed by Andre Przywara
Browse files

spi: sunxi: fix clock divider calculation for max frequency setting



If the maximum frequency is requested, we still fall into the CDR2
handling. But there the minimal divider is 2. For the sun6i and sun8i we
can do better with the CDR1 setting where the minimal divider is 1:
  SPI_CLK = MOD_CLK / 2 ^ cdr with cdr = 0

Thus, handle the div = 1 case specially.

While at it, correct the comment above the calculation.

Signed-off-by: default avatarMichael Walle <mwalle@kernel.org>
Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent 6aadcb81
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment