2019-09-26 09:37:24

by Sam Shih

[permalink] [raw]
Subject: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string

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

Signed-off-by: Sam Shih <[email protected]>
---
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


2019-09-27 11:32:24

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string

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 <[email protected]>
> ---
> 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
>


Attachments:
(No filename) (1.45 kB)
signature.asc (849.00 B)
Download all attachments

2019-09-30 08:53:11

by Sam Shih

[permalink] [raw]
Subject: Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string

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 <[email protected]>
> > ---
> > 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

2019-09-30 09:40:14

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string

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 <[email protected]>
> > > ---
> > > 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 <[email protected]>
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 <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
---
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


Attachments:
(No filename) (2.88 kB)
signature.asc (849.00 B)
Download all attachments

2019-09-30 09:52:45

by Sam Shih

[permalink] [raw]
Subject: Re: [PATCH v10 08/12] pwm: mediatek: Add MT7629 compatible string

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 <[email protected]>
> > > > ---
> > > > 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 <[email protected]>
> 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 <[email protected]>
> Signed-off-by: Thierry Reding <[email protected]>
> ---
> 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