clocksource: export the clocks_calc_mult_shift to use by timestamp code
authorMurali Karicheri <[email protected]>
Wed, 7 Dec 2016 00:00:43 +0000 (18:00 -0600)
committerDavid S. Miller <[email protected]>
Wed, 7 Dec 2016 16:13:48 +0000 (11:13 -0500)
The CPSW CPTS driver is capable of doing timestamping on tx/rx packets and
requires to know mult and shift factors for timestamp conversion from raw
value to nanoseconds (ptp clock). Now these mult and shift factors are
calculated manually and provided through DT, which makes very hard to
support of a lot number of platforms, especially if CPTS refclk is not the
same for some kind of boards and depends on efuse settings (Keystone 2
platforms). Hence, export clocks_calc_mult_shift() to allow drivers like
CPSW CPTS (and other ptp drivesr) to benefit from automaitc calculation of
mult and shift factors.

Cc: John Stultz <[email protected]>
Signed-off-by: Murali Karicheri <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
kernel/time/clocksource.c

index 7e4fad75acaaddbac4d11ade83f6e14cc22aee8c..150242ccfcd201a14e633357589d4c4f3327207e 100644 (file)
@@ -89,6 +89,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 maxsec)
        *mult = tmp;
        *shift = sft;
 }
+EXPORT_SYMBOL_GPL(clocks_calc_mult_shift);
 
 /*[Clocksource internal variables]---------
  * curr_clocksource: