diff mbox series

[v2] drm/bridge: anx7625: Set downstream sink into normal status

Message ID 20220322080213.1487134-1-xji@analogixsemi.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/bridge: anx7625: Set downstream sink into normal status | expand

Commit Message

Xin Ji March 22, 2022, 8:02 a.m. UTC
As downstream sink was set into standby mode while bridge disabled,
this patch used for setting downstream sink into normal status
while enable bridge.

Signed-off-by: Xin Ji <xji@analogixsemi.com>
Reviewed-by: Pin-Yen Lin <treapking@chromium.org>

---
V1 -> V2: use dev_dbg replace of dev_info
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Hsin-Yi Wang March 22, 2022, 8:43 a.m. UTC | #1
On Tue, Mar 22, 2022 at 4:02 PM Xin Ji <xji@analogixsemi.com> wrote:
>
> As downstream sink was set into standby mode while bridge disabled,
> this patch used for setting downstream sink into normal status
> while enable bridge.
>
> Signed-off-by: Xin Ji <xji@analogixsemi.com>
> Reviewed-by: Pin-Yen Lin <treapking@chromium.org>
>
> ---
> V1 -> V2: use dev_dbg replace of dev_info
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 9a2a19ad4202..dcf3275a00fe 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -924,12 +924,20 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
>  {
>         int ret;
>         struct device *dev = &ctx->client->dev;
> +       u8 data;
>
>         if (!ctx->display_timing_valid) {
>                 DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
>                 return;
>         }
>
> +       dev_dbg(dev, "set downstream sink into normal\n");
> +       /* Downstream sink enter into normal mode */
> +       data = 1;
> +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
> +       if (ret < 0)
> +               dev_err(dev, "IO error : set sink into normal mode fail\n");
> +

The driver uses DRM_DEV_* for logs. Can we use this?

>         /* Disable HDCP */
>         anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
>
> --
> 2.25.1
>
Xin Ji March 22, 2022, 8:52 a.m. UTC | #2
On Tue, Mar 22, 2022 at 04:43:20PM +0800, Hsin-Yi Wang wrote:
> On Tue, Mar 22, 2022 at 4:02 PM Xin Ji <xji@analogixsemi.com> wrote:
> >
> > As downstream sink was set into standby mode while bridge disabled,
> > this patch used for setting downstream sink into normal status
> > while enable bridge.
> >
> > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > Reviewed-by: Pin-Yen Lin <treapking@chromium.org>
> >
> > ---
> > V1 -> V2: use dev_dbg replace of dev_info
> > ---
> >  drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 9a2a19ad4202..dcf3275a00fe 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -924,12 +924,20 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
> >  {
> >         int ret;
> >         struct device *dev = &ctx->client->dev;
> > +       u8 data;
> >
> >         if (!ctx->display_timing_valid) {
> >                 DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
> >                 return;
> >         }
> >
> > +       dev_dbg(dev, "set downstream sink into normal\n");
> > +       /* Downstream sink enter into normal mode */
> > +       data = 1;
> > +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
> > +       if (ret < 0)
> > +               dev_err(dev, "IO error : set sink into normal mode fail\n");
> > +
> 
> The driver uses DRM_DEV_* for logs. Can we use this?
Hi Hsin-Yi, as comment in drm/drm_print.h:
"NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
later.

Thanks,
Xin
> 
> >         /* Disable HDCP */
> >         anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
> >
> > --
> > 2.25.1
> >
Pin-yen Lin March 22, 2022, 8:52 a.m. UTC | #3
The DRM_DEV_* macros have been deprecated:
https://www.kernel.org/doc/html/latest/gpu/drm-internals.html#c.DRM_DEV_DEBUG_DRIVER

On Tue, Mar 22, 2022 at 4:43 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> On Tue, Mar 22, 2022 at 4:02 PM Xin Ji <xji@analogixsemi.com> wrote:
> >
> > As downstream sink was set into standby mode while bridge disabled,
> > this patch used for setting downstream sink into normal status
> > while enable bridge.
> >
> > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > Reviewed-by: Pin-Yen Lin <treapking@chromium.org>
> >
> > ---
> > V1 -> V2: use dev_dbg replace of dev_info
> > ---
> >  drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 9a2a19ad4202..dcf3275a00fe 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -924,12 +924,20 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
> >  {
> >         int ret;
> >         struct device *dev = &ctx->client->dev;
> > +       u8 data;
> >
> >         if (!ctx->display_timing_valid) {
> >                 DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
> >                 return;
> >         }
> >
> > +       dev_dbg(dev, "set downstream sink into normal\n");
> > +       /* Downstream sink enter into normal mode */
> > +       data = 1;
> > +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
> > +       if (ret < 0)
> > +               dev_err(dev, "IO error : set sink into normal mode fail\n");
> > +
>
> The driver uses DRM_DEV_* for logs. Can we use this?
>
> >         /* Disable HDCP */
> >         anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
> >
> > --
> > 2.25.1
> >
Chen-Yu Tsai March 22, 2022, 9:16 a.m. UTC | #4
On Tue, Mar 22, 2022 at 4:52 PM Xin Ji <xji@analogixsemi.com> wrote:
>
> On Tue, Mar 22, 2022 at 04:43:20PM +0800, Hsin-Yi Wang wrote:
> > On Tue, Mar 22, 2022 at 4:02 PM Xin Ji <xji@analogixsemi.com> wrote:
> > >
> > > As downstream sink was set into standby mode while bridge disabled,
> > > this patch used for setting downstream sink into normal status
> > > while enable bridge.
> > >
> > > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > > Reviewed-by: Pin-Yen Lin <treapking@chromium.org>
> > >
> > > ---
> > > V1 -> V2: use dev_dbg replace of dev_info
> > > ---
> > >  drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > index 9a2a19ad4202..dcf3275a00fe 100644
> > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > @@ -924,12 +924,20 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
> > >  {
> > >         int ret;
> > >         struct device *dev = &ctx->client->dev;
> > > +       u8 data;
> > >
> > >         if (!ctx->display_timing_valid) {
> > >                 DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
> > >                 return;
> > >         }
> > >
> > > +       dev_dbg(dev, "set downstream sink into normal\n");
> > > +       /* Downstream sink enter into normal mode */
> > > +       data = 1;
> > > +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
> > > +       if (ret < 0)
> > > +               dev_err(dev, "IO error : set sink into normal mode fail\n");
> > > +
> >
> > The driver uses DRM_DEV_* for logs. Can we use this?
> Hi Hsin-Yi, as comment in drm/drm_print.h:
> "NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
> use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
> later.

drm_dbg is better than dev_dbg though. With the former, you still get the
option to control it with the drm.debug module parameter, unlike the latter
which normally gets compiled out.

Please use drm_dbg*.

ChenYu

> Thanks,
> Xin
> >
> > >         /* Disable HDCP */
> > >         anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
> > >
> > > --
> > > 2.25.1
> > >
Xin Ji March 22, 2022, 10:13 a.m. UTC | #5
On Tue, Mar 22, 2022 at 05:16:43PM +0800, Chen-Yu Tsai wrote:
> On Tue, Mar 22, 2022 at 4:52 PM Xin Ji <xji@analogixsemi.com> wrote:
> >
> > On Tue, Mar 22, 2022 at 04:43:20PM +0800, Hsin-Yi Wang wrote:
> > > On Tue, Mar 22, 2022 at 4:02 PM Xin Ji <xji@analogixsemi.com> wrote:
> > > >
> > > > As downstream sink was set into standby mode while bridge disabled,
> > > > this patch used for setting downstream sink into normal status
> > > > while enable bridge.
> > > >
> > > > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > > > Reviewed-by: Pin-Yen Lin <treapking@chromium.org>
> > > >
> > > > ---
> > > > V1 -> V2: use dev_dbg replace of dev_info
> > > > ---
> > > >  drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
> > > >  1 file changed, 8 insertions(+)
> > > >
> > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > > index 9a2a19ad4202..dcf3275a00fe 100644
> > > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > > > @@ -924,12 +924,20 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
> > > >  {
> > > >         int ret;
> > > >         struct device *dev = &ctx->client->dev;
> > > > +       u8 data;
> > > >
> > > >         if (!ctx->display_timing_valid) {
> > > >                 DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
> > > >                 return;
> > > >         }
> > > >
> > > > +       dev_dbg(dev, "set downstream sink into normal\n");
> > > > +       /* Downstream sink enter into normal mode */
> > > > +       data = 1;
> > > > +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
> > > > +       if (ret < 0)
> > > > +               dev_err(dev, "IO error : set sink into normal mode fail\n");
> > > > +
> > >
> > > The driver uses DRM_DEV_* for logs. Can we use this?
> > Hi Hsin-Yi, as comment in drm/drm_print.h:
> > "NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
> > use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
> > later.
> 
> drm_dbg is better than dev_dbg though. With the former, you still get the
> option to control it with the drm.debug module parameter, unlike the latter
> which normally gets compiled out.
> 
> Please use drm_dbg*.
> 
> ChenYu

Hi ChenYu, the parameter of drm_dbg is "drm", if use drm_dbg, it will
change more code, I'll consider to upstream new patch to replace all of
them later.

Thanks,
Xin
> 
> > Thanks,
> > Xin
> > >
> > > >         /* Disable HDCP */
> > > >         anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
> > > >
> > > > --
> > > > 2.25.1
> > > >
Robert Foss March 24, 2022, 12:07 p.m. UTC | #6
> > > > The driver uses DRM_DEV_* for logs. Can we use this?
> > > Hi Hsin-Yi, as comment in drm/drm_print.h:
> > > "NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
> > > use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
> > > later.
> >
> > drm_dbg is better than dev_dbg though. With the former, you still get the
> > option to control it with the drm.debug module parameter, unlike the latter
> > which normally gets compiled out.
> >
> > Please use drm_dbg*.
> >
> > ChenYu
>
> Hi ChenYu, the parameter of drm_dbg is "drm", if use drm_dbg, it will
> change more code, I'll consider to upstream new patch to replace all of
> them later.
>

Alright, since the driver already uses these logging functions, let's
apply this patch and fix the logging function this driver uses in a
separate series.

Xin: Can you submit a patch/series that converts this driver to use
drm_dbg* functions instead?
Xin Ji March 25, 2022, 6:29 a.m. UTC | #7
On Thu, Mar 24, 2022 at 01:07:56PM +0100, Robert Foss wrote:
> > > > > The driver uses DRM_DEV_* for logs. Can we use this?
> > > > Hi Hsin-Yi, as comment in drm/drm_print.h:
> > > > "NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
> > > > use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
> > > > later.
> > >
> > > drm_dbg is better than dev_dbg though. With the former, you still get the
> > > option to control it with the drm.debug module parameter, unlike the latter
> > > which normally gets compiled out.
> > >
> > > Please use drm_dbg*.
> > >
> > > ChenYu
> >
> > Hi ChenYu, the parameter of drm_dbg is "drm", if use drm_dbg, it will
> > change more code, I'll consider to upstream new patch to replace all of
> > them later.
> >
> 
> Alright, since the driver already uses these logging functions, let's
> apply this patch and fix the logging function this driver uses in a
> separate series.
> 
> Xin: Can you submit a patch/series that converts this driver to use
> drm_dbg* functions instead?
Hi Robert Foss, OK, I'll submit patch after this patch get merged.
Thanks,
Xin
Robert Foss March 28, 2022, 1:21 p.m. UTC | #8
On Fri, 25 Mar 2022 at 07:29, Xin Ji <xji@analogixsemi.com> wrote:
>
> On Thu, Mar 24, 2022 at 01:07:56PM +0100, Robert Foss wrote:
> > > > > > The driver uses DRM_DEV_* for logs. Can we use this?
> > > > > Hi Hsin-Yi, as comment in drm/drm_print.h:
> > > > > "NOTE: this is deprecated in favor of drm_dbg". DRM bridge driver not
> > > > > use DRM_DEV_* any more. I'll send a patch to replace all of DRM_DEV_*
> > > > > later.
> > > >
> > > > drm_dbg is better than dev_dbg though. With the former, you still get the
> > > > option to control it with the drm.debug module parameter, unlike the latter
> > > > which normally gets compiled out.
> > > >
> > > > Please use drm_dbg*.
> > > >
> > > > ChenYu
> > >
> > > Hi ChenYu, the parameter of drm_dbg is "drm", if use drm_dbg, it will
> > > change more code, I'll consider to upstream new patch to replace all of
> > > them later.
> > >
> >
> > Alright, since the driver already uses these logging functions, let's
> > apply this patch and fix the logging function this driver uses in a
> > separate series.
> >
> > Xin: Can you submit a patch/series that converts this driver to use
> > drm_dbg* functions instead?
> Hi Robert Foss, OK, I'll submit patch after this patch get merged.
> Thanks,

Applied to drm-misc-next.

Rob.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 9a2a19ad4202..dcf3275a00fe 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -924,12 +924,20 @@  static void anx7625_dp_start(struct anx7625_data *ctx)
 {
 	int ret;
 	struct device *dev = &ctx->client->dev;
+	u8 data;
 
 	if (!ctx->display_timing_valid) {
 		DRM_DEV_ERROR(dev, "mipi not set display timing yet.\n");
 		return;
 	}
 
+	dev_dbg(dev, "set downstream sink into normal\n");
+	/* Downstream sink enter into normal mode */
+	data = 1;
+	ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
+	if (ret < 0)
+		dev_err(dev, "IO error : set sink into normal mode fail\n");
+
 	/* Disable HDCP */
 	anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);