Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1808576ybi; Sat, 8 Jun 2019 19:31:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwekeOh9olyGRbPlrHX6qk8XGE2xuBLedLPdWv+sdTGMPPjiyvHSzTheEWkXIr5Yx0C6ixe X-Received: by 2002:a17:902:a513:: with SMTP id s19mr9222105plq.25.1560047494252; Sat, 08 Jun 2019 19:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560047494; cv=none; d=google.com; s=arc-20160816; b=yk+kEWqz+UF+T1QY+OHePxz4M42WKZ9pd+wqOdzDnIAWEwFdf4uuet1Hnn1OzNKTVz Lwpa9HruMAF5rh/z8kzeCxdeALzjthymsH+N+1XxY57A+S8lmaSb1Bwuq2514+T25WzF O7CJ/EMVWS/Twjl6rSwb6db15FjkMOhWhAdpJ1ZAi6RcCwvLu6JP/6zfoPPZjFOq8JGr MZlgH0ogEnva0574GZ8K2KlL4VNUY+kJEkMuGtw25BbVpxgMjVrPcGNWLpfdhZtbaHkZ CF5tbj0/GKsAfRGSguo2dxCfRwG2lR08hIgXFQUV2yTNBXveXPL3DsDjULv6n+EzvkRM pkfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1i+/CwQvCFSSff2+OU8uan6/0iYzlORT2y09SfPy9RM=; b=d4WXgTTAVhyCLPYGFuI6Ml/xx/tkn52VL53so7/A+nxHjjqvUcLIYYIbjwge6v6LUP Fm7x/IbEitDioaJa3MTEs0gPPRUhNmolNOMK2sfCnAOpddUGnLTAQK7iCdz7d/IQ2L0o nuce2ewrf/s28UKs17S4fnAGEl/+/UN/idY/GzMtbkbLc3ChgjQvYEEtWtrHQ/L/Ckwx 19LoHAs/TmSaopVGa1Xxn8LgqnIr5CHgcRsw2L7xVYo4+n5WTyi2Fa4P/a9HI4Z3wEDD hJcUGrsWe/s9jghzK3FrPiT7/fhHL1cJWlguigbzhBtf+W1NaWzxNYh8B73mCtvnZ8Re NewA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=GmdE597H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gb4si6311107plb.429.2019.06.08.19.31.18; Sat, 08 Jun 2019 19:31:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=GmdE597H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728009AbfFIC1e (ORCPT + 99 others); Sat, 8 Jun 2019 22:27:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55576 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727654AbfFIC1b (ORCPT ); Sat, 8 Jun 2019 22:27:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1i+/CwQvCFSSff2+OU8uan6/0iYzlORT2y09SfPy9RM=; b=GmdE597H7q53teUMVQ2HkbOqRc 8dR49Qb4hVzwkzkB6n55GIcLVCaTk45+4uGAlTSFk/MabvPxqzi59sQSebYof9amo5vxVcr/e+zJi k+e1cXJTaagGWhXpksQXihWJXEN1OchYlnqZ2hWaiyDO6CooLqcKrzSoowTtzy3TCYPQDVsPuuKt0 VHEeDpKAumDQmcYGzoo3bSMugoeGC4l4G6jg7n9jgd2k9mHlzZU12wwq2UXKXiy9a+GGTNQhp/T4R Y8FMzNo+Aa4vtmN3NzQ0Gk2316UjukLGAjuEQ86/pKWnTb2url+nhaUNcV7mXQhJ5z2G3uMAf+53y oa4Y5LHg==; Received: from 179.176.115.133.dynamic.adsl.gvt.net.br ([179.176.115.133] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hZnYO-0001mz-2b; Sun, 09 Jun 2019 02:27:28 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hZnYL-0000Jt-E0; Sat, 08 Jun 2019 23:27:25 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Rodolfo Giometti Subject: [PATCH v3 22/33] docs: pps.txt: convert to ReST and rename to pps.rst Date: Sat, 8 Jun 2019 23:27:12 -0300 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This file is already in a good shape: just its title and adding some literal block markups is needed for it to be part of the document. While it has a small chapter with sysfs stuff, most of the document is focused on driver development. As it describes a kernel API, move it to the driver-api directory. In order to avoid conflicts, let's add an :orphan: tag to it, to be removed when added to the driver-api book. Signed-off-by: Mauro Carvalho Chehab --- .../{pps/pps.txt => driver-api/pps.rst} | 67 ++++++++++--------- MAINTAINERS | 2 +- 2 files changed, 36 insertions(+), 33 deletions(-) rename Documentation/{pps/pps.txt => driver-api/pps.rst} (89%) diff --git a/Documentation/pps/pps.txt b/Documentation/driver-api/pps.rst similarity index 89% rename from Documentation/pps/pps.txt rename to Documentation/driver-api/pps.rst index 99f5d8c4c652..1456d2c32ebd 100644 --- a/Documentation/pps/pps.txt +++ b/Documentation/driver-api/pps.rst @@ -1,8 +1,10 @@ +:orphan: - PPS - Pulse Per Second - ---------------------- +====================== +PPS - Pulse Per Second +====================== -(C) Copyright 2007 Rodolfo Giometti +Copyright (C) 2007 Rodolfo Giometti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,7 +90,7 @@ Coding example -------------- To register a PPS source into the kernel you should define a struct -pps_source_info as follows: +pps_source_info as follows:: static struct pps_source_info pps_ktimer_info = { .name = "ktimer", @@ -101,12 +103,12 @@ pps_source_info as follows: }; and then calling the function pps_register_source() in your -initialization routine as follows: +initialization routine as follows:: source = pps_register_source(&pps_ktimer_info, PPS_CAPTUREASSERT | PPS_OFFSETASSERT); -The pps_register_source() prototype is: +The pps_register_source() prototype is:: int pps_register_source(struct pps_source_info *info, int default_params) @@ -118,7 +120,7 @@ pps_source_info which describe the capabilities of the driver). Once you have registered a new PPS source into the system you can signal an assert event (for example in the interrupt handler routine) -just using: +just using:: pps_event(source, &ts, PPS_CAPTUREASSERT, ptr) @@ -134,13 +136,13 @@ Please see the file drivers/pps/clients/pps-ktimer.c for example code. SYSFS support ------------- -If the SYSFS filesystem is enabled in the kernel it provides a new class: +If the SYSFS filesystem is enabled in the kernel it provides a new class:: $ ls /sys/class/pps/ pps0/ pps1/ pps2/ Every directory is the ID of a PPS sources defined in the system and -inside you find several files: +inside you find several files:: $ ls -F /sys/class/pps/pps0/ assert dev mode path subsystem@ @@ -148,7 +150,7 @@ inside you find several files: Inside each "assert" and "clear" file you can find the timestamp and a -sequence number: +sequence number:: $ cat /sys/class/pps/pps0/assert 1170026870.983207967#8 @@ -175,11 +177,11 @@ and the userland tools available in your distribution's pps-tools package, http://linuxpps.org , or https://github.com/redlab-i/pps-tools. Once you have enabled the compilation of pps-ktimer just modprobe it (if -not statically compiled): +not statically compiled):: # modprobe pps-ktimer -and the run ppstest as follow: +and the run ppstest as follow:: $ ./ppstest /dev/pps1 trying PPS source "/dev/pps1" @@ -204,26 +206,27 @@ nor affordable. The cheap way is to load a PPS generator on one of the computers (master) and PPS clients on others (slaves), and use very simple cables to deliver signals using parallel ports, for example. -Parallel port cable pinout: -pin name master slave -1 STROBE *------ * -2 D0 * | * -3 D1 * | * -4 D2 * | * -5 D3 * | * -6 D4 * | * -7 D5 * | * -8 D6 * | * -9 D7 * | * -10 ACK * ------* -11 BUSY * * -12 PE * * -13 SEL * * -14 AUTOFD * * -15 ERROR * * -16 INIT * * -17 SELIN * * -18-25 GND *-----------* +Parallel port cable pinout:: + + pin name master slave + 1 STROBE *------ * + 2 D0 * | * + 3 D1 * | * + 4 D2 * | * + 5 D3 * | * + 6 D4 * | * + 7 D5 * | * + 8 D6 * | * + 9 D7 * | * + 10 ACK * ------* + 11 BUSY * * + 12 PE * * + 13 SEL * * + 14 AUTOFD * * + 15 ERROR * * + 16 INIT * * + 17 SELIN * * + 18-25 GND *-----------* Please note that parallel port interrupt occurs only on high->low transition, so it is used for PPS assert edge. PPS clear edge can be determined only diff --git a/MAINTAINERS b/MAINTAINERS index 01d9120bb83b..b982622ea7ee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12689,7 +12689,7 @@ M: Rodolfo Giometti W: http://wiki.enneenne.com/index.php/LinuxPPS_support L: linuxpps@ml.enneenne.com (subscribers-only) S: Maintained -F: Documentation/pps/ +F: Documentation/driver-api/pps.rst F: Documentation/devicetree/bindings/pps/pps-gpio.txt F: Documentation/ABI/testing/sysfs-pps F: drivers/pps/ -- 2.21.0