]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: cpts: calc mult and shift from refclk freq
authorGrygorii Strashko <grygorii.strashko@ti.com>
Wed, 7 Dec 2016 00:00:44 +0000 (18:00 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Dec 2016 16:13:48 +0000 (11:13 -0500)
commite9b927b0a1d20e121169f044a2a1d75ba7fa7209
tree4959691cfec4f836023a6ed9e392164946120b7d
parent4ea2d08ced5f295a99bbed40de10773b498a47ff
net: ethernet: ti: cpts: calc mult and shift from refclk freq

The cyclecounter mult and shift values can be calculated based on the
CPTS rfclk frequency and timekeepnig framework provides required algos
and API's.

Hence, calc mult and shift basing on CPTS rfclk frequency if both
cpts_clock_shift and cpts_clock_mult properties are not provided in DT (the
basis of calculation algorithm is borrowed from
__clocksource_update_freq_scale() commit 69b22542527e ("clocksource:
Provide a generic mult/shift factor calculation")). After this change
cpts_clock_shift and cpts_clock_mult DT properties will become optional.

Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/cpsw.txt
drivers/net/ethernet/ti/cpts.c