summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-12 13:52:56 -0400
committerJonathan Corbet <corbet@lwn.net>2019-06-14 16:31:19 -0400
commit28aedd7ee214eb63a2e6924b5ec2b081aa7b3953 (patch)
treedbf9476393fbf5a327a457805f7d2a398a5a968b
parent3bdab16c55f57a24245c97d707241dd9b48d1a91 (diff)
docs: pps.txt: convert to ReST and rename to pps.rst
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 <mchehab+samsung@kernel.org> Acked-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/driver-api/pps.rst (renamed from Documentation/pps/pps.txt)67
-rw-r--r--MAINTAINERS2
2 files changed, 36 insertions, 33 deletions
diff --git a/Documentation/pps/pps.txt b/Documentation/driver-api/pps.rst
index 99f5d8c4c652..1456d2c32ebd 100644
--- a/Documentation/pps/pps.txt
+++ b/Documentation/driver-api/pps.rst
@@ -1,8 +1,10 @@
1:orphan:
1 2
2 PPS - Pulse Per Second 3======================
3 ---------------------- 4PPS - Pulse Per Second
5======================
4 6
5(C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com> 7Copyright (C) 2007 Rodolfo Giometti <giometti@enneenne.com>
6 8
7This program is free software; you can redistribute it and/or modify 9This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by 10it under the terms of the GNU General Public License as published by
@@ -88,7 +90,7 @@ Coding example
88-------------- 90--------------
89 91
90To register a PPS source into the kernel you should define a struct 92To register a PPS source into the kernel you should define a struct
91pps_source_info as follows: 93pps_source_info as follows::
92 94
93 static struct pps_source_info pps_ktimer_info = { 95 static struct pps_source_info pps_ktimer_info = {
94 .name = "ktimer", 96 .name = "ktimer",
@@ -101,12 +103,12 @@ pps_source_info as follows:
101 }; 103 };
102 104
103and then calling the function pps_register_source() in your 105and then calling the function pps_register_source() in your
104initialization routine as follows: 106initialization routine as follows::
105 107
106 source = pps_register_source(&pps_ktimer_info, 108 source = pps_register_source(&pps_ktimer_info,
107 PPS_CAPTUREASSERT | PPS_OFFSETASSERT); 109 PPS_CAPTUREASSERT | PPS_OFFSETASSERT);
108 110
109The pps_register_source() prototype is: 111The pps_register_source() prototype is::
110 112
111 int pps_register_source(struct pps_source_info *info, int default_params) 113 int pps_register_source(struct pps_source_info *info, int default_params)
112 114
@@ -118,7 +120,7 @@ pps_source_info which describe the capabilities of the driver).
118 120
119Once you have registered a new PPS source into the system you can 121Once you have registered a new PPS source into the system you can
120signal an assert event (for example in the interrupt handler routine) 122signal an assert event (for example in the interrupt handler routine)
121just using: 123just using::
122 124
123 pps_event(source, &ts, PPS_CAPTUREASSERT, ptr) 125 pps_event(source, &ts, PPS_CAPTUREASSERT, ptr)
124 126
@@ -134,13 +136,13 @@ Please see the file drivers/pps/clients/pps-ktimer.c for example code.
134SYSFS support 136SYSFS support
135------------- 137-------------
136 138
137If the SYSFS filesystem is enabled in the kernel it provides a new class: 139If the SYSFS filesystem is enabled in the kernel it provides a new class::
138 140
139 $ ls /sys/class/pps/ 141 $ ls /sys/class/pps/
140 pps0/ pps1/ pps2/ 142 pps0/ pps1/ pps2/
141 143
142Every directory is the ID of a PPS sources defined in the system and 144Every directory is the ID of a PPS sources defined in the system and
143inside you find several files: 145inside you find several files::
144 146
145 $ ls -F /sys/class/pps/pps0/ 147 $ ls -F /sys/class/pps/pps0/
146 assert dev mode path subsystem@ 148 assert dev mode path subsystem@
@@ -148,7 +150,7 @@ inside you find several files:
148 150
149 151
150Inside each "assert" and "clear" file you can find the timestamp and a 152Inside each "assert" and "clear" file you can find the timestamp and a
151sequence number: 153sequence number::
152 154
153 $ cat /sys/class/pps/pps0/assert 155 $ cat /sys/class/pps/pps0/assert
154 1170026870.983207967#8 156 1170026870.983207967#8
@@ -175,11 +177,11 @@ and the userland tools available in your distribution's pps-tools package,
175http://linuxpps.org , or https://github.com/redlab-i/pps-tools. 177http://linuxpps.org , or https://github.com/redlab-i/pps-tools.
176 178
177Once you have enabled the compilation of pps-ktimer just modprobe it (if 179Once you have enabled the compilation of pps-ktimer just modprobe it (if
178not statically compiled): 180not statically compiled)::
179 181
180 # modprobe pps-ktimer 182 # modprobe pps-ktimer
181 183
182and the run ppstest as follow: 184and the run ppstest as follow::
183 185
184 $ ./ppstest /dev/pps1 186 $ ./ppstest /dev/pps1
185 trying PPS source "/dev/pps1" 187 trying PPS source "/dev/pps1"
@@ -204,26 +206,27 @@ nor affordable. The cheap way is to load a PPS generator on one of the
204computers (master) and PPS clients on others (slaves), and use very simple 206computers (master) and PPS clients on others (slaves), and use very simple
205cables to deliver signals using parallel ports, for example. 207cables to deliver signals using parallel ports, for example.
206 208
207Parallel port cable pinout: 209Parallel port cable pinout::
208pin name master slave 210
2091 STROBE *------ * 211 pin name master slave
2102 D0 * | * 212 1 STROBE *------ *
2113 D1 * | * 213 2 D0 * | *
2124 D2 * | * 214 3 D1 * | *
2135 D3 * | * 215 4 D2 * | *
2146 D4 * | * 216 5 D3 * | *
2157 D5 * | * 217 6 D4 * | *
2168 D6 * | * 218 7 D5 * | *
2179 D7 * | * 219 8 D6 * | *
21810 ACK * ------* 220 9 D7 * | *
21911 BUSY * * 221 10 ACK * ------*
22012 PE * * 222 11 BUSY * *
22113 SEL * * 223 12 PE * *
22214 AUTOFD * * 224 13 SEL * *
22315 ERROR * * 225 14 AUTOFD * *
22416 INIT * * 226 15 ERROR * *
22517 SELIN * * 227 16 INIT * *
22618-25 GND *-----------* 228 17 SELIN * *
229 18-25 GND *-----------*
227 230
228Please note that parallel port interrupt occurs only on high->low transition, 231Please note that parallel port interrupt occurs only on high->low transition,
229so it is used for PPS assert edge. PPS clear edge can be determined only 232so it is used for PPS assert edge. PPS clear edge can be determined only
diff --git a/MAINTAINERS b/MAINTAINERS
index ac88ed99fca5..aae3bd8a19f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12659,7 +12659,7 @@ M: Rodolfo Giometti <giometti@enneenne.com>
12659W: http://wiki.enneenne.com/index.php/LinuxPPS_support 12659W: http://wiki.enneenne.com/index.php/LinuxPPS_support
12660L: linuxpps@ml.enneenne.com (subscribers-only) 12660L: linuxpps@ml.enneenne.com (subscribers-only)
12661S: Maintained 12661S: Maintained
12662F: Documentation/pps/ 12662F: Documentation/driver-api/pps.rst
12663F: Documentation/devicetree/bindings/pps/pps-gpio.txt 12663F: Documentation/devicetree/bindings/pps/pps-gpio.txt
12664F: Documentation/ABI/testing/sysfs-pps 12664F: Documentation/ABI/testing/sysfs-pps
12665F: drivers/pps/ 12665F: drivers/pps/