From patchwork Fri Sep 21 17:00:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 185839 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 240062C007C for ; Sat, 22 Sep 2012 03:00:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430Ab2IURAp (ORCPT ); Fri, 21 Sep 2012 13:00:45 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:50181 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754643Ab2IURAo (ORCPT ); Fri, 21 Sep 2012 13:00:44 -0400 Received: by wibhr14 with SMTP id hr14so2320932wib.1 for ; Fri, 21 Sep 2012 10:00:43 -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=0FqEbKH7mTLkiB0OuEgPcUWAvqszDpxp39/tiCslZA0=; b=ELV2VWgmr6lDOmwJguhkGXKBKgKzhGu6kZ3aj0he6jywVG+V/Pykza9/d/+iIM+4W6 1DgbAA5qpQHRo9jWYRscqR8UAeFNkbB1omaGS2YP1WiNGltbIrrpChpFQFxCSLeVYggK YZLFECj61QtbK84CaUJNN3ZSDtlP5yY7A1K1TIR9gQb4yVaOQDAwS1iBokh3zhZKYhxV A2QJrTgxZ/2q6gUM31iNjl0tX/W1dO1+M6LPONuEAUIwsyPungSVeDL5xJ9LR6XyWM5I xL1ToPzntgG4nianmkxavRBIFa6eX4VyXAaqzDWxfrgox2pn9j2Yw3bFX1yqH1SpoAha 1Yig== Received: by 10.216.179.205 with SMTP id h55mr3392576wem.100.1348246843108; Fri, 21 Sep 2012 10:00:43 -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.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 10:00:42 -0700 (PDT) From: Richard Cochran To: Cc: Ben Hutchings , David Miller , Jacob Keller , Jeff Kirsher , John Stultz , Matthew Vick Subject: [PATCH net-next 2/3] ptp: provide the clock's adjusted frequency Date: Fri, 21 Sep 2012 19:00:26 +0200 Message-Id: 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 If the timex.mode field indicates a query, then we provide the value of the current frequency adjustment. Signed-off-by: Richard Cochran --- drivers/ptp/ptp_clock.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index fbd7104..6e47450 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -148,6 +148,11 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx) err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq)); ptp->dialed_frequency = tx->freq; + + } else if (tx->modes == 0) { + + tx->freq = ptp->dialed_frequency; + err = 0; } return err;