1
0
Fork 0
Commit Graph

188 Commits (e51fb152318ee6502a2d224771b0bbbbda046128)

Author SHA1 Message Date
Viresh Kumar 9cc236827f Shiraz has moved
shiraz.hashim@st.com email-id doesn't exist anymore as he has left the
company.  Replace ST's id with shiraz.linux.kernel@gmail.com.

It also updates .mailmap file to fix address for 'git shortlog'.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Shiraz Hashim <shiraz.linux.kernel@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-04-18 16:40:08 -07:00
Linus Torvalds 9712d3c377 pwm: Changes for v3.15-rc1
The legacy HAVE_PWM Kconfig symbol is finally being retired. Thanks a
 lot to Sascha Hauer for doing that.
 
 Three new drivers are added: Freescale FTM, Cirrus Logic CLPS711X and
 Intel Low Power Subsystem.
 
 An assortment of fixes and cleanups rounds things off for this release
 cycle.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTPmXoAAoJEN0jrNd/PrOhSacQAKNpqWHpFdFuhqpO6dvmqYj3
 dvf6EDMnNaOS+TjbCvwP5awAiBhTbJRaTclP1lXXXOnzHvzeeYWhS2ESp4Yl8mRx
 GRHj5OxmquaVPY5HN+6guVyCrgq4R2sxPU1P2VoPhhomhvP2VuEBbD/ddudC3e2k
 /e9BuBhUB9eaur6d+vKX7Bnz09wf+ASobgIisjyyqSYysDgE82BAanX/knnLIyQL
 RKCsz75w14rIxU/f8EML8EMnWiGINYpP+M/NGtPvcNBBOX9DkdzBvSvcbm+gS6ma
 g2P+zsJgxhUpvvmzhqUumADUU8BWo/P1Y/6FQGRku6EmmJQQspTvDvOs1jCauouC
 5vUA41Jwh+4+AKeNWN28tDlh9i5kKYdzYP5SeRcM9mW1SI7AIFmg62lxdus7ZnBB
 e8UFd26kp/hZxXPdDVHtQi9y5Z5kn4axutVpbISuW5P9z1HF9bFOVHKQVlk7D6uz
 EqqiYLdW/MxrmBq+v35biwx6afk3zJ8Qas/MmVIVTcLcLDTFLPEm4EawwcRZo8F3
 Jh4p4IHxjEgLYcwVBNOe4ZBJg10fM1gmh18dDTyri759HE1mpi4/DwTGcv3iK4AU
 njv4Q+qBq9QkY2ktw3qCkTDcwiM9jm+FHfdyKXeR5+CjfOf61/CF+N1jBQ8ZMrb7
 XIRHle+mvL/RYpPDML/P
 =pbF+
 -----END PGP SIGNATURE-----

Merge tag 'pwm/for-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm changes from Thierry Reding:
 "The legacy HAVE_PWM Kconfig symbol is finally being retired.  Thanks a
  lot to Sascha Hauer for doing that.

  Three new drivers are added: Freescale FTM, Cirrus Logic CLPS711X and
  Intel Low Power Subsystem.

  An assortment of fixes and cleanups rounds things off for this release
  cycle"

* tag 'pwm/for-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: pxa: Constify OF match table
  pwm: pxa: Fix typo "pwm" -> "PWM"
  Revert "pwm: pxa: Use of_match_ptr()"
  pwm: add support for Intel Low Power Subsystem PWM
  pwm: Add CLPS711X PWM support
  pwm: atmel: correct CDTY calculation
  pwm: atmel: Fix polarity handling
  Documentation: Add device tree bindings for Freescale FTM PWM.
  pwm: Add Freescale FTM PWM driver support
  pwm: pxa: Use of_match_ptr()
  pwm: samsung: Use SIMPLE_DEV_PM_OPS macro
  pwm: renesas-tpu: Add dependency on HAS_IOMEM
  pwm: Remove obsolete HAVE_PWM Kconfig symbol
2014-04-05 18:32:31 -07:00
Thierry Reding 2ae69a4604 pwm: pxa: Constify OF match table
The table is never modified and all OF functions that use it take a
const struct of_device_id *.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-04-01 14:06:43 +02:00
Thierry Reding fdec4f7271 pwm: pxa: Fix typo "pwm" -> "PWM"
Being an abbreviation, PWM should always be capitalized in prose.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-04-01 14:04:59 +02:00
Thierry Reding f409cd3833 Revert "pwm: pxa: Use of_match_ptr()"
This reverts commit 8468949cdd.

The OF match table dummy for non-OF configurations cannot be removed
because it is still used by the pxa_pwm_get_id_dt() function.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-04-01 14:01:32 +02:00
Mika Westerberg d16a5aa9e8 pwm: add support for Intel Low Power Subsystem PWM
Add support for Intel Low Power I/O subsystem PWM controllers found on
Intel BayTrail SoC.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Chew, Kean Ho <kean.ho.chew@intel.com>
Signed-off-by: Chang, Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-04-01 12:03:40 +02:00
Alexander Shiyan 7eb3f6ffb5 pwm: Add CLPS711X PWM support
Add a new driver for the ARM CLPS711X Pulse Width Modulator (PWM) interface.
This CPU contain two 4-bit PWM outputs with constant period, based on CPU
PLL frequency. PWM polarity is determined by hardware by power on reset.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-03-18 21:15:16 +01:00
Alexandre Belloni 916030db43 pwm: atmel: correct CDTY calculation
From the datasheet, the actual duty cycle is:

	(period - (1 / clk) * CDTY) / period

This actually correct the polarity of the PWM and solves the issue that
pwm-leds exhibits: when setting a duty cycle of 0 and then disabling a
channel, the level was wrong (1 when the polarity was normal and 0 when
the polarity was inversed).

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-03-18 20:47:48 +01:00
Alexandre Belloni 8db9e29fe5 pwm: atmel: Fix polarity handling
When atmel_pwm_config() calculates and then sets the prescaler, it is
overwriting the channel's CMR register so we are losing the CPOL
configuration.

As atmel_pwm_config() is always called before enabling a channel,
inverting the polarity doesn't work.

Fix that by reading CMR first and only overwriting the prescaler bits.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-03-18 20:47:31 +01:00
Xiubo Li b505183b51 pwm: Add Freescale FTM PWM driver support
The FTM PWM device can be found on Vybrid VF610 Tower and
Layerscape LS-1 SoCs.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Alison Wang <b18965@freescale.com>
Signed-off-by: Jingchang Lu <b35083@freescale.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Yuan Yao <yao.yuan@freescale.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-03-18 18:01:56 +01:00
Jingoo Han 8468949cdd pwm: pxa: Use of_match_ptr()
Use of_match_ptr(), because of_match_ptr() returns NULL pointer
when CONFIG_OF is disabled.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-02-26 16:14:57 +01:00
Jingoo Han 4407b6d243 pwm: samsung: Use SIMPLE_DEV_PM_OPS macro
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-02-26 16:14:57 +01:00
Richard Weinberger 2974b09860 pwm: renesas-tpu: Add dependency on HAS_IOMEM
On archs like S390 or um this driver cannot build nor work.
Make it depend on HAS_IOMEM to bypass build failures.

drivers/built-in.o: In function `tpu_probe':
drivers/pwm/pwm-renesas-tpu.c:421: undefined reference to `devm_ioremap_resource'

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-02-26 16:14:42 +01:00
Christian Engelmayer 0b7d25c347 pwm: lp3943: Fix potential memory leak during request
Fix a memory leak in the lp3943_pwm_request_map() error handling path.
Make sure already allocated pwm map memory is freed correctly.
Detected by Coverity: CID 1162829.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-02-26 15:45:12 +01:00
Linus Torvalds 398b60a8de pwm: Changes for v3.14-rc1
The patches for this release cycle include various enhancements (device
 tree support, better compile coverage, ...) for existing drivers. There
 is a new driver for Atmel SoCs.
 
 Various drivers as well as the sysfs support received minor fixes and
 cleanups.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJS5m3bAAoJEN0jrNd/PrOhukQP/RdjGTUc8McrOt6pU20xKedI
 Sg2HfA77ODWb1T8iigO31qOfCzEhtpl15AZ9kpj6sgLP17PQAlMBQWxQO9iHwRIv
 GSGCW8RoWq1yvMImBn6LswR6a+aczsbI46z9kMvBGAsl58AETjR82dxH/nuJ6CVw
 cTUIaysmnOhDCidPBSQ2JG/TrmAqhM1wmaixv/39LtIt3pFC5XKoj5rQqPlLKVrZ
 r87ZvwKdoX9z87L1gDOxybGOhcKJOKU8Qc8MlQjYzIUzwd91V7fsGF+98RB7e1k2
 +I/U0YYRFVfLIc2xxHtQZe80khhWTAOEkzvVOS7jgoXI41AlIlT6rOQnRCuMRniv
 YfPTMAQDln+npDEZ4xgdB6qUHIUtduNm2sfL6hWox8xG3Z8Wk5b2IlyBx+kwhSwY
 MiM6UZjuENi+XjO/Ea+oJtD6CJ+U48g++mrQhB+BY1IzmEmIeMH6Qut5I0grotjm
 qgjw+hEoFL9lJ190OXM9Fxu8aoDcGCIWS/UtXTG8q+V/jBmMeBvqj2jscnrMsZXF
 3CTpIquKIHe83A8CLdD0AXauE4TJ/8Eh0zY+jEJzBNDgIFkqZJPIVrmwPgMCFz5O
 2Vux3WDxIqXDYJ1RjKeNGUFEfnRPa1PUqc2un9512xJkthXQD4EYE9/P+/MOVGXX
 UJoi2MMv4Cmkbs+bMTns
 =Rq3R
 -----END PGP SIGNATURE-----

Merge tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm changes from Thierry Reding:
 "The patches for this release cycle include various enhancements
  (device tree support, better compile coverage, ...) for existing
  drivers.  There is a new driver for Atmel SoCs.

  Various drivers as well as the sysfs support received minor fixes and
  cleanups"

* tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: tiecap: Remove duplicate put_sync call
  pwm: tiehrpwm: use dev_err() instead of pr_err()
  pwm: pxa: remove unnecessary space before tabs
  pwm: ep93xx: split module author names
  pwm: use seq_puts() instead of seq_printf()
  pwm: atmel-pwm: Do not unprepare clock after successful registration
  of: Add Atmel PWM controller device tree binding
  pwm: atmel-pwm: Add Atmel PWM controller driver
  backlight: pwm_bl: Remove error message upon devm_kzalloc() failure
  pwm: pca9685: depends on I2C rather than REGMAP_I2C
  pwm: renesas-tpu: Enable driver compilation with COMPILE_TEST
  pwm: jz4740: Use devm_clk_get()
  pwm: jz4740: Pass device to clk_get()
  pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
  pwm: pxa: Add device tree support
2014-01-27 08:15:51 -08:00
Sourav Poddar 6691a19966 pwm: tiecap: Remove duplicate put_sync call
Remove duplicate 'pm_runtime_put_sync' in the remove path.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-01-23 15:19:18 +01:00
Milo Kim af66b3c093 pwm: Add LP3943 PWM driver
This is the other of the LP3943 MFD driver.
LP3943 can be used as a PWM generator, up to 2 channels.

* Two PWM generators supported

* Supported PWM operations
  request, free, config, enable and disable

* Pin assignment
  A driver data, 'pin_used' is checked when a PWM is requested.
  If the output pin is already assigned, then returns as failure.
  If the pin is available, 'pin_used' is set.
  When the PWM is not used anymore, then it is cleared.
  It is defined as unsigned long type for atomic bit operation APIs,
  but only LSB 16bits are used because LP3943 has 16 outputs.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21 08:28:00 +00:00
Jingoo Han 82569e5b22 pwm: tiehrpwm: use dev_err() instead of pr_err()
Use dev_err() instead of pr_err() to provide a better message
to userspace.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-20 11:03:17 +01:00
Jingoo Han b07ab66391 pwm: pxa: remove unnecessary space before tabs
Remove unnecessary space before tabs in order to fix the following
checkpatch warning.

  WARNING: please, no space before tabs

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-20 10:53:55 +01:00
Jingoo Han 5eabf82ecf pwm: ep93xx: split module author names
Split module author names in order to fix the following
checkpatch warning.

  WARNING: quoted string split across lines

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-20 10:53:50 +01:00
Jingoo Han adcba1e3a5 pwm: use seq_puts() instead of seq_printf()
For a constant format without additional arguments, use seq_puts()
instead of seq_printf(). Also, the following checkpatch warning is
fixed.

  WARNING: Prefer seq_puts to seq_printf

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-20 10:53:41 +01:00
Bo Shen 6a6833563f pwm: atmel-pwm: Do not unprepare clock after successful registration
When the PWM controller is registered successfully, the clock can not
unprepare, so fix it.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-20 10:48:43 +01:00
Bo Shen 32b16d46e4 pwm: atmel-pwm: Add Atmel PWM controller driver
Add a PWM framework driver for the PWM controller found on Atmel SoCs.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
[thierry.reding: coding style and other minor cleanups]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-17 11:26:42 +01:00
Axel Lin 2c80a4923a pwm: pca9685: depends on I2C rather than REGMAP_I2C
REGMAP_I2C is not a visible config option.
Thus make PWM_PCA9685 depend on I2c and then select REGMAP_I2C.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-17 10:18:07 +01:00
Laurent Pinchart 94d88d63c6 pwm: renesas-tpu: Enable driver compilation with COMPILE_TEST
This helps increasing build testing coverage.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-12 13:36:38 +01:00
Lars-Peter Clausen 0dc1135fdf pwm: jz4740: Use devm_clk_get()
Using the managed version of clk_get() makes the code a bit shorter and the
error paths less complicated.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-12 13:23:23 +01:00
Lars-Peter Clausen 078c6ac1bd pwm: jz4740: Pass device to clk_get()
In preparation to switching the jz4740 clk driver to the common clk framework
make sure to pass the device to clk_get().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-12 13:23:23 +01:00
Axel Lin 6ca142ad0d pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-04 11:35:28 +01:00
Mike Dunn b52fa7bc5d pwm: pxa: Add device tree support
This patch adds device tree support to the PXA's PWM driver.  Nothing
needs to be extracted from the device tree node by the PWM device.
Client devices need only specify the period; the per-chip index is
implicitly zero because one device node must be present for each PWM
output in use.  This approach is more convenient due to the wide
variability in the number of PWM channels present across the various PXA
variants, and is made possible by the fact that the register sets for
each PWM channel are segregated from each other.  An of_xlate() method
is added to parse this single-cell node.  The existing ID table is
reused for the match table data.

Tested on a Palm Treo 680 (both platform data and DT cases).

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-12-04 10:18:52 +01:00
Sachin Kamat b577cdcf17 pwm: samsung: Fix kernel warning while unexporting a channel
PWM channel data was set to NULL before freeing it. This caused the
following kernel warning while unexporting the channel. Set the channel
data to NULL after freeing it.

[   70.495000] WARNING: CPU: 0 PID: 1 at drivers/base/devres.c:805 pwm_put+0x48/0x80()
[   70.505000] Modules linked in:
[   70.505000] CPU: 0 PID: 1 Comm: sh Not tainted 3.12.0-rc6-next-20131024-00012-gd4aec04-dirty #58
[   70.515000] [<c0014ddc>] (unwind_backtrace+0x0/0xf4) from [<c0011784>] (show_stack+0x10/0x14)
[   70.525000] [<c0011784>] (show_stack+0x10/0x14) from [<c03a3cbc>] (dump_stack+0x7c/0xb0)
[   70.530000] [<c03a3cbc>] (dump_stack+0x7c/0xb0) from [<c001de68>] (warn_slowpath_common+0x6c/0x88)
[   70.540000] [<c001de68>] (warn_slowpath_common+0x6c/0x88) from [<c001df20>] (warn_slowpath_null+0x1c/0x24)
[   70.550000] [<c001df20>] (warn_slowpath_null+0x1c/0x24) from [<c01d1af8>] (pwm_put+0x48/0x80)
[   70.560000] [<c01d1af8>] (pwm_put+0x48/0x80) from [<c01d21c8>] (pwm_unexport_store+0x94/0xac)
[   70.565000] [<c01d21c8>] (pwm_unexport_store+0x94/0xac) from [<c010991c>] (sysfs_write_file+0x148/0x1d8)
[   70.575000] [<c010991c>] (sysfs_write_file+0x148/0x1d8) from [<c00b2a80>] (vfs_write+0xb4/0x1a0)
[   70.585000] [<c00b2a80>] (vfs_write+0xb4/0x1a0) from [<c00b3068>] (SyS_write+0x3c/0x78)
[   70.595000] [<c00b3068>] (SyS_write+0x3c/0x78) from [<c000e2e0>] (ret_fast_syscall+0x0/0x30)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-11-01 11:17:57 +01:00
H Hartley Sweeten a230869817 pwm: add ep93xx PWM support
Remove the non-standard EP93xx PWM driver in drivers/misc and add
a new driver for the PWM controllers on the EP93xx platform based
on the PWM framework.

These PWM controllers each support 1 PWM channel with programmable
duty cycle, frequency, and polarity inversion.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-17 16:07:19 +02:00
Wolfram Sang faed9c3808 pwm: don't use devm_pinctrl_get_select_default() in probe
Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for setting the default pins. Compile tested only.

Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-15 12:16:35 +02:00
Sachin Kamat becbca1390 pwm: imx: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:49:38 +02:00
Sachin Kamat 3cb3b2bfdd pwm: lpc32xx: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:49:19 +02:00
Sachin Kamat de02cb887c pwm: mxs: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:49:10 +02:00
Sachin Kamat ea8eeb1502 pwm: twl: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:45:44 +02:00
Sachin Kamat e852340dee pwm: twl-led: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:45:44 +02:00
Sachin Kamat c3bdfe1f1e pwm: samsung: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:45:44 +02:00
Sachin Kamat 2a8876cfdf pwm: imx: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-10-08 15:45:44 +02:00
Boris BREZILLON ceb12f9398 pwm: atmel-tcb: fix max time computation for slow clk source
Use the the tcb counter width to compute the maximum time that can be
represented using the slow clock source instead of the static 16 bit width.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-19 14:04:32 +02:00
Boris BREZILLON f3a82170ae pwm: atmel-tcb: add missing clk source config
Clock source changes are never applied to the CMR register.
This may lead to wrong period/duty cycle configuration.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-19 14:04:24 +02:00
Linus Torvalds 8e73e367f7 ARM: SoC cleanups for 3.12
This branch contains code cleanups, moves and removals for 3.12.
 
 There's a large number of various cleanups, and a nice net removal of
 13500 lines of code.
 
 Highlights worth mentioning are:
 
 - A series of patches from Stephen Boyd removing the ARM local timer API.
 - Move of Qualcomm MSM IOMMU code to drivers/iommu.
 - Samsung PWM driver cleanups from Tomasz Figa, removing legacy PWM driver
   and switching over to the drivers/pwm one.
 - Removal of some unusued auto-generated headers for OMAP2+ (PRM/CM).
 
 There's also a move of a header file out of include/linux/i2c/ to
 platform_data, where it really belongs. It touches mostly ARM platform
 code for include changes so we took it through our tree.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJSKg/NAAoJEIwa5zzehBx3vxIP/19ouV4WrzOeEMz2Id8bYT5/
 Tu9HRm+PJJ2O+4P+DYlycRAEHsbuDbwgdcqToH3quca1YnIcoJgY0FA6D0ihQ5uE
 EvTgFIpkNMLnR43GYDOE3a/rR3hYPg5oQabKFn7ZGLG2ND3D3d2N05WT8XNbTYDk
 nvCXvyRRT1ynCEzbxRBiE8x62ao4bqa5dZ1zrHHIEoakqciXEng8IU0nxx7SUarv
 61GBJHVoGFpwOWXdgt2uxyXFbn6nMrhf33ynB+RRAZhqlrC8FROj8Iz+3EoKSAHc
 fMJSw6jgdjMCfTDvi0j/eemoNC4fm0eP17Dz9WcwxtIrJPNFVrxZq+biDnpb49nM
 IHsbNrILosw9AbHr3C0kTU9tp+Jie2cE1RWHqTIN3S3zb4qN+fIJiU6o6LMhsNP5
 +ZxL4M5IYmvZYbU3a+A00TPwVRqBbsZB+et9RtYZsdpepovDiN4XcixEoT7ffqrt
 VLjJyoX7Aqmds46lMdsdD3bpPkREmMdf8aMm5fvdIqwbJi1pFMMGMdTgN2WLG5aM
 r0bj/DizxL7Brs8RHwOScUgXteZs3gg87v5Ns/3zAyJZvE4norPAiT+EJeXylpRO
 LDqqaypFs75nU+mWLNo8Fzck4Xue55SBqx5Bo3aD/Smk8B6r4KMqnMKVsV5RFHAU
 XfWb49HulUwHHdn5DAPx
 =1vE4
 -----END PGP SIGNATURE-----

Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC cleanups from Olof Johansson:
 "This branch contains code cleanups, moves and removals for 3.12.

  There's a large number of various cleanups, and a nice net removal of
  13500 lines of code.

  Highlights worth mentioning are:

   - A series of patches from Stephen Boyd removing the ARM local timer
     API.
   - Move of Qualcomm MSM IOMMU code to drivers/iommu.
   - Samsung PWM driver cleanups from Tomasz Figa, removing legacy PWM
     driver and switching over to the drivers/pwm one.
   - Removal of some unusued auto-generated headers for OMAP2+ (PRM/CM).

  There's also a move of a header file out of include/linux/i2c/ to
  platform_data, where it really belongs.  It touches mostly ARM
  platform code for include changes so we took it through our tree"

* tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (83 commits)
  ARM: OMAP2+: Add back the define for AM33XX_RST_GLOBAL_WARM_SW_MASK
  gpio: (gpio-pca953x) move header to linux/platform_data/
  arm: zynq: hotplug: Remove unreachable code
  ARM: SAMSUNG: Remove unnecessary exynos4_default_sdhci*()
  tegra: simplify use of devm_ioremap_resource
  ARM: SAMSUNG: Remove plat/regs-timer.h header
  ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header
  ARM: SAMSUNG: Remove pwm-clock infrastructure
  ARM: SAMSUNG: Remove old PWM timer platform devices
  pwm: Remove superseded pwm-samsung-legacy driver
  ARM: SAMSUNG: Modify board files to use new PWM platform device
  ARM: SAMSUNG: Rework private data handling in dev-backlight
  pwm: Add new pwm-samsung driver
  ARM: mach-mvebu: remove redundant DT parsing and validation
  ARM: msm: Only compile io.c on platforms that use it
  iommu/msm: Move mach includes to iommu directory
  ARM: msm: Remove devices-iommu.c
  ARM: msm: Move mach/board.h contents to common.h
  ARM: msm: Migrate msm_timer to CLOCKSOURCE_OF_DECLARE
  ARM: msm: Remove TMR and TMR0 static mappings
  ...
2013-09-06 13:21:16 -07:00
Mike Dunn 1e185c7aaf pwm: pxa: Use module_platform_driver
Commit 76abbdde2d

    pwm: Add sysfs interface

causes a kernel oops due to a null pointer dereference on PXA platforms.
This happens because the class added by the patch is registered in a
subsys_initcall (initcall4), but the pxa pwm driver is registered in
arch_initcall (initcall3). If the class is not registered before the
driver probe function runs, the oops occurs in device_add() when the
uninitialized pointers in struct class are dereferenced.  I don't see a
reason that the driver must be an arch_initcall, so this patch makes it
a regular module_platform_driver (initcall6), preventing the oops.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:09:17 +02:00
Jingoo Han ac872bc9ed pwm: tiehrpwm: add missing __iomem annotation
Fix the following sparse warnings:

drivers/pwm/pwm-tiehrpwm.c:144:16: warning: incorrect type in argument 1 (different address spaces)
drivers/pwm/pwm-tiehrpwm.c:144:16:    expected void const volatile [noderef] <asn:2>*addr
drivers/pwm/pwm-tiehrpwm.c:144:16:    got void *
drivers/pwm/pwm-tiehrpwm.c:149:9: warning: incorrect type in argument 2 (different address spaces)
drivers/pwm/pwm-tiehrpwm.c:149:9:    expected void volatile [noderef] <asn:2>*addr
drivers/pwm/pwm-tiehrpwm.c:149:9:    got void *
drivers/pwm/pwm-tiehrpwm.c:157:18: warning: incorrect type in argument 1 (different address spaces)
drivers/pwm/pwm-tiehrpwm.c:157:18:    expected void const volatile [noderef] <asn:2>*addr
drivers/pwm/pwm-tiehrpwm.c:157:18:    got void *
drivers/pwm/pwm-tiehrpwm.c:160:9: warning: incorrect type in argument 2 (different address spaces)
drivers/pwm/pwm-tiehrpwm.c:160:9:    expected void volatile [noderef] <asn:2>*addr
drivers/pwm/pwm-tiehrpwm.c:160:9:    got void *

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:09:16 +02:00
Jingoo Han 3943a650f6 pwm: tiecap: add CONFIG_PM_SLEEP to ecap_pwm_{save,restore}_context()
ecap_pwm_save_context() and ecap_pwm_restore_context() are only used
when CONFIG_PM_SLEEP is selected.

drivers/pwm/pwm-tiecap.c:293:13: warning: 'ecap_pwm_save_context' defined but not used [-Wunused-function]
drivers/pwm/pwm-tiecap.c:302:13: warning: 'ecap_pwm_restore_context' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:09:16 +02:00
Julia Lawall 88d5a2e6ff pwm: simplify use of devm_ioremap_resource
Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:09:16 +02:00
Laurent Pinchart 382457e562 pwm: renesas-tpu: Add DT support
Specify DT bindings for the TPU PWM controller and add OF support to the
driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:09:15 +02:00
Laurent Pinchart 208be7698f pwm: Use the DT macro directly when parsing PWM DT flags
Don't redefine a PWM_SPEC_POLARITY macro with a value identical to
PWM_POLARITY_INVERTED, use the PWM DT macro directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:08:10 +02:00
Fabio Estevam cfb9e4c40e pwm: mxs: Check the return value from stmp_reset_block()
stmp_reset_block() may fail, so let's check its return value and
propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2013-09-03 13:07:51 +02:00
Tomasz Figa 6059235c51 pwm: Remove superseded pwm-samsung-legacy driver
This patch removes the now unused pwm-samsung-legacy driver, which was
replaced by new pwm-samsung driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Mark Brown <broonie@linaro.org>
Tested-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
2013-08-12 21:53:23 +02:00