diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-12 13:52:56 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2019-06-14 16:31:19 -0400 |
commit | 28aedd7ee214eb63a2e6924b5ec2b081aa7b3953 (patch) | |
tree | dbf9476393fbf5a327a457805f7d2a398a5a968b | |
parent | 3bdab16c55f57a24245c97d707241dd9b48d1a91 (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-- | MAINTAINERS | 2 |
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 | ---------------------- | 4 | PPS - Pulse Per Second |
5 | ====================== | ||
4 | 6 | ||
5 | (C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com> | 7 | Copyright (C) 2007 Rodolfo Giometti <giometti@enneenne.com> |
6 | 8 | ||
7 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by |
@@ -88,7 +90,7 @@ Coding example | |||
88 | -------------- | 90 | -------------- |
89 | 91 | ||
90 | To register a PPS source into the kernel you should define a struct | 92 | To register a PPS source into the kernel you should define a struct |
91 | pps_source_info as follows: | 93 | pps_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 | ||
103 | and then calling the function pps_register_source() in your | 105 | and then calling the function pps_register_source() in your |
104 | initialization routine as follows: | 106 | initialization 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 | ||
109 | The pps_register_source() prototype is: | 111 | The 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 | ||
119 | Once you have registered a new PPS source into the system you can | 121 | Once you have registered a new PPS source into the system you can |
120 | signal an assert event (for example in the interrupt handler routine) | 122 | signal an assert event (for example in the interrupt handler routine) |
121 | just using: | 123 | just 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. | |||
134 | SYSFS support | 136 | SYSFS support |
135 | ------------- | 137 | ------------- |
136 | 138 | ||
137 | If the SYSFS filesystem is enabled in the kernel it provides a new class: | 139 | If 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 | ||
142 | Every directory is the ID of a PPS sources defined in the system and | 144 | Every directory is the ID of a PPS sources defined in the system and |
143 | inside you find several files: | 145 | inside 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 | ||
150 | Inside each "assert" and "clear" file you can find the timestamp and a | 152 | Inside each "assert" and "clear" file you can find the timestamp and a |
151 | sequence number: | 153 | sequence 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, | |||
175 | http://linuxpps.org , or https://github.com/redlab-i/pps-tools. | 177 | http://linuxpps.org , or https://github.com/redlab-i/pps-tools. |
176 | 178 | ||
177 | Once you have enabled the compilation of pps-ktimer just modprobe it (if | 179 | Once you have enabled the compilation of pps-ktimer just modprobe it (if |
178 | not statically compiled): | 180 | not statically compiled):: |
179 | 181 | ||
180 | # modprobe pps-ktimer | 182 | # modprobe pps-ktimer |
181 | 183 | ||
182 | and the run ppstest as follow: | 184 | and 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 | |||
204 | computers (master) and PPS clients on others (slaves), and use very simple | 206 | computers (master) and PPS clients on others (slaves), and use very simple |
205 | cables to deliver signals using parallel ports, for example. | 207 | cables to deliver signals using parallel ports, for example. |
206 | 208 | ||
207 | Parallel port cable pinout: | 209 | Parallel port cable pinout:: |
208 | pin name master slave | 210 | |
209 | 1 STROBE *------ * | 211 | pin name master slave |
210 | 2 D0 * | * | 212 | 1 STROBE *------ * |
211 | 3 D1 * | * | 213 | 2 D0 * | * |
212 | 4 D2 * | * | 214 | 3 D1 * | * |
213 | 5 D3 * | * | 215 | 4 D2 * | * |
214 | 6 D4 * | * | 216 | 5 D3 * | * |
215 | 7 D5 * | * | 217 | 6 D4 * | * |
216 | 8 D6 * | * | 218 | 7 D5 * | * |
217 | 9 D7 * | * | 219 | 8 D6 * | * |
218 | 10 ACK * ------* | 220 | 9 D7 * | * |
219 | 11 BUSY * * | 221 | 10 ACK * ------* |
220 | 12 PE * * | 222 | 11 BUSY * * |
221 | 13 SEL * * | 223 | 12 PE * * |
222 | 14 AUTOFD * * | 224 | 13 SEL * * |
223 | 15 ERROR * * | 225 | 14 AUTOFD * * |
224 | 16 INIT * * | 226 | 15 ERROR * * |
225 | 17 SELIN * * | 227 | 16 INIT * * |
226 | 18-25 GND *-----------* | 228 | 17 SELIN * * |
229 | 18-25 GND *-----------* | ||
227 | 230 | ||
228 | Please note that parallel port interrupt occurs only on high->low transition, | 231 | Please note that parallel port interrupt occurs only on high->low transition, |
229 | so it is used for PPS assert edge. PPS clear edge can be determined only | 232 | so 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> | |||
12659 | W: http://wiki.enneenne.com/index.php/LinuxPPS_support | 12659 | W: http://wiki.enneenne.com/index.php/LinuxPPS_support |
12660 | L: linuxpps@ml.enneenne.com (subscribers-only) | 12660 | L: linuxpps@ml.enneenne.com (subscribers-only) |
12661 | S: Maintained | 12661 | S: Maintained |
12662 | F: Documentation/pps/ | 12662 | F: Documentation/driver-api/pps.rst |
12663 | F: Documentation/devicetree/bindings/pps/pps-gpio.txt | 12663 | F: Documentation/devicetree/bindings/pps/pps-gpio.txt |
12664 | F: Documentation/ABI/testing/sysfs-pps | 12664 | F: Documentation/ABI/testing/sysfs-pps |
12665 | F: drivers/pps/ | 12665 | F: drivers/pps/ |