diff options
author | Milo Kim <woogyom.kim@gmail.com> | 2016-08-31 04:25:20 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-09-08 04:55:05 -0400 |
commit | 42ddcf4f9ebbfeac75fac3851f2807833b222399 (patch) | |
tree | e47ac393b7087ec82d8a311edcd5d251367b2980 | |
parent | 211ed630753d2f0553ff642346e9995503bc240d (diff) |
pwm: sunxi: Add H3 support
H3 PWM controller has same register layout as sun4i driver, so it works
by adding H3 specific data.
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: linux-pwm@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r-- | Documentation/devicetree/bindings/pwm/pwm-sun4i.txt | 1 | ||||
-rw-r--r-- | drivers/pwm/pwm-sun4i.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt index cf6068b8e974..f1cbeefb3087 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt +++ b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt | |||
@@ -6,6 +6,7 @@ Required properties: | |||
6 | - "allwinner,sun5i-a10s-pwm" | 6 | - "allwinner,sun5i-a10s-pwm" |
7 | - "allwinner,sun5i-a13-pwm" | 7 | - "allwinner,sun5i-a13-pwm" |
8 | - "allwinner,sun7i-a20-pwm" | 8 | - "allwinner,sun7i-a20-pwm" |
9 | - "allwinner,sun8i-h3-pwm" | ||
9 | - reg: physical base address and length of the controller's registers | 10 | - reg: physical base address and length of the controller's registers |
10 | - #pwm-cells: should be 3. See pwm.txt in this directory for a description of | 11 | - #pwm-cells: should be 3. See pwm.txt in this directory for a description of |
11 | the cells format. | 12 | the cells format. |
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c index 03a99a53c39e..b0803f6c64d9 100644 --- a/drivers/pwm/pwm-sun4i.c +++ b/drivers/pwm/pwm-sun4i.c | |||
@@ -284,6 +284,12 @@ static const struct sun4i_pwm_data sun4i_pwm_data_a20 = { | |||
284 | .npwm = 2, | 284 | .npwm = 2, |
285 | }; | 285 | }; |
286 | 286 | ||
287 | static const struct sun4i_pwm_data sun4i_pwm_data_h3 = { | ||
288 | .has_prescaler_bypass = true, | ||
289 | .has_rdy = true, | ||
290 | .npwm = 1, | ||
291 | }; | ||
292 | |||
287 | static const struct of_device_id sun4i_pwm_dt_ids[] = { | 293 | static const struct of_device_id sun4i_pwm_dt_ids[] = { |
288 | { | 294 | { |
289 | .compatible = "allwinner,sun4i-a10-pwm", | 295 | .compatible = "allwinner,sun4i-a10-pwm", |
@@ -298,6 +304,9 @@ static const struct of_device_id sun4i_pwm_dt_ids[] = { | |||
298 | .compatible = "allwinner,sun7i-a20-pwm", | 304 | .compatible = "allwinner,sun7i-a20-pwm", |
299 | .data = &sun4i_pwm_data_a20, | 305 | .data = &sun4i_pwm_data_a20, |
300 | }, { | 306 | }, { |
307 | .compatible = "allwinner,sun8i-h3-pwm", | ||
308 | .data = &sun4i_pwm_data_h3, | ||
309 | }, { | ||
301 | /* sentinel */ | 310 | /* sentinel */ |
302 | }, | 311 | }, |
303 | }; | 312 | }; |