mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: agust@denx.de, u-boot@lists.denx.de
Cc: mjourdan@baylibre.com, linux-amlogic@lists.infradead.org,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jorge Ramirez-Ortiz <jramirez@baylibre.com>,
	jbrunet@baylibre.com
Subject: [PATCH u-boot 02/11] video: dw_hdmi: support SoC specific read/write ops
Date: Tue, 15 Jan 2019 17:17:50 +0100	[thread overview]
Message-ID: <20190115161759.1657-3-narmstrong@baylibre.com> (raw)
In-Reply-To: <20190115161759.1657-1-narmstrong@baylibre.com>

From: Jorge Ramirez-Ortiz <jramirez@baylibre.com>

Some IPs like the meson VPU have a specific way to write to dw_hdmi
registers. Make it configurable.

Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
[added commit description]
Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/video/dw_hdmi.c | 14 ++++++++++++--
 include/dw_hdmi.h       |  2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index 229bd63c97..e03f24fa98 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -52,7 +52,7 @@ static const struct tmds_n_cts n_cts_table[] = {
 	}
 };
 
-static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
+static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 {
 	switch (hdmi->reg_io_width) {
 	case 1:
@@ -67,7 +67,7 @@ static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 	}
 }
 
-static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
+static u8 dw_hdmi_read(struct dw_hdmi *hdmi, int offset)
 {
 	switch (hdmi->reg_io_width) {
 	case 1:
@@ -82,6 +82,10 @@ static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
 	return 0;
 }
 
+static u8 (*hdmi_read)(struct dw_hdmi *hdmi, int offset) = dw_hdmi_read;
+static void (*hdmi_write)(struct dw_hdmi *hdmi, u8 val, int offset) =
+								 dw_hdmi_write;
+
 static void hdmi_mod(struct dw_hdmi *hdmi, unsigned reg, u8 mask, u8 data)
 {
 	u8 val = hdmi_read(hdmi, reg) & ~mask;
@@ -754,6 +758,12 @@ void dw_hdmi_init(struct dw_hdmi *hdmi)
 		  HDMI_IH_MUTE_MUTE_WAKEUP_INTERRUPT |
 		  HDMI_IH_MUTE_MUTE_ALL_INTERRUPT;
 
+	if (hdmi->write_reg)
+		hdmi_write = hdmi->write_reg;
+
+	if (hdmi->read_reg)
+		hdmi_read = hdmi->read_reg;
+
 	hdmi_write(hdmi, ih_mute, HDMI_IH_MUTE);
 
 	/* enable i2c master done irq */
diff --git a/include/dw_hdmi.h b/include/dw_hdmi.h
index 23088ec768..35edc189c0 100644
--- a/include/dw_hdmi.h
+++ b/include/dw_hdmi.h
@@ -472,6 +472,8 @@ struct dw_hdmi {
 	u8 reg_io_width;
 
 	int (*phy_set)(struct dw_hdmi *hdmi, uint mpixelclock);
+	void (*write_reg)(struct dw_hdmi *hdmi, u8 val, int offset);
+	u8 (*read_reg)(struct dw_hdmi *hdmi, int offset);
 };
 
 int dw_hdmi_phy_cfg(struct dw_hdmi *hdmi, uint mpixelclock);
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply	other threads:[~2019-01-15 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 16:17 [PATCH u-boot 00/11] meson: add support for Video Output Neil Armstrong
2019-01-15 16:17 ` [PATCH u-boot 01/11] power: domain: meson-gx-pwrc-vpu: add missing depends Neil Armstrong
2019-01-28 19:58   ` Anatolij Gustschin
2019-01-15 16:17 ` Neil Armstrong [this message]
2019-01-28 16:00   ` [PATCH u-boot 02/11] video: dw_hdmi: support SoC specific read/write ops Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 03/11] video: dw_hdmi: add support for color conversion Neil Armstrong
2019-01-28 16:01   ` Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 04/11] video: Add Meson Video Processing Unit Driver Neil Armstrong
2019-01-28 19:56   ` Anatolij Gustschin
2019-01-29  8:26     ` Neil Armstrong
2019-01-29 10:28       ` Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 05/11] arm64: dts: meson-gx: vpu should be probed before relocation Neil Armstrong
2019-01-15 16:17 ` [PATCH u-boot 06/11] arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply Neil Armstrong
2019-01-15 16:17 ` [PATCH u-boot 07/11] arm64: dts: meson-gx: add hhi reg entry to hdmi_tx Neil Armstrong
2019-01-15 16:17 ` [PATCH u-boot 08/11] arm: meson: board-gx: Setup VPU in fdt Neil Armstrong
2019-01-28 20:07   ` Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 09/11] configs: meson64: use vidconsole and usbkbd if enabled Neil Armstrong
2019-01-28 20:09   ` Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 10/11] arm: meson64: enable console mux and console env by default Neil Armstrong
2019-01-28 20:11   ` Anatolij Gustschin
2019-01-15 16:17 ` [PATCH u-boot 11/11] arm: libretech-cc: enable video " Neil Armstrong
2019-01-28 20:12   ` Anatolij Gustschin
2019-01-28  9:10 ` [PATCH u-boot 00/11] meson: add support for Video Output Neil Armstrong

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=20190115161759.1657-3-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=agust@denx.de \
    --cc=jbrunet@baylibre.com \
    --cc=jramirez@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=mjourdan@baylibre.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®