pwm: Simplify all drivers with explicit of_pwm_n_cells = 3
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 10 May 2021 14:06:40 +0000 (16:06 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 25 May 2021 16:19:15 +0000 (18:19 +0200)
With the previous commit there is no need for the lowlevel driver any
more to specify it it uses two or three cells. So simplify accordingly.

The only non-trival change affects the pwm-rockchip driver: It used to only
support three cells if the hardware supports polarity. Now the default
number depends on the device tree which has to match hardware anyhow
(and if it doesn't the error is just a bit delayed as a PWM handle with
an inverted setting is catched when pwm_apply_state() is called).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
26 files changed:
drivers/pwm/pwm-atmel-hlcdc.c
drivers/pwm/pwm-atmel-tcb.c
drivers/pwm/pwm-atmel.c
drivers/pwm/pwm-bcm-iproc.c
drivers/pwm/pwm-bcm-kona.c
drivers/pwm/pwm-bcm2835.c
drivers/pwm/pwm-berlin.c
drivers/pwm/pwm-fsl-ftm.c
drivers/pwm/pwm-hibvt.c
drivers/pwm/pwm-imx-tpm.c
drivers/pwm/pwm-imx27.c
drivers/pwm/pwm-jz4740.c
drivers/pwm/pwm-lpc18xx-sct.c
drivers/pwm/pwm-meson.c
drivers/pwm/pwm-mxs.c
drivers/pwm/pwm-omap-dmtimer.c
drivers/pwm/pwm-renesas-tpu.c
drivers/pwm/pwm-rockchip.c
drivers/pwm/pwm-samsung.c
drivers/pwm/pwm-sifive.c
drivers/pwm/pwm-stm32-lp.c
drivers/pwm/pwm-stm32.c
drivers/pwm/pwm-sun4i.c
drivers/pwm/pwm-tiecap.c
drivers/pwm/pwm-tiehrpwm.c
drivers/pwm/pwm-vt8500.c

index 6ab597e54005cf1a31b6658317e1f198f74c1cc4..4459325d3650725beaee453198ac59dfcd387348 100644 (file)
@@ -266,8 +266,6 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
        chip->chip.ops = &atmel_hlcdc_pwm_ops;
        chip->chip.dev = dev;
        chip->chip.npwm = 1;
-       chip->chip.of_xlate = of_pwm_xlate_with_flags;
-       chip->chip.of_pwm_n_cells = 3;
 
        ret = pwmchip_add(&chip->chip);
        if (ret) {
index 8451d3e846bec1b982cfd9aeebbc2254b39e613d..bf398f21484db650987371ca969c28a0eff7f225 100644 (file)
@@ -469,8 +469,6 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
 
        tcbpwm->chip.dev = &pdev->dev;
        tcbpwm->chip.ops = &atmel_tcb_pwm_ops;
-       tcbpwm->chip.of_xlate = of_pwm_xlate_with_flags;
-       tcbpwm->chip.of_pwm_n_cells = 3;
        tcbpwm->chip.npwm = NPWM;
        tcbpwm->channel = channel;
        tcbpwm->regmap = regmap;
index 29b5ad03f7150f1cc14ead6733e1872f65e7d865..a8162bae3e8ad9a10774180a2259f789fa8acd29 100644 (file)
@@ -436,8 +436,6 @@ static int atmel_pwm_probe(struct platform_device *pdev)
 
        atmel_pwm->chip.dev = &pdev->dev;
        atmel_pwm->chip.ops = &atmel_pwm_ops;
-       atmel_pwm->chip.of_xlate = of_pwm_xlate_with_flags;
-       atmel_pwm->chip.of_pwm_n_cells = 3;
        atmel_pwm->chip.npwm = 4;
 
        ret = pwmchip_add(&atmel_pwm->chip);
index edd2ce1760abd62fbe0329e0c181b83fb4e15c06..0226bf697f097ee52a22663160bbb40067584f28 100644 (file)
@@ -210,8 +210,6 @@ static int iproc_pwmc_probe(struct platform_device *pdev)
        ip->chip.dev = &pdev->dev;
        ip->chip.ops = &iproc_pwm_ops;
        ip->chip.npwm = 4;
-       ip->chip.of_xlate = of_pwm_xlate_with_flags;
-       ip->chip.of_pwm_n_cells = 3;
 
        ip->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(ip->base))
index 800b9edf2e7156f7a33243b4d885d1aaf7ae0cc3..8c85c66ea5c9eac9c0c2eb5de0f73d61045855fd 100644 (file)
@@ -272,8 +272,6 @@ static int kona_pwmc_probe(struct platform_device *pdev)
        kp->chip.dev = &pdev->dev;
        kp->chip.ops = &kona_pwm_ops;
        kp->chip.npwm = 6;
-       kp->chip.of_xlate = of_pwm_xlate_with_flags;
-       kp->chip.of_pwm_n_cells = 3;
 
        kp->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(kp->base))
index fc240d5b812158c81a0ca2a06b751b0a11e41b7c..50b8594be31d829fc991c7345aeca3e9d4927886 100644 (file)
@@ -159,8 +159,6 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
        pc->chip.dev = &pdev->dev;
        pc->chip.ops = &bcm2835_pwm_ops;
        pc->chip.npwm = 2;
-       pc->chip.of_xlate = of_pwm_xlate_with_flags;
-       pc->chip.of_pwm_n_cells = 3;
 
        platform_set_drvdata(pdev, pc);
 
index acb6fbc3cc32d7fe45287227cf6d7c78a719aecd..a7fa6a4bf1c9d4e8e235cce2c1eb655f19055df1 100644 (file)
@@ -207,8 +207,6 @@ static int berlin_pwm_probe(struct platform_device *pdev)
        pwm->chip.dev = &pdev->dev;
        pwm->chip.ops = &berlin_pwm_ops;
        pwm->chip.npwm = 4;
-       pwm->chip.of_xlate = of_pwm_xlate_with_flags;
-       pwm->chip.of_pwm_n_cells = 3;
 
        ret = pwmchip_add(&pwm->chip);
        if (ret < 0) {
index 0e1ae9469edab480aa8b807daa04d5b4b33486e8..96ccd772280cecafd6fb752107602f8bf99ac87f 100644 (file)
@@ -451,8 +451,6 @@ static int fsl_pwm_probe(struct platform_device *pdev)
 
 
        fpc->chip.ops = &fsl_pwm_ops;
-       fpc->chip.of_xlate = of_pwm_xlate_with_flags;
-       fpc->chip.of_pwm_n_cells = 3;
        fpc->chip.npwm = 8;
 
        ret = pwmchip_add(&fpc->chip);
index 82d17fc75c210b91e1c10b486665b02b3f9b077c..4a6e9ad3c0ff9b7117992c6eb0b37017f38c72c4 100644 (file)
@@ -206,8 +206,6 @@ static int hibvt_pwm_probe(struct platform_device *pdev)
        pwm_chip->chip.ops = &hibvt_pwm_ops;
        pwm_chip->chip.dev = &pdev->dev;
        pwm_chip->chip.npwm = soc->num_pwms;
-       pwm_chip->chip.of_xlate = of_pwm_xlate_with_flags;
-       pwm_chip->chip.of_pwm_n_cells = 3;
        pwm_chip->soc = soc;
 
        pwm_chip->base = devm_platform_ioremap_resource(pdev, 0);
index 97c9133b687629a35a20ebaa7c8678f3ba47ed00..dbb50493abdd4e75931b1f52e131daca0c3b251d 100644 (file)
@@ -363,8 +363,6 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
 
        tpm->chip.dev = &pdev->dev;
        tpm->chip.ops = &imx_tpm_pwm_ops;
-       tpm->chip.of_xlate = of_pwm_xlate_with_flags;
-       tpm->chip.of_pwm_n_cells = 3;
 
        /* get number of channels */
        val = readl(tpm->base + PWM_IMX_TPM_PARAM);
index ba695115c16091f3240d8947fde72e45860d1059..f6588a96fbd98b9952c7c2a4c102c415649c4d5f 100644 (file)
@@ -329,9 +329,6 @@ static int pwm_imx27_probe(struct platform_device *pdev)
        imx->chip.dev = &pdev->dev;
        imx->chip.npwm = 1;
 
-       imx->chip.of_xlate = of_pwm_xlate_with_flags;
-       imx->chip.of_pwm_n_cells = 3;
-
        imx->mmio_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(imx->mmio_base))
                return PTR_ERR(imx->mmio_base);
index 5b6bdcdcecf582a2e5378ab59c11ef40c55f7bc7..990e7904c7f1fc463aeb976c1f26c1752ad3937d 100644 (file)
@@ -244,8 +244,6 @@ static int jz4740_pwm_probe(struct platform_device *pdev)
        jz4740->chip.dev = dev;
        jz4740->chip.ops = &jz4740_pwm_ops;
        jz4740->chip.npwm = info->num_pwms;
-       jz4740->chip.of_xlate = of_pwm_xlate_with_flags;
-       jz4740->chip.of_pwm_n_cells = 3;
 
        platform_set_drvdata(pdev, jz4740);
 
index b643ac61a2e7a1f19f2b6be7ec1d1c6b2e782d15..8e461f3baa05a9f32170194261ea9c392c3bdb21 100644 (file)
@@ -371,8 +371,6 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev)
        lpc18xx_pwm->chip.dev = &pdev->dev;
        lpc18xx_pwm->chip.ops = &lpc18xx_pwm_ops;
        lpc18xx_pwm->chip.npwm = 16;
-       lpc18xx_pwm->chip.of_xlate = of_pwm_xlate_with_flags;
-       lpc18xx_pwm->chip.of_pwm_n_cells = 3;
 
        /* SCT counter must be in unify (32 bit) mode */
        lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_CONFIG,
index 9eb060613cb45951c9b962a97aea58b72575f64d..595afec53a2d2fe40ecd1eba991d90555c5e3feb 100644 (file)
@@ -551,8 +551,6 @@ static int meson_pwm_probe(struct platform_device *pdev)
        meson->chip.dev = &pdev->dev;
        meson->chip.ops = &meson_pwm_ops;
        meson->chip.npwm = MESON_NUM_PWMS;
-       meson->chip.of_xlate = of_pwm_xlate_with_flags;
-       meson->chip.of_pwm_n_cells = 3;
 
        meson->data = of_device_get_match_data(&pdev->dev);
 
index 0266e84e982cab0d8a7472a9a98ba84a81f98bee..a22180803bd7dd2b03f13f54e3843e2ad820b337 100644 (file)
@@ -138,8 +138,6 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 
        mxs->chip.dev = &pdev->dev;
        mxs->chip.ops = &mxs_pwm_ops;
-       mxs->chip.of_xlate = of_pwm_xlate_with_flags;
-       mxs->chip.of_pwm_n_cells = 3;
 
        ret = of_property_read_u32(np, "fsl,pwm-number", &mxs->chip.npwm);
        if (ret < 0) {
index 612b3c85929536e009b7d2144aeb95a8a6780951..507a2d945b900d17a3f66640cacc109945eb513d 100644 (file)
@@ -404,8 +404,6 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
        omap->chip.dev = &pdev->dev;
        omap->chip.ops = &pwm_omap_dmtimer_ops;
        omap->chip.npwm = 1;
-       omap->chip.of_xlate = of_pwm_xlate_with_flags;
-       omap->chip.of_pwm_n_cells = 3;
 
        mutex_init(&omap->mutex);
 
index e2959fae0969cb1f7f4d3b88f3da0bb86882f4d0..b853e7942605812b477553a6ad139392e4f18077 100644 (file)
@@ -408,8 +408,6 @@ static int tpu_probe(struct platform_device *pdev)
 
        tpu->chip.dev = &pdev->dev;
        tpu->chip.ops = &tpu_pwm_ops;
-       tpu->chip.of_xlate = of_pwm_xlate_with_flags;
-       tpu->chip.of_pwm_n_cells = 3;
        tpu->chip.npwm = TPU_CHANNEL_MAX;
 
        pm_runtime_enable(&pdev->dev);
index 301785fa293eba05e5b300582ed9697e28bb287f..cbe900877724f0072de64b21cdaa28767e9586dc 100644 (file)
@@ -354,11 +354,6 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
        pc->chip.ops = &rockchip_pwm_ops;
        pc->chip.npwm = 1;
 
-       if (pc->data->supports_polarity) {
-               pc->chip.of_xlate = of_pwm_xlate_with_flags;
-               pc->chip.of_pwm_n_cells = 3;
-       }
-
        enable_conf = pc->data->enable_conf;
        ctrl = readl_relaxed(pc->base + pc->data->regs.ctrl);
        enabled = (ctrl & enable_conf) == enable_conf;
index 515489fa4f6d3826268f040708686880af672ca7..f6c528f02d43f35ceea30116973c5d32f3cbe640 100644 (file)
@@ -526,9 +526,6 @@ static int pwm_samsung_probe(struct platform_device *pdev)
                ret = pwm_samsung_parse_dt(chip);
                if (ret)
                        return ret;
-
-               chip->chip.of_xlate = of_pwm_xlate_with_flags;
-               chip->chip.of_pwm_n_cells = 3;
        } else {
                if (!pdev->dev.platform_data) {
                        dev_err(&pdev->dev, "no platform data specified\n");
index 688737f091ac485808f69e13198638d09f3f700b..420edc4aa94a3c7a7af9f9406369769ebc8b6a45 100644 (file)
@@ -242,8 +242,6 @@ static int pwm_sifive_probe(struct platform_device *pdev)
        chip = &ddata->chip;
        chip->dev = dev;
        chip->ops = &pwm_sifive_ops;
-       chip->of_xlate = of_pwm_xlate_with_flags;
-       chip->of_pwm_n_cells = 3;
        chip->npwm = 4;
 
        ddata->regs = devm_platform_ioremap_resource(pdev, 0);
index af08f564ef1d31c1f49aa6f7b11f03659487b0a3..93dd03618465bb3deff9e8eaa3abe15405740654 100644 (file)
@@ -208,8 +208,6 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev)
        priv->chip.dev = &pdev->dev;
        priv->chip.ops = &stm32_pwm_lp_ops;
        priv->chip.npwm = 1;
-       priv->chip.of_xlate = of_pwm_xlate_with_flags;
-       priv->chip.of_pwm_n_cells = 3;
 
        ret = pwmchip_add(&priv->chip);
        if (ret < 0)
index c46fb90036ab4fc350c255468b7b015e467e4517..794ca5b029681f6668f13c23d2865105ab2dfbdc 100644 (file)
@@ -621,8 +621,6 @@ static int stm32_pwm_probe(struct platform_device *pdev)
        priv->regmap = ddata->regmap;
        priv->clk = ddata->clk;
        priv->max_arr = ddata->max_arr;
-       priv->chip.of_xlate = of_pwm_xlate_with_flags;
-       priv->chip.of_pwm_n_cells = 3;
 
        if (!priv->regmap || !priv->clk)
                return -EINVAL;
index e01becd102c0a2bafe7c50c08c76bebdb3ab4cfa..c952604e91f3a3065c4e702566679a11d2f6d41c 100644 (file)
@@ -460,8 +460,6 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
        pwm->chip.dev = &pdev->dev;
        pwm->chip.ops = &sun4i_pwm_ops;
        pwm->chip.npwm = pwm->data->npwm;
-       pwm->chip.of_xlate = of_pwm_xlate_with_flags;
-       pwm->chip.of_pwm_n_cells = 3;
 
        spin_lock_init(&pwm->ctrl_lock);
 
index b9a17ab0c202abdd3ebf73d03f0737febd238123..f40975fcb195a9b0cba8d21c4783327c53e28194 100644 (file)
@@ -224,8 +224,6 @@ static int ecap_pwm_probe(struct platform_device *pdev)
 
        pc->chip.dev = &pdev->dev;
        pc->chip.ops = &ecap_pwm_ops;
-       pc->chip.of_xlate = of_pwm_xlate_with_flags;
-       pc->chip.of_pwm_n_cells = 3;
        pc->chip.npwm = 1;
 
        pc->mmio_base = devm_platform_ioremap_resource(pdev, 0);
index 90095a19bf2da9667ce6bb889500fae4b0675a16..17909fa5321138eeb806f319be14e70a387fb44d 100644 (file)
@@ -447,8 +447,6 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
 
        pc->chip.dev = &pdev->dev;
        pc->chip.ops = &ehrpwm_pwm_ops;
-       pc->chip.of_xlate = of_pwm_xlate_with_flags;
-       pc->chip.of_pwm_n_cells = 3;
        pc->chip.npwm = NUM_PWM_CHANNEL;
 
        pc->mmio_base = devm_platform_ioremap_resource(pdev, 0);
index 52fe5d19473aab75a873d5a4876e49cd89e8990a..f9eb36be908818cd99072efd920415b29a00af6b 100644 (file)
@@ -207,8 +207,6 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
 
        chip->chip.dev = &pdev->dev;
        chip->chip.ops = &vt8500_pwm_ops;
-       chip->chip.of_xlate = of_pwm_xlate_with_flags;
-       chip->chip.of_pwm_n_cells = 3;
        chip->chip.npwm = VT8500_NR_PWMS;
 
        chip->clk = devm_clk_get(&pdev->dev, NULL);