Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e4d313ff authored by Takashi Yoshii's avatar Takashi Yoshii Committed by Mark Brown
Browse files

spi: spi-sh-msiof: round up div to fix freq calculation



Truncation on integer division in sh_msiof_spi_set_clk_regs()
results in insufficient transfer frequency (> max_speed_freq).

For example, source 52MHz, required max 6MHz
 52/6 = 8.6 --> 8, then 1/8 table selected,
and result in 52/8 = 6.5 MHz (>6MHz)

Rounding it up is a simple solution.
 52/6 = 8.6 --> 9, then 1/16 table selected,
and result in 52/16 = 3.25 MHz

Signed-off-by: default avatarTakashi Yoshii <takasi-y@ops.dti.ne.jp>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 6ce4eac1
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