Age | Commit message (Collapse) | Author | Files | Lines |
|
Add support for PWM chips present on SPEAr platforms. These PWM
chips support 4 channel output with programmable duty cycle and
frequency.
More details on these PWM chips can be obtained from relevant
chapter of reference manual, present at following[1] location.
1. http://www.st.com/internet/mcu/product/251211.jsp
Cc: Thierry Reding <[email protected]>
Signed-off-by: Shiraz Hashim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Reviewed-by: Vipin Kumar <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
This patch updates pwm-vt8500.c to support devicetree probing and
make use of the common clock subsystem.
A binding document describing the PWM controller found on
arch-vt8500 is also included.
Signed-off-by: Tony Prisk <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Pull pwm changes from Thierry Reding:
"All legacy PWM providers have now been moved to the PWM subsystem.
The plan for 3.8 is to adapt all board files to provide a lookup table
for PWM devices in order to get rid of the global namespace.
Subsequently, users of the legacy pwm_request() and pwm_free()
functions can be migrated to the new pwm_get() and pwm_put()
functions. Once this has been completed, the legacy API and the
compatibility code in the core can be removed.
In addition to the above, these changes also add support for
configuring the polarity of a PWM signal (currently only supported on
ECAP and EHRPWM) and include a much needed rework of the i.MX driver.
Managed functions to obtain and release a PWM device (devm_pwm_get()
and devm_pwm_put()) have been added and the pwm-backlight driver has
been updated to use them. If the PWM subsystem hasn't been enabled,
dummy functions are provided that allow the subsystem to safely
compile out.
Some common checks on input parameters have been moved to the core and
removed from the drivers. Finally, a small fix corrects the
description of the PWM specifier's second cell in the device tree
representation."
* tag 'for-3.7-rc1' of git://gitorious.org/linux-pwm/linux-pwm: (23 commits)
pwm: dt: Fix description of second PWM cell
pwm: Check for negative duty-cycle and period
pwm: Add Ingenic JZ4740 support
MIPS: JZ4740: Export timer API
pwm: Move PUV3 PWM driver to PWM framework
unicore32: pwm: Use managed resource allocations
unicore32: pwm: Remove unnecessary indirection
unicore32: pwm: Use module_platform_driver()
unicore32: pwm: Properly remap memory-mapped registers
pwm-backlight: Use devm_pwm_get() instead of pwm_get()
pwm: Move AB8500 PWM driver to PWM framework
pwm: Fix compilation error when CONFIG_PWM is not defined
pwm: i.MX: fix clock lookup
pwm: i.MX: use per clock unconditionally
pwm: i.MX: add devicetree support
pwm: i.MX: Use module_platform_driver
pwm: i.MX: add functions to enable/disable pwm.
pwm: i.MX: remove unnecessary if in pwm_[en|dis]able
pwm: i.MX: factor out SoC specific functions
pwm: pwm-tiehrpwm: Add support for configuring polarity of PWM
...
|
|
Make sure the duty-cycle and period passed in are not negative. This
should eventually be made implicit by making them unsigned. While at
it, the drivers' .config() implementations can have the equivalent
checks removed.
Signed-off-by: Thierry Reding <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Sachin Kamat <[email protected]>
Cc: Axel Lin <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: Jonghwan Choi <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: "Philip, Avinash" <[email protected]>
Cc: Vaibhav Bedia <[email protected]>
Acked-by: Jingoo Han <[email protected]>
|
|
This commit moves the driver to drivers/pwm and converts it to the new
PWM framework.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Lars-Peter Clausen <[email protected]>
Tested-by: Lars-Peter Clausen <[email protected]>
Acked-by: Ralf Baechle <[email protected]>
|
|
This commit moves the driver to drivers/pwm and converts it to the new
PWM framework.
Signed-off-by: Thierry Reding <[email protected]>
Tested-by: Qin Rui <[email protected]>
Acked-by: Guan Xuetao <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
"MFD bits for the 3.7 merge window.
As usual we have a few new drivers:
- TI LP8788
- TI OMAP USB TLL
- Maxim MAX8907
- SMSC ECE1099
- Dialog Semiconductor DA9055
- A simpler syscon driver that allow us to get rid of the anatop one.
Drivers are also gradually getting Device Tree and IRQ domain support.
The following drivers got DT support:
- palmas, 88pm860x, tc3589x and twl4030-audio
And those ones now use the IRQ domain APIs:
- 88pm860x, tc3589x, db8500_prcmu
Also some other interesting changes:
- Intel's ICH LPC now supports Lynx Point
- TI's twl4030-audio added a GPO child
- tps6527 enabled its backlight subdevice
- The twl6030 pwm driver moved to the new PWM subsystem
And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x,
palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family."
Fix up various annoying conflicts: the DT and IRQ domain support came in
twice and was already in 3.6. And then it was apparently rebased.
Guys, DON'T REBASE!
* tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits)
ARM: dts: Enable 88pm860x pmic
mfd: 88pm860x: Move gpadc init into touch
mfd: 88pm860x: Device tree support
mfd: 88pm860x: Use irqdomain
mfd: smsc: Add support for smsc gpio io/keypad driver
backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
mfd: DA9055 core driver
mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list
mfd: wm5110: Add register patches for revision B
mfd: wm5110: Disable control interface error report for WM5110 rev B
mfd: max8907: Remove regulator-compatible from DT docs
backlight: Add TPS65217 WLED driver
mfd: Add backlight as subdevice to the tps65217
mfd: Provide the PRCMU with its own IRQ domain
mfd: Fix max8907 sparse warning
mfd: Add lp8788 mfd driver
mfd: dbx500: Provide a more accurate smp_twd clock
mfd: rc5t583: Fix warning messages
regulator: palmas: Add DT support
mfd: palmas: Change regulator defns to better suite DT
...
|
|
This commit moves the driver to drivers/pwm and converts it to the new
PWM framework.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Arun Murthy <[email protected]>
|
|
This commit moves the driver to drivers/pwm and converts it to the new
PWM framework. In order for this to work properly, register the PWM as
child of the multi-function TWL6030 device.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
|
|
The i.MX PWM core has two clocks: The ipg clock and the ipg highfreq
(peripheral) clock. The ipg clock has to be enabled for this hardware
to work. The actual PWM output can either be driven by the ipg clock
or the ipg highfreq. The ipg highfreq has the advantage that it runs
even when the SoC is in low power modes.
This patch requests both clocks and enables the ipg clock for accessing
registers and the peripheral clock to actually turn on the PWM.
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
The i.MX PWM module has two clocks: The ipg clock and the ipg highfreq
(peripheral) clock. The ipg clock has to be enabled for this hardware
to work. The actual PWM output can either be driven by the ipg clock
or the ipg highfreq. The ipg highfreq has the advantage that it runs
even when the SoC is in low power modes.
Use the always running clock also on i.MX25.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
At the same time remove platform based support. No user for
this driver has made it into mainline so far, so all we break
is out of tree stuff.
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
We used to enable/disable the PWM only by switching the
clock on or off. Instead, use the dedicated register bits.
These differ on different SoCs, so introduce a SoC specific
function for this.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
The PWM core makes sure that pwm_enable/disable are called only
once. Still keep the enabled state since we will need it in
pwm_config.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
To cleanup the code and to make it easier to support different
SoCs.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Shawn Guo <[email protected]>
Reviewed-by: Benoît Thébaudeau <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
EHRPWM hardware supports polarity configuration of PWM output. However
configuration of polarity done in hardware only in .enable() to ensure
PWM output present only after enabling PWM. This commit adds support for
polarity configuration for EHRPWM.
When being here, remove configuring of polarity during .config() and do
it explicitly from .set_polarity().
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
ECAP APWM hardware supports polarity configuration of PWM output.
This commit adds support for polarity configuration of ECAP APWM.
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
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: Alexandre Courbot <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
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: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
EHRPWM hardware supports 2 independent PWM channels. However the device
uses only one register to handle period setting for both channels. So
both channels should be configured for same period (in nsec).
Fix the same by returning error for conflicting period values.
However, allow
1. Configuration of period settings if not conflicting with other
channels
2. Re-configuring of period settings if no other channels being
configured
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
APWM mode is enabled while configuring PWM device. This was done to
handle shadow & immediate mode update of period and compare registers.
However, leaving it enabled after configuring will cause APWM output on
PWM pin even before enabling PWM device.
Fix the same by disabling APWM mode after configuring if PWM device is
not running.
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
The Kconfig help text should help the user understand what functionality
is provided by an option. This is especially true for new subsystems. An
improved help text is provided by this commit in the hopes of clarifying
the usefulness of the PWM framework.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
|
|
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: Sachin Kamat <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Fixes the following:
WARNING: Prefer pr_warn(... to pr_warning(...
pr_warning("Waiting for status bits 0x%x to clear timed out\n",
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
The implementation in devm_request_and_ioremap() already shows error message,
so no need to show dev_err again if devm_request_and_ioremap() fails.
Signed-off-by: Axel Lin <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
This patch adds missing device pointer to struct pwm_chip. If the
device pointer is NULL, pwmchip_add() will return error.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
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: Sachin Kamat <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Enhanced high resolution PWM module (EHRPWM) hardware can be used to
generate PWM output over 2 channels. This commit adds PWM driver support
for EHRPWM device present on AM33XX SOC. Current implementation supports
simple PWM functionality.
Reviewed-by: Vaibhav Bedia <[email protected]>
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
ECAP hardware on AM33XX SOC supports auxiliary PWM (APWM) feature. This
commit adds PWM driver support for ECAP hardware on AM33XX SOC.
In the ECAP hardware, each PWM pin can also be configured to be in
capture mode. Current implementation only supports PWM mode of
operation. Also, hardware supports sync between multiple PWM pins but
the driver supports simple independent PWM functionality.
Reviewed-by: Vaibhav Bedia <[email protected]>
Signed-off-by: Philip, Avinash <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
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: Stephen Warren <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add lpc32xx SOC PWM driver.
Signed-off-by: Alexandre Pereira da Silva <[email protected]>
Acked-by: Roland Stigge <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Replace printk with pr_* functions to avoid checkpatch warnings.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Also return proper error in tegra_pwm_remove() if pwmchip_remove()
fails.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
If the pwmchip_remove() call fails, propagate the error to the driver's
remove callback. This is required to prevent the module from being
unloaded if a PWM provided by the driver is still in use.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
In order to avoid duplicate symbols with legacy PWM API implementations,
the new PWM framework needs to conflict with any of the existing legacy
implementations. This is done in two ways: for implementations provided
by drivers, a conflict is added to the driver to ensure it will have to
be ported to the PWM subsystem before it can coexist with other PWM
providers. For architecture-specific code, the conflict is added to the
PWM symbol to avoid confusion when a previously picked platform or
machine can no longer be selected because of the PWM subsystem being
included.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Call pinctrl subsystem to set up pwm pin.
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Use devm_* managed functions to have a clean fail-out.
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Use global reset function stmp_reset_block instead of mxs_reset_block
to remove <mach/common.h> inclusion.
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Encode soc name in the compatible string to know the specific version
hardware block. This is the general approach adopted for most bindings.
Change mxs-pwm binding to use the approach.
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add generic PWM framework driver (DT only) for Freescale MXS.
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Move the driver to drivers/pwm/ and convert it to use the framework.
Signed-off-by: Sascha Hauer <[email protected]>
Cc: Alexey Charkov <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Move the driver to drivers/pwm/ and convert it to use the framework.
Signed-off-by: Sascha Hauer <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Kukjin Kim <[email protected]>
[[email protected]: fix pwmchip_add return code test]
Signed-off-by: Eric Bénard <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Move the driver to drivers/pwm/ and convert it to use the framework.
Signed-off-by: Sascha Hauer <[email protected]>
[[email protected]: set chip.dev to prevent probe failure]
[[email protected]: fix pwmchip_add return code test]
Signed-off-by: Eric Bénard <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|