Skip to content

Commit 28aedd7

Browse files
mchehabJonathan Corbet
authored andcommitted
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>
1 parent 3bdab16 commit 28aedd7

2 files changed

Lines changed: 36 additions & 33 deletions

File tree

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
:orphan:
12

2-
PPS - Pulse Per Second
3-
----------------------
3+
======================
4+
PPS - Pulse Per Second
5+
======================
46

5-
(C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com>
7+
Copyright (C) 2007 Rodolfo Giometti <giometti@enneenne.com>
68

79
This program is free software; you can redistribute it and/or modify
810
it under the terms of the GNU General Public License as published by
@@ -88,7 +90,7 @@ Coding example
8890
--------------
8991

9092
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::
9294

9395
static struct pps_source_info pps_ktimer_info = {
9496
.name = "ktimer",
@@ -101,12 +103,12 @@ pps_source_info as follows:
101103
};
102104

103105
and then calling the function pps_register_source() in your
104-
initialization routine as follows:
106+
initialization routine as follows::
105107

106108
source = pps_register_source(&pps_ktimer_info,
107109
PPS_CAPTUREASSERT | PPS_OFFSETASSERT);
108110

109-
The pps_register_source() prototype is:
111+
The pps_register_source() prototype is::
110112

111113
int pps_register_source(struct pps_source_info *info, int default_params)
112114

@@ -118,7 +120,7 @@ pps_source_info which describe the capabilities of the driver).
118120

119121
Once you have registered a new PPS source into the system you can
120122
signal an assert event (for example in the interrupt handler routine)
121-
just using:
123+
just using::
122124

123125
pps_event(source, &ts, PPS_CAPTUREASSERT, ptr)
124126

@@ -134,21 +136,21 @@ Please see the file drivers/pps/clients/pps-ktimer.c for example code.
134136
SYSFS support
135137
-------------
136138

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::
138140

139141
$ ls /sys/class/pps/
140142
pps0/ pps1/ pps2/
141143

142144
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::
144146

145147
$ ls -F /sys/class/pps/pps0/
146148
assert dev mode path subsystem@
147149
clear echo name power/ uevent
148150

149151

150152
Inside each "assert" and "clear" file you can find the timestamp and a
151-
sequence number:
153+
sequence number::
152154

153155
$ cat /sys/class/pps/pps0/assert
154156
1170026870.983207967#8
@@ -175,11 +177,11 @@ and the userland tools available in your distribution's pps-tools package,
175177
http://linuxpps.org , or https://github.com/redlab-i/pps-tools.
176178

177179
Once you have enabled the compilation of pps-ktimer just modprobe it (if
178-
not statically compiled):
180+
not statically compiled)::
179181

180182
# modprobe pps-ktimer
181183

182-
and the run ppstest as follow:
184+
and the run ppstest as follow::
183185

184186
$ ./ppstest /dev/pps1
185187
trying PPS source "/dev/pps1"
@@ -204,26 +206,27 @@ nor affordable. The cheap way is to load a PPS generator on one of the
204206
computers (master) and PPS clients on others (slaves), and use very simple
205207
cables to deliver signals using parallel ports, for example.
206208

207-
Parallel port cable pinout:
208-
pin name master slave
209-
1 STROBE *------ *
210-
2 D0 * | *
211-
3 D1 * | *
212-
4 D2 * | *
213-
5 D3 * | *
214-
6 D4 * | *
215-
7 D5 * | *
216-
8 D6 * | *
217-
9 D7 * | *
218-
10 ACK * ------*
219-
11 BUSY * *
220-
12 PE * *
221-
13 SEL * *
222-
14 AUTOFD * *
223-
15 ERROR * *
224-
16 INIT * *
225-
17 SELIN * *
226-
18-25 GND *-----------*
209+
Parallel port cable pinout::
210+
211+
pin name master slave
212+
1 STROBE *------ *
213+
2 D0 * | *
214+
3 D1 * | *
215+
4 D2 * | *
216+
5 D3 * | *
217+
6 D4 * | *
218+
7 D5 * | *
219+
8 D6 * | *
220+
9 D7 * | *
221+
10 ACK * ------*
222+
11 BUSY * *
223+
12 PE * *
224+
13 SEL * *
225+
14 AUTOFD * *
226+
15 ERROR * *
227+
16 INIT * *
228+
17 SELIN * *
229+
18-25 GND *-----------*
227230

228231
Please note that parallel port interrupt occurs only on high->low transition,
229232
so it is used for PPS assert edge. PPS clear edge can be determined only

‎MAINTAINERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12659,7 +12659,7 @@ M: Rodolfo Giometti <giometti@enneenne.com>
1265912659
W: http://wiki.enneenne.com/index.php/LinuxPPS_support
1266012660
L: linuxpps@ml.enneenne.com (subscribers-only)
1266112661
S: Maintained
12662-
F: Documentation/pps/
12662+
F: Documentation/driver-api/pps.rst
1266312663
F: Documentation/devicetree/bindings/pps/pps-gpio.txt
1266412664
F: Documentation/ABI/testing/sysfs-pps
1266512665
F: drivers/pps/

0 commit comments

Comments
 (0)