pwm: corrects return values to handle error situation This patch fixes 1. Proper return values for pwm framework API's. 2. Return values for SYSFS interface. Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
pwm: fix division by zero error. Divisor should be checked before dividing for non-zero value. This patch fixes the same and added debug messages. Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
pwm: Correct the "request" SYSFS interface This patch changes handling of "request" SYSFS interface 1. Request for PWM device from "cat request" to "echo 1 > request" 2. Release for PWM device from "echo 1 > request" to "echo 0 > request" 3.Information on reading "request" SYSFS interface if pwm device used, "<pwm device> is used by which <application>" or if pwm device is free, "<pwm device> is free" Also this patch has the fix for hanging of the system on subsequent request/release operation after release of unused device. This is because, release of unused device causes mutex to hold in a locked state and further request for the mutex would hang. Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
PWM: Add cpu frequency transition support for PWM devices Implement a generic frequency transition callback for PWM devices. Generic PWM framework notifies all the PWM devices currently being used about the frequency transition. Signed-off-by: Natarajan Sugumar <sugumar@ti.com> Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
PWM: Add helper APIs and sysfs entries to the PWM Frame Work 1. Add pwm_duty_percent and pwm_frequency attributes to the SYSFS interface of the PWM Framework. Since, PWM waveform is characterized mainly by percent duty and the frequency, it is pretty much useful to have these attributes. 2. Also, period_ns and duty_ns variables have been added to the pwm_device structure as it might be needed by the PWM driver functions. Signed-off-by: Natarajan Sugumar <sugumar@ti.com> Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
PWM: Implement a generic PWM framework Updates the existing PWM-related functions to support multiple and/or hotplugged PWM devices, and adds a sysfs interface. spin_lock protection added. Signed-off-by: Bill Gatliff <bgat@billgatliff.com> Signed-off-by: Philip, Avinash <avinashphilip@ti.com>