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

Skip to content
Commit fe03a9f7 authored by Hans J. Koch's avatar Hans J. Koch Committed by Thomas Gleixner
Browse files

arm: tcc8k: Fix clock rate calculation



The calculation of the best divider value for a requested clock rate
always returned a value that was slightly too large. It was also not
protected against possible divisions by zero.

Request for very low, but non zero rates would cause the ACLK divisor
field to overflow. Catch this situation by using the maximum value.

The internal function aclk_set_rate() calculates the correct divider
value, but doesn't write it back to the register. Add the write back.

Signed-off-by: default avatarHans J. Koch <hjk@linutronix.de>
Signed-off-by: default avatarOskar Schirmer <oskar@linutronix.de>
Cc: bigeasy@linutronix.de
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 85922e54
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