Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933573AbbDIUCV (ORCPT ); Thu, 9 Apr 2015 16:02:21 -0400 Received: from spidey.rellim.com ([204.17.205.8]:46581 "EHLO spidey.rellim.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756048AbbDIUCT convert rfc822-to-8bit (ORCPT ); Thu, 9 Apr 2015 16:02:19 -0400 X-Greylist: delayed 729 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Apr 2015 16:02:18 EDT DKIM-Filter: OpenDKIM Filter v2.9.2 spidey.rellim.com t39JnjOd013759 Date: Thu, 9 Apr 2015 12:49:45 -0700 From: "Gary E. Miller" To: Jan =?UTF-8?B?TMO8YmJl?= Cc: linux-kernel@vger.kernel.org, Rodolfo Giometti , Ricardo Martin s , James Nus s Subject: Re: [PATCH] PPS: Restore lost capture-clear option to pps-gpio module. Message-ID: <20150409124945.2743383e@rellim.com> In-Reply-To: <1428584709.7346.25.camel@pengutronix.de> References: <201504022004.t32K4xbW013508@spidey.rellim.com> <1428584709.7346.25.camel@pengutronix.de> Organization: Rellim X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2345 Lines: 64 Yo Jan! On Thu, 09 Apr 2015 15:05:09 +0200 Jan Lübbe wrote: > Hi Gary, > > On Do, 2015-04-02 at 12:21 -0700, Gary E. Miller wrote: > > In the conversion from platform to device tree the capture-clear > > option was lost. > > > > capture-clear is needed so that time_pps_fetch() will report both > > edges of each PPS pulse. Both edges are needed so that userland > > programs, like gpsd, can autodetect the leading and trailing PPS > > edges. > > This is intentional. The userspace program can configure which edges > it wants to capture at runtime. Yes, on pps-ldisc, but no on pps-gpio. If you think I am wrong then please show me how I can do that in my userspace program. I have talked to several experts that could not figure out how to do so. They all started with the same assertion as yours. The time_pps_setcap() function call will not work to do so because the PPS_CAPTUREASSERT is locked out before time_pps_getcap(). You can easily verify this with the ppstest program on a Raspberry Pi running Debian Wheezy using an Adafruit GPS. Notice that info->catpure_clear can ONLY be set one place in the entire driver, and that place is during platform probing. pps-gpio.c line 110. No other place. Without info->capture_clear it is not possible to capture the clear edge. Check pps-gpio.c lines 68 and 82. I would be happy to provide you ssh access to the test platform if you think you can prove me wrong. I have test programs I can show you that demonstrate this. > Only the polarity > (assert-falling-edge) is actually determined by the hardware and must > be described in the device tree. Now, but when it was a platform driver the capture assert could also be selected in the platform hardware description. I'm just trying to restore lost functionality. If instead you would be in favor of always allowing capture assert that would be good as well. RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701 gem@rellim.com Tel:+1(541)382-8588 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/