Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
28aedd7e 3bdab16c

+36 -33
+35 -32
Documentation/pps/pps.txt Documentation/driver-api/pps.rst
··· 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 9 This program is free software; you can redistribute it and/or modify 8 10 it under the terms of the GNU General Public License as published by ··· 90 88 -------------- 91 89 92 90 To register a PPS source into the kernel you should define a struct 93 - pps_source_info as follows: 91 + pps_source_info as follows:: 94 92 95 93 static struct pps_source_info pps_ktimer_info = { 96 94 .name = "ktimer", ··· 103 101 }; 104 102 105 103 and then calling the function pps_register_source() in your 106 - initialization routine as follows: 104 + initialization routine as follows:: 107 105 108 106 source = pps_register_source(&pps_ktimer_info, 109 107 PPS_CAPTUREASSERT | PPS_OFFSETASSERT); 110 108 111 - The pps_register_source() prototype is: 109 + The pps_register_source() prototype is:: 112 110 113 111 int pps_register_source(struct pps_source_info *info, int default_params) 114 112 ··· 120 118 121 119 Once you have registered a new PPS source into the system you can 122 120 signal an assert event (for example in the interrupt handler routine) 123 - just using: 121 + just using:: 124 122 125 123 pps_event(source, &ts, PPS_CAPTUREASSERT, ptr) 126 124 ··· 136 134 SYSFS support 137 135 ------------- 138 136 139 - If the SYSFS filesystem is enabled in the kernel it provides a new class: 137 + If the SYSFS filesystem is enabled in the kernel it provides a new class:: 140 138 141 139 $ ls /sys/class/pps/ 142 140 pps0/ pps1/ pps2/ 143 141 144 142 Every directory is the ID of a PPS sources defined in the system and 145 - inside you find several files: 143 + inside you find several files:: 146 144 147 145 $ ls -F /sys/class/pps/pps0/ 148 146 assert dev mode path subsystem@ ··· 150 148 151 149 152 150 Inside each "assert" and "clear" file you can find the timestamp and a 153 - sequence number: 151 + sequence number:: 154 152 155 153 $ cat /sys/class/pps/pps0/assert 156 154 1170026870.983207967#8 ··· 177 175 http://linuxpps.org , or https://github.com/redlab-i/pps-tools. 178 176 179 177 Once you have enabled the compilation of pps-ktimer just modprobe it (if 180 - not statically compiled): 178 + not statically compiled):: 181 179 182 180 # modprobe pps-ktimer 183 181 184 - and the run ppstest as follow: 182 + and the run ppstest as follow:: 185 183 186 184 $ ./ppstest /dev/pps1 187 185 trying PPS source "/dev/pps1" ··· 206 204 computers (master) and PPS clients on others (slaves), and use very simple 207 205 cables to deliver signals using parallel ports, for example. 208 206 209 - Parallel port cable pinout: 210 - pin name master slave 211 - 1 STROBE *------ * 212 - 2 D0 * | * 213 - 3 D1 * | * 214 - 4 D2 * | * 215 - 5 D3 * | * 216 - 6 D4 * | * 217 - 7 D5 * | * 218 - 8 D6 * | * 219 - 9 D7 * | * 220 - 10 ACK * ------* 221 - 11 BUSY * * 222 - 12 PE * * 223 - 13 SEL * * 224 - 14 AUTOFD * * 225 - 15 ERROR * * 226 - 16 INIT * * 227 - 17 SELIN * * 228 - 18-25 GND *-----------* 207 + Parallel port cable pinout:: 208 + 209 + pin name master slave 210 + 1 STROBE *------ * 211 + 2 D0 * | * 212 + 3 D1 * | * 213 + 4 D2 * | * 214 + 5 D3 * | * 215 + 6 D4 * | * 216 + 7 D5 * | * 217 + 8 D6 * | * 218 + 9 D7 * | * 219 + 10 ACK * ------* 220 + 11 BUSY * * 221 + 12 PE * * 222 + 13 SEL * * 223 + 14 AUTOFD * * 224 + 15 ERROR * * 225 + 16 INIT * * 226 + 17 SELIN * * 227 + 18-25 GND *-----------* 229 228 230 229 Please note that parallel port interrupt occurs only on high->low transition, 231 230 so it is used for PPS assert edge. PPS clear edge can be determined only
+1 -1
MAINTAINERS
··· 12659 12659 W: http://wiki.enneenne.com/index.php/LinuxPPS_support 12660 12660 L: linuxpps@ml.enneenne.com (subscribers-only) 12661 12661 S: Maintained 12662 - F: Documentation/pps/ 12662 + F: Documentation/driver-api/pps.rst 12663 12663 F: Documentation/devicetree/bindings/pps/pps-gpio.txt 12664 12664 F: Documentation/ABI/testing/sysfs-pps 12665 12665 F: drivers/pps/