forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple sysfs interface to the generic PWM framework. /sys/class/pwm/ `-- pwmchipN/ for each PWM chip |-- export (w/o) ask the kernel to export a PWM channel |-- npwm (r/o) number of PWM channels in this PWM chip |-- pwmX/ for each exported PWM channel | |-- duty_cycle (r/w) duty cycle (in nanoseconds) | |-- enable (r/w) enable/disable PWM | |-- period (r/w) period (in nanoseconds) | `-- polarity (r/w) polarity of PWM (normal/inversed) `-- unexport (w/o) return a PWM channel to the kernel Based on work by Lars Poeschel. Signed-off-by: H Hartley Sweeten <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Lars Poeschel <[email protected]> Cc: Ryan Mallon <[email protected]> Cc: Rob Landley <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
- Loading branch information
1 parent
3dd0a90
commit 76abbdd
Showing
7 changed files
with
524 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
What: /sys/class/pwm/ | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
The pwm/ class sub-directory belongs to the Generic PWM | ||
Framework and provides a sysfs interface for using PWM | ||
channels. | ||
|
||
What: /sys/class/pwm/pwmchipN/ | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
A /sys/class/pwm/pwmchipN directory is created for each | ||
probed PWM controller/chip where N is the base of the | ||
PWM chip. | ||
|
||
What: /sys/class/pwm/pwmchipN/npwm | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
The number of PWM channels supported by the PWM chip. | ||
|
||
What: /sys/class/pwm/pwmchipN/export | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Exports a PWM channel from the PWM chip for sysfs control. | ||
Value is between 0 and /sys/class/pwm/pwmchipN/npwm - 1. | ||
|
||
What: /sys/class/pwm/pwmchipN/unexport | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Unexports a PWM channel. | ||
|
||
What: /sys/class/pwm/pwmchipN/pwmX | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
A /sys/class/pwm/pwmchipN/pwmX directory is created for | ||
each exported PWM channel where X is the exported PWM | ||
channel number. | ||
|
||
What: /sys/class/pwm/pwmchipN/pwmX/period | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Sets the PWM signal period in nanoseconds. | ||
|
||
What: /sys/class/pwm/pwmchipN/pwmX/duty_cycle | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Sets the PWM signal duty cycle in nanoseconds. | ||
|
||
What: /sys/class/pwm/pwmchipN/pwmX/polarity | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Sets the output polarity of the PWM signal to "normal" or | ||
"inversed". | ||
|
||
What: /sys/class/pwm/pwmchipN/pwmX/enable | ||
Date: May 2013 | ||
KernelVersion: 3.11 | ||
Contact: H Hartley Sweeten <[email protected]> | ||
Description: | ||
Enable/disable the PWM signal. | ||
0 is disabled | ||
1 is enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.