aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm
Commit message (Collapse)AuthorAgeFilesLines
* pwm: qpnp: Fix wrong usage of ramp control addressSubbaraman Narayanamurthy2014-10-131-30/+65
| | | | | | | | | | | Currently, the ramp control address is determined only by checking the HW revision of LPG. However, that only applies to LPG peripherals of LPG_CHAN subtype. Read the subtype as well so that the proper address offset for ramp control can be determined and used. CRs-Fixed: 733418 Change-Id: I404c66695eb8a9ab942b0a5d8a82c17b6016953a Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* pwm: qpnp: Read dtest configuration before checking modeSubbaraman Narayanamurthy2014-09-111-14/+14
| | | | | | | | | | | | | In certain cases like PWM configuration handoff from the bootloader, it's not required to configure the PWM channel during probe. So mode-select will not be specified. Without mode-select, driver will skip reading dtest related configuration. However this has to be still read from the device tree and stored for controlling the PWM configuration further. Hence move reading the dtest related configuration before reading the mode-select. Change-Id: Ia3378d98e172b55f47ac6acebbc4e8c525cb963e Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* pwm: qpnp: Add support for configuring LPG to DTESTSubbaraman Narayanamurthy2014-08-271-0/+88
| | | | | | | | | | LPG channel outputs can be configured to route them to DTEST lines so that they can be made available externally on MPP or GPIO pins. This will be helpful for testing the channel output. CRs-Fixed: 705733 Change-Id: I8e04344fa1df677400bd4b2a50af5f0d04f1c346 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* pwm: qpnp: Allocate the base for pwm chip automaticallySubbaraman Narayanamurthy2014-08-191-1/+1
| | | | | | | | | | | | | Currently we're setting the base of a pwm chip with the channel number while adding the pwm chip. Generic pwm driver maintains a single bitmap for the channels from multiple devices. If there are multiple PWM hardware blocks with the same channel number, this causes a probe failure for the second device as that base is allocated already for the first device. Fix that by setting the base to be allocated automatically. Change-Id: If533ab0e70b5e32adac9ab53efdb6cd30edacadb Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* pwm: qpnp: re-enable PWM or LUT output when configuration is changedPrasad Sodagudi2014-07-291-0/+14
| | | | | | | | | | | | | | The PWM controller in Qualcomm PMIC chipset needs to re-enabled if the underlying PWM configuration is changed. Currently all the PWM client drivers are disabling pwm before changing configuration and there is no output from PWM while changing the configuration. Hence re-enable PWM or LUT output whenever the PWM or LUT configuration is changed. This will allow clients to change the configuration without first calling pwm_disable(). Change-Id: I3dd1b6644c2c04bdfb053ee7c6d18c59ae129295 Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* pwm: qpnp: correct LUT mode LPG disable stepsPrasad Sodagudi2014-07-161-4/+3
| | | | | | | | | | | | Modify the pwm-qpnp driver in order to remove RAMP_CONTROL register writes during LPG disable while in LUT mode. This is needed to fix the LED blink functionality when LPG enable/disable operations are performed continously CRs-Fixed: 593837 Change-Id: I915eb7620902911ef8d3f8d44c9b75986bc69bd1 Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* pwm: qpnp: add PWM sync for 8994 PMICMohan Pallaka2014-06-151-3/+6
| | | | | | | | | PWM channels in PMIC 8994 use sync to update the PWM values. Change-Id: I72e6bac2a94ec745957764c4a9904d7ba08786e9 Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org> Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* pwm: qpnp: use the correct parameter to check the change of PWM periodXu Kai2014-04-211-2/+4
| | | | | | | | | | | | "pwm->period" is an external parameter that will be updated out of the pwm-qpnp driver unexpectedly. It's improper to use this parameter to check whether the expected period is different from the one being used. "chip->pwm_config.pwm_period" is a pwm-qpnp internal parameter, which always represents the current period, so use it to fix the problem. Change-Id: I455b828c8c9270ef0f32ab3533daa1bc2c7d183d Signed-off-by: Xu Kai <kaixu@codeaurora.org>
* pwm: qpnp: provide both nsec/usec-supported pwm config() functionsXu Kai2013-12-121-38/+98
| | | | | | | | | | | | | | Kernel 3.10 introduces pwm framework, and the standard pwm_config() API uses nanosecond-level parameters, so we should implement it. But Qualcomm platform should support 384 seconds pwm-period at most, the above standard API couldn't satisfy the requirement of the bigger period, so we also provide pwm_config_us() this such platform related API. CRs-Fixed: 587715 Change-Id: Ia3ea9904141f69c1f40a8619ba8d9fe891e3460a Signed-off-by: Xu Kai <kaixu@codeaurora.org>
* qpnp: pwm: remove the PWM Channel ID dependencyPrasad Sodagudi2013-09-131-37/+75
| | | | | | | | | | | | | | | | | | Existing driver uses the PWM channel ID to identify PWM sizes are supported and to enable RAMP_CONTROL register in LUT mode. To support more than one PMIC chip in system, this channel ID dependency breaks LPG functionality. So add supported_sizes field for every LPG/PWM to dynamically identify supported sizes of LPG/PWM channel. Also to start the ramp in LPG mode, ramp_index is required for every LPG to update the RAMP_CONTROL register without depending on channel ID. Change-Id: Ic4a73c7ea1b8d581d71687a7baaf411b67851f0e Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* qpnp: pwm: Force the pwm size selectionPrasad Sodagudi2013-09-041-12/+54
| | | | | | | | | | | | | For certain use cases pwm size need to restricted to avoid dynamic pwm size selection based on the pwm period value. Currently pwm freqency and pwm sizes are selected for a given pwm period. Restrict pwm size to a specific value and select pwm frequency closest to pwm period requested. CRs-Fixed: 529920 Change-Id: I42d4d9621312adf25061b7a9b52056806f8d9b2b Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* pwm: Refactor Qualcomm pwm driver to support upstream pwm frameworkPrasad Sodagudi2013-09-043-0/+1846
| | | | | | | | | | | | | | Linux 3.10 version includes generic PWM framework support, therefore update the existing Qualcomm PWM drivers to use the framework. Rename the qpnp-pwm driver to align with upstream pwm file nomenclature. Also, revert the pwm header back to linux 3.10. The changes to the pwm drivers are backward compatible so that they do not break existing clients. Subsequent patches should include changes to both PWM drivers and their clients so that usage of deprecated APIs (i.e. pwm_request) can be removed. Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
* drivers/pwm: don't check resource with devm_ioremap_resourceWolfram Sang2013-05-188-40/+0
| | | | | | | | devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Stephen Warren <swarren@nvidia.com>
* pwm: lpc32xx: Don't change PWM_ENABLE bit in lpc32xx_pwm_configAxel Lin2013-04-231-2/+5
| | | | | | | | | lpc32xx_pwm_config() is supposed to set duty_ns and period_ns, it should not change PWM_ENABLE bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: lpc32xx: Properly set PWM_ENABLE bit in lpc32xx_pwm_[enable|disable]Axel Lin2013-04-231-2/+16
| | | | | | | | | | | | | | | | | | | | | | According to the LPC32x0 User Manual [1]: For both PWM1 and PWM2 Control Registers: BIT 31: This bit gates the PWM_CLK signal and enables the external output pin to the PWM_PIN_STATE logical level. 0 = PWM disabled. (Default) 1 = PWM enabled So in lpc32xx_pwm_enable(), we should set PWM_ENABLE bit. In lpc32xx_pwm_disable(), we should just clear PWM_ENABLE bit rather than write 0 to the register which will also clear PWMx_RELOADV and PWMx_DUTY bits. [1] http://www.nxp.com/documents/user_manual/UM10326.pdf Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: Constify OF match tablesThierry Reding2013-04-236-6/+6
| | | | | | | | | | A few drivers already annotate this properly. Make the same change for all other OF supporting drivers. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
* pwm: puv3: Remove unused enabled filed from struct puv3_pwm_chipAxel Lin2013-04-021-1/+0
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: pxa: Remove PWM_ID_BASE macroAxel Lin2013-04-021-4/+3
| | | | | | | | | PWM_ID_BASE() is not used after convert to PWM framework, remove it. Also update driver_data field of struct platform_device_id accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: spear: Remove unused *dev from struct spear_pwm_chipAxel Lin2013-04-021-3/+0
| | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Shiraz Hashim <shiraz.hashim@st.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: mxs: Remove unused *dev from struct mxs_pwm_chipAxel Lin2013-04-021-2/+0
| | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: twl: Return proper error if twl6030_pwm_enable() failsAxel Lin2013-04-021-1/+1
| | | | | | | | Return proper error instead of 0 if twl6030_pwm_enable() fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: pxa: Remove clk_enabled field from struct pxa_pwm_chipAxel Lin2013-04-021-14/+2
| | | | | | | | | | | clk_enable/clk_disable maintain an enable_count, clk_prepare and clk_unprepare also maintain a prepare_count. These APIs will do prepare/enable when the first user calling these APIs, and do disable/unprepare when the corresponding counter reach 0. Thus We don't need to maintain a clk_enabled counter here. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: imx: Remove enabled field from struct imx_chipAxel Lin2013-04-021-5/+1
| | | | | | | | | We can test PWMF_ENABLED bit to know if pwm is enabled or not. Thus remove enabled field from struct imx_chip. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: twl: Add .owner to struct pwm_opsAxel Lin2013-04-021-0/+2
| | | | | | | | | Add missing .owner of struct pwm_ops. This prevents the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: twl-led: Add .owner to struct pwm_opsAxel Lin2013-04-021-0/+2
| | | | | | | | | Add missing .owner of struct pwm_ops. This prevents the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: atmel-tcb: Add .owner to struct pwm_opsAxel Lin2013-04-021-0/+1
| | | | | | | | Add missing .owner of struct pwm_ops. This prevents the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: ab8500: Add .owner to struct pwm_opsAxel Lin2013-04-021-0/+1
| | | | | | | | Add missing .owner of struct pwm_ops. This prevents the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: spear: Fix checking return value of clk_enable() and clk_prepare()Axel Lin2013-04-021-3/+3
| | | | | | | | | | The logic to check return value of clk_enable() and clk_prepare() is reversed, fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: tiehrpwm: Staticize non-exported symbolsAxel Lin2013-03-261-2/+2
| | | | | | | | Both ehrpwm_pwm_save_context() and ehrpwm_pwm_restore_context() are only used in this file, make them static. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: tiecap: Staticize non-exported symbolsAxel Lin2013-03-261-2/+2
| | | | | | | | Both ecap_pwm_save_context() and ecap_pwm_restore_context() are only used in this file, make them static. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: ab8500: Fix trivial typo in dev_err messageAxel Lin2013-03-261-1/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: davinci: Add Kconfig support for ECAP & EHRPWM devicesPhilip Avinash2013-03-222-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add EHRPWM and ECAP support build support for DAVINCI_DA8XX platforms. Also, since DAVINCI platforms doesn't support TI-PWM-Subsystem module, remove the select option for CONFIG_PWM_TIPWMSS. Also, update CONFIG_PWM_TIPWMSS compiler directive appropriately in pwm-tipwmss.h to fix the below compiler error upon removal of CONFIG_PWM_TIPWMSS for DAVINCI platforms. drivers/pwm/pwm-tiecap.c: In function 'ecap_pwm_probe': drivers/pwm/pwm-tiecap.c:263:4: error: 'PWMSS_ECAPCLK_EN' undeclared (first use in this function) drivers/pwm/pwm-tiecap.c:263:4: note: each undeclared identifier is reported only once for each function it appears in drivers/pwm/pwm-tiecap.c:264:17: error: 'PWMSS_ECAPCLK_EN_ACK' undeclared (first use in this function) drivers/pwm/pwm-tiecap.c: In function 'ecap_pwm_remove': drivers/pwm/pwm-tiecap.c:291:49: error: 'PWMSS_ECAPCLK_STOP_REQ' undeclared (first use in this function) make[2]: *** [drivers/pwm/pwm-tiecap.o] Error 1 make[1]: *** [drivers/pwm] Error 2 make: *** [drivers] Error 2 Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-03-111-0/+2
| | | | | | | | | | | This patch adds CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. drivers/pwm/pwm-tiehrpwm.c:562:12: warning: 'ehrpwm_pwm_suspend' defined but not used [-Wunused-function] drivers/pwm/pwm-tiehrpwm.c:580:12: warning: 'ehrpwm_pwm_resume' defined but not used [-Wunused-function Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: pwm-tipwmss: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-03-111-0/+2
| | | | | | | | | | | This patch adds CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. drivers/pwm/pwm-tipwmss.c:104:12: warning: 'pwmss_suspend' defined but not used [-Wunused-function] drivers/pwm/pwm-tipwmss.c:113:12: warning: 'pwmss_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: pwm-tiecap: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-03-111-0/+2
| | | | | | | | | | | This patch adds CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. drivers/pwm/pwm-tiecap.c:314:12: warning: 'ecap_pwm_suspend' defined but not used [-Wunused-function] drivers/pwm/pwm-tiecap.c:328:12: warning: 'ecap_pwm_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: samsung: convert s3c_pwm to dev_pm_opsJingoo Han2013-03-081-11/+9
| | | | | | | | Instead of using legacy suspend/resume methods, using newer dev_pm_ops structure allows better control over power management. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* pwm: ab8500: use devm_kzalloc()Jingoo Han2013-03-081-5/+2
| | | | | | | Use devm_kzalloc() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwmLinus Torvalds2013-02-2610-29/+697
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull PWM changes from Thierry Reding: "A new driver has been added to support the PWM mode of the timer counter blocks found on Atmel AT91 SoCs. The VT8500 driver now supports changing the PWM signal polarity and the TI drivers (EHRPWM and ECAP) gained suspend and resume functionality. User drivers can now query the core for whether access to a PWM device will sleep (if the PWM chip is on a slow bus such as I2C or SPI). The pwm-backlight driver now handles the backlight BL_CORE_FBBLANK state in addition to the FB layer's blanking states. To round things off, a few fixes and cleanups are also included" * tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm: pwm: twl: Use to_twl() instead of container_of() pwm: tegra: assume CONFIG_OF pwm_backlight: Validate dft_brightness in main probe function pwm: Export pwm_{set,get}_chip_data() pwm: Make Kconfig entries more consistent pwm: Add can_sleep property to drivers pwm: Add pwm_can_sleep() as exported API to users pwm-backlight: handle BL_CORE_FBBLANK state pwm: pwm-tiecap: Low power sleep support pwm: pwm-tiehrpwm: Low power sleep support pwm: pwm-tiehrpwm: Update the clock handling of pwm-tiehrpwm driver pwm: vt8500: Add polarity support pwm: vt8500: Register write busy test performed incorrectly pwm: atmel: add Timer Counter Block PWM driver
| * pwm: twl: Use to_twl() instead of container_of()Johannes Thumshirn2013-02-171-6/+3
| | | | | | | | | | | | | | | | Always use to_twl() for converting into private data instead of container_of(). Signed-off-by: Johannes Thumshirn <morbidrsa@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: tegra: assume CONFIG_OFStephen Warren2013-02-151-3/+1
| | | | | | | | | | | | | | | | Tegra only supports, and always enables, device tree. Remove all ifdefs for DT support from the driver. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: Export pwm_{set,get}_chip_data()Thierry Reding2013-01-301-0/+2
| | | | | | | | | | | | | | When building a driver as a module, these functions need to be exported for linking to succeed. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: Make Kconfig entries more consistentThierry Reding2013-01-301-4/+4
| | | | | | | | | | | | | | PWM is now consistently spelled in all uppercase letters. For the Atmel driver the entry now also mentions Atmel to make it easier to find. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: Add can_sleep property to driversFlorian Vaussard2013-01-302-0/+2
| | | | | | | | | | | | | | | | | | Calls to PWM drivers connected through I2C can sleep. Use the new can_sleep property. Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: Add pwm_can_sleep() as exported API to usersFlorian Vaussard2013-01-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | Calls to some external PWM chips can sleep. To help users, add pwm_can_sleep() API. Cc: Thierry Reding <thierry.reding@avionic-design.de> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: pwm-tiecap: Low power sleep supportPhilip Avinash2013-01-171-0/+53
| | | | | | | | | | | | | | | | In low power modes of AM33XX platforms, peripherals power is cut off. This patch supports low power sleep transition support for ECAP driver. Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: pwm-tiehrpwm: Low power sleep supportPhilip Avinash2013-01-171-0/+83
| | | | | | | | | | | | | | | | | | In low power modes of AM33XX platforms, peripherals power is cut off. This patch supports low power sleep transition support for EHRPWM driver. Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: pwm-tiehrpwm: Update the clock handling of pwm-tiehrpwm driverPhilip, Avinash2013-01-141-2/+8
| | | | | | | | | | | | | | | | | | | | The clock framework has changed and it's now better to invoke clock_prepare_enable() and clk_disable_unprepare() rather than the legacy clk_enable() and clk_disable() calls. This patch converts the pwm-tiehrpwm driver to the new framework. Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: vt8500: Add polarity supportTony Prisk2013-01-091-0/+23
| | | | | | | | | | | | | | | | | | | | | | Add support to set polarity on PWM devices, allowing for inverted duty cycles. Also update the binding document to #pwm-cells = <3> to allow passing the flags from devicetree. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: vt8500: Register write busy test performed incorrectlyTony Prisk2013-01-091-15/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct operation for register writes is to perform a busy-wait after writing the register. Currently the busy wait it performed before, meaning subsequent register writes to bitfields may occur before the previous field has been updated. Also, all registers are defined as 32-bit read/write. Change pwm_busy_wait() to use readl rather than readb. Improve readability of code with defines for registers and bitfields. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
| * pwm: atmel: add Timer Counter Block PWM driverBoris BREZILLON2013-01-083-0/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a PWM driver based on Atmel Timer Counter Block. The Timer Counter Block is used in Waveform generator mode. A Timer Counter Block provides up to 6 PWM devices grouped by 2: * group 0 = PWM 0 and 1 * group 1 = PWM 2 and 3 * group 2 = PMW 4 and 5 PWM devices in a given group must be configured with the same period value. If a PWM device in a group tries to change the period value and the other device is already configured with a different value an error will be returned. This driver requires device tree support. The Timer Counter Block number used to create a PWM chip is given by the tc-block field in an "atmel,tcb-pwm" compatible node. This patch was tested on kizbox board (at91sam9g20 SoC) with pwm-leds. Signed-off-by: Boris BREZILLON <linux-arm@overkiz.com> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>