diff mbox series

[resend,2/3] pwm: mediatek: add pwm support for MT7629 SoC

Message ID 9043534495d49c532bdb0b904344b77faeb41359.1542074855.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [resend,1/3] pwm: mediatek: drop flag 'has_clks' | expand

Commit Message

Ryder Lee Nov. 13, 2018, 2:08 a.m. UTC
This adds pwm controller support for MT7629 SoC.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/pwm/pwm-mediatek.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sean Wang Nov. 15, 2018, 7:20 p.m. UTC | #1
On Mon, Nov 12, 2018 at 6:09 PM Ryder Lee <ryder.lee@mediatek.com> wrote:
>
> This adds pwm controller support for MT7629 SoC.
>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
>  drivers/pwm/pwm-mediatek.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
> index 9400c41..4ed95e5 100644
> --- a/drivers/pwm/pwm-mediatek.c
> +++ b/drivers/pwm/pwm-mediatek.c
> @@ -292,11 +292,16 @@ static int mtk_pwm_remove(struct platform_device *pdev)
>         .pwm45_fixup = true,
>  };
>
> +static const struct mtk_pwm_platform_data mt7629_pwm_data = {
> +       .num_pwms = 1,
> +};

How about adding a property for the num_pwms for the PWM controller?
It at least can help stop adding a new entry for every SoC with only
differences on PWM number.

> +
>  static const struct of_device_id mtk_pwm_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, mtk_pwm_of_match);
> --
> 1.9.1
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
index 9400c41..4ed95e5 100644
--- a/drivers/pwm/pwm-mediatek.c
+++ b/drivers/pwm/pwm-mediatek.c
@@ -292,11 +292,16 @@  static int mtk_pwm_remove(struct platform_device *pdev)
 	.pwm45_fixup = true,
 };
 
+static const struct mtk_pwm_platform_data mt7629_pwm_data = {
+	.num_pwms = 1,
+};
+
 static const struct of_device_id mtk_pwm_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, mtk_pwm_of_match);