From patchwork Fri Dec 2 20:30:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 86364 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp432966qgi; Fri, 2 Dec 2016 12:32:26 -0800 (PST) X-Received: by 10.99.6.134 with SMTP id 128mr81728806pgg.53.1480710746466; Fri, 02 Dec 2016 12:32:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si6389339pgn.234.2016.12.02.12.32.26; Fri, 02 Dec 2016 12:32:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932393AbcLBUcO (ORCPT + 5 others); Fri, 2 Dec 2016 15:32:14 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:24997 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753989AbcLBUar (ORCPT ); Fri, 2 Dec 2016 15:30:47 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id uB2KUTVC000353; Fri, 2 Dec 2016 14:30:29 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id uB2KUTbP015064; Fri, 2 Dec 2016 14:30:29 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Fri, 2 Dec 2016 14:30:28 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uB2KUSUL028616; Fri, 2 Dec 2016 14:30:28 -0600 Received: from localhost (uda0226610.am.dhcp.ti.com [128.247.83.173]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id uB2KUS325379; Fri, 2 Dec 2016 14:30:28 -0600 (CST) From: Grygorii Strashko To: "David S. Miller" , , Mugunthan V N , Richard Cochran CC: Sekhar Nori , , , Rob Herring , , Murali Karicheri , Wingman Kwok , Thomas Gleixner , John Stultz , Grygorii Strashko Subject: [PATCH v3 11/13] clocksource: export the clocks_calc_mult_shift to use by timestamp code Date: Fri, 2 Dec 2016 14:30:21 -0600 Message-ID: <20161202203023.25526-12-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161202203023.25526-1-grygorii.strashko@ti.com> References: <20161202203023.25526-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Murali Karicheri 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 Acked-by: Thomas Gleixner Signed-off-by: Murali Karicheri Signed-off-by: Grygorii Strashko --- kernel/time/clocksource.c | 1 + 1 file changed, 1 insertion(+) -- 2.10.1 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: