UPSTREAM: pwm: Introduce the pwm_args concept
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 14 Apr 2016 19:17:21 +0000 (21:17 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
commite82fc9af20f0fb0d16df3a1944ce1025527f2409
tree39a0cc6aff956b33702c5a27d386271333839a05
parent9f7ad83534e36248d30aaf72daf30154fcd20286
UPSTREAM: pwm: Introduce the pwm_args concept

Currently the PWM core mixes the current PWM state with the per-platform
reference config (specified through the PWM lookup table, DT definition
or directly hardcoded in PWM drivers).

Create a struct pwm_args to store this reference configuration, so that
PWM users can differentiate between the current and reference
configurations.

Patch all places where pwm->args should be initialized. We keep the
pwm_set_polarity/period() calls until all PWM users are patched to use
pwm_args instead of pwm_get_period/polarity().

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
[thierry.reding@gmail.com: reword kerneldoc comments]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit e39c0df1be5a97e0910b09af1530bdf3de057a06)

Change-Id: Id9ec0898d92d7049813c32acbd909103e949c846
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/pwm/core.c
drivers/pwm/pwm-clps711x.c
drivers/pwm/pwm-pxa.c
include/linux/pwm.h