summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-mtk-disp.c
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-12-06 13:32:02 +0200
committerThierry Reding <thierry.reding@gmail.com>2015-12-16 17:01:06 +0100
commitd6dbdf0ddefa581e49c2abe5fb0eb17d14111d89 (patch)
tree49d6a3c2c8119480c873eb8f2cf7da9d16a2f2a5 /drivers/pwm/pwm-mtk-disp.c
parent5a9fc9c666d5d759699cf5495bda85f1da0d747e (diff)
downloadblackbird-op-linux-d6dbdf0ddefa581e49c2abe5fb0eb17d14111d89.tar.gz
blackbird-op-linux-d6dbdf0ddefa581e49c2abe5fb0eb17d14111d89.zip
pwm: lpc32xx: return ERANGE, if requested period is not supported
Instead of silent acceptance of unsupported requested configuration for PWM period and setting the boundary supported value, return -ERANGE to a caller. Duty period value equal to 0 or period is still accepted to allow configuration by PWM sysfs interface, when it is set to 0 by default. For reference this is a list of restrictions on period_ns == 1/freq: | PWM parent clock | parent clock divisor | max freq | min freq | +------------------+----------------------+----------+----------+ | HCLK == 13 MHz | 1 (min) | 50.7 KHz | 198.3 Hz | | HCLK == 13 MHz | 15 (max) | 3.38 KHz | 13.22 Hz | | RTC == 32.7 KHz | 1 (min) | 128 Hz | 0.5 Hz | | RTC == 32.7 KHz | 15 (max) | 8.533 Hz | 0.033 Hz | Note that PWM sysfs interface does not support setting of period more than NSEC_PER_SEC / MAX_INT32 ~ 2 seconds, however this PWM controller supports a period up to 30 seconds. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-mtk-disp.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud