From patchwork Fri Sep 21 17:00:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 185838 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AA9B22C0086 for ; Sat, 22 Sep 2012 03:00:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753603Ab2IURAn (ORCPT ); Fri, 21 Sep 2012 13:00:43 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:53214 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754468Ab2IURAl (ORCPT ); Fri, 21 Sep 2012 13:00:41 -0400 Received: by mail-we0-f174.google.com with SMTP id x8so2072211wey.19 for ; Fri, 21 Sep 2012 10:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=7xHryZhhs1F76fJ3kmXWpeQIbYTTT5MV0yYMmIACroI=; b=be4bC5N7RENYzjU4ib5PgMAXNeIN5w4Pdvt2nk6G8qsj92jNaXnTDk9SJgiA6YOunY WcqrP/zesF/K0N/y5vTIE0S0PYb80RTkiLjfeDtcpqLYFOIkuSIFJGQ60CUHHkUCYBBd FwGkyQURdrHCjz/ZWg/Blz8MhFev7d93WR+CnJgIcvB76u+jwTKjEBe6PyU13556ixNG ZVs7zmn+4x9vWiBskfRyscLJanrlo8sxIErzyKe2dizqrGlM7KSqThJhlp3Sf9i4NRt7 x5IyEtDS3Xms2OknDnDeHHLCQ9TJNjPqBBhJGNCSGa+ClgVK6qVi2E4IQ9BXvPOl85bJ 81Tw== Received: by 10.180.109.129 with SMTP id hs1mr5679563wib.0.1348246841002; Fri, 21 Sep 2012 10:00:41 -0700 (PDT) Received: from localhost.localdomain (089144206034.atnat0015.highway.a1.net. [89.144.206.34]) by mx.google.com with ESMTPS id eu4sm38703653wib.2.2012.09.21.10.00.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 10:00:40 -0700 (PDT) From: Richard Cochran To: Cc: Ben Hutchings , David Miller , Jacob Keller , Jeff Kirsher , John Stultz , Matthew Vick Subject: [PATCH net-next 1/3] ptp: remember the adjusted frequency Date: Fri, 21 Sep 2012 19:00:25 +0200 Message-Id: <4eb4f128a263639f2bfec631a379287b136eabcc.1348245523.git.richardcochran@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds a field to the representation of a PTP hardware clock in order to remember the frequency adjustment value dialed by the user. Adding this field will let us answer queries in the manner of adjtimex in a follow on patch. Signed-off-by: Richard Cochran --- drivers/ptp/ptp_clock.c | 1 + drivers/ptp/ptp_private.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index 1e528b5..fbd7104 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -147,6 +147,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx) } else if (tx->modes & ADJ_FREQUENCY) { err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq)); + ptp->dialed_frequency = tx->freq; } return err; diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h index 4d5b508..69d3207 100644 --- a/drivers/ptp/ptp_private.h +++ b/drivers/ptp/ptp_private.h @@ -45,6 +45,7 @@ struct ptp_clock { dev_t devid; int index; /* index into clocks.map */ struct pps_device *pps_source; + long dialed_frequency; /* remembers the frequency adjustment */ struct timestamp_event_queue tsevq; /* simple fifo for time stamps */ struct mutex tsevq_mux; /* one process at a time reading the fifo */ wait_queue_head_t tsev_wq;