linux-next/Documentation
Thierry Reding f051c466cf pwm: Allow chips to support multiple PWMs
Many PWM controllers provide access to more than a single PWM output and
may even share some resource among them. Allowing a PWM chip to provide
multiple PWM devices enables better sharing of those resources. As a
side-effect this change allows easy integration with the device tree
where a given PWM can be looked up based on the PWM chip's phandle and a
corresponding index.

This commit modifies the PWM core to support multiple PWMs per struct
pwm_chip. It achieves this in a similar way to how gpiolib works, by
allowing PWM ranges to be requested dynamically (pwm_chip.base == -1) or
starting at a given offset (pwm_chip.base >= 0). A chip specifies how
many PWMs it controls using the npwm member. Each of the functions in
the pwm_ops structure gets an additional argument that specified the PWM
number (it can be converted to a per-chip index by subtracting the
chip's base).

The total maximum number of PWM devices is currently fixed to 1024 while
the data is actually stored in a radix tree, thus saving resources if
not all of them are used.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
[eric@eukrea.com: fix error handling in pwmchip_add]
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2012-06-15 12:56:52 +02:00
..
2012-06-01 16:57:51 -07:00
2011-09-27 18:08:04 +02:00
2010-02-24 13:51:32 +01:00
2012-04-03 13:09:18 +02:00
2011-09-27 18:08:04 +02:00
2012-05-23 14:15:09 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-05-15 17:28:01 -04:00
2011-09-27 18:08:04 +02:00
2012-04-14 11:13:22 +10:00
2011-11-02 16:07:02 -07:00
2012-05-23 13:05:43 -07:00
2011-03-31 11:26:23 -03:00
2011-09-27 18:08:04 +02:00
2011-03-31 11:26:23 -03:00
2010-04-08 11:34:34 +02:00
2008-12-03 16:09:53 -07:00
2008-07-25 10:53:30 -07:00
2012-03-16 20:35:01 +00:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-09-27 18:08:04 +02:00
2009-07-01 22:36:22 +02:00
2011-03-07 13:20:05 -08:00
2009-04-27 12:00:27 -07:00
2009-04-27 12:00:27 -07:00
2011-09-27 18:08:04 +02:00
2012-02-28 16:05:06 +01:00
2012-05-17 08:51:59 -07:00
2011-09-27 18:08:04 +02:00
2011-03-31 11:26:23 -03:00
2010-07-19 10:56:54 +02:00
2010-03-16 11:47:56 +01:00
2012-01-02 13:04:55 +01:00