Commit Graph

137 Commits

Author SHA1 Message Date
Subbaraman Narayanamurthy bc71f84cb1 pwm: qpnp: do not control EN_PWM_OUTPUT for LPG lite peripherals
In LPG lite peripherals, the EN_PWM_OUTPUT bit controls whether
or not the LPG_OUT signal is output onto DTEST as opposed to
whether or not the LPG_OUT signal is output in general. DTEST
output is not desired so ensure that the EN_PWM_OUTPUT bit is
never set for LPG lite peripherals.

CRs-Fixed: 803896
Change-Id: I34b7832e2b15e60b5bf2d9bcc0837af67f6d5400
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2015-03-10 16:12:38 -07:00
Subbaraman Narayanamurthy a088bc4e1c pwm: qpnp: Fix wrong usage of ramp control address
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>
2014-10-13 10:37:50 -07:00
Subbaraman Narayanamurthy 33094d5201 pwm: qpnp: Read dtest configuration before checking mode
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>
2014-09-11 18:28:07 -07:00
Subbaraman Narayanamurthy da9e0db11c pwm: qpnp: Add support for configuring LPG to DTEST
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>
2014-08-27 15:03:12 -07:00
Subbaraman Narayanamurthy 907b090a5a pwm: qpnp: Allocate the base for pwm chip automatically
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>
2014-08-19 16:20:38 -07:00
Prasad Sodagudi 17a5e3c020 pwm: qpnp: re-enable PWM or LUT output when configuration is changed
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>
2014-07-29 11:03:22 -07:00
Prasad Sodagudi 46883f3b59 pwm: qpnp: correct LUT mode LPG disable steps
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>
2014-07-16 23:25:05 +05:30
Mohan Pallaka 57b2345726 pwm: qpnp: add PWM sync for 8994 PMIC
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>
2014-06-15 12:58:01 +05:30
Xu Kai 3044bc94e9 pwm: qpnp: use the correct parameter to check the change of PWM period
"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>
2014-04-21 17:23:03 +08:00
Xu Kai 82d4c56831 pwm: qpnp: provide both nsec/usec-supported pwm config() functions
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>
2013-12-12 12:47:55 +08:00
Prasad Sodagudi 3811a22bc7 qpnp: pwm: remove the PWM Channel ID dependency
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>
2013-09-13 13:59:16 +05:30
Prasad Sodagudi 94950490e5 qpnp: pwm: Force the pwm size selection
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>
2013-09-04 17:28:25 -07:00
Prasad Sodagudi 5f8d9ac84f pwm: Refactor Qualcomm pwm driver to support upstream pwm framework
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>
2013-09-04 17:24:26 -07:00
Wolfram Sang 362e9cd2f5 drivers/pwm: don't check resource with devm_ioremap_resource
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>
2013-05-18 11:55:58 +02:00
Axel Lin affb923df9 pwm: lpc32xx: Don't change PWM_ENABLE bit in lpc32xx_pwm_config
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>
2013-04-23 10:58:47 +02:00
Axel Lin 08ee77b5a5 pwm: lpc32xx: Properly set PWM_ENABLE bit in lpc32xx_pwm_[enable|disable]
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>
2013-04-23 10:58:35 +02:00
Thierry Reding f1a8870aeb pwm: Constify OF match tables
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>
2013-04-23 07:42:20 +02:00
Axel Lin a46ef4d572 pwm: puv3: Remove unused enabled filed from struct puv3_pwm_chip
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2013-04-02 11:40:18 +02:00
Axel Lin 22976a5dad pwm: pxa: Remove PWM_ID_BASE macro
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>
2013-04-02 11:40:17 +02:00
Axel Lin b3fef7f100 pwm: spear: Remove unused *dev from struct spear_pwm_chip
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>
2013-04-02 11:40:00 +02:00
Axel Lin 4e61573df8 pwm: mxs: Remove unused *dev from struct mxs_pwm_chip
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>
2013-04-02 11:33:05 +02:00
Axel Lin c8e4df3109 pwm: twl: Return proper error if twl6030_pwm_enable() fails
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>
2013-04-02 11:32:14 +02:00
Axel Lin b014a30c59 pwm: pxa: Remove clk_enabled field from struct pxa_pwm_chip
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>
2013-04-02 11:31:37 +02:00
Axel Lin 72da70e77f pwm: imx: Remove enabled field from struct imx_chip
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>
2013-04-02 11:30:57 +02:00
Axel Lin d5714e8b9d pwm: twl: Add .owner to struct pwm_ops
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>
2013-04-02 11:30:18 +02:00
Axel Lin 7fa25314d5 pwm: twl-led: Add .owner to struct pwm_ops
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>
2013-04-02 11:29:57 +02:00
Axel Lin 83c80dc535 pwm: atmel-tcb: Add .owner to struct pwm_ops
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>
2013-04-02 11:29:22 +02:00
Axel Lin fa0abee9b8 pwm: ab8500: Add .owner to struct pwm_ops
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>
2013-04-02 11:29:11 +02:00
Axel Lin 563861cd63 pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
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>
2013-04-02 11:28:36 +02:00
Axel Lin b343a1887e pwm: tiehrpwm: Staticize non-exported symbols
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>
2013-03-26 16:04:03 +01:00
Axel Lin a38c989857 pwm: tiecap: Staticize non-exported symbols
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>
2013-03-26 16:04:03 +01:00
Axel Lin 622fc5d445 pwm: ab8500: Fix trivial typo in dev_err message
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2013-03-26 16:04:03 +01:00
Philip Avinash 1bf0f20bcc pwm: davinci: Add Kconfig support for ECAP & EHRPWM devices
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>
2013-03-22 11:35:20 +01:00
Jingoo Han 29258b215a pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions
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>
2013-03-11 08:28:22 +01:00
Jingoo Han c26e9bb4ac pwm: pwm-tipwmss: add CONFIG_PM_SLEEP to suspend/resume functions
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>
2013-03-11 08:28:22 +01:00
Jingoo Han b78f5fc92a pwm: pwm-tiecap: add CONFIG_PM_SLEEP to suspend/resume functions
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>
2013-03-11 08:28:22 +01:00
Jingoo Han c509a8e521 pwm: samsung: convert s3c_pwm to dev_pm_ops
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>
2013-03-08 08:30:55 +01:00
Jingoo Han 482467ad97 pwm: ab8500: use devm_kzalloc()
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>
2013-03-08 08:30:50 +01:00
Linus Torvalds 3eb05225ee pwm: Changes for v3.9-rc1
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRKxfbAAoJEN0jrNd/PrOhcwEP/0plVf30QDMhcan1GR3l+jmK
 3Q/cCNIWEZ75mRu+FtVYKUOduxkCOHR6LM4C2ScGnnpsS/X5oitc45FrblIwQaEI
 UeWVxDqI+pEp+rCdYVCND4lih60FJU0Cct0zZL2db4D4idF+8FRChhzwzSXhajnj
 ZZqz782Y2ig3YTLHtVGT1pp61DKxdu1Gz4U+fxo4G1/fnkquCYDzbCQovcmPSnnF
 gYB8hfxgT9JIt2cHrK6eKCHBF/4GToU+x5zDV2Ub15C2K/UQ+qgw82yl8MNd/ZS5
 rFA06iW3icnJRRc8u6hu9WVjNVNTBrUqUlFhctNB01d5jF4R6uR6aEvovT9xe8NW
 Wa5v5WrjnL6SWpZVwb/3kwwJmkeU9zKESQt5KUw3VKnT8yr2BfxcH1gJIiuW6wK7
 uYqknAvt2rwMEGzaKZJmQH682wNMxpJirs8hG9VjJc/v7AOnk6586HbRupAq8wWZ
 qK4n1Fto9RCg+b6e/hDId7+mN1GEcA5B8BOotPQ6ud+cinDZBKSbCSHhQG2LQ++F
 m81BbL82H2R2ICRoYNA74/bKq5OVOFFqHLHg5bUrG7ikdNbYOTK/4dF9qSS7DnT3
 Bi6WnKpOtfpWbHBnDunP2vBFo3f+gXmbLJdgarxk7mneV8wp0GY6TYI1awWn0hI9
 82JP3yiK5kW2JZv92o0H
 =Fcxi
 -----END PGP SIGNATURE-----

Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm

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
2013-02-26 09:34:29 -08:00
Linus Torvalds 0512c04a2b Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu.

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (61 commits)
  leds: leds-sunfire: use dev_err()/pr_err() instead of printk()
  leds: 88pm860x: Add missing of_node_put()
  leds: tca6507: Use of_get_child_count()
  leds: leds-pwm: make it depend on PWM and not HAVE_PWM
  Documentation: leds: update LP55xx family devices
  leds-lp55xx: fix problem on removing LED attributes
  leds-lp5521/5523: add author and copyright description
  leds-lp5521/5523: use new lp55xx common header
  leds-lp55xx: clean up headers
  leds-lp55xx: clean up definitions
  leds-lp55xx: clean up unused data and functions
  leds-lp55xx: clean up _remove()
  leds-lp55xx: add new function for removing device attribtues
  leds-lp55xx: code refactoring on selftest function
  leds-lp55xx: use common device attribute driver function
  leds-lp55xx: support device specific attributes
  leds-lp5523: use generic firmware interface
  leds-lp5521: use generic firmware interface
  leds-lp55xx: support firmware interface
  leds-lp55xx: add new lp55xx_register_sysfs() for the firmware interface
  ...
2013-02-26 09:29:02 -08:00
Johannes Thumshirn 30f7861703 pwm: twl: Use to_twl() instead of container_of()
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>
2013-02-17 11:27:07 +01:00
Stephen Warren 838bf09d4f pwm: tegra: assume CONFIG_OF
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>
2013-02-15 23:27:51 +01:00
Peter Ujfalusi 261a5edd3a pwm: Add devm_of_pwm_get() as exported API for users
When booted with DT users can use devm version of of_pwm_get() to benefit
from automatic resource release.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-02-01 17:47:05 -08:00
Peter Ujfalusi 8eb9612799 pwm: core: Rename of_pwm_request() to of_pwm_get() and export it
Allow client driver to use of_pwm_get() to get the PWM they need. This
is needed for drivers which handle more than one PWM separately, like
leds-pwm driver, which have:

pwmleds {
	compatible = "pwm-leds";
	kpad {
		label = "omap4::keypad";
		pwms = <&twl_pwm 0 7812500>;
		max-brightness = <127>;
	};

	charging {
		label = "omap4:green:chrg";
		pwms = <&twl_pwmled 0 7812500>;
		max-brightness = <255>;
	};
};

in the dts files.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-02-01 17:47:05 -08:00
Thierry Reding 928c44775b pwm: Export pwm_{set,get}_chip_data()
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>
2013-01-30 09:22:24 +01:00
Thierry Reding b133d2a137 pwm: Make Kconfig entries more consistent
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>
2013-01-30 09:21:35 +01:00
Florian Vaussard 2e2a0f6ed1 pwm: Add can_sleep property to drivers
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>
2013-01-30 09:12:51 +01:00
Florian Vaussard 6e69ab1361 pwm: Add pwm_can_sleep() as exported API to users
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>
2013-01-30 09:12:18 +01:00
Thierry Reding 6d4294d163 pwm: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22 11:41:57 -08:00
Philip Avinash 0d75c203ef pwm: pwm-tiecap: Low power sleep support
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>
2013-01-17 16:52:59 +01:00