balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline/armbian/0000-0077-drm-bridge-synopsys-dw_hdmi-Add-a-quirk-to-automatic.patch
Vicentiu Galanopulo 7d5f1dbda1 recipes-kernel/linux: Remove unused patches and householding
Some patches were part of other linux-mainline
kernel versions but are not anymore part of the
current 4.19.76.

Move 0001-Enable-uart3-for-NanoPi-Neo-Air-used-by-BT.patch
in linux-mainline_4.19.76.bbappend to avoid error
patching file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
Hunk #2 FAILED at 162.
1 out of 2 hunks FAILED -- rejects in file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts

Place all patches from Armbian in a separate directory and do all the Balena specific
operations in linux-mainline_%.bbappend only.

Changelog-entry: Remove unused patches and cleanup
Signed-off-by: Vicentiu Galanopulo <vicentiu@balena.io>
2019-10-14 09:43:01 +02:00

68 lines
2.5 KiB
Diff

From 796acec22305cbd6c1bf6dcc4e103482ca525025 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@siol.net>
Date: Thu, 8 Mar 2018 17:16:22 +0100
Subject: [PATCH 77/82] drm/bridge/synopsys: dw_hdmi: Add a quirk to
automatically set CTS
On some SoCs with DW HDMI, like Allwinner H3, HDMI audio doesn't work
well if CTS is not set automatically. Add a quirk for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 26 ++++++++++++++---------
include/drm/bridge/dw_hdmi.h | 2 ++
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 5971976284bf..822d0093a990 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -424,16 +424,22 @@ static struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi)
static void hdmi_set_cts_n(struct dw_hdmi *hdmi, unsigned int cts,
unsigned int n)
{
- /* Must be set/cleared first */
- hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3);
-
- /* nshift factor = 0 */
- hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_N_SHIFT_MASK, HDMI_AUD_CTS3);
-
- hdmi_writeb(hdmi, ((cts >> 16) & HDMI_AUD_CTS3_AUDCTS19_16_MASK) |
- HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3);
- hdmi_writeb(hdmi, (cts >> 8) & 0xff, HDMI_AUD_CTS2);
- hdmi_writeb(hdmi, cts & 0xff, HDMI_AUD_CTS1);
+ if (!hdmi->plat_data->auto_cts) {
+ /* Must be set/cleared first */
+ hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3);
+
+ /* nshift factor = 0 */
+ hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_N_SHIFT_MASK, HDMI_AUD_CTS3);
+
+ hdmi_writeb(hdmi,
+ ((cts >> 16) & HDMI_AUD_CTS3_AUDCTS19_16_MASK) |
+ HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3);
+ hdmi_writeb(hdmi, (cts >> 8) & 0xff, HDMI_AUD_CTS2);
+ hdmi_writeb(hdmi, cts & 0xff, HDMI_AUD_CTS1);
+ } else {
+ /* set automatic CTS calculation */
+ hdmi_writeb(hdmi, 0x00, HDMI_AUD_CTS3);
+ }
hdmi_writeb(hdmi, (n >> 16) & 0x0f, HDMI_AUD_N3);
hdmi_writeb(hdmi, (n >> 8) & 0xff, HDMI_AUD_N2);
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index ccb5aa8468e0..b6a878455364 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -129,6 +129,8 @@ struct dw_hdmi_plat_data {
unsigned long input_bus_format;
unsigned long input_bus_encoding;
+ bool auto_cts;
+
/* Vendor PHY support */
const struct dw_hdmi_phy_ops *phy_ops;
const char *phy_name;
--
2.20.1