29 Nov, 2016

1 commit

  • Make sure to drop the reference to the parent device taken by
    class_find_device() after "unexporting" any children when deregistering
    a PWM chip.

    Fixes: 0733424c9ba9 ("pwm: Unexport children before chip removal")
    Signed-off-by: Johan Hovold
    Signed-off-by: Thierry Reding

    Johan Hovold
     

05 Sep, 2016

1 commit

  • Exported pwm channels aren't removed before the pwmchip and are
    leaked. This results in invalid sysfs files. This fix removes
    all exported pwm channels before chip removal.

    Signed-off-by: David Hsu
    Fixes: 76abbdde2d95 ("pwm: Add sysfs interface")
    Signed-off-by: Thierry Reding

    David Hsu
     

25 Jul, 2016

1 commit


10 Jun, 2016

2 commits

  • Allow a user to read PWM capture results from sysfs. To start a capture
    and read the result, simply read the file:

    $ cat $PWMCHIP/capture

    The output format is " ".

    Signed-off-by: Lee Jones
    Signed-off-by: Thierry Reding

    Lee Jones
     
  • This patch adds to check the return value from pwm_apply_state()
    used in enable_store(). The error of enable_store() doesn't work
    if the return value doesn't received.

    Signed-off-by: Ryo Kodama
    Signed-off-by: Yoshihiro Shimoda
    Fixes: 39100ceea79f ("pwm: Switch to the atomic API")
    Signed-off-by: Thierry Reding

    Ryo Kodama
     

17 May, 2016

2 commits

  • Replace legacy pwm_get/set_xxx() and pwm_config/enable/disable() calls
    by pwm_get/apply_state().

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • PWM devices are not protected against concurrent accesses. The lock in
    struct pwm_device might let PWM users think it is, but it's actually
    only protecting the enabled state.

    Removing this lock should be fine as long as all PWM users are aware
    that accesses to the PWM device have to be serialized, which seems to be
    the case for all of them except the sysfs interface. Patch the sysfs
    code by adding a lock to the pwm_export struct and making sure it's
    taken for all relevant accesses to the exported PWM device.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris BREZILLON
     

10 Nov, 2015

2 commits


27 Jul, 2015

2 commits


20 Jul, 2015

2 commits


04 Dec, 2013

1 commit


29 Jul, 2013

1 commit


21 Jun, 2013

1 commit

  • 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
    Cc: Thierry Reding
    Cc: Lars Poeschel
    Cc: Ryan Mallon
    Cc: Rob Landley
    Signed-off-by: Thierry Reding

    H Hartley Sweeten