]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
pwm: Add sysfs interface
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 11 Jun 2013 17:38:59 +0000 (10:38 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Thu, 4 Sep 2014 01:03:14 +0000 (18:03 -0700)
commit8e837f9cce974ed641a43535f1185371d68a592c
tree34972965ad2b284eea568fbc58e2a14380a26d86
parentac954dd4168e97d41d68d79d530144333a8ef132
pwm: Add sysfs interface

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.

Bug  200028381

Change-Id: I0c9c6ad2ca7173e6fc3fbe1d3cd3963cde00539a
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Lars Poeschel <poeschel@lemonage.de>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Rob Landley <rob@landley.net>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
(cherry picked from commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d)
Reviewed-on: http://git-master/r/455068
(cherry picked from commit b1824bc0325f84ea04dab7d6d4f7c887c80b1982)
Reviewed-on: http://git-master/r/488690
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
Documentation/ABI/testing/sysfs-class-pwm [new file with mode: 0644]
Documentation/pwm.txt
drivers/pwm/Kconfig
drivers/pwm/Makefile
drivers/pwm/core.c
drivers/pwm/sysfs.c [new file with mode: 0644]
include/linux/pwm.h