[PATCH v6 04/10] drm/bridge: connector: add support for HDMI codec framework
Dmitry Baryshkov
dmitry.baryshkov at linaro.org
Mon Dec 16 09:49:47 PST 2024
On Mon, Dec 16, 2024 at 06:14:43PM +0100, Maxime Ripard wrote:
> On Fri, Dec 06, 2024 at 12:15:58PM +0200, Dmitry Baryshkov wrote:
> > Add necessary glue code to be able to use new HDMI codec framework from
> > the DRM bridge drivers. The drm_bridge implements a limited set of the
> > hdmi_codec_ops interface, with the functions accepting both
> > drm_connector and drm_bridge instead of just a generic void pointer.
> >
> > This framework is integrated with the DRM HDMI Connector framework, but
> > can also be used for DisplayPort connectors.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
> > ---
> > drivers/gpu/drm/display/drm_bridge_connector.c | 100 ++++++++++++++++++++++++-
> > include/drm/drm_bridge.h | 38 ++++++++++
> > 2 files changed, 134 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> > index 512ced87ea18c74e182a558a686ddd83de891814..4fa1bb73d430d02d5b79a1a184c203ec9e9c66e7 100644
> > --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> > +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> > @@ -21,6 +21,8 @@
> > #include <drm/display/drm_hdmi_helper.h>
> > #include <drm/display/drm_hdmi_state_helper.h>
> >
> > +#include <sound/hdmi-codec.h>
> > +
> > /**
> > * DOC: overview
> > *
> > @@ -368,10 +370,80 @@ static int drm_bridge_connector_write_infoframe(struct drm_connector *connector,
> > return bridge->funcs->hdmi_write_infoframe(bridge, type, buffer, len);
> > }
> >
> > +static int drm_bridge_connector_audio_startup(struct drm_connector *connector)
> > +{
> > + struct drm_bridge_connector *bridge_connector =
> > + to_drm_bridge_connector(connector);
> > + struct drm_bridge *bridge;
> > +
> > + bridge = bridge_connector->bridge_hdmi;
> > + if (!bridge)
> > + return -EINVAL;
> > +
> > + if (bridge->funcs->hdmi_codec_audio_startup)
> > + return bridge->funcs->hdmi_codec_audio_startup(connector, bridge);
> > + else
> > + return 0;
> > +}
>
> Nit: it looks like you return in other cases, and there's no need for
> that else.
>
> I'd remove the else.
Ack
>
> Looks good otherwise, once fixed
> Reviewed-by: Maxime Ripard <mripard at kernel.org>
>
> Maxime
--
With best wishes
Dmitry
More information about the Linux-mediatek
mailing list