lkml.org 
[lkml]   [2019]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] pwm: Convert period and duty cycle to u64
On Tue, Oct 15, 2019 at 07:11:39PM -0700, Guru Das Srinagesh wrote:
> Because period and duty cycle are defined as ints with units of
> nanoseconds, the maximum time duration that can be set is limited to
> ~2.147 seconds. Change their definitions to u64 so that higher durations
> may be set.
>
> Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
> ---
> drivers/pwm/core.c | 4 ++--
> drivers/pwm/sysfs.c | 10 +++++-----
> include/linux/pwm.h | 16 ++++++++--------
> 3 files changed, 15 insertions(+), 15 deletions(-)

Actually, we can't do that without further preparatory work. The reason
is that consumers use the period and duty_cycle members in computations
of their own, which lead to errors such as this:

armv7l-unknown-linux-gnueabihf-ld: drivers/video/backlight/pwm_bl.o: in function `pwm_backlight_probe':
pwm_bl.c:(.text+0x3b0): undefined reference to `__aeabi_uldivmod'

So I think we need to audit all consumers carefully and make sure that
they use do_div() where necessary to avoid such errors.

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-10-16 12:16    [W:0.104 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site