[PATCH v2] driver: pwm: pwm-imx: fix probing on imx6

Fabio Estevam festevam at gmail.com
Tue Aug 13 22:12:28 CEST 2024


Hi Heiko,

On Tue, Aug 13, 2024 at 10:58 AM Heiko Schocher <hs at denx.de> wrote:

> Should we revert this patch?
>
> I just can say for the aristianetos2 board, that I readded exactly this
> define in my work for the port to currentmainline ... and with my patch,
> pwm and so bootlogo works again ...

What about the change below on top of your patch?

--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -14,6 +14,8 @@
 #include <asm/io.h>
 #include <clk.h>

+#define IMX6_PWM_PER_CLK       66000000
+
 int pwm_config_internal(struct pwm_regs *pwm, unsigned long period_cycles,
                        unsigned long duty_cycles, unsigned long prescale)
 {
@@ -75,7 +77,7 @@ int pwm_imx_get_parms(int period_ns, int duty_ns,
unsigned long *period_c,
         * value here as a define. Replace it when we have the clock
         * framework.
         */
-       c = CFG_IMX6_PWM_PER_CLK;
+       c = IMX6_PWM_PER_CLK;
        c = c * period_ns;
        do_div(c, 1000000000);
        *period_c = c;
@@ -162,7 +164,7 @@ int pwm_dm_imx_get_parms(struct imx_pwm_priv
*priv, int period_ns,
        if (CONFIG_IS_ENABLED(CLK))
                c = clk_get_rate(&priv->per_clk);
        else
-               c = CFG_IMX6_PWM_PER_CLK;
+               c = IMX6_PWM_PER_CLK;

        c = c * period_ns;
        do_div(c, 1000000000);


More information about the U-Boot mailing list