summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHsin-Yi Wang <hsinyi@chromium.org>2022-04-14 17:00:04 +0800
committerRobert Foss <robert.foss@linaro.org>2022-04-19 15:54:56 +0200
commit97f2c684f34d386639926787fe5211d42b6f4e6f (patch)
tree963c38844ec645a9e6539837775204cef7db249c /drivers
parentc9b2d923befd8cee0b9d6cbd96128ec0bf44c881 (diff)
downloadlinux-stable-97f2c684f34d386639926787fe5211d42b6f4e6f.tar.gz
linux-stable-97f2c684f34d386639926787fe5211d42b6f4e6f.tar.bz2
linux-stable-97f2c684f34d386639926787fe5211d42b6f4e6f.zip
drm/bridge: anx7625: Fill in empty ELD when no connector
Speaker may share I2S with DP and .get_eld callback will be called when speaker is playing. When HDMI wans't connected, the connector will be null. Instead of return an error, fill in empty ELD. Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Xin Ji <xji@analogixsemi.com> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20220414090003.1806535-1-hsinyi@chromium.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/bridge/analogix/anx7625.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 6516f9570b86..f2bc30c98c77 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1932,14 +1932,14 @@ static int anx7625_audio_get_eld(struct device *dev, void *data,
struct anx7625_data *ctx = dev_get_drvdata(dev);
if (!ctx->connector) {
- dev_err(dev, "connector not initial\n");
- return -EINVAL;
+ /* Pass en empty ELD if connector not available */
+ memset(buf, 0, len);
+ } else {
+ dev_dbg(dev, "audio copy eld\n");
+ memcpy(buf, ctx->connector->eld,
+ min(sizeof(ctx->connector->eld), len));
}
- dev_dbg(dev, "audio copy eld\n");
- memcpy(buf, ctx->connector->eld,
- min(sizeof(ctx->connector->eld), len));
-
return 0;
}