linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milo Kim <woogyom.kim@gmail.com>
To: Rob Herring <robh+dt@kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Milo Kim <woogyom.kim@gmail.com>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCH v2 4/4] pwm: sunxi: Add H3 support
Date: Wed, 31 Aug 2016 17:25:20 +0900	[thread overview]
Message-ID: <20160831082520.25962-5-woogyom.kim@gmail.com> (raw)
In-Reply-To: <20160831082520.25962-1-woogyom.kim@gmail.com>

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>
---
 Documentation/devicetree/bindings/pwm/pwm-sun4i.txt | 1 +
 drivers/pwm/pwm-sun4i.c                             | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt
index cf6068b..f1cbeef 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-sun4i.txt
@@ -6,6 +6,7 @@ Required properties:
     - "allwinner,sun5i-a10s-pwm"
     - "allwinner,sun5i-a13-pwm"
     - "allwinner,sun7i-a20-pwm"
+    - "allwinner,sun8i-h3-pwm"
   - reg: physical base address and length of the controller's registers
   - #pwm-cells: should be 3. See pwm.txt in this directory for a description of
     the cells format.
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c
index 03a99a5..b0803f6 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 = {
 	.npwm = 2,
 };
 
+static const struct sun4i_pwm_data sun4i_pwm_data_h3 = {
+	.has_prescaler_bypass = true,
+	.has_rdy = true,
+	.npwm = 1,
+};
+
 static const struct of_device_id sun4i_pwm_dt_ids[] = {
 	{
 		.compatible = "allwinner,sun4i-a10-pwm",
@@ -298,6 +304,9 @@ static const struct of_device_id sun4i_pwm_dt_ids[] = {
 		.compatible = "allwinner,sun7i-a20-pwm",
 		.data = &sun4i_pwm_data_a20,
 	}, {
+		.compatible = "allwinner,sun8i-h3-pwm",
+		.data = &sun4i_pwm_data_h3,
+	}, {
 		/* sentinel */
 	},
 };
-- 
2.9.3

  parent reply	other threads:[~2016-08-31  8:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31  8:25 [PATCH v2 0/4] Add PWM feature in Allwinner H3 Milo Kim
2016-08-31  8:25 ` [PATCH v2 1/4] ARM: dts: sun8i: Add PWM pin in H3 Milo Kim
2016-08-31  8:33   ` Chen-Yu Tsai
2016-09-01 12:51     ` Milo Kim
2016-08-31 16:20   ` Maxime Ripard
2016-09-01 13:06     ` Milo Kim
2016-09-01 19:51       ` Maxime Ripard
2016-08-31  8:25 ` [PATCH v2 2/4] ARM: dts: sun8i: Add PWM controller node " Milo Kim
2016-08-31  8:42   ` Chen-Yu Tsai
2016-08-31 16:16   ` Maxime Ripard
2016-08-31  8:25 ` [PATCH v2 3/4] pinctrl: sunxi: Remove unsupported PWM channel pinmux " Milo Kim
2016-08-31  8:35   ` Chen-Yu Tsai
2016-09-07 19:41   ` Linus Walleij
2016-09-07 19:54     ` Maxime Ripard
2016-09-07 23:09   ` Linus Walleij
2016-08-31  8:25 ` Milo Kim [this message]
2016-08-31  8:41   ` [PATCH v2 4/4] pwm: sunxi: Add H3 support Chen-Yu Tsai
2016-09-01 10:39   ` Alexandre Belloni
2016-09-02 15:18   ` Rob Herring
2016-09-05 10:09   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160831082520.25962-5-woogyom.kim@gmail.com \
    --to=woogyom.kim@gmail.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).