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

pwm: Standardize document format

Each text file under Documentation follows a different format. Some
don't even have titles!

Change its representation to follow the adopted standard, using ReST
markup for it to be parseable by Sphinx:

- mark document title;
- mark literal blocks;
- better format the parameters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Mauro Carvalho Chehab and committed by
Thierry Reding
c571123c 2ea659a9

+28 -18
+28 -18
Documentation/pwm.txt
··· 1 + ====================================== 1 2 Pulse Width Modulation (PWM) interface 3 + ====================================== 2 4 3 5 This provides an overview about the Linux PWM interface 4 6 ··· 18 16 19 17 Instead of referring to a PWM device via its unique ID, board setup code 20 18 should instead register a static mapping that can be used to match PWM 21 - consumers to providers, as given in the following example: 19 + consumers to providers, as given in the following example:: 22 20 23 21 static struct pwm_lookup board_pwm_lookup[] = { 24 22 PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL, ··· 42 40 device or a consumer name. pwm_put() is used to free the PWM device. Managed 43 41 variants of these functions, devm_pwm_get() and devm_pwm_put(), also exist. 44 42 45 - After being requested, a PWM has to be configured using: 43 + After being requested, a PWM has to be configured using:: 46 44 47 - int pwm_apply_state(struct pwm_device *pwm, struct pwm_state *state); 45 + int pwm_apply_state(struct pwm_device *pwm, struct pwm_state *state); 48 46 49 47 This API controls both the PWM period/duty_cycle config and the 50 48 enable/disable state. ··· 74 72 pwmchipN, where N is the base of the PWM chip. Inside the directory you 75 73 will find: 76 74 77 - npwm - The number of PWM channels this chip supports (read-only). 75 + npwm 76 + The number of PWM channels this chip supports (read-only). 78 77 79 - export - Exports a PWM channel for use with sysfs (write-only). 78 + export 79 + Exports a PWM channel for use with sysfs (write-only). 80 80 81 - unexport - Unexports a PWM channel from sysfs (write-only). 81 + unexport 82 + Unexports a PWM channel from sysfs (write-only). 82 83 83 84 The PWM channels are numbered using a per-chip index from 0 to npwm-1. 84 85 ··· 89 84 pwmchipN directory it is associated with, where X is the number of the 90 85 channel that was exported. The following properties will then be available: 91 86 92 - period - The total period of the PWM signal (read/write). 93 - Value is in nanoseconds and is the sum of the active and inactive 94 - time of the PWM. 87 + period 88 + The total period of the PWM signal (read/write). 89 + Value is in nanoseconds and is the sum of the active and inactive 90 + time of the PWM. 95 91 96 - duty_cycle - The active time of the PWM signal (read/write). 97 - Value is in nanoseconds and must be less than the period. 92 + duty_cycle 93 + The active time of the PWM signal (read/write). 94 + Value is in nanoseconds and must be less than the period. 98 95 99 - polarity - Changes the polarity of the PWM signal (read/write). 100 - Writes to this property only work if the PWM chip supports changing 101 - the polarity. The polarity can only be changed if the PWM is not 102 - enabled. Value is the string "normal" or "inversed". 96 + polarity 97 + Changes the polarity of the PWM signal (read/write). 98 + Writes to this property only work if the PWM chip supports changing 99 + the polarity. The polarity can only be changed if the PWM is not 100 + enabled. Value is the string "normal" or "inversed". 103 101 104 - enable - Enable/disable the PWM signal (read/write). 105 - 0 - disabled 106 - 1 - enabled 102 + enable 103 + Enable/disable the PWM signal (read/write). 104 + 105 + - 0 - disabled 106 + - 1 - enabled 107 107 108 108 Implementing a PWM driver 109 109 -------------------------