linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm
@ 2019-09-25 14:32 Sam Shih
  2019-09-25 14:32 ` [PATCH v10 01/12] pwm: mediatek: add a property "num-pwms" Sam Shih
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

Changes since v10
  1. Follow reviewers's comments:
  - derive the number of PWMs from the specific compatible string
  2. Add mt7629 pwm description
  3. Add mt7628 fixed-clock description

Changes since v9:
  1. PATCH 03/11: Add an Acked-by tag

Changes since v8:
  1. Fix warning and build-error for patch 04/11

Changes since v7:
  1. PATCH v7 10/11: Add a missed Reviewed-by tag

Changes since v6:
  1. Due to we can use fixed-clock in DT
     We removed has_clks and fixed-clock properties 

Changes since v5:
- Follow reviewer's comments:
  1. the license stuff is a separate change
  2. split fix mt7628 pwm into a single patch
  3. to ensure to not use mtk_pwm_clk_name[10] 
     (After dynamic allocate clock array patch, 
      this is no need to check)
  4. Use clock-frequency property to replace 
     the use of has_clks

Changes since v4:
- Follow reviewer's comments (v3: pwm: mediatek: add a property "num-pwms")
  Move the changes of droping the check for of_device_get_match_data
  returning non-NULL to next patch
- Follow reviewers's comments 
  (v3: pwm: mediatek: allocate the clks array dynamically)
  1. use pc->soc->has_clks to check clocks exist or not.
  2. Add error message when probe() unable to get clks
- Fixes bug when SoC is old mips which has no complex clock tree.
if clocks not exist, use the new property from DT to apply period 
calculation; otherwise, use clk_get_rate to get clock frequency and 
apply period calculation.

Changes since v3:
- add a new property "clock-frequency" and fix mt7628 pwm
- add mt7629 pwm support

Changes since v2:
- use num-pwms instead of mediatek,num-pwms.
- rename the member from num_pwms to fallback_num_pwms to make it 
  more obvious that it doesn't represent the actually used value.
- add a dev_warn and a expressive comment to help other developers 
  to not start adding num_pwms in the compatible_data.

Changes since v1:
- add some checks for backwards compatibility.



Ryder Lee (5):
  pwm: mediatek: add a property "num-pwms"
  dt-bindings: pwm: pwm-mediatek: add a property "num-pwms"
  arm64: dts: mt7622: add a property "num-pwms" for PWM
  arm: dts: mt7623: add a property "num-pwms" for PWM
  dt-bindings: pwm: update bindings for MT7629 SoC

Sam Shih (7):
  pwm: mediatek: droping the check for of_device_get_match_data
  pwm: mediatek: remove a property "has-clks"
  pwm: mediatek: allocate the clks array dynamically
  pwm: mediatek: use pwm_mediatek as common prefix
  pwm: mediatek: update license and switch to SPDX tag
  pwm: mediatek: Add MT7629 compatible string
  arm: dts: mediatek: add mt7629 pwm support

 .../devicetree/bindings/pwm/pwm-mediatek.txt  |  11 +-
 arch/arm/boot/dts/mt7623.dtsi                 |   1 +
 arch/arm/boot/dts/mt7629.dtsi                 |  15 ++
 arch/arm64/boot/dts/mediatek/mt7622.dtsi      |   1 +
 drivers/pwm/pwm-mediatek.c                    | 249 +++++++++---------
 5 files changed, 155 insertions(+), 122 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v10 01/12] pwm: mediatek: add a property "num-pwms"
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 02/12] pwm: mediatek: droping the check for of_device_get_match_data Sam Shih
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a property "num-pwms" to avoid having an endless
list of compatibles with no differences for the same driver.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v6:
Add a Reviewed-by tag

Changes since v5:
Check num-pwms value is no more than MTK_CLK_MAX - 2 (MAIN + TOP)

Changes since v4:
Follow reviewer's comments:
Move the changes of droping the check for of_device_get_match_data returning non-NULL to next patch

---
 drivers/pwm/pwm-mediatek.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index eb6674ce995f..e214f4f57107 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -55,7 +55,7 @@ static const char * const mtk_pwm_clk_name[MTK_CLK_MAX] = {
 };
 
 struct mtk_pwm_platform_data {
-	unsigned int num_pwms;
+	unsigned int fallback_npwms;
 	bool pwm45_fixup;
 	bool has_clks;
 };
@@ -227,9 +227,10 @@ static const struct pwm_ops mtk_pwm_ops = {
 static int mtk_pwm_probe(struct platform_device *pdev)
 {
 	const struct mtk_pwm_platform_data *data;
+	struct device_node *np = pdev->dev.of_node;
 	struct mtk_pwm_chip *pc;
 	struct resource *res;
-	unsigned int i;
+	unsigned int i, npwms;
 	int ret;
 
 	pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
@@ -246,7 +247,26 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	if (IS_ERR(pc->regs))
 		return PTR_ERR(pc->regs);
 
-	for (i = 0; i < data->num_pwms + 2 && pc->soc->has_clks; i++) {
+	ret = of_property_read_u32(np, "num-pwms", &npwms);
+	if (ret < 0) {
+		/* It's deprecated, we should specify num_pwms via DT now. */
+		if (pc->soc->fallback_npwms) {
+			npwms = pc->soc->fallback_npwms;
+			dev_warn(&pdev->dev, "DT is outdated, please update it\n");
+		} else {
+			dev_err(&pdev->dev, "failed to get number of PWMs\n");
+			return ret;
+		}
+	}
+
+	/* MAIN + TOP + NPWM < MTK_CLK_MAX */
+	if ((npwms + 2) > MTK_CLK_MAX) {
+		dev_warn(&pdev->dev, "number of PWMs is larger than %d\n",
+			 MTK_CLK_MAX - 2);
+		npwms = MTK_CLK_MAX - 2;
+	}
+
+	for (i = 0; i < npwms + 2 && pc->soc->has_clks; i++) {
 		pc->clks[i] = devm_clk_get(&pdev->dev, mtk_pwm_clk_name[i]);
 		if (IS_ERR(pc->clks[i])) {
 			dev_err(&pdev->dev, "clock: %s fail: %ld\n",
@@ -260,7 +280,7 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	pc->chip.dev = &pdev->dev;
 	pc->chip.ops = &mtk_pwm_ops;
 	pc->chip.base = -1;
-	pc->chip.npwm = data->num_pwms;
+	pc->chip.npwm = npwms;
 
 	ret = pwmchip_add(&pc->chip);
 	if (ret < 0) {
@@ -279,25 +299,25 @@ static int mtk_pwm_remove(struct platform_device *pdev)
 }
 
 static const struct mtk_pwm_platform_data mt2712_pwm_data = {
-	.num_pwms = 8,
+	.fallback_npwms = 8,
 	.pwm45_fixup = false,
 	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7622_pwm_data = {
-	.num_pwms = 6,
+	.fallback_npwms = 6,
 	.pwm45_fixup = false,
 	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7623_pwm_data = {
-	.num_pwms = 5,
+	.fallback_npwms = 5,
 	.pwm45_fixup = true,
 	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7628_pwm_data = {
-	.num_pwms = 4,
+	.fallback_npwms = 4,
 	.pwm45_fixup = true,
 	.has_clks = false,
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 02/12] pwm: mediatek: droping the check for of_device_get_match_data
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
  2019-09-25 14:32 ` [PATCH v10 01/12] pwm: mediatek: add a property "num-pwms" Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 03/12] pwm: mediatek: remove a property "has-clks" Sam Shih
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

This patch drop the check for of_device_get_match_data.
Due to the only way call driver probe is compatible match.
The .data pointer which point to the SoC specify data is
directly set by driver, and it should not be NULL in our case.
We can safety remove the check for of_device_get_match_data.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Used:
https://patchwork.kernel.org/patch/11096905/
Changes since v6:
Add an Acked-by tag

Changes since v4:
Follow reviewer's comments:
Move the changes of droping the check for of_device_get_match_data
returning non-NULL to this patch

---
 drivers/pwm/pwm-mediatek.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index e214f4f57107..ebd62629e3fe 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -226,7 +226,6 @@ static const struct pwm_ops mtk_pwm_ops = {
 
 static int mtk_pwm_probe(struct platform_device *pdev)
 {
-	const struct mtk_pwm_platform_data *data;
 	struct device_node *np = pdev->dev.of_node;
 	struct mtk_pwm_chip *pc;
 	struct resource *res;
@@ -237,10 +236,7 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	if (!pc)
 		return -ENOMEM;
 
-	data = of_device_get_match_data(&pdev->dev);
-	if (data == NULL)
-		return -EINVAL;
-	pc->soc = data;
+	pc->soc = of_device_get_match_data(&pdev->dev);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	pc->regs = devm_ioremap_resource(&pdev->dev, res);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 03/12] pwm: mediatek: remove a property "has-clks"
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
  2019-09-25 14:32 ` [PATCH v10 01/12] pwm: mediatek: add a property "num-pwms" Sam Shih
  2019-09-25 14:32 ` [PATCH v10 02/12] pwm: mediatek: droping the check for of_device_get_match_data Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 04/12] pwm: mediatek: allocate the clks array dynamically Sam Shih
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

We can use fixed-clock to repair mt7628 pwm during configure from
userspace. The SoC is legacy MIPS and has no complex clock tree.
Due to we can get clock frequency for period calculation from DT
fixed-clock, so we can remove has-clock property, and directly
use devm_clk_get and clk_get_rate.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v9:
Added an Acked-by tag

Changes since v6:
Based on fixed-clock in DT, we can remove has-clks property

Changes since v5:
1. Follow reviewer's comments
Make the changes of fix mt7628 pwm as a single patch

Changes since v4:
- Follow reviewers's comments
1. use pc->soc->has_clks to check clocks exist or not.
2. Add error message when probe() unable to get clks
- Fixes bug when SoC is old mips which has no complex clock tree.
if clocks not exist, use the new property from DT to apply period caculation;
otherwise, use clk_get_rate to get clock frequency and apply period caculation.

---
 drivers/pwm/pwm-mediatek.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index ebd62629e3fe..07e843aeddb1 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -57,7 +57,6 @@ static const char * const mtk_pwm_clk_name[MTK_CLK_MAX] = {
 struct mtk_pwm_platform_data {
 	unsigned int fallback_npwms;
 	bool pwm45_fixup;
-	bool has_clks;
 };
 
 /**
@@ -87,9 +86,6 @@ static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
 	int ret;
 
-	if (!pc->soc->has_clks)
-		return 0;
-
 	ret = clk_prepare_enable(pc->clks[MTK_CLK_TOP]);
 	if (ret < 0)
 		return ret;
@@ -116,9 +112,6 @@ static void mtk_pwm_clk_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
 
-	if (!pc->soc->has_clks)
-		return;
-
 	clk_disable_unprepare(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]);
 	clk_disable_unprepare(pc->clks[MTK_CLK_MAIN]);
 	clk_disable_unprepare(pc->clks[MTK_CLK_TOP]);
@@ -262,11 +255,13 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 		npwms = MTK_CLK_MAX - 2;
 	}
 
-	for (i = 0; i < npwms + 2 && pc->soc->has_clks; i++) {
-		pc->clks[i] = devm_clk_get(&pdev->dev, mtk_pwm_clk_name[i]);
+	for (i = 0; i < npwms + 2 ; i++) {
+		pc->clks[i] = devm_clk_get(&pdev->dev,
+					  mtk_pwm_clk_name[i]);
 		if (IS_ERR(pc->clks[i])) {
 			dev_err(&pdev->dev, "clock: %s fail: %ld\n",
-				mtk_pwm_clk_name[i], PTR_ERR(pc->clks[i]));
+				mtk_pwm_clk_name[i],
+				PTR_ERR(pc->clks[i]));
 			return PTR_ERR(pc->clks[i]);
 		}
 	}
@@ -297,25 +292,21 @@ static int mtk_pwm_remove(struct platform_device *pdev)
 static const struct mtk_pwm_platform_data mt2712_pwm_data = {
 	.fallback_npwms = 8,
 	.pwm45_fixup = false,
-	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7622_pwm_data = {
 	.fallback_npwms = 6,
 	.pwm45_fixup = false,
-	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7623_pwm_data = {
 	.fallback_npwms = 5,
 	.pwm45_fixup = true,
-	.has_clks = true,
 };
 
 static const struct mtk_pwm_platform_data mt7628_pwm_data = {
 	.fallback_npwms = 4,
 	.pwm45_fixup = true,
-	.has_clks = false,
 };
 
 static const struct of_device_id mtk_pwm_of_match[] = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 04/12] pwm: mediatek: allocate the clks array dynamically
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (2 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 03/12] pwm: mediatek: remove a property "has-clks" Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 05/12] pwm: mediatek: use pwm_mediatek as common prefix Sam Shih
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

Instead of using fixed size of arrays, allocate the memory for them
based on the information we get from the DT.

Also remove the check for num_pwms, due to dynamically allocate pwm
should not cause array index out of bound.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v10:
- Remove unuse clk_freq description

Changes since v8:
- Fix warning and build-error

Changes since v6:
- Add a Reviewed-by tag

Changes since v5:
- Follow reviewers's comments
Make the changes of allocate the clks array dynamically as a single patch

Changes since v4:
- Follow reviewers's comments
1. use pc->soc->has_clks to check clocks exist or not.
2. Add error message when probe() unable to get clks
- Fixes bug when SoC is old mips which has no complex clock tree.
if clocks not exist, use the new property from DT to apply period caculation;
otherwise, use clk_get_rate to get clock frequency and apply period caculation.

---
 drivers/pwm/pwm-mediatek.c | 84 +++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 43 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index 07e843aeddb1..dcc85d07156f 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -35,25 +35,6 @@
 
 #define PWM_CLK_DIV_MAX		7
 
-enum {
-	MTK_CLK_MAIN = 0,
-	MTK_CLK_TOP,
-	MTK_CLK_PWM1,
-	MTK_CLK_PWM2,
-	MTK_CLK_PWM3,
-	MTK_CLK_PWM4,
-	MTK_CLK_PWM5,
-	MTK_CLK_PWM6,
-	MTK_CLK_PWM7,
-	MTK_CLK_PWM8,
-	MTK_CLK_MAX,
-};
-
-static const char * const mtk_pwm_clk_name[MTK_CLK_MAX] = {
-	"main", "top", "pwm1", "pwm2", "pwm3", "pwm4", "pwm5", "pwm6", "pwm7",
-	"pwm8"
-};
-
 struct mtk_pwm_platform_data {
 	unsigned int fallback_npwms;
 	bool pwm45_fixup;
@@ -63,12 +44,16 @@ struct mtk_pwm_platform_data {
  * struct mtk_pwm_chip - struct representing PWM chip
  * @chip: linux PWM chip representation
  * @regs: base address of PWM chip
- * @clks: list of clocks
+ * @clk_top: the top clock generator
+ * @clk_main: the clock used by PWM core
+ * @clk_pwms: the clock used by each PWM channel
  */
 struct mtk_pwm_chip {
 	struct pwm_chip chip;
 	void __iomem *regs;
-	struct clk *clks[MTK_CLK_MAX];
+	struct clk *clk_top;
+	struct clk *clk_main;
+	struct clk **clk_pwms;
 	const struct mtk_pwm_platform_data *soc;
 };
 
@@ -86,24 +71,24 @@ static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
 	int ret;
 
-	ret = clk_prepare_enable(pc->clks[MTK_CLK_TOP]);
+	ret = clk_prepare_enable(pc->clk_top);
 	if (ret < 0)
 		return ret;
 
-	ret = clk_prepare_enable(pc->clks[MTK_CLK_MAIN]);
+	ret = clk_prepare_enable(pc->clk_main);
 	if (ret < 0)
 		goto disable_clk_top;
 
-	ret = clk_prepare_enable(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]);
+	ret = clk_prepare_enable(pc->clk_pwms[pwm->hwpwm]);
 	if (ret < 0)
 		goto disable_clk_main;
 
 	return 0;
 
 disable_clk_main:
-	clk_disable_unprepare(pc->clks[MTK_CLK_MAIN]);
+	clk_disable_unprepare(pc->clk_main);
 disable_clk_top:
-	clk_disable_unprepare(pc->clks[MTK_CLK_TOP]);
+	clk_disable_unprepare(pc->clk_top);
 
 	return ret;
 }
@@ -112,9 +97,9 @@ static void mtk_pwm_clk_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
 
-	clk_disable_unprepare(pc->clks[MTK_CLK_PWM1 + pwm->hwpwm]);
-	clk_disable_unprepare(pc->clks[MTK_CLK_MAIN]);
-	clk_disable_unprepare(pc->clks[MTK_CLK_TOP]);
+	clk_disable_unprepare(pc->clk_pwms[pwm->hwpwm]);
+	clk_disable_unprepare(pc->clk_main);
+	clk_disable_unprepare(pc->clk_top);
 }
 
 static inline u32 mtk_pwm_readl(struct mtk_pwm_chip *chip, unsigned int num,
@@ -134,7 +119,7 @@ static int mtk_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 			  int duty_ns, int period_ns)
 {
 	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
-	struct clk *clk = pc->clks[MTK_CLK_PWM1 + pwm->hwpwm];
+	struct clk *clk = pc->clk_pwms[pwm->hwpwm];
 	u32 clkdiv = 0, cnt_period, cnt_duty, reg_width = PWMDWIDTH,
 	    reg_thres = PWMTHRES;
 	u64 resolution;
@@ -222,8 +207,9 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct mtk_pwm_chip *pc;
 	struct resource *res;
-	unsigned int i, npwms;
+	unsigned int npwms;
 	int ret;
+	int i;
 
 	pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
 	if (!pc)
@@ -248,21 +234,33 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* MAIN + TOP + NPWM < MTK_CLK_MAX */
-	if ((npwms + 2) > MTK_CLK_MAX) {
-		dev_warn(&pdev->dev, "number of PWMs is larger than %d\n",
-			 MTK_CLK_MAX - 2);
-		npwms = MTK_CLK_MAX - 2;
+	pc->clk_pwms = devm_kcalloc(&pdev->dev, npwms,
+				    sizeof(*pc->clk_pwms), GFP_KERNEL);
+	if (!pc->clk_pwms)
+		return -ENOMEM;
+
+	pc->clk_top = devm_clk_get(&pdev->dev, "top");
+	if (IS_ERR(pc->clk_top)) {
+		dev_err(&pdev->dev, "clock: top fail: %ld\n",
+			PTR_ERR(pc->clk_top));
+		return PTR_ERR(pc->clk_top);
+	}
+
+	pc->clk_main = devm_clk_get(&pdev->dev, "main");
+	if (IS_ERR(pc->clk_main)) {
+		dev_err(&pdev->dev, "clock: main fail: %ld\n",
+			PTR_ERR(pc->clk_main));
+		return PTR_ERR(pc->clk_main);
 	}
+	for (i = 0; i < npwms; i++) {
+		char name[8];
 
-	for (i = 0; i < npwms + 2 ; i++) {
-		pc->clks[i] = devm_clk_get(&pdev->dev,
-					  mtk_pwm_clk_name[i]);
-		if (IS_ERR(pc->clks[i])) {
+		snprintf(name, sizeof(name), "pwm%d", i + 1);
+		pc->clk_pwms[i] = devm_clk_get(&pdev->dev, name);
+		if (IS_ERR(pc->clk_pwms[i])) {
 			dev_err(&pdev->dev, "clock: %s fail: %ld\n",
-				mtk_pwm_clk_name[i],
-				PTR_ERR(pc->clks[i]));
-			return PTR_ERR(pc->clks[i]);
+				name, PTR_ERR(pc->clk_pwms[i]));
+			return PTR_ERR(pc->clk_pwms[i]);
 		}
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 05/12] pwm: mediatek: use pwm_mediatek as common prefix
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (3 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 04/12] pwm: mediatek: allocate the clks array dynamically Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 06/12] pwm: mediatek: update license and switch to SPDX tag Sam Shih
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

Use pwm_mediatek as common prefix to match the filename.
No functional change intended.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v6:
Add an Acked-by tag

Changes since v5:
- Follow reviewers's comments
The license stuff is a separate change

---
 drivers/pwm/pwm-mediatek.c | 116 +++++++++++++++++++------------------
 1 file changed, 59 insertions(+), 57 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index dcc85d07156f..2db17d6b6ae1 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -34,41 +34,42 @@
 #define PWM45THRES_FIXUP	0x34
 
 #define PWM_CLK_DIV_MAX		7
-
-struct mtk_pwm_platform_data {
+struct pwm_mediatek_of_data {
 	unsigned int fallback_npwms;
 	bool pwm45_fixup;
 };
 
 /**
- * struct mtk_pwm_chip - struct representing PWM chip
+ * struct pwm_mediatek_chip - struct representing PWM chip
  * @chip: linux PWM chip representation
  * @regs: base address of PWM chip
  * @clk_top: the top clock generator
  * @clk_main: the clock used by PWM core
  * @clk_pwms: the clock used by each PWM channel
  */
-struct mtk_pwm_chip {
+struct pwm_mediatek_chip {
 	struct pwm_chip chip;
 	void __iomem *regs;
 	struct clk *clk_top;
 	struct clk *clk_main;
 	struct clk **clk_pwms;
-	const struct mtk_pwm_platform_data *soc;
+	const struct pwm_mediatek_of_data *soc;
 };
 
-static const unsigned int mtk_pwm_reg_offset[] = {
+static const unsigned int pwm_mediatek_reg_offset[] = {
 	0x0010, 0x0050, 0x0090, 0x00d0, 0x0110, 0x0150, 0x0190, 0x0220
 };
 
-static inline struct mtk_pwm_chip *to_mtk_pwm_chip(struct pwm_chip *chip)
+static inline struct pwm_mediatek_chip *
+to_pwm_mediatek_chip(struct pwm_chip *chip)
 {
-	return container_of(chip, struct mtk_pwm_chip, chip);
+	return container_of(chip, struct pwm_mediatek_chip, chip);
 }
 
-static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm)
+static int pwm_mediatek_clk_enable(struct pwm_chip *chip,
+				   struct pwm_device *pwm)
 {
-	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
+	struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
 	int ret;
 
 	ret = clk_prepare_enable(pc->clk_top);
@@ -93,45 +94,46 @@ static int mtk_pwm_clk_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	return ret;
 }
 
-static void mtk_pwm_clk_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+static void pwm_mediatek_clk_disable(struct pwm_chip *chip,
+				     struct pwm_device *pwm)
 {
-	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
+	struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
 
 	clk_disable_unprepare(pc->clk_pwms[pwm->hwpwm]);
 	clk_disable_unprepare(pc->clk_main);
 	clk_disable_unprepare(pc->clk_top);
 }
 
-static inline u32 mtk_pwm_readl(struct mtk_pwm_chip *chip, unsigned int num,
-				unsigned int offset)
+static inline u32 pwm_mediatek_readl(struct pwm_mediatek_chip *chip,
+				     unsigned int num, unsigned int offset)
 {
-	return readl(chip->regs + mtk_pwm_reg_offset[num] + offset);
+	return readl(chip->regs + pwm_mediatek_reg_offset[num] + offset);
 }
 
-static inline void mtk_pwm_writel(struct mtk_pwm_chip *chip,
-				  unsigned int num, unsigned int offset,
-				  u32 value)
+static inline void pwm_mediatek_writel(struct pwm_mediatek_chip *chip,
+				       unsigned int num, unsigned int offset,
+				       u32 value)
 {
-	writel(value, chip->regs + mtk_pwm_reg_offset[num] + offset);
+	writel(value, chip->regs + pwm_mediatek_reg_offset[num] + offset);
 }
 
-static int mtk_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
-			  int duty_ns, int period_ns)
+static int pwm_mediatek_config(struct pwm_chip *chip, struct pwm_device *pwm,
+			       int duty_ns, int period_ns)
 {
-	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
-	struct clk *clk = pc->clk_pwms[pwm->hwpwm];
+	struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
 	u32 clkdiv = 0, cnt_period, cnt_duty, reg_width = PWMDWIDTH,
 	    reg_thres = PWMTHRES;
 	u64 resolution;
 	int ret;
 
-	ret = mtk_pwm_clk_enable(chip, pwm);
+	ret = pwm_mediatek_clk_enable(chip, pwm);
+
 	if (ret < 0)
 		return ret;
 
 	/* Using resolution in picosecond gets accuracy higher */
 	resolution = (u64)NSEC_PER_SEC * 1000;
-	do_div(resolution, clk_get_rate(clk));
+	do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm]));
 
 	cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution);
 	while (cnt_period > 8191) {
@@ -142,7 +144,7 @@ static int mtk_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	}
 
 	if (clkdiv > PWM_CLK_DIV_MAX) {
-		mtk_pwm_clk_disable(chip, pwm);
+		pwm_mediatek_clk_disable(chip, pwm);
 		dev_err(chip->dev, "period %d not supported\n", period_ns);
 		return -EINVAL;
 	}
@@ -157,22 +159,22 @@ static int mtk_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	}
 
 	cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution);
-	mtk_pwm_writel(pc, pwm->hwpwm, PWMCON, BIT(15) | clkdiv);
-	mtk_pwm_writel(pc, pwm->hwpwm, reg_width, cnt_period);
-	mtk_pwm_writel(pc, pwm->hwpwm, reg_thres, cnt_duty);
+	pwm_mediatek_writel(pc, pwm->hwpwm, PWMCON, BIT(15) | clkdiv);
+	pwm_mediatek_writel(pc, pwm->hwpwm, reg_width, cnt_period);
+	pwm_mediatek_writel(pc, pwm->hwpwm, reg_thres, cnt_duty);
 
-	mtk_pwm_clk_disable(chip, pwm);
+	pwm_mediatek_clk_disable(chip, pwm);
 
 	return 0;
 }
 
-static int mtk_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
+static int pwm_mediatek_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
-	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
+	struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
 	u32 value;
 	int ret;
 
-	ret = mtk_pwm_clk_enable(chip, pwm);
+	ret = pwm_mediatek_clk_enable(chip, pwm);
 	if (ret < 0)
 		return ret;
 
@@ -183,29 +185,29 @@ static int mtk_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 	return 0;
 }
 
-static void mtk_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+static void pwm_mediatek_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
-	struct mtk_pwm_chip *pc = to_mtk_pwm_chip(chip);
+	struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
 	u32 value;
 
 	value = readl(pc->regs);
 	value &= ~BIT(pwm->hwpwm);
 	writel(value, pc->regs);
 
-	mtk_pwm_clk_disable(chip, pwm);
+	pwm_mediatek_clk_disable(chip, pwm);
 }
 
-static const struct pwm_ops mtk_pwm_ops = {
-	.config = mtk_pwm_config,
-	.enable = mtk_pwm_enable,
-	.disable = mtk_pwm_disable,
+static const struct pwm_ops pwm_mediatek_ops = {
+	.config = pwm_mediatek_config,
+	.enable = pwm_mediatek_enable,
+	.disable = pwm_mediatek_disable,
 	.owner = THIS_MODULE,
 };
 
-static int mtk_pwm_probe(struct platform_device *pdev)
+static int pwm_mediatek_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct mtk_pwm_chip *pc;
+	struct pwm_mediatek_chip *pc;
 	struct resource *res;
 	unsigned int npwms;
 	int ret;
@@ -267,7 +269,7 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pc);
 
 	pc->chip.dev = &pdev->dev;
-	pc->chip.ops = &mtk_pwm_ops;
+	pc->chip.ops = &pwm_mediatek_ops;
 	pc->chip.base = -1;
 	pc->chip.npwm = npwms;
 
@@ -280,51 +282,51 @@ static int mtk_pwm_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mtk_pwm_remove(struct platform_device *pdev)
+static int pwm_mediatek_remove(struct platform_device *pdev)
 {
-	struct mtk_pwm_chip *pc = platform_get_drvdata(pdev);
+	struct pwm_mediatek_chip *pc = platform_get_drvdata(pdev);
 
 	return pwmchip_remove(&pc->chip);
 }
 
-static const struct mtk_pwm_platform_data mt2712_pwm_data = {
+static const struct pwm_mediatek_of_data mt2712_pwm_data = {
 	.fallback_npwms = 8,
 	.pwm45_fixup = false,
 };
 
-static const struct mtk_pwm_platform_data mt7622_pwm_data = {
+static const struct pwm_mediatek_of_data mt7622_pwm_data = {
 	.fallback_npwms = 6,
 	.pwm45_fixup = false,
 };
 
-static const struct mtk_pwm_platform_data mt7623_pwm_data = {
+static const struct pwm_mediatek_of_data mt7623_pwm_data = {
 	.fallback_npwms = 5,
 	.pwm45_fixup = true,
 };
 
-static const struct mtk_pwm_platform_data mt7628_pwm_data = {
+static const struct pwm_mediatek_of_data mt7628_pwm_data = {
 	.fallback_npwms = 4,
 	.pwm45_fixup = true,
 };
 
-static const struct of_device_id mtk_pwm_of_match[] = {
+static const struct of_device_id pwm_mediatek_of_match[] = {
 	{ .compatible = "mediatek,mt2712-pwm", .data = &mt2712_pwm_data },
 	{ .compatible = "mediatek,mt7622-pwm", .data = &mt7622_pwm_data },
 	{ .compatible = "mediatek,mt7623-pwm", .data = &mt7623_pwm_data },
 	{ .compatible = "mediatek,mt7628-pwm", .data = &mt7628_pwm_data },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, mtk_pwm_of_match);
+MODULE_DEVICE_TABLE(of, pwm_mediatek_of_match);
 
-static struct platform_driver mtk_pwm_driver = {
+static struct platform_driver pwm_mediatek_driver = {
 	.driver = {
-		.name = "mtk-pwm",
-		.of_match_table = mtk_pwm_of_match,
+		.name = "pwm-mediatek",
+		.of_match_table = pwm_mediatek_of_match,
 	},
-	.probe = mtk_pwm_probe,
-	.remove = mtk_pwm_remove,
+	.probe = pwm_mediatek_probe,
+	.remove = pwm_mediatek_remove,
 };
-module_platform_driver(mtk_pwm_driver);
+module_platform_driver(pwm_mediatek_driver);
 
 MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
 MODULE_LICENSE("GPL");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 06/12] pwm: mediatek: update license and switch to SPDX tag
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (4 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 05/12] pwm: mediatek: use pwm_mediatek as common prefix Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms" Sam Shih
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

Add SPDX identifiers to pwm-mediatek.c
Update license to GNU General Public License v2.0

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v6:
Add a Reviewed-by tag

Changes since v5:
- Follow reviewers's comments
The license stuff is a separate change

---
 drivers/pwm/pwm-mediatek.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index 2db17d6b6ae1..ce7525d8d71b 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -1,12 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
- * Mediatek Pulse Width Modulator driver
+ * MediaTek Pulse Width Modulator driver
  *
  * Copyright (C) 2015 John Crispin <blogic@openwrt.org>
  * Copyright (C) 2017 Zhi Mao <zhi.mao@mediatek.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/err.h>
@@ -329,4 +327,4 @@ static struct platform_driver pwm_mediatek_driver = {
 module_platform_driver(pwm_mediatek_driver);
 
 MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms"
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (5 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 06/12] pwm: mediatek: update license and switch to SPDX tag Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 22:50   ` Thierry Reding
  2019-09-25 14:32 ` [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string Sam Shih
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a property "num-pwms" in example so that we could
specify the number of PWM channels via device tree.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes since v10:
1. Follow reviewers's comments:
- derive the number of PWMs from the specific compatible string
2. Add mt7629 pwm description
3. Add mt7628 fixed-clock description

Changes since v6:
Follow reviewers's comments:
- The subject should indicate this is for Mediatek

Changes since v5:
- Add an Acked-by tag
- This file is original v4 patch 5/10
(https://patchwork.kernel.org/patch/11102577/)

---
 Documentation/devicetree/bindings/pwm/pwm-mediatek.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
index 991728cb46cb..975d7871830d 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
@@ -9,17 +9,20 @@ Required properties:
  - reg: physical base address and length of the controller's registers.
  - #pwm-cells: must be 2. See pwm.txt in this directory for a description of
    the cell format.
- - clocks: phandle and clock specifier of the PWM reference clock.
- - clock-names: must contain the following, except for MT7628 which
-                has no clocks
+ - clocks: One phandle and clock specifier for each entry in the "clock-names"
+           property, Use fixed-clock as dummy clocks for mt7628
+ - clock-names: must contain the following
    - "top": the top clock generator
    - "main": clock used by the PWM core
    - "pwm1-8": the eight per PWM clocks for mt2712
    - "pwm1-6": the six per PWM clocks for mt7622
    - "pwm1-5": the five per PWM clocks for mt7623
+   - "pwm1-4": the four per PWM clocks for mt7628
+   - "pwm1": the PWM1 clock for mt7629
  - pinctrl-names: Must contain a "default" entry.
  - pinctrl-0: One property must exist for each entry in pinctrl-names.
    See pinctrl/pinctrl-bindings.txt for details of the property values.
+ - num-pwms: the number of PWM channels.
 
 Example:
 	pwm0: pwm@11006000 {
@@ -37,4 +40,5 @@ Example:
 			      "pwm3", "pwm4", "pwm5";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pwm0_pins>;
+		num-pwms = <5>;
 	};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (6 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms" Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-27 11:28   ` Thierry Reding
  2019-09-25 14:32 ` [PATCH v10 09/12] arm64: dts: mt7622: add a property "num-pwms" for PWM Sam Shih
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

This adds pwm support for MT7629, and separate mt7629 compatible string
from mt7622

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
---
 drivers/pwm/pwm-mediatek.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index ce7525d8d71b..7035abfbdc6a 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -307,11 +307,17 @@ static const struct pwm_mediatek_of_data mt7628_pwm_data = {
 	.pwm45_fixup = true,
 };
 
+static const struct pwm_mediatek_of_data mt7629_pwm_data = {
+	.fallback_npwms = 1,
+	.pwm45_fixup = false,
+};
+
 static const struct of_device_id pwm_mediatek_of_match[] = {
 	{ .compatible = "mediatek,mt2712-pwm", .data = &mt2712_pwm_data },
 	{ .compatible = "mediatek,mt7622-pwm", .data = &mt7622_pwm_data },
 	{ .compatible = "mediatek,mt7623-pwm", .data = &mt7623_pwm_data },
 	{ .compatible = "mediatek,mt7628-pwm", .data = &mt7628_pwm_data },
+	{ .compatible = "mediatek,mt7629-pwm", .data = &mt7629_pwm_data },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pwm_mediatek_of_match);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 09/12] arm64: dts: mt7622: add a property "num-pwms" for PWM
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (7 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 10/12] arm: dts: mt7623: " Sam Shih
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a property "num-pwms" for PWM controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt7622.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index d1e13d340e26..9a043938881f 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -439,6 +439,7 @@
 			 <&pericfg CLK_PERI_PWM6_PD>;
 		clock-names = "top", "main", "pwm1", "pwm2", "pwm3", "pwm4",
 			      "pwm5", "pwm6";
+		num-pwms = <6>;
 		status = "disabled";
 	};
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 10/12] arm: dts: mt7623: add a property "num-pwms" for PWM
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (8 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 09/12] arm64: dts: mt7622: add a property "num-pwms" for PWM Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 11/12] dt-bindings: pwm: update bindings for MT7629 SoC Sam Shih
  2019-09-25 14:32 ` [PATCH v10 12/12] arm: dts: mediatek: add mt7629 pwm support Sam Shih
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a property "num-pwms" for PWM controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
---
 arch/arm/boot/dts/mt7623.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
index a79f0b6c3429..208e0d19a575 100644
--- a/arch/arm/boot/dts/mt7623.dtsi
+++ b/arch/arm/boot/dts/mt7623.dtsi
@@ -452,6 +452,7 @@
 			 <&pericfg CLK_PERI_PWM5>;
 		clock-names = "top", "main", "pwm1", "pwm2",
 			      "pwm3", "pwm4", "pwm5";
+		num-pwms = <5>;
 		status = "disabled";
 	};
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 11/12] dt-bindings: pwm: update bindings for MT7629 SoC
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (9 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 10/12] arm: dts: mt7623: " Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  2019-09-25 14:32 ` [PATCH v10 12/12] arm: dts: mediatek: add mt7629 pwm support Sam Shih
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

From: Ryder Lee <ryder.lee@mediatek.com>

This updates bindings for MT7629 pwm controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
Changes since v7:
- add a missed Reviewed-by tag back from v1:
https://patchwork.kernel.org/patch/10769381/
Changes since v1:
- add a Reviewed-by tag

---
 Documentation/devicetree/bindings/pwm/pwm-mediatek.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
index 975d7871830d..744deea8a256 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
@@ -6,6 +6,7 @@ Required properties:
    - "mediatek,mt7622-pwm": found on mt7622 SoC.
    - "mediatek,mt7623-pwm": found on mt7623 SoC.
    - "mediatek,mt7628-pwm": found on mt7628 SoC.
+   - "mediatek,mt7629-pwm": found on mt7629 SoC.
  - reg: physical base address and length of the controller's registers.
  - #pwm-cells: must be 2. See pwm.txt in this directory for a description of
    the cell format.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v10 12/12] arm: dts: mediatek: add mt7629 pwm support
  2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
                   ` (10 preceding siblings ...)
  2019-09-25 14:32 ` [PATCH v10 11/12] dt-bindings: pwm: update bindings for MT7629 SoC Sam Shih
@ 2019-09-25 14:32 ` Sam Shih
  11 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-25 14:32 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Matthias Brugger, Thierry Reding
  Cc: Ryder Lee, John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek, Sam Shih

This adds pwm support for MT7629.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
---
Changes since v10:
- Use "mediatek,mt7629-pwm" as compatible string
- Fix reg setting

---
 arch/arm/boot/dts/mt7629.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/mt7629.dtsi b/arch/arm/boot/dts/mt7629.dtsi
index 9608bc2ccb3f..6f3f1430ca84 100644
--- a/arch/arm/boot/dts/mt7629.dtsi
+++ b/arch/arm/boot/dts/mt7629.dtsi
@@ -241,6 +241,21 @@
 			status = "disabled";
 		};
 
+		pwm: pwm@11006000 {
+			compatible = "mediatek,mt7629-pwm";
+			reg = <0x11006000 0x1000>;
+			interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&topckgen CLK_TOP_PWM_SEL>,
+				 <&pericfg CLK_PERI_PWM_PD>,
+				 <&pericfg CLK_PERI_PWM1_PD>;
+			clock-names = "top", "main", "pwm1";
+			assigned-clocks = <&topckgen CLK_TOP_PWM_SEL>;
+			assigned-clock-parents =
+					<&topckgen CLK_TOP_UNIVPLL2_D4>;
+			num-pwms = <1>;
+			status = "disabled";
+		};
+
 		i2c: i2c@11007000 {
 			compatible = "mediatek,mt7629-i2c",
 				     "mediatek,mt2712-i2c";
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms"
  2019-09-25 14:32 ` [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms" Sam Shih
@ 2019-09-25 22:50   ` Thierry Reding
  0 siblings, 0 replies; 18+ messages in thread
From: Thierry Reding @ 2019-09-25 22:50 UTC (permalink / raw)
  To: Sam Shih
  Cc: Rob Herring, Mark Rutland, Matthias Brugger, Ryder Lee,
	John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

On Wed, Sep 25, 2019 at 10:32:32PM +0800, Sam Shih wrote:
> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This adds a property "num-pwms" in example so that we could
> specify the number of PWM channels via device tree.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Changes since v10:
> 1. Follow reviewers's comments:
> - derive the number of PWMs from the specific compatible string
[...]
> + - num-pwms: the number of PWM channels.
[...]

Why is num-pwms still there if you derive it from the compatible string?
I guess I must not have made myself clear. Please drop this.

Also, as I mentioned earlier, I've already applied the patches from v9
that were suitable. Please take a look.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string
  2019-09-25 14:32 ` [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string Sam Shih
@ 2019-09-27 11:28   ` Thierry Reding
  2019-09-30  8:51     ` Sam Shih
  0 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2019-09-27 11:28 UTC (permalink / raw)
  To: Sam Shih
  Cc: Rob Herring, Mark Rutland, Matthias Brugger, Ryder Lee,
	John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

On Wed, Sep 25, 2019 at 10:32:33PM +0800, Sam Shih wrote:
> This adds pwm support for MT7629, and separate mt7629 compatible string
> from mt7622
> 
> Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> ---
>  drivers/pwm/pwm-mediatek.c | 6 ++++++
>  1 file changed, 6 insertions(+)

I picked this patch up and made some minor adjustments to make it build
without the num_pwms patches. With that I don't think there's anything
left from this series that you need.

Let me know if that's not true.

Thierry

> 
> diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
> index ce7525d8d71b..7035abfbdc6a 100644
> --- a/drivers/pwm/pwm-mediatek.c
> +++ b/drivers/pwm/pwm-mediatek.c
> @@ -307,11 +307,17 @@ static const struct pwm_mediatek_of_data mt7628_pwm_data = {
>  	.pwm45_fixup = true,
>  };
>  
> +static const struct pwm_mediatek_of_data mt7629_pwm_data = {
> +	.fallback_npwms = 1,
> +	.pwm45_fixup = false,
> +};
> +
>  static const struct of_device_id pwm_mediatek_of_match[] = {
>  	{ .compatible = "mediatek,mt2712-pwm", .data = &mt2712_pwm_data },
>  	{ .compatible = "mediatek,mt7622-pwm", .data = &mt7622_pwm_data },
>  	{ .compatible = "mediatek,mt7623-pwm", .data = &mt7623_pwm_data },
>  	{ .compatible = "mediatek,mt7628-pwm", .data = &mt7628_pwm_data },
> +	{ .compatible = "mediatek,mt7629-pwm", .data = &mt7629_pwm_data },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, pwm_mediatek_of_match);
> -- 
> 2.17.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string
  2019-09-27 11:28   ` Thierry Reding
@ 2019-09-30  8:51     ` Sam Shih
  2019-09-30  9:36       ` Thierry Reding
  0 siblings, 1 reply; 18+ messages in thread
From: Sam Shih @ 2019-09-30  8:51 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Mark Rutland, Matthias Brugger, Ryder Lee,
	John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek

Hi,

On Fri, 2019-09-27 at 13:28 +0200, Thierry Reding wrote:
> On Wed, Sep 25, 2019 at 10:32:33PM +0800, Sam Shih wrote:
> > This adds pwm support for MT7629, and separate mt7629 compatible string
> > from mt7622
> > 
> > Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> > ---
> >  drivers/pwm/pwm-mediatek.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> 
> I picked this patch up and made some minor adjustments to make it build
> without the num_pwms patches. With that I don't think there's anything
> left from this series that you need.

Yes, I think the driver should work once dtsi updated.
("[v10,12/12] arm: dts: mediatek: add mt7629 pwm support")

But, due to we use comaptible string separately for every SoC now,
The comaptible string in dt-bindings should be "mediatek,mt7629-pwm".
I think we should use "[v10,11/12] dt-bindings: pwm: update bindings 
for MT7629" to replace commit 1c00ad6ebf36aa3b0fa598a48b8ae59782be4121,
Or maybe we need a little modification like this ?
diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt ...
- - "mediatek,mt7629-pwm", "mediatek,mt7622-pwm": found on mt7629 SoC.
+ - "mediatek,mt7629-pwm": found on mt7629 SoC.

Thanks,
Regards, Sam


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string
  2019-09-30  8:51     ` Sam Shih
@ 2019-09-30  9:36       ` Thierry Reding
  2019-09-30  9:51         ` Sam Shih
  0 siblings, 1 reply; 18+ messages in thread
From: Thierry Reding @ 2019-09-30  9:36 UTC (permalink / raw)
  To: Sam Shih
  Cc: Rob Herring, Mark Rutland, Matthias Brugger, Ryder Lee,
	John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]

On Mon, Sep 30, 2019 at 04:51:08PM +0800, Sam Shih wrote:
> Hi,
> 
> On Fri, 2019-09-27 at 13:28 +0200, Thierry Reding wrote:
> > On Wed, Sep 25, 2019 at 10:32:33PM +0800, Sam Shih wrote:
> > > This adds pwm support for MT7629, and separate mt7629 compatible string
> > > from mt7622
> > > 
> > > Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> > > ---
> > >  drivers/pwm/pwm-mediatek.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > 
> > I picked this patch up and made some minor adjustments to make it build
> > without the num_pwms patches. With that I don't think there's anything
> > left from this series that you need.
> 
> Yes, I think the driver should work once dtsi updated.
> ("[v10,12/12] arm: dts: mediatek: add mt7629 pwm support")
> 
> But, due to we use comaptible string separately for every SoC now,
> The comaptible string in dt-bindings should be "mediatek,mt7629-pwm".
> I think we should use "[v10,11/12] dt-bindings: pwm: update bindings 
> for MT7629" to replace commit 1c00ad6ebf36aa3b0fa598a48b8ae59782be4121,
> Or maybe we need a little modification like this ?
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt ...
> - - "mediatek,mt7629-pwm", "mediatek,mt7622-pwm": found on mt7629 SoC.
> + - "mediatek,mt7629-pwm": found on mt7629 SoC.

Good catch, I must've taken this from the wrong version of the patch.

How about the attached patch?

Thanks,
Thierry
--- >8 ---
From 641b0ee176b139f9edd137ba636ca0cb9c63289a Mon Sep 17 00:00:00 2001
From: Thierry Reding <thierry.reding@gmail.com>
Date: Mon, 30 Sep 2019 11:33:31 +0200
Subject: [PATCH] dt-bindings: pwm: mediatek: Remove gratuitous compatible
 string for MT7629

The MT7629 is, in fact, not compatible with the MT7622 because the
former has a single PWM channel while the former has 6. Remove the
gratuitous compatible string for MT7629.

Reported-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
---
 Documentation/devicetree/bindings/pwm/pwm-mediatek.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
index c8501530173c..053e9b5880f1 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
@@ -6,7 +6,7 @@ Required properties:
    - "mediatek,mt7622-pwm": found on mt7622 SoC.
    - "mediatek,mt7623-pwm": found on mt7623 SoC.
    - "mediatek,mt7628-pwm": found on mt7628 SoC.
-   - "mediatek,mt7629-pwm", "mediatek,mt7622-pwm": found on mt7629 SoC.
+   - "mediatek,mt7629-pwm": found on mt7629 SoC.
    - "mediatek,mt8516-pwm": found on mt8516 SoC.
  - reg: physical base address and length of the controller's registers.
  - #pwm-cells: must be 2. See pwm.txt in this directory for a description of
-- 
2.23.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string
  2019-09-30  9:36       ` Thierry Reding
@ 2019-09-30  9:51         ` Sam Shih
  0 siblings, 0 replies; 18+ messages in thread
From: Sam Shih @ 2019-09-30  9:51 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Mark Rutland, Matthias Brugger, Ryder Lee,
	John Crispin, linux-pwm, devicetree, linux-kernel,
	linux-mediatek

On Mon, 2019-09-30 at 11:36 +0200, Thierry Reding wrote:
> On Mon, Sep 30, 2019 at 04:51:08PM +0800, Sam Shih wrote:
> > Hi,
> > 
> > On Fri, 2019-09-27 at 13:28 +0200, Thierry Reding wrote:
> > > On Wed, Sep 25, 2019 at 10:32:33PM +0800, Sam Shih wrote:
> > > > This adds pwm support for MT7629, and separate mt7629 compatible string
> > > > from mt7622
> > > > 
> > > > Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> > > > ---
> > > >  drivers/pwm/pwm-mediatek.c | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > 
> > > I picked this patch up and made some minor adjustments to make it build
> > > without the num_pwms patches. With that I don't think there's anything
> > > left from this series that you need.
> > 
> > Yes, I think the driver should work once dtsi updated.
> > ("[v10,12/12] arm: dts: mediatek: add mt7629 pwm support")
> > 
> > But, due to we use comaptible string separately for every SoC now,
> > The comaptible string in dt-bindings should be "mediatek,mt7629-pwm".
> > I think we should use "[v10,11/12] dt-bindings: pwm: update bindings 
> > for MT7629" to replace commit 1c00ad6ebf36aa3b0fa598a48b8ae59782be4121,
> > Or maybe we need a little modification like this ?
> > diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt ...
> > - - "mediatek,mt7629-pwm", "mediatek,mt7622-pwm": found on mt7629 SoC.
> > + - "mediatek,mt7629-pwm": found on mt7629 SoC.
> 
> Good catch, I must've taken this from the wrong version of the patch.
> 
> How about the attached patch?
> 
> Thanks,
> Thierry
> --- >8 ---
> From 641b0ee176b139f9edd137ba636ca0cb9c63289a Mon Sep 17 00:00:00 2001
> From: Thierry Reding <thierry.reding@gmail.com>
> Date: Mon, 30 Sep 2019 11:33:31 +0200
> Subject: [PATCH] dt-bindings: pwm: mediatek: Remove gratuitous compatible
>  string for MT7629
> 
> The MT7629 is, in fact, not compatible with the MT7622 because the
> former has a single PWM channel while the former has 6. Remove the
> gratuitous compatible string for MT7629.
> 
> Reported-by: Sam Shih <sam.shih@mediatek.com>
> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
> ---
>  Documentation/devicetree/bindings/pwm/pwm-mediatek.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
> index c8501530173c..053e9b5880f1 100644
> --- a/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
> @@ -6,7 +6,7 @@ Required properties:
>     - "mediatek,mt7622-pwm": found on mt7622 SoC.
>     - "mediatek,mt7623-pwm": found on mt7623 SoC.
>     - "mediatek,mt7628-pwm": found on mt7628 SoC.
> -   - "mediatek,mt7629-pwm", "mediatek,mt7622-pwm": found on mt7629 SoC.
> +   - "mediatek,mt7629-pwm": found on mt7629 SoC.
>     - "mediatek,mt8516-pwm": found on mt8516 SoC.
>   - reg: physical base address and length of the controller's registers.
>   - #pwm-cells: must be 2. See pwm.txt in this directory for a description of

It seems good to me.

Thanks,
Regards, Sam



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-09-30  9:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 14:32 [PATCH v10 0/12] Add mt7629 and fix mt7628 pwm Sam Shih
2019-09-25 14:32 ` [PATCH v10 01/12] pwm: mediatek: add a property "num-pwms" Sam Shih
2019-09-25 14:32 ` [PATCH v10 02/12] pwm: mediatek: droping the check for of_device_get_match_data Sam Shih
2019-09-25 14:32 ` [PATCH v10 03/12] pwm: mediatek: remove a property "has-clks" Sam Shih
2019-09-25 14:32 ` [PATCH v10 04/12] pwm: mediatek: allocate the clks array dynamically Sam Shih
2019-09-25 14:32 ` [PATCH v10 05/12] pwm: mediatek: use pwm_mediatek as common prefix Sam Shih
2019-09-25 14:32 ` [PATCH v10 06/12] pwm: mediatek: update license and switch to SPDX tag Sam Shih
2019-09-25 14:32 ` [PATCH v10 07/12] dt-bindings: pwm: pwm-mediatek: add a property "num-pwms" Sam Shih
2019-09-25 22:50   ` Thierry Reding
2019-09-25 14:32 ` [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string Sam Shih
2019-09-27 11:28   ` Thierry Reding
2019-09-30  8:51     ` Sam Shih
2019-09-30  9:36       ` Thierry Reding
2019-09-30  9:51         ` Sam Shih
2019-09-25 14:32 ` [PATCH v10 09/12] arm64: dts: mt7622: add a property "num-pwms" for PWM Sam Shih
2019-09-25 14:32 ` [PATCH v10 10/12] arm: dts: mt7623: " Sam Shih
2019-09-25 14:32 ` [PATCH v10 11/12] dt-bindings: pwm: update bindings for MT7629 SoC Sam Shih
2019-09-25 14:32 ` [PATCH v10 12/12] arm: dts: mediatek: add mt7629 pwm support Sam Shih

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).