Skip to content

Commit

Permalink
drm/bridge: anx7625: add audio codec .get_eld support
Browse files Browse the repository at this point in the history
Provide .get_eld interface in hdmi_codec_ops for hdmi-codec driver.

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106100127.1862702-3-xji@analogixsemi.com
  • Loading branch information
Xin Ji authored and Robert Foss committed Jan 10, 2022
1 parent cd1637c commit 607a264
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/gpu/drm/bridge/analogix/anx7625.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 607a264

Please sign in to comment.