summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/core.c
Commit message (Collapse)AuthorAgeFilesLines
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-1/+1
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make parameter functions more consistentSascha Hauer2017-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_<type><access> "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask The improvement here is that we now can exactly specify the width of the int type parameters and also correctly distinguish between signed and unsigned variables which means that a variable no longer ends up with INT_MAX when it's assigned -1. "access" can be empty for regular read/write parameter, "_ro" for readonly parameters which get their value from a variable pointer in the background or "_fixed" for parameters which are set to a fixed value (without a pointer in the background). Some more exotic types are not (yet) implemented, like dev_add_param_ip_ro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PWM: update enable status when using the internal APIJan Luebbe2017-01-101-0/+4
| | | | | | | | Without these, 'devinfo pwmX' will show enabled=0 even though the PWM was enabled (for example by a pwm-backlight). Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PWM: Allow multiple PWMs per device nodeSascha Hauer2015-06-121-3/+4
| | | | | | | Matching a device node is enough since a device node may have multiple PWMs. Check for a id aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PWM: Implement devicetree supportSascha Hauer2014-02-281-7/+64
| | | | | | This implements of_pwm_request() for PWM client drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PWM: Add functions for getting/setting period/duty cycleSascha Hauer2014-02-281-0/+20
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PWM: Use a separate device for PWMsSascha Hauer2014-02-131-5/+15
| | | | | | | | Instead of directly using the hardware devicet for PWMs register a logical PWM device so that the user operates on pwmx devices rather than pxa-pwmx. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pwm: sanity check values before passing them to the driversSascha Hauer2013-09-271-0/+7
| | | | | | | | | Check for valid period size before calling ops->config. This fixes the pxa driver which otherwise does a division by zero. While at it, also check for duty_ns being smaller or equal to period_ns. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
* pwm: Use dev_add_param_int for pwm parametersSascha Hauer2013-04-111-59/+30
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/pwm: add duty_ns and period_ns to core pwm chipRobert Jarzmik2012-02-171-1/+75
| | | | | | | | | | Add variables to control the duty_ns and period_ns of PWM chips. When these variables are set, a call to either pwm_enable() or pwm_config() is performed to enforce the setup values. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add pwm core supportSascha Hauer2012-02-171-0/+163
This patch adds framework support for PWM (pulse width modulation) devices. A new pwm can be registered from a hardware driver using pwmchip_add(). It can then be requested from a client driver using pwm_request(). A string is used as a unique identifier for the pwms. It should usually be initialized by the hardware drivers using dev_name(dev). The client API is the same as currently in the Linux Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>