* [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format
@ 2022-07-26 3:30 Xin Ji
2022-07-26 9:15 ` Jiaxin Yu
0 siblings, 1 reply; 4+ messages in thread
From: Xin Ji @ 2022-07-26 3:30 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter
Cc: qwen, linux-kernel, dri-devel, hsinyi, bliang, Xin Ji
1. Support HDMI_I2S audio format.
2. Return 0 if there is no sink connection in .hw_param callback.
Signed-off-by: Xin Ji <xji@analogixsemi.com>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 79fc7a50b497..c74b5df4cade 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1797,8 +1797,13 @@ static int anx7625_audio_hw_params(struct device *dev, void *data,
int wl, ch, rate;
int ret = 0;
- if (fmt->fmt != HDMI_DSP_A) {
- DRM_DEV_ERROR(dev, "only supports DSP_A\n");
+ if (anx7625_sink_detect(ctx) == connector_status_disconnected) {
+ DRM_DEV_DEBUG_DRIVER(dev, "DP not connected\n");
+ return 0;
+ }
+
+ if (fmt->fmt != HDMI_DSP_A && fmt->fmt != HDMI_I2S) {
+ DRM_DEV_ERROR(dev, "only supports DSP_A & I2S\n");
return -EINVAL;
}
@@ -1806,10 +1811,16 @@ static int anx7625_audio_hw_params(struct device *dev, void *data,
params->sample_rate, params->sample_width,
params->cea.channels);
- ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
- AUDIO_CHANNEL_STATUS_6,
- ~I2S_SLAVE_MODE,
- TDM_SLAVE_MODE);
+ if (fmt->fmt == HDMI_DSP_A)
+ ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
+ AUDIO_CHANNEL_STATUS_6,
+ ~I2S_SLAVE_MODE,
+ TDM_SLAVE_MODE);
+ else
+ ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
+ AUDIO_CHANNEL_STATUS_6,
+ ~TDM_SLAVE_MODE,
+ I2S_SLAVE_MODE);
/* Word length */
switch (params->sample_width) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format
2022-07-26 3:30 [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format Xin Ji
@ 2022-07-26 9:15 ` Jiaxin Yu
2022-08-10 8:58 ` Hsin-Yi Wang
0 siblings, 1 reply; 4+ messages in thread
From: Jiaxin Yu @ 2022-07-26 9:15 UTC (permalink / raw)
To: Xin Ji, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, David Airlie,
Daniel Vetter
Cc: qwen, bliang, linux-kernel, dri-devel, hsinyi
On Tue, 2022-07-26 at 11:30 +0800, Xin Ji wrote:
> 1. Support HDMI_I2S audio format.
> 2. Return 0 if there is no sink connection in .hw_param callback.
>
> Signed-off-by: Xin Ji <xji@analogixsemi.com>
> ---
> drivers/gpu/drm/bridge/analogix/anx7625.c | 23 +++++++++++++++++--
> ----
> 1 file changed, 17 insertions(+), 6 deletions(-)
>
Acked-by: Jiaxin Yu<jiaxin.yu@mediatek.com>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c
> b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 79fc7a50b497..c74b5df4cade 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1797,8 +1797,13 @@ static int anx7625_audio_hw_params(struct
> device *dev, void *data,
> int wl, ch, rate;
> int ret = 0;
>
> - if (fmt->fmt != HDMI_DSP_A) {
> - DRM_DEV_ERROR(dev, "only supports DSP_A\n");
> + if (anx7625_sink_detect(ctx) == connector_status_disconnected)
> {
> + DRM_DEV_DEBUG_DRIVER(dev, "DP not connected\n");
> + return 0;
> + }
> +
> + if (fmt->fmt != HDMI_DSP_A && fmt->fmt != HDMI_I2S) {
> + DRM_DEV_ERROR(dev, "only supports DSP_A & I2S\n");
> return -EINVAL;
> }
>
> @@ -1806,10 +1811,16 @@ static int anx7625_audio_hw_params(struct
> device *dev, void *data,
> params->sample_rate, params->sample_width,
> params->cea.channels);
>
> - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> - AUDIO_CHANNEL_STATUS_6,
> - ~I2S_SLAVE_MODE,
> - TDM_SLAVE_MODE);
> + if (fmt->fmt == HDMI_DSP_A)
> + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> + AUDIO_CHANNEL_STATUS_6,
> + ~I2S_SLAVE_MODE,
> + TDM_SLAVE_MODE);
> + else
> + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> + AUDIO_CHANNEL_STATUS_6,
> + ~TDM_SLAVE_MODE,
> + I2S_SLAVE_MODE);
>
> /* Word length */
> switch (params->sample_width) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format
2022-07-26 9:15 ` Jiaxin Yu
@ 2022-08-10 8:58 ` Hsin-Yi Wang
2022-08-29 13:56 ` Robert Foss
0 siblings, 1 reply; 4+ messages in thread
From: Hsin-Yi Wang @ 2022-08-10 8:58 UTC (permalink / raw)
To: Jiaxin Yu
Cc: dri-devel, Jernej Skrabec, Jonas Karlman, David Airlie, qwen,
Neil Armstrong, linux-kernel, Robert Foss, Laurent Pinchart,
Andrzej Hajda, bliang, Xin Ji
On Tue, Jul 26, 2022 at 5:16 PM Jiaxin Yu <jiaxin.yu@mediatek.com> wrote:
>
> On Tue, 2022-07-26 at 11:30 +0800, Xin Ji wrote:
> > 1. Support HDMI_I2S audio format.
> > 2. Return 0 if there is no sink connection in .hw_param callback.
> >
> > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > ---
> > drivers/gpu/drm/bridge/analogix/anx7625.c | 23 +++++++++++++++++--
> > ----
> > 1 file changed, 17 insertions(+), 6 deletions(-)
> >
> Acked-by: Jiaxin Yu<jiaxin.yu@mediatek.com>
Acked-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 79fc7a50b497..c74b5df4cade 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -1797,8 +1797,13 @@ static int anx7625_audio_hw_params(struct
> > device *dev, void *data,
> > int wl, ch, rate;
> > int ret = 0;
> >
> > - if (fmt->fmt != HDMI_DSP_A) {
> > - DRM_DEV_ERROR(dev, "only supports DSP_A\n");
> > + if (anx7625_sink_detect(ctx) == connector_status_disconnected)
> > {
> > + DRM_DEV_DEBUG_DRIVER(dev, "DP not connected\n");
> > + return 0;
> > + }
> > +
> > + if (fmt->fmt != HDMI_DSP_A && fmt->fmt != HDMI_I2S) {
> > + DRM_DEV_ERROR(dev, "only supports DSP_A & I2S\n");
> > return -EINVAL;
> > }
> >
> > @@ -1806,10 +1811,16 @@ static int anx7625_audio_hw_params(struct
> > device *dev, void *data,
> > params->sample_rate, params->sample_width,
> > params->cea.channels);
> >
> > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > - AUDIO_CHANNEL_STATUS_6,
> > - ~I2S_SLAVE_MODE,
> > - TDM_SLAVE_MODE);
> > + if (fmt->fmt == HDMI_DSP_A)
> > + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > + AUDIO_CHANNEL_STATUS_6,
> > + ~I2S_SLAVE_MODE,
> > + TDM_SLAVE_MODE);
> > + else
> > + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > + AUDIO_CHANNEL_STATUS_6,
> > + ~TDM_SLAVE_MODE,
> > + I2S_SLAVE_MODE);
> >
> > /* Word length */
> > switch (params->sample_width) {
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format
2022-08-10 8:58 ` Hsin-Yi Wang
@ 2022-08-29 13:56 ` Robert Foss
0 siblings, 0 replies; 4+ messages in thread
From: Robert Foss @ 2022-08-29 13:56 UTC (permalink / raw)
To: Hsin-Yi Wang
Cc: dri-devel, Jernej Skrabec, Jonas Karlman, David Airlie, qwen,
Neil Armstrong, linux-kernel, Jiaxin Yu, Laurent Pinchart,
Andrzej Hajda, bliang, Xin Ji
On Wed, 10 Aug 2022 at 10:58, Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> On Tue, Jul 26, 2022 at 5:16 PM Jiaxin Yu <jiaxin.yu@mediatek.com> wrote:
> >
> > On Tue, 2022-07-26 at 11:30 +0800, Xin Ji wrote:
> > > 1. Support HDMI_I2S audio format.
> > > 2. Return 0 if there is no sink connection in .hw_param callback.
> > >
> > > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > > ---
> > > drivers/gpu/drm/bridge/analogix/anx7625.c | 23 +++++++++++++++++--
> > > ----
> > > 1 file changed, 17 insertions(+), 6 deletions(-)
> > >
> > Acked-by: Jiaxin Yu<jiaxin.yu@mediatek.com>
> Acked-by: Hsin-Yi Wang <hsinyi@chromium.org>
>
> > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > index 79fc7a50b497..c74b5df4cade 100644
> > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > @@ -1797,8 +1797,13 @@ static int anx7625_audio_hw_params(struct
> > > device *dev, void *data,
> > > int wl, ch, rate;
> > > int ret = 0;
> > >
> > > - if (fmt->fmt != HDMI_DSP_A) {
> > > - DRM_DEV_ERROR(dev, "only supports DSP_A\n");
> > > + if (anx7625_sink_detect(ctx) == connector_status_disconnected)
> > > {
> > > + DRM_DEV_DEBUG_DRIVER(dev, "DP not connected\n");
> > > + return 0;
> > > + }
> > > +
> > > + if (fmt->fmt != HDMI_DSP_A && fmt->fmt != HDMI_I2S) {
> > > + DRM_DEV_ERROR(dev, "only supports DSP_A & I2S\n");
> > > return -EINVAL;
> > > }
> > >
> > > @@ -1806,10 +1811,16 @@ static int anx7625_audio_hw_params(struct
> > > device *dev, void *data,
> > > params->sample_rate, params->sample_width,
> > > params->cea.channels);
> > >
> > > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > > - AUDIO_CHANNEL_STATUS_6,
> > > - ~I2S_SLAVE_MODE,
> > > - TDM_SLAVE_MODE);
> > > + if (fmt->fmt == HDMI_DSP_A)
> > > + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > > + AUDIO_CHANNEL_STATUS_6,
> > > + ~I2S_SLAVE_MODE,
> > > + TDM_SLAVE_MODE);
> > > + else
> > > + ret = anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client,
> > > + AUDIO_CHANNEL_STATUS_6,
> > > + ~TDM_SLAVE_MODE,
> > > + I2S_SLAVE_MODE);
> > >
> > > /* Word length */
> > > switch (params->sample_width) {
> >
Applied to drm-misc-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-29 13:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 3:30 [PATCH] drm/bridge: anx7625: Support HDMI_I2S audio format Xin Ji
2022-07-26 9:15 ` Jiaxin Yu
2022-08-10 8:58 ` Hsin-Yi Wang
2022-08-29 13:56 ` Robert Foss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).