11 Jul, 2016
1 commit
-
The PWMSS local clock gating registers have no real purpose on OMAP ARM
devices. These registers were left over registers from DSP IP where the
PRCM doesn't exist. There is a silicon bug where gating and ungating clocks
don't function properly. TRMs will be update to indicate that these
registers shouldn't be touched.Therefore, all code that accesses the PWMSS_CLKCONFIG or PWMSS_CLKSTATUS
will be removed by this patch with zero loss of functionality by the ECAP
and EPWM drivers.Signed-off-by: Franklin S Cooper Jr
Signed-off-by: Thierry Reding
08 Jul, 2016
1 commit
-
When using the old eCAP and ePWM bindings for AM335x and AM437x the clock
can be retrieved from the PWMSS parent. Newer bindings will insure that
this clock is provided via device tree.Therefore, update this driver to support the newer and older bindings. In
the case of the older binding being used give a warning.Signed-off-by: Franklin S Cooper Jr
[thierry.reding@gmail.com: rewrite slightly for readability]
Signed-off-by: Thierry Reding
20 Jul, 2015
1 commit
-
Some PWM drivers are testing the PWMF_ENABLED flag. Create a helper
function to hide the logic behind enabled test. This will allow us to
smoothly move from the current approach to an atomic PWM update
approach.Signed-off-by: Boris Brezillon
Signed-off-by: Thierry Reding
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
21 May, 2014
2 commits
-
These elementary functions should be inlined for fastest access. Also
fixes this warning as a side-effect (when no PM_SLEEP is selected):drivers/pwm/pwm-tiehrpwm.c:141:12: warning: 'ehrpwm_read' defined but not used [-Wunused-function]
Signed-off-by: Wolfram Sang
Signed-off-by: Thierry Reding -
Fixes following warnings on AM335X with no PM_SLEEP
drivers/pwm/pwm-tiehrpwm.c:534:13: warning: 'ehrpwm_pwm_save_context' defined but not used [-Wunused-function]
drivers/pwm/pwm-tiehrpwm.c:548:13: warning: 'ehrpwm_pwm_restore_context' defined but not used [-Wunused-function]Signed-off-by: Wolfram Sang
Signed-off-by: Thierry Reding
28 Apr, 2014
1 commit
-
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.Signed-off-by: Jingoo Han
Signed-off-by: Thierry Reding
20 Dec, 2013
1 commit
-
Use dev_err() instead of pr_err() to provide a better message
to userspace.Signed-off-by: Jingoo Han
Signed-off-by: Thierry Reding
15 Oct, 2013
1 commit
-
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 (personally at LCE13)
Signed-off-by: Wolfram Sang
Signed-off-by: Thierry Reding
03 Sep, 2013
1 commit
-
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] *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] *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] *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] *addr
drivers/pwm/pwm-tiehrpwm.c:160:9: got void *Signed-off-by: Jingoo Han
Signed-off-by: Thierry Reding
27 Jun, 2013
1 commit
-
This was found when using pwm-led on am33xx and enable
heartbeat trigger.[ 808.624876] =================================
[ 808.629443] [ INFO: inconsistent lock state ]
[ 808.634021] 3.9.0 #2 Not tainted
[ 808.637415] ---------------------------------
[ 808.641981] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
[ 808.648288] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
[ 808.653494] (prepare_lock){+.?.+.}, at: [] clk_unprepare+0x15/0x24
[ 808.661040] {SOFTIRQ-ON-W} state was registered at:
[ 808.666155] [] __lock_acquire+0x411/0x824
[ 808.671465] [] lock_acquire+0x41/0x50
[ 808.676412] [] mutex_lock_nested+0x31/0x1d8
[ 808.681912] [] clk_prepare+0x15/0x28
[ 808.686764] [] _init+0x117/0x1e0
[ 808.691256] [] omap_hwmod_for_each+0x29/0x3c
[ 808.696842] [] __omap_hwmod_setup_all+0x17/0x2c
[ 808.702696] [] do_one_initcall+0xc3/0x10c
[ 808.708017] [] kernel_init_freeable+0xa7/0x134
[ 808.713778] [] kernel_init+0x7/0x98
[ 808.718544] [] ret_from_fork+0x11/0x3c
[ 808.723583] irq event stamp: 1379172
[ 808.727328] hardirqs last enabled at (1379172): [] _raw_spin_unlock_irqrestore+0x21/0x30
[ 808.736828] hardirqs last disabled at (1379171): [] _raw_spin_lock_irqsave+0x13/0x38
[ 808.745876] softirqs last enabled at (1379164): [] irq_enter+0x49/0x4c
[ 808.753747] softirqs last disabled at (1379165): [] irq_exit+0x63/0x88
[ 808.761518]
[ 808.761518] other info that might help us debug this:
[ 808.768373] Possible unsafe locking scenario:
[ 808.768373]
[ 808.774578] CPU0
[ 808.777141] ----
[ 808.779705] lock(prepare_lock);
[ 808.783186]
[ 808.785929] lock(prepare_lock);
[ 808.789595]
[ 808.789595] *** DEADLOCK ***
[ 808.789595]
[ 808.795805] 1 lock held by swapper/0:
[ 808.799643] #0: (((&heartbeat_data->timer))){+.-...}, at: [] call_timer_fn+0x0/0x90
[ 808.808814]
[ 808.808814] stack backtrace:
[ 808.813402] [] (unwind_backtrace+0x1/0x98) from [] (print_usage_bug.part.25+0x16d/0x1cc)
[ 808.823721] [] (print_usage_bug.part.25+0x16d/0x1cc) from [] (mark_lock+0x18d/0x434)
[ 808.833669] [] (mark_lock+0x18d/0x434) from [] (__lock_acquire+0x3e1/0x824)
[ 808.842803] [] (__lock_acquire+0x3e1/0x824) from [] (lock_acquire+0x41/0x50)
[ 808.852031] [] (lock_acquire+0x41/0x50) from [] (mutex_lock_nested+0x31/0x1d8)
[ 808.861433] [] (mutex_lock_nested+0x31/0x1d8) from [] (clk_unprepare+0x15/0x24)
[ 808.870930] [] (clk_unprepare+0x15/0x24) from [] (ehrpwm_pwm_disable+0x5f/0x80)
[ 808.880431] [] (ehrpwm_pwm_disable+0x5f/0x80) from [] (pwm_disable+0x27/0x28)
[ 808.889751] [] (pwm_disable+0x27/0x28) from [] (led_heartbeat_function+0x3f/0xb0)
[ 808.899431] [] (led_heartbeat_function+0x3f/0xb0) from [] (call_timer_fn+0x45/0x90)
[ 808.909288] [] (call_timer_fn+0x45/0x90) from [] (run_timer_softirq+0x105/0x17c)
[ 808.918884] [] (run_timer_softirq+0x105/0x17c) from [] (__do_softirq+0xa5/0x150)
[ 808.928486] [] (__do_softirq+0xa5/0x150) from [] (irq_exit+0x63/0x88)
[ 808.937098] [] (irq_exit+0x63/0x88) from [] (handle_IRQ+0x21/0x54)
[ 808.945415] [] (handle_IRQ+0x21/0x54) from [] (omap3_intc_handle_irq+0x5d/0x68)
[ 808.954900] [] (omap3_intc_handle_irq+0x5d/0x68) from [] (__irq_svc+0x3f/0x64)
[ 808.964287] Exception stack(0xc05b1f68 to 0xc05b1fb0)
[ 808.969587] 1f60: 00000001 00000001 00000000 00000000 c05b0000 c0619748
[ 808.978158] 1f80: c05b0000 c05b0000 c0619748 413fc082 00000000 00000000 01000000 c05b1fb0
[ 808.986719] 1fa0: c004f989 c000d6f0 400f0033 ffffffff
[ 808.992024] [] (__irq_svc+0x3f/0x64) from [] (cpu_idle+0x60/0x98)
[ 809.000250] [] (cpu_idle+0x60/0x98) from [] (start_kernel+0x1e9/0x234)Remove non atomic clk api calls and use only atomic for enable/disable because
can be called from atomic context (led_heartbeat_function is timer callback).Signed-off-by: Marek Belisko
Signed-off-by: Thierry Reding
18 May, 2013
1 commit
-
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.Signed-off-by: Wolfram Sang
Acked-by: Stephen Warren
26 Mar, 2013
1 commit
-
Both ehrpwm_pwm_save_context() and ehrpwm_pwm_restore_context() are only used in
this file, make them static.Signed-off-by: Axel Lin
Signed-off-by: Thierry Reding
11 Mar, 2013
1 commit
-
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-functionSigned-off-by: Jingoo Han
Signed-off-by: Thierry Reding
27 Feb, 2013
1 commit
-
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
23 Jan, 2013
1 commit
-
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
Acked-by: Viresh Kumar
Signed-off-by: Greg Kroah-Hartman
17 Jan, 2013
1 commit
-
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
Signed-off-by: Thierry Reding
14 Jan, 2013
1 commit
-
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
Signed-off-by: Thierry Reding
20 Dec, 2012
1 commit
-
Pull pwm changes from Thierry Reding:
"A new driver has been added for the SPEAr platform and the
TWL4030/6030 driver has been replaced by two drivers that control the
regular PWMs and the PWM driven LEDs provided by the chips.The vt8500, tiecap, tiehrpwm, i.MX, LPC32xx and Samsung drivers have
all been improved and the device tree bindings now support the PWM
signal polarity."Fix up trivial conflicts due to __devinit/exit removal.
* tag 'for-3.8-rc1' of git://gitorious.org/linux-pwm/linux-pwm: (21 commits)
pwm: samsung: add missing s3c->pwm_id assignment
pwm: lpc32xx: Set the chip base for dynamic allocation
pwm: lpc32xx: Properly disable the clock on device removal
pwm: lpc32xx: Fix the PWM polarity
pwm: i.MX: eliminate build warning
pwm: Export of_pwm_xlate_with_flags()
pwm: Remove pwm-twl6030 driver
pwm: New driver to support PWM driven LEDs on TWL4030/6030 series of PMICs
pwm: New driver to support PWMs on TWL4030/6030 series of PMICs
pwm: pwm-tiehrpwm: pinctrl support
pwm: tiehrpwm: Add device-tree binding
pwm: pwm-tiehrpwm: Adding TBCLK gating support.
pwm: pwm-tiecap: pinctrl support
pwm: tiecap: Add device-tree binding
pwm: Add TI PWM subsystem driver
pwm: Device tree support for PWM polarity
pwm: vt8500: Ensure PWM clock is enabled during pwm_config
pwm: vt8500: Fix build error
pwm: spear: Staticize spear_pwm_config()
pwm: Add SPEAr PWM chip driver support
...
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Acked-by: Thierry Reding
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Acked-by: Thierry Reding
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Acked-by: Thierry Reding
Signed-off-by: Greg Kroah-Hartman
28 Nov, 2012
3 commits
-
Enable pinctrl for pwm-tiehrpwm if pinctrl driver available, else
bail out with warning message.Signed-off-by: Philip, Avinash
Signed-off-by: Thierry Reding -
This patch
1. Add support for device-tree binding for EHRWPM driver.
2. Set size of pwm-cells set to 3 to support PWM channel number, PWM
period & polarity configuration from device tree.
3. Add enable/disable clock gating in PWM subsystem common config space.
4. When here set .owner member in platform_driver structure to
THIS_MODULE.Signed-off-by: Philip, Avinash
Cc: Grant Likely
Cc: Rob Herring
Cc: Rob Landley
Signed-off-by: Thierry Reding -
Some platforms (like AM33XX) requires clock gating from control module
explicitly for TBCLK. Enabling of this clock required for the
functioning of the time base sub module in EHRPWM module. Adding support
for handling by enabling the clock on PWM device enable & disable on PWM
device disable. Platforms don't have explicit TBCLK gating has to add
dummy TBCLK node.Signed-off-by: Philip, Avinash
Signed-off-by: Thierry Reding
06 Oct, 2012
1 commit
-
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
Cc: Shawn Guo
Cc: Mark Brown
Cc: Arnd Bergmann
Cc: Sachin Kamat
Cc: Axel Lin
Cc: Kukjin Kim
Cc: Jingoo Han
Cc: Jonghwan Choi
Cc: Sascha Hauer
Cc: "Philip, Avinash"
Cc: Vaibhav Bedia
Acked-by: Jingoo Han
10 Sep, 2012
2 commits
-
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
Signed-off-by: Thierry Reding -
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
configuredSigned-off-by: Philip, Avinash
Signed-off-by: Thierry Reding
17 Aug, 2012
1 commit
-
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
Cc: Stephen Warren
Cc: Philip, Avinash
Signed-off-by: Thierry Reding
26 Jul, 2012
1 commit
-
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
Signed-off-by: Philip, Avinash
Signed-off-by: Thierry Reding