diff options
author | Jorge Ramirez-Ortiz <jramirez@baylibre.com> | 2018-11-08 16:51:01 +0100 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2019-01-31 09:35:01 +0100 |
commit | fd998418084a9ac0928b4032ce0bb8bee8c9323b (patch) | |
tree | 3e46b4ba5921f3928f8b5a5cc92da4622150974c /drivers/video | |
parent | 335d287327a1953f69da056cffc3276681b56b00 (diff) | |
download | u-boot-fd998418084a9ac0928b4032ce0bb8bee8c9323b.tar.gz |
video: dw_hdmi: support SoC specific read/write ops
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>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/dw_hdmi.c | 14 |
1 files changed, 12 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 */ |