diff mbox series

[v3,3/4] video: mxsfb: add clk_enable()

Message ID 20200427155306.105284-4-giulio.benetti@benettiengineering.com
State Accepted
Commit 72fef43d4d4043cf62fc9d8da6b41fe17f3dfb5e
Headers show
Series Various i.MXRT bug/typo fixes | expand

Commit Message

Giulio Benetti April 27, 2020, 3:53 p.m. UTC
BROM doesn't enable lcdif by default so add clk_enable() after
clk_set_rate().

Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
---
V1->V2:
* call clk_enable() after clk_set_rate() as suggested by Fabio
---
 drivers/video/mxsfb.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Giulio Benetti April 27, 2020, 3:56 p.m. UTC | #1
Forgotten to add

On 4/27/20 5:53 PM, Giulio Benetti wrote:
> BROM doesn't enable lcdif by default so add clk_enable() after
> clk_set_rate().
> 
> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>

Reviewed-by: Anatolij Gustschin <agust at denx.de>
Reviewed-by: Fabio Estevam <festevam at gmail.com>

> ---
> V1->V2:
> * call clk_enable() after clk_set_rate() as suggested by Fabio
> ---
>   drivers/video/mxsfb.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> index 8a5a61c9fb..12d00b4689 100644
> --- a/drivers/video/mxsfb.c
> +++ b/drivers/video/mxsfb.c
> @@ -77,6 +77,12 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
>   		dev_err(dev, "Failed to set mxs clk: %d\n", ret);
>   		return;
>   	}
> +
> +	ret = clk_enable(&per_clk);
> +	if (ret < 0) {
> +		dev_err(dev, "Failed to enable mxs clk: %d\n", ret);
> +		return;
> +	}
>   #else
>   	/* Kick in the LCDIF clock */
>   	mxs_set_lcdclk(MXS_LCDIF_BASE, timings->pixelclock.typ / 1000);
>
Stefano Babic May 2, 2020, 9:08 a.m. UTC | #2
> BROM doesn't enable lcdif by default so add clk_enable() after
> clk_set_rate().
> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> Reviewed-by: Anatolij Gustschin <agust at denx.de>
> Reviewed-by: Fabio Estevam <festevam at gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 8a5a61c9fb..12d00b4689 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -77,6 +77,12 @@  static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 		dev_err(dev, "Failed to set mxs clk: %d\n", ret);
 		return;
 	}
+
+	ret = clk_enable(&per_clk);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable mxs clk: %d\n", ret);
+		return;
+	}
 #else
 	/* Kick in the LCDIF clock */
 	mxs_set_lcdclk(MXS_LCDIF_BASE, timings->pixelclock.typ / 1000);