diff mbox

[v2,11/13] clocksource: export the clocks_calc_mult_shift to use by timestamp code

Message ID 20161128230337.6731-12-grygorii.strashko@ti.com
State New
Headers show

Commit Message

Grygorii Strashko Nov. 28, 2016, 11:03 p.m. UTC
From: Murali Karicheri <m-karicheri2@ti.com>


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 <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

---
 kernel/time/clocksource.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Thomas Gleixner Nov. 29, 2016, 9:08 a.m. UTC | #1
On Mon, 28 Nov 2016, Grygorii Strashko wrote:

> From: Murali Karicheri <m-karicheri2@ti.com>

> 

> 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 <john.stultz@linaro.org>

> Cc: Thomas Gleixner <tglx@linutronix.de>

> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>

> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>


Acked-by: Thomas Gleixner <tglx@linutronix.de>


> ---

>  kernel/time/clocksource.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c

> index 7e4fad7..150242c 100644

> --- a/kernel/time/clocksource.c

> +++ b/kernel/time/clocksource.c

> @@ -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:

> -- 

> 2.10.1

> 

> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 7e4fad7..150242c 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -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: