From patchwork Mon Nov 28 23:03:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 84474 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp1957853obn; Mon, 28 Nov 2016 15:08:35 -0800 (PST) X-Received: by 10.99.112.66 with SMTP id a2mr44332511pgn.43.1480374515567; Mon, 28 Nov 2016 15:08:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si51144585pgh.314.2016.11.28.15.08.34; Mon, 28 Nov 2016 15:08:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1753405AbcK1XIZ (ORCPT + 7 others); Mon, 28 Nov 2016 18:08:25 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:42774 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755954AbcK1XD6 (ORCPT ); Mon, 28 Nov 2016 18:03:58 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id uASN3gBb017184; Mon, 28 Nov 2016 17:03:42 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id uASN3gFe000934; Mon, 28 Nov 2016 17:03:42 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Mon, 28 Nov 2016 17:03:41 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uASN3fP4019700; Mon, 28 Nov 2016 17:03:41 -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 uASN3f305502; Mon, 28 Nov 2016 17:03:41 -0600 (CST) From: Grygorii Strashko To: "David S. Miller" , , Mugunthan V N , Richard Cochran CC: Sekhar Nori , , , Rob Herring , , Murali Karicheri , Wingman Kwok , John Stultz , Thomas Gleixner , Grygorii Strashko Subject: [PATCH v2 11/13] clocksource: export the clocks_calc_mult_shift to use by timestamp code Date: Mon, 28 Nov 2016 17:03:35 -0600 Message-ID: <20161128230337.6731-12-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161128230337.6731-1-grygorii.strashko@ti.com> References: <20161128230337.6731-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 Cc: 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 -- 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 Acked-by: Thomas Gleixner 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: