UPSTREAM: pwm: Add relative duty cycle manipulation helpers
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 14 Jun 2016 09:13:10 +0000 (11:13 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
commit4898ef21677177d9a7d52d6939d68bfb08010ada
treed299538b9c7f47cb9905b1a682e67d6d6147bc38
parent1889e37ad59ecda85dd03bbb89d7a60ae90390c8
UPSTREAM: pwm: Add relative duty cycle manipulation helpers

The PWM framework expects PWM users to configure the duty cycle in nano-
seconds, but many users want to express the duty cycle relatively to the
period value (i.e. duty_cycle = 33% of the period).

Add the pwm_{get,set}_relative_duty_cycle() helpers to ease this kind of
conversion.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit f6f3bddf7b2b994a927808fcc5a3d07069c35956)

Change-Id: Ifffc72290225766a6006db6b18e6902ee51adb1c
Signed-off-by: David Wu <david.wu@rock-chips.com>
include/linux/pwm.h