Skip to contentSkip to conversation

drm/bridge: anx7625: Set downstream sink into normal status

PATCH Applied Xin Ji 5 participants 9 messages Mar 22, 2022 – Mar 28, 2022

Subsystems (3)
lore
Share & tools
lore

Xin Ji

author
#0 lore raw

PATCH v2 1/1 drm/bridge: anx7625: Set downstream sink into normal status

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +8 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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);
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 26 lines · Xin Ji

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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");

drivers/gpu/drm/bridge/analogix/anx7625.c static void anx7625_dp_start(struct anx7625_data *ctx) · line 940

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +7 -0
                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?

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -1
        /* Disable HDCP */
        anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
 
--

2.25.1

author
#2 lore raw
Quoted 30 lines · Hsin-Yi Wang
Quoted 29 lines · Xin Ji

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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;
        }
 
Quoted 9 lines

drivers/gpu/drm/bridge/analogix/anx7625.c static void anx7625_dp_start(struct anx7625_data *ctx) · line 940

Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +7 -0
+       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

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -1
        /* Disable HDCP */
        anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
 
--

2.25.1

#3 lore raw
Quoted 41 lines · Xin Ji
Quoted 30 lines · Hsin-Yi Wang
Quoted 29 lines · Xin Ji

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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;
        }
 
Quoted 9 lines

drivers/gpu/drm/bridge/analogix/anx7625.c static void anx7625_dp_start(struct anx7625_data *ctx) · line 940

Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +7 -0
+       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?

Quoted 4 lines

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

Quoted 9 lines

Thanks,
Xin

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -1
        /* Disable HDCP */
        anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
 
--

2.25.1

author
#4 lore raw
Quoted 47 lines · Chen-Yu Tsai
Quoted 41 lines · Xin Ji
Quoted 30 lines · Hsin-Yi Wang
Quoted 29 lines · Xin Ji

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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;
        }
 
Quoted 9 lines

drivers/gpu/drm/bridge/analogix/anx7625.c static void anx7625_dp_start(struct anx7625_data *ctx) · line 940

Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +7 -0
+       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?

Quoted 4 lines

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.

Quoted 7 lines

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

Quoted 10 lines
Quoted 10 lines

Thanks,
Xin

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -1
        /* Disable HDCP */
        anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
 
--

2.25.1

#5 lore raw
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Quoted 1 line

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.

Quoted 8 lines
Quoted 3 lines

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?

author
#6 lore raw
Quoted 19 lines · Robert Foss
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Quoted 1 line

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.

Quoted 8 lines
Quoted 3 lines

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.

Quoted 6 lines

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

Applied
#7 lore raw
Quoted 21 lines · Xin Ji
Quoted 19 lines · Robert Foss
Quoted 18 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

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.

Quoted 7 lines

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.

Quoted 8 lines
Quoted 6 lines

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.

#8 lore raw
In reply to Hsin-Yi Wang

The DRM_DEV_* macros have been deprecated:
https://www.kernel.org/doc/html/latest/gpu/drm-internals.html#c.DRM_DEV_DEBUG_DRIVER

Quoted 47 lines · Hsin-Yi Wang
Quoted 26 lines · Xin Ji

As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge.

---
V1 -> V2: use dev_dbg replace of dev_info

---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +1 -0
index 9a2a19ad4202..dcf3275a00fe 100644
@@ -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");

drivers/gpu/drm/bridge/analogix/anx7625.c static void anx7625_dp_start(struct anx7625_data *ctx) · line 940

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +7 -0
                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?

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/anx7625.c +0 -1
        /* Disable HDCP */
        anx7625_write_and(ctx, ctx->i2c.rx_p1_client, 0xee, 0x9f);
 
--

2.25.1