All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/5] video: mxsfb: add enabling of "axi" clock other than "per" clock
Date: Tue, 13 Apr 2021 01:03:31 +0200	[thread overview]
Message-ID: <20210412230335.2249323-2-giulio.benetti@benettiengineering.com> (raw)
In-Reply-To: <20210412230335.2249323-1-giulio.benetti@benettiengineering.com>

On some SoC mxsfb needs more than one clock gate(actual "per" clock). So
let's introduce "axi" clock that can be provided but it's not mandatory.
This is inspired from linux mxsfb driver. Also let's rename "per" clock to
"pix" clock for compatibility with already existing .dts lcdif nodes
implementation.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 drivers/video/mxsfb.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index e1fd36a62d..147bd668fe 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -67,26 +67,37 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 	uint32_t vdctrl0;
 
 #if CONFIG_IS_ENABLED(CLK)
-	struct clk per_clk;
+	struct clk clk;
 	int ret;
 
-	ret = clk_get_by_name(dev, "per", &per_clk);
+	ret = clk_get_by_name(dev, "pix", &clk);
 	if (ret) {
-		dev_err(dev, "Failed to get mxs clk: %d\n", ret);
+		dev_err(dev, "Failed to get mxs pix clk: %d\n", ret);
 		return;
 	}
 
-	ret = clk_set_rate(&per_clk, timings->pixelclock.typ);
+	ret = clk_set_rate(&clk, timings->pixelclock.typ);
 	if (ret < 0) {
-		dev_err(dev, "Failed to set mxs clk: %d\n", ret);
+		dev_err(dev, "Failed to set mxs pix clk: %d\n", ret);
 		return;
 	}
 
-	ret = clk_enable(&per_clk);
+	ret = clk_enable(&clk);
 	if (ret < 0) {
-		dev_err(dev, "Failed to enable mxs clk: %d\n", ret);
+		dev_err(dev, "Failed to enable mxs pix clk: %d\n", ret);
 		return;
 	}
+
+	ret = clk_get_by_name(dev, "axi", &clk);
+	if (!ret) {
+		debug("%s: Failed to get mxs axi clk: %d\n", __func__, ret);
+	} else {
+		ret = clk_enable(&clk);
+		if (ret < 0) {
+			dev_err(dev, "Failed to enable mxs axi clk: %d\n", ret);
+			return;
+		}
+	}
 #else
 	/* Kick in the LCDIF clock */
 	mxs_set_lcdclk(MXS_LCDIF_BASE, timings->pixelclock.typ / 1000);
-- 
2.25.1

  reply	other threads:[~2021-04-12 23:03 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 23:03 [PATCH 0/5] Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb Giulio Benetti
2021-04-12 23:03 ` Giulio Benetti [this message]
2021-04-12 23:03 ` [PATCH 2/5] video: mxsfb: add enabling of "disp_axi" clock Giulio Benetti
2021-04-12 23:03 ` [PATCH 3/5] clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to LCDIF_APB Giulio Benetti
2021-04-12 23:03 ` [PATCH 4/5] ARM: dts: imxrt1050: move lcdif assigned clock to dtsi Giulio Benetti
2021-04-12 23:03 ` [PATCH 5/5] ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver Giulio Benetti
2021-04-12 23:05 ` [PATCH 0/5] Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb Giulio Benetti
2021-05-01 23:44   ` Giulio Benetti
2021-05-12 22:12     ` Giulio Benetti
2021-05-13  8:14       ` Stefano Babic
2021-05-13  9:09         ` [PATCH v3 00/22] Fix i.MXRT1020/50 Giulio Benetti
2021-05-13 10:18         ` Giulio Benetti
2021-05-13 10:18           ` [PATCH v3 01/22] arm: imxrt: soc: make mpu regions generic Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 02/22] timer: imx-gpt: Add timer support for i.MX SoCs family Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:18           ` [PATCH v3 03/22] ARM: dts: imxrt1020: add node label to osc Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 04/22] ARM: dts: imxrt1020: add gpt1 node Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:18           ` [PATCH v3 05/22] ARM: dts: imxrt1020-evk: enable gpt1 timer Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 06/22] ARM: dts: imxrt1020-evk: set gpt1 as tick-timer for u-boot Giulio Benetti
2021-06-09 13:42             ` sbabic
2021-05-13 10:18           ` [PATCH v3 07/22] ARM: dts: imxrt1020-evk-u-boot: make gpt1 present for SPL Giulio Benetti
2021-06-09 13:42             ` sbabic
2021-05-13 10:18           ` [PATCH v3 08/22] ARM: dts: imxrt1020-evk: add device_type = "memory" to memory node Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:18           ` [PATCH v3 09/22] configs: imxrt1020-evk: enable imx gpt timer as tick-timer Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 10/22] ARM: dts: imxrt1050: add node label to osc Giulio Benetti
2021-06-09 13:42             ` sbabic
2021-05-13 10:18           ` [PATCH v3 11/22] ARM: dts: imxrt1050: add gpt1 node Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:18           ` [PATCH v3 12/22] ARM: dts: imxrt1050-evk: enable gpt1 timer Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 13/22] ARM: dts: imxrt1050-evk: set gpt1 as tick-timer for u-boot Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:18           ` [PATCH v3 14/22] ARM: dts: imxrt1050-evk-u-boot: make gpt1 present for SPL Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 15/22] ARM: dts: imxrt1050-evk: add device_type = "memory" to memory node Giulio Benetti
2021-06-09 13:42             ` sbabic
2021-05-13 10:18           ` [PATCH v3 16/22] configs: imxrt1050-evk: enable imx gpt timer as tick-timer Giulio Benetti
2021-06-09 13:42             ` sbabic
2021-05-13 10:18           ` [PATCH v3 17/22] video: mxsfb: add enabling of "axi" clock other than "per" clock Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:18           ` [PATCH v3 18/22] video: mxsfb: add enabling of "disp_axi" clock Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:19         ` Giulio Benetti
2021-05-13 10:19           ` [PATCH v3 19/22] clk: imx: clk-imxrt1050: introduce LCDIF_PIX and rename LCDIF to LCDIF_APB Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:19           ` [PATCH v3 20/22] ARM: dts: imxrt1050: move lcdif assigned clock to dtsi Giulio Benetti
2021-06-09 13:44             ` sbabic
2021-05-13 10:19           ` [PATCH v3 21/22] ARM: dts: imxrt1050: set lcdif clocks according to mxsfb driver Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:19           ` [PATCH v3 22/22] ARM: dts: imxrt1050-evk: remove u-boot,dm-spl Giulio Benetti
2021-06-09 13:43             ` sbabic
2021-05-13 10:21           ` [PATCH v3 18/22] video: mxsfb: add enabling of "disp_axi" clock Giulio Benetti
2021-05-13 10:26         ` [PATCH 0/5] Fix i.MXRT1050 hang on lcdif init and improve DT for mxsfb Giulio Benetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210412230335.2249323-2-giulio.benetti@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.