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

Commit 1594aaf2 authored by Meng Wang's avatar Meng Wang Committed by Gerrit - the friendly Code Review server
Browse files

soc: avtimer: add support for decimal value MHz clock



Add support for clocks which has a decimal MHz frequency (e.g. 19.2MHz).
The support is added in such a way that this will avoid the need of
having a floating point operation to get the msec count from the
number of clock ticks.

Change-Id: Iee57a5b67139150a1ffb86e580d8a90e032a894f
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mwang@codeaurora.org>
parent 51f87de7
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -13,8 +13,16 @@ Required properties:
- compatible : Must be "qcom,avtimer"

Optional properties:
- clk-div : The clk is at 27MHz and hence ticks are to be
 divided by 27 to achive the msec value.
- clk-div : Divisor to divide the ticks value to get msec value.
 If the clock is at 27MHz, the ticks value read from AVTimer
 registers will have to be divided by 27, to achieve the msec value.
- clk-mult : Multiplier to multiply the ticks value in order to avoid
 a floating point operation if the clock is of decimal value.
 E.g. To get msec out of ticks from a 19.2MHz clock source, the ticks
 value will have to be divided by 19.2, which will then become a
 floating point operation. However, to avoid using a floating point
 operation, the msec can be calculated by multiplying ticks with 10
 and dividing the result by 192. i.e. msec = (ticks * 10) / 192;

Example:
	qcom,avtimer@90f7000 {
@@ -23,4 +31,5 @@ Example:
		      <0x90f7010 0x4>;
		reg-names = "avtimer_lsb_addr", "avtimer_msb_addr";
		qcom,clk-div = <27>;
		qcom,clk-mult = <10>;
	};