06 Sep, 2016
1 commit
-
From pwm_samsung_calc_tin(), there is routine to find the lowest divider
possible to generate lower frequency than requested one. But it is
always possible to generate requested frequency with large enough
modulation bits except on s3c24xx, so this patch fixes to use lowest div
for the case. This patch removes following UBSAN warning:UBSAN: Undefined behaviour in drivers/pwm/pwm-samsung.c:197:13
shift exponent 32 is too large for 32-bit type 'long unsigned int'
[...]
[] (ubsan_epilogue) from [] (__ubsan_handle_shift_out_of_bounds+0xd8/0x120)
[] (__ubsan_handle_shift_out_of_bounds) from [] (pwm_samsung_config+0x508/0x6a4)
[] (pwm_samsung_config) from [] (pwm_apply_state+0x174/0x40c)
[] (pwm_apply_state) from [] (pwm_fan_probe+0xc8/0x488)
[] (pwm_fan_probe) from [] (platform_drv_probe+0x70/0x150)
[...]Cc: Tomasz Figa
Signed-off-by: Seung-Woo Kim
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Thierry Reding
21 May, 2015
1 commit
-
If the pwm-samsung driver is built as a module, modalias information is
not filled so the module is not autoloaded. Use the MODULE_DEVICE_TABLE()
macro to export the OF device ID so the module contains that information.Signed-off-by: Javier Martinez Canillas
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Thierry Reding
27 Mar, 2015
1 commit
-
When disabling the Samsung PWM the output state remains at the level it
was at the end of a PWM cycle. In other words, calling pwm_disable()
when at 100% duty cycle will keep the output active, while at all other
settings the output will go/stay inactive. On top of that the Samsung
PWM settings are double-buffered, which means the new settings only get
applied at the start of a new PWM cycle.This results in a race if the PWM is at 100% duty cycle and a driver
calls:pwm_config(pwm, 0, period);
pwm_disable(pwm);In this case the PWMs output will unexpectedly stay active, unless a new
PWM cycle happened to start between the register writes in pwm_config()
and pwm_disable(). As far as I can tell this is a regression introduced
by 3bdf878, before that a call to pwm_config() would call
pwm_samsung_enable() which, while heavy-handed, made sure the expected
settings were live.To resolve this, while not re-introducing the issues 3bdf878 (flickering
as the PWM got reset while in a PWM cycle) fixed, only force an update
of the settings when at 100% duty cycle, which shouldn't have any
noticeable effect on the output but is enough to ensure the behaviour is
as expected on disable.Signed-off-by: Sjoerd Simons
Reviewed-by: Javier Martinez Canillas
Acked-by: Lukasz Majewski
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
1 commit
-
pwm_samsung_config() sets the manual update bit via a call to the
pwm_samsung_enable() function even when the channel is already running.
This causes noticable flicker on display if we try to change the
backlight brightness from minimum to maximum, continuously.So, we remove the call to pwm_samsung_enable() from pwm_samsung_config
to avoid the flicker and this change doesn't harm normal working since
the pwm-backlight driver already calls pwm_samsung_enable() where
needed.Signed-off-by: Ajay Kumar
Reviewed-by: Tomasz Figa
Signed-off-by: Thierry Reding
26 Feb, 2014
1 commit
-
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Thierry Reding
01 Nov, 2013
1 commit
-
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] [] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14)
[ 70.525000] [] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0)
[ 70.530000] [] (dump_stack+0x7c/0xb0) from [] (warn_slowpath_common+0x6c/0x88)
[ 70.540000] [] (warn_slowpath_common+0x6c/0x88) from [] (warn_slowpath_null+0x1c/0x24)
[ 70.550000] [] (warn_slowpath_null+0x1c/0x24) from [] (pwm_put+0x48/0x80)
[ 70.560000] [] (pwm_put+0x48/0x80) from [] (pwm_unexport_store+0x94/0xac)
[ 70.565000] [] (pwm_unexport_store+0x94/0xac) from [] (sysfs_write_file+0x148/0x1d8)
[ 70.575000] [] (sysfs_write_file+0x148/0x1d8) from [] (vfs_write+0xb4/0x1a0)
[ 70.585000] [] (vfs_write+0xb4/0x1a0) from [] (SyS_write+0x3c/0x78)
[ 70.595000] [] (SyS_write+0x3c/0x78) from [] (ret_fast_syscall+0x0/0x30)Signed-off-by: Sachin Kamat
Reviewed-by: Jingoo Han
Signed-off-by: Thierry Reding
08 Oct, 2013
1 commit
-
'of_match_ptr' is defined in linux/of.h. Include it explicitly.
Signed-off-by: Sachin Kamat
Signed-off-by: Thierry Reding
13 Aug, 2013
1 commit
-
This patch introduces new Samsung PWM driver, which is completely
rewritten to be multiplatform- and DeviceTree-aware.In addition, remaining problems of old driver are fixed, such as:
- proper handling of hardware variants,
- synchronization on SMP systems,
- handling of boundary parameter values,
- hardware sharing with PWM clocksource driver,
- undefined state of PWM output after stopping PWM channel.Signed-off-by: Tomasz Figa
Reviewed-by: Sylwester Nawrocki
Tested-by: Heiko Stuebner
Tested-by: Mark Brown
Tested-by: Sylwester Nawrocki
Acked-by: Arnd Bergmann
Acked-by: Thierry Reding
06 Aug, 2013
1 commit
-
This patch renames the old pwm-samsung driver to pwm-samsung-legacy to
create place for the new, rewritten, DT-aware pwm-samsung driver.Signed-off-by: Tomasz Figa
Reviewed-by: Sylwester Nawrocki
Tested-by: Heiko Stuebner
Tested-by: Mark Brown
Tested-by: Sylwester Nawrocki
Acked-by: Arnd Bergmann
Acked-by: Thierry Reding
08 Mar, 2013
1 commit
-
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.Signed-off-by: Jingoo Han
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
...
14 Dec, 2012
1 commit
-
The s3c->pwm_id is used to calculate offset of related register.
Signed-off-by: Joonyoung Shim
Signed-off-by: Thierry Reding
29 Nov, 2012
2 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 __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Acked-by: Thierry Reding
Signed-off-by: Greg Kroah-Hartman
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
17 Aug, 2012
1 commit
-
This patch adds missing device pointer to struct pwm_chip. If the
device pointer is NULL, pwmchip_add() will return error.Signed-off-by: Jingoo Han
Signed-off-by: Thierry Reding
23 Jul, 2012
2 commits
-
Replace printk with pr_* functions to avoid checkpatch warnings.
Signed-off-by: Sachin Kamat
Signed-off-by: Thierry Reding -
Signed-off-by: Axel Lin
Signed-off-by: Thierry Reding
03 Jul, 2012
1 commit
-
Move the driver to drivers/pwm/ and convert it to use the framework.
Signed-off-by: Sascha Hauer
Cc: Ben Dooks
Cc: Kukjin Kim
[eric@eukrea.com: fix pwmchip_add return code test]
Signed-off-by: Eric Bénard
Signed-off-by: Thierry Reding