[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240502-anx-tdm-v1-2-894a9f634f44@chromium.org>
Date: Thu, 02 May 2024 09:03:32 +0000
From: Hsin-Te Yuan <yuanhsinte@...omium.org>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Xin Ji <xji@...logixsemi.com>
Cc: dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Hsin-Te Yuan <yuanhsinte@...omium.org>
Subject: [PATCH 2/2] drm/bridge: anx7625: Change TDM setting accroding to
dt property
For some SoCs, the TDM setting is not to shift the first audio data bit,
which is not the default setting of anx7625. In such cases, the TDM
setting should be changed according to the device tree property.
Signed-off-by: Hsin-Te Yuan <yuanhsinte@...omium.org>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
drivers/gpu/drm/bridge/analogix/anx7625.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 29d91493b101a..538edddf313c9 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1709,6 +1709,9 @@ static int anx7625_parse_dt(struct device *dev,
if (of_property_read_bool(np, "analogix,audio-enable"))
pdata->audio_en = 1;
+ if(!of_property_read_bool(np, "no-shift-audio-data"))
+ pdata->shift_audio_data = 1;
+
return 0;
}
@@ -1866,6 +1869,11 @@ static int anx7625_audio_hw_params(struct device *dev, void *data,
~TDM_SLAVE_MODE,
I2S_SLAVE_MODE);
+ if (!ctx->pdata.shift_audio_data)
+ ret |= anx7625_write_or(ctx, ctx->i2c.tx_p2_client,
+ AUDIO_CONTROL_REGISTER,
+ TDM_TIMING_MODE);
+
/* Word length */
switch (params->sample_width) {
case 16:
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h
index 39ed35d338363..41b395725913a 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.h
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.h
@@ -441,6 +441,7 @@ struct anx7625_platform_data {
u8 lane1_reg_data[DP_TX_SWING_REG_CNT];
u32 low_power_mode;
struct device_node *mipi_host_node;
+ int shift_audio_data;
};
struct anx7625_i2c_client {
--
2.45.0.rc1.225.g2a3ae87e7f-goog
Powered by blists - more mailing lists