- 10 9月, 2012 2 次提交
-
-
由 Alexandre Courbot 提交于
Add resource managed variants of pwm_get() and pwm_put() for convenience. Code is largely inspired by the equivalent devm functions of the regulator framework. Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Philip, Avinash 提交于
Some hardware supports inverting the polarity of the PWM signal. This commit adds support to the PWM framework to allow users of the PWM API to configure the polarity. Note that in order to reduce complexity, changing the polarity of a PWM signal is only allowed while the PWM is disabled. A practical example where this can prove useful is to simulate inversion of the duty cycle. While inversion of polarity and duty cycle are not exactly the same, the differences for most use-cases are negligible. Signed-off-by: NPhilip, Avinash <avinashphilip@ti.com> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
- 17 8月, 2012 2 次提交
-
-
由 Sachin Kamat 提交于
Fixes the following: WARNING: line over 80 characters ERROR: spaces required around that ':' (ctx:VxW) WARNING: Prefer pr_warn(... to pr_warning(... Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Sachin Kamat 提交于
Fixes the following sparse warnings: drivers/pwm/core.c:152:6: warning: symbol 'of_pwmchip_add' was not declared. Should it be static? drivers/pwm/core.c:165:6: warning: symbol 'of_pwmchip_remove' was not declared. Should it be static? Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
- 23 7月, 2012 1 次提交
-
-
由 Thierry Reding 提交于
Some versions of GCC don't seem no notice that the initialization of the index variable is tied to that of the chip variable and falsely report it as potentially being used uninitialized. However, to save anybody else from tripping over this, we now initialize the index variable unconditionally. Originally-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
- 15 6月, 2012 5 次提交
-
-
由 Thierry Reding 提交于
This patch adds helpers to support device tree bindings for the generic PWM API. Device tree binding documentation for PWM controllers is also provided. Acked-by: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NShawn Guo <shawn.guo@linaro.org> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Thierry Reding 提交于
In order to get rid of the global namespace for PWM devices, this commit provides an alternative method, similar to that of the regulator or clock frameworks, for registering a static mapping for PWM devices. This works by providing a table with a provider/consumer map in the board setup code. With the new pwm_get() and pwm_put() functions available, usage of pwm_request() and pwm_free() becomes deprecated. Reviewed-by: NShawn Guo <shawn.guo@linaro.org> Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Thierry Reding 提交于
This commit adds a debugfs interface that can be used to list the current internal state of the PWM devices registered with the PWM framework. Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: NShawn Guo <shawn.guo@linaro.org> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Thierry Reding 提交于
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: NMark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: NShawn Guo <shawn.guo@linaro.org> [eric@eukrea.com: fix error handling in pwmchip_add] Signed-off-by: NEric Bénard <eric@eukrea.com> Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-
由 Sascha Hauer 提交于
This patch adds framework support for PWM (pulse width modulation) devices. The is a barebone PWM API already in the kernel under include/linux/pwm.h, but it does not allow for multiple drivers as each of them implements the pwm_*() functions. There are other PWM framework patches around from Bill Gatliff. Unlike his framework this one does not change the existing API for PWMs so that this framework can act as a drop in replacement for the existing API. Why another framework? Several people argue that there should not be another framework for PWMs but they should be integrated into one of the existing frameworks like led or hwmon. Unlike these frameworks the PWM framework is agnostic to the purpose of the PWM. In fact, a PWM can drive a LED, but this makes the LED framework a user of a PWM, like already done in leds-pwm.c. The gpio framework also is not suitable for PWMs. Every gpio could be turned into a PWM using timer based toggling, but on the other hand not every PWM hardware device can be turned into a gpio due to the lack of hardware capabilities. This patch does not try to improve the PWM API yet, this could be done in subsequent patches. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Acked-by: NKurt Van Dijck <kurt.van.dijck@eia.be> Reviewed-by: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NMatthias Kaehlcke <matthias@kaehlcke.net> Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: NShawn Guo <shawn.guo@linaro.org> [thierry.reding@avionic-design.de: fixup typos, kerneldoc comments] Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
-