[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220106061630.1752762-3-xji@analogixsemi.com>
Date: Thu, 6 Jan 2022 14:16:30 +0800
From: Xin Ji <xji@...logixsemi.com>
To: Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Robert Foss <robert.foss@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
Cc: bliang@...logixsemi.com, qwen@...logixsemi.com,
Xin Ji <xji@...logixsemi.com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/3] drm/bridge: anx7625: add audio codec .get_eld support
Provide .get_eld interface in hdmi_codec_ops for hdmi-codec driver.
Reviewed-by: Robert Foss <robert.foss@...aro.org>
Signed-off-by: Xin Ji <xji@...logixsemi.com>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index a225dd1abf41..a41f22d0e088 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1840,9 +1840,27 @@ static int anx7625_audio_hook_plugged_cb(struct device *dev, void *data,
return 0;
}
+static int anx7625_audio_get_eld(struct device *dev, void *data,
+ u8 *buf, size_t len)
+{
+ struct anx7625_data *ctx = dev_get_drvdata(dev);
+
+ if (!ctx->connector) {
+ dev_err(dev, "connector not initial\n");
+ return -EINVAL;
+ }
+
+ dev_dbg(dev, "audio copy eld\n");
+ memcpy(buf, ctx->connector->eld,
+ min(sizeof(ctx->connector->eld), len));
+
+ return 0;
+}
+
static const struct hdmi_codec_ops anx7625_codec_ops = {
.hw_params = anx7625_audio_hw_params,
.audio_shutdown = anx7625_audio_shutdown,
+ .get_eld = anx7625_audio_get_eld,
.get_dai_id = anx7625_hdmi_i2s_get_dai_id,
.hook_plugged_cb = anx7625_audio_hook_plugged_cb,
};
--
2.25.1
Powered by blists - more mailing lists