linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Refactor MediaTek DP drivers
@ 2022-09-16 13:38 Bo-Chen Chen
  2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bo-Chen Chen @ 2022-09-16 13:38 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi,
	angelogioacchino.delregno, ck.hu, liangxu.xu, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group, Bo-Chen Chen

For this series, we do some clean-up and fix a build warning.
This series is based on linux-next-20220915.

Changes for v2:
1. Update commit message in "drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()".
2. Add fix tag for "drm/mediatek: dp: Fix warning in mtk_dp_video_mute()".

Bo-Chen Chen (3):
  drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
  drm/mediatek: dp: Remove unused register definitions
  drm/mediatek: dp: Fix warning in mtk_dp_video_mute()

 drivers/gpu/drm/mediatek/mtk_dp.c     | 70 ++++++++++++++-------------
 drivers/gpu/drm/mediatek/mtk_dp_reg.h |  6 ---
 2 files changed, 36 insertions(+), 40 deletions(-)

-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
  2022-09-16 13:38 [PATCH v2 0/3] Refactor MediaTek DP drivers Bo-Chen Chen
@ 2022-09-16 13:38 ` Bo-Chen Chen
  2022-09-18  3:13   ` Chun-Kuang Hu
  2022-09-19  8:04   ` AngeloGioacchino Del Regno
  2022-09-16 13:38 ` [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions Bo-Chen Chen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Bo-Chen Chen @ 2022-09-16 13:38 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi,
	angelogioacchino.delregno, ck.hu, liangxu.xu, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group, Bo-Chen Chen

In order to improve human readability, reduce the indentation by
returning early if the dp/edp cable is not plugged in.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_dp.c | 66 ++++++++++++++++---------------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index dfa942ca62da..c72c646e25e9 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1933,39 +1933,41 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
 	bool enabled = mtk_dp->enabled;
 	u8 sink_count = 0;
 
-	if (mtk_dp->train_info.cable_plugged_in) {
-		if (!enabled) {
-			/* power on aux */
-			mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
-					   DP_PWR_STATE_BANDGAP_TPLL_LANE,
-					   DP_PWR_STATE_MASK);
-
-			/* power on panel */
-			drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
-			usleep_range(2000, 5000);
-		}
-		/*
-		 * Some dongles still source HPD when they do not connect to any
-		 * sink device. To avoid this, we need to read the sink count
-		 * to make sure we do connect to sink devices. After this detect
-		 * function, we just need to check the HPD connection to check
-		 * whether we connect to a sink device.
-		 */
-		drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
-		if (DP_GET_SINK_COUNT(sink_count))
-			ret = connector_status_connected;
-
-		if (!enabled) {
-			/* power off panel */
-			drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D3);
-			usleep_range(2000, 3000);
-
-			/* power off aux */
-			mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
-					   DP_PWR_STATE_BANDGAP_TPLL,
-					   DP_PWR_STATE_MASK);
-		}
+	if (!mtk_dp->train_info.cable_plugged_in)
+		return ret;
+
+	if (!enabled) {
+		/* power on aux */
+		mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
+				   DP_PWR_STATE_BANDGAP_TPLL_LANE,
+				   DP_PWR_STATE_MASK);
+
+		/* power on panel */
+		drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
+		usleep_range(2000, 5000);
 	}
+	/*
+	 * Some dongles still source HPD when they do not connect to any
+	 * sink device. To avoid this, we need to read the sink count
+	 * to make sure we do connect to sink devices. After this detect
+	 * function, we just need to check the HPD connection to check
+	 * whether we connect to a sink device.
+	 */
+	drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
+	if (DP_GET_SINK_COUNT(sink_count))
+		ret = connector_status_connected;
+
+	if (!enabled) {
+		/* power off panel */
+		drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D3);
+		usleep_range(2000, 3000);
+
+		/* power off aux */
+		mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
+				   DP_PWR_STATE_BANDGAP_TPLL,
+				   DP_PWR_STATE_MASK);
+	}
+
 	return ret;
 }
 
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions
  2022-09-16 13:38 [PATCH v2 0/3] Refactor MediaTek DP drivers Bo-Chen Chen
  2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
@ 2022-09-16 13:38 ` Bo-Chen Chen
  2022-09-18  3:14   ` Chun-Kuang Hu
  2022-09-16 13:38 ` [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute() Bo-Chen Chen
  2022-09-18  3:17 ` [PATCH v2 0/3] Refactor MediaTek DP drivers Chun-Kuang Hu
  3 siblings, 1 reply; 11+ messages in thread
From: Bo-Chen Chen @ 2022-09-16 13:38 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi,
	angelogioacchino.delregno, ck.hu, liangxu.xu, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group, Bo-Chen Chen

Some definitions in mtk_dp_reg.h are not used, so remove these
redundant codes.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/gpu/drm/mediatek/mtk_dp_reg.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp_reg.h b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
index 096ad6572a5e..84e38cef03c2 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp_reg.h
+++ b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
@@ -153,8 +153,6 @@
 #define CH_STATUS_1_DP_ENC0_P0_MASK			GENMASK(15, 0)
 #define MTK_DP_ENC0_P0_3094			0x3094
 #define CH_STATUS_2_DP_ENC0_P0_MASK			GENMASK(7, 0)
-#define MTK_DP_ENC0_P0_30A0			0x30a0
-#define DP_ENC0_30A0_MASK				(BIT(7) | BIT(8) | BIT(12))
 #define MTK_DP_ENC0_P0_30A4			0x30a4
 #define AU_TS_CFG_DP_ENC0_P0_MASK			GENMASK(7, 0)
 #define MTK_DP_ENC0_P0_30A8			0x30a8
@@ -171,8 +169,6 @@
 #define MTK_DP_ENC0_P0_312C			0x312c
 #define ASP_HB2_DP_ENC0_P0_MASK				GENMASK(7, 0)
 #define ASP_HB3_DP_ENC0_P0_MASK				GENMASK(15, 8)
-#define MTK_DP_ENC0_P0_3130			0x3130
-#define MTK_DP_ENC0_P0_3138			0x3138
 #define MTK_DP_ENC0_P0_3154			0x3154
 #define PGEN_HTOTAL_DP_ENC0_P0_MASK			GENMASK(13, 0)
 #define MTK_DP_ENC0_P0_3158			0x3158
@@ -206,8 +202,6 @@
 #define SDP_PACKET_TYPE_DP_ENC1_P0_MASK			GENMASK(4, 0)
 #define SDP_PACKET_W_DP_ENC1_P0				BIT(5)
 #define SDP_PACKET_W_DP_ENC1_P0_MASK			BIT(5)
-#define MTK_DP_ENC1_P0_328C			0x328c
-#define VSC_DATA_RDY_VESA_DP_ENC1_P0_MASK		BIT(7)
 #define MTK_DP_ENC1_P0_3300			0x3300
 #define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_VAL		2
 #define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_MASK		GENMASK(9, 8)
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute()
  2022-09-16 13:38 [PATCH v2 0/3] Refactor MediaTek DP drivers Bo-Chen Chen
  2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
  2022-09-16 13:38 ` [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions Bo-Chen Chen
@ 2022-09-16 13:38 ` Bo-Chen Chen
  2022-09-18  3:13   ` Chun-Kuang Hu
  2022-09-19  8:05   ` AngeloGioacchino Del Regno
  2022-09-18  3:17 ` [PATCH v2 0/3] Refactor MediaTek DP drivers Chun-Kuang Hu
  3 siblings, 2 replies; 11+ messages in thread
From: Bo-Chen Chen @ 2022-09-16 13:38 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi,
	angelogioacchino.delregno, ck.hu, liangxu.xu, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group, Bo-Chen Chen

Warning:
../drivers/gpu/drm/mediatek/mtk_dp.c: In function ‘mtk_dp_video_mute’:
../drivers/gpu/drm/mediatek/mtk_dp.c:947:23: warning: format ‘%x’
expects argument of type ‘unsigned int’, but argument 4 has type ‘long
unsigned int’ [-Wformat=]
  947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/linux/dev_printk.h:129:27: note: in definition of macro ‘dev_printk’
  129 |   _dev_printk(level, dev, fmt, ##__VA_ARGS__);  \
      |                           ^~~
../include/linux/dev_printk.h:163:31: note: in expansion of macro ‘dev_fmt’
  163 |   dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
      |                               ^~~~~~~
../drivers/gpu/drm/mediatek/mtk_dp.c:947:2: note: in expansion of
macro ‘dev_dbg’
  947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
      |  ^~~~~~~
../drivers/gpu/drm/mediatek/mtk_dp.c:947:36: note: format string is defined here
  947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
      |                                   ~^
      |                                    |
      |                                    unsigned int
      |                                   %lx

To fix this issue, we use %s to replace 0x%x.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Reported-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/gpu/drm/mediatek/mtk_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index c72c646e25e9..d58e98b2f83a 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1222,8 +1222,8 @@ static void mtk_dp_video_mute(struct mtk_dp *mtk_dp, bool enable)
 		      mtk_dp->data->smc_cmd, enable,
 		      0, 0, 0, 0, 0, &res);
 
-	dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
-		mtk_dp->data->smc_cmd, enable, res.a0, res.a1);
+	dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: %s, ret: 0x%lx-0x%lx\n",
+		mtk_dp->data->smc_cmd, enable ? "enable" : "disable", res.a0, res.a1);
 }
 
 static void mtk_dp_audio_mute(struct mtk_dp *mtk_dp, bool mute)
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
  2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
@ 2022-09-18  3:13   ` Chun-Kuang Hu
  2022-09-19  8:04   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 11+ messages in thread
From: Chun-Kuang Hu @ 2022-09-18  3:13 UTC (permalink / raw)
  To: Bo-Chen Chen
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Matthias Brugger,
	Guillaume Ranquet, Daniel Vetter, Jitao Shi,
	AngeloGioacchino Del Regno, CK Hu, liangxu.xu, DRI Development,
	moderated list:ARM/Mediatek SoC support, linux-kernel, Linux ARM,
	Project_Global_Chrome_Upstream_Group

Bo-Chen Chen <rex-bc.chen@mediatek.com> 於 2022年9月16日 週五 晚上9:38寫道:
>
> In order to improve human readability, reduce the indentation by
> returning early if the dp/edp cable is not plugged in.

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 66 ++++++++++++++++---------------
>  1 file changed, 34 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index dfa942ca62da..c72c646e25e9 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -1933,39 +1933,41 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
>         bool enabled = mtk_dp->enabled;
>         u8 sink_count = 0;
>
> -       if (mtk_dp->train_info.cable_plugged_in) {
> -               if (!enabled) {
> -                       /* power on aux */
> -                       mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
> -                                          DP_PWR_STATE_BANDGAP_TPLL_LANE,
> -                                          DP_PWR_STATE_MASK);
> -
> -                       /* power on panel */
> -                       drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
> -                       usleep_range(2000, 5000);
> -               }
> -               /*
> -                * Some dongles still source HPD when they do not connect to any
> -                * sink device. To avoid this, we need to read the sink count
> -                * to make sure we do connect to sink devices. After this detect
> -                * function, we just need to check the HPD connection to check
> -                * whether we connect to a sink device.
> -                */
> -               drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> -               if (DP_GET_SINK_COUNT(sink_count))
> -                       ret = connector_status_connected;
> -
> -               if (!enabled) {
> -                       /* power off panel */
> -                       drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D3);
> -                       usleep_range(2000, 3000);
> -
> -                       /* power off aux */
> -                       mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
> -                                          DP_PWR_STATE_BANDGAP_TPLL,
> -                                          DP_PWR_STATE_MASK);
> -               }
> +       if (!mtk_dp->train_info.cable_plugged_in)
> +               return ret;
> +
> +       if (!enabled) {
> +               /* power on aux */
> +               mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
> +                                  DP_PWR_STATE_BANDGAP_TPLL_LANE,
> +                                  DP_PWR_STATE_MASK);
> +
> +               /* power on panel */
> +               drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
> +               usleep_range(2000, 5000);
>         }
> +       /*
> +        * Some dongles still source HPD when they do not connect to any
> +        * sink device. To avoid this, we need to read the sink count
> +        * to make sure we do connect to sink devices. After this detect
> +        * function, we just need to check the HPD connection to check
> +        * whether we connect to a sink device.
> +        */
> +       drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> +       if (DP_GET_SINK_COUNT(sink_count))
> +               ret = connector_status_connected;
> +
> +       if (!enabled) {
> +               /* power off panel */
> +               drm_dp_dpcd_writeb(&mtk_dp->aux, DP_SET_POWER, DP_SET_POWER_D3);
> +               usleep_range(2000, 3000);
> +
> +               /* power off aux */
> +               mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE,
> +                                  DP_PWR_STATE_BANDGAP_TPLL,
> +                                  DP_PWR_STATE_MASK);
> +       }
> +
>         return ret;
>  }
>
> --
> 2.18.0
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute()
  2022-09-16 13:38 ` [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute() Bo-Chen Chen
@ 2022-09-18  3:13   ` Chun-Kuang Hu
  2022-09-19  8:05   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 11+ messages in thread
From: Chun-Kuang Hu @ 2022-09-18  3:13 UTC (permalink / raw)
  To: Bo-Chen Chen
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Matthias Brugger,
	Guillaume Ranquet, Daniel Vetter, Jitao Shi,
	AngeloGioacchino Del Regno, CK Hu, liangxu.xu, DRI Development,
	moderated list:ARM/Mediatek SoC support, linux-kernel, Linux ARM,
	Project_Global_Chrome_Upstream_Group

Hi, Bo-Chen:

Bo-Chen Chen <rex-bc.chen@mediatek.com> 於 2022年9月16日 週五 晚上9:38寫道:
>
> Warning:
> ../drivers/gpu/drm/mediatek/mtk_dp.c: In function ‘mtk_dp_video_mute’:
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:23: warning: format ‘%x’
> expects argument of type ‘unsigned int’, but argument 4 has type ‘long
> unsigned int’ [-Wformat=]
>   947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>       |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../include/linux/dev_printk.h:129:27: note: in definition of macro ‘dev_printk’
>   129 |   _dev_printk(level, dev, fmt, ##__VA_ARGS__);  \
>       |                           ^~~
> ../include/linux/dev_printk.h:163:31: note: in expansion of macro ‘dev_fmt’
>   163 |   dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
>       |                               ^~~~~~~
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:2: note: in expansion of
> macro ‘dev_dbg’
>   947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>       |  ^~~~~~~
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:36: note: format string is defined here
>   947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>       |                                   ~^
>       |                                    |
>       |                                    unsigned int
>       |                                   %lx
>
> To fix this issue, we use %s to replace 0x%x.

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
> Reported-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index c72c646e25e9..d58e98b2f83a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -1222,8 +1222,8 @@ static void mtk_dp_video_mute(struct mtk_dp *mtk_dp, bool enable)
>                       mtk_dp->data->smc_cmd, enable,
>                       0, 0, 0, 0, 0, &res);
>
> -       dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
> -               mtk_dp->data->smc_cmd, enable, res.a0, res.a1);
> +       dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: %s, ret: 0x%lx-0x%lx\n",
> +               mtk_dp->data->smc_cmd, enable ? "enable" : "disable", res.a0, res.a1);
>  }
>
>  static void mtk_dp_audio_mute(struct mtk_dp *mtk_dp, bool mute)
> --
> 2.18.0
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions
  2022-09-16 13:38 ` [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions Bo-Chen Chen
@ 2022-09-18  3:14   ` Chun-Kuang Hu
  0 siblings, 0 replies; 11+ messages in thread
From: Chun-Kuang Hu @ 2022-09-18  3:14 UTC (permalink / raw)
  To: Bo-Chen Chen
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Matthias Brugger,
	Guillaume Ranquet, Daniel Vetter, Jitao Shi,
	AngeloGioacchino Del Regno, CK Hu, liangxu.xu, DRI Development,
	moderated list:ARM/Mediatek SoC support, linux-kernel, Linux ARM,
	Project_Global_Chrome_Upstream_Group

Hi, Bo-Chen:

Bo-Chen Chen <rex-bc.chen@mediatek.com> 於 2022年9月16日 週五 晚上9:38寫道:
>
> Some definitions in mtk_dp_reg.h are not used, so remove these
> redundant codes.

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp_reg.h | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp_reg.h b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> index 096ad6572a5e..84e38cef03c2 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> +++ b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> @@ -153,8 +153,6 @@
>  #define CH_STATUS_1_DP_ENC0_P0_MASK                    GENMASK(15, 0)
>  #define MTK_DP_ENC0_P0_3094                    0x3094
>  #define CH_STATUS_2_DP_ENC0_P0_MASK                    GENMASK(7, 0)
> -#define MTK_DP_ENC0_P0_30A0                    0x30a0
> -#define DP_ENC0_30A0_MASK                              (BIT(7) | BIT(8) | BIT(12))
>  #define MTK_DP_ENC0_P0_30A4                    0x30a4
>  #define AU_TS_CFG_DP_ENC0_P0_MASK                      GENMASK(7, 0)
>  #define MTK_DP_ENC0_P0_30A8                    0x30a8
> @@ -171,8 +169,6 @@
>  #define MTK_DP_ENC0_P0_312C                    0x312c
>  #define ASP_HB2_DP_ENC0_P0_MASK                                GENMASK(7, 0)
>  #define ASP_HB3_DP_ENC0_P0_MASK                                GENMASK(15, 8)
> -#define MTK_DP_ENC0_P0_3130                    0x3130
> -#define MTK_DP_ENC0_P0_3138                    0x3138
>  #define MTK_DP_ENC0_P0_3154                    0x3154
>  #define PGEN_HTOTAL_DP_ENC0_P0_MASK                    GENMASK(13, 0)
>  #define MTK_DP_ENC0_P0_3158                    0x3158
> @@ -206,8 +202,6 @@
>  #define SDP_PACKET_TYPE_DP_ENC1_P0_MASK                        GENMASK(4, 0)
>  #define SDP_PACKET_W_DP_ENC1_P0                                BIT(5)
>  #define SDP_PACKET_W_DP_ENC1_P0_MASK                   BIT(5)
> -#define MTK_DP_ENC1_P0_328C                    0x328c
> -#define VSC_DATA_RDY_VESA_DP_ENC1_P0_MASK              BIT(7)
>  #define MTK_DP_ENC1_P0_3300                    0x3300
>  #define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_VAL             2
>  #define VIDEO_AFIFO_RDY_SEL_DP_ENC1_P0_MASK            GENMASK(9, 8)
> --
> 2.18.0
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 0/3] Refactor MediaTek DP drivers
  2022-09-16 13:38 [PATCH v2 0/3] Refactor MediaTek DP drivers Bo-Chen Chen
                   ` (2 preceding siblings ...)
  2022-09-16 13:38 ` [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute() Bo-Chen Chen
@ 2022-09-18  3:17 ` Chun-Kuang Hu
  2022-09-19  9:54   ` Dmitry Osipenko
  3 siblings, 1 reply; 11+ messages in thread
From: Chun-Kuang Hu @ 2022-09-18  3:17 UTC (permalink / raw)
  To: Bo-Chen Chen
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Matthias Brugger,
	Guillaume Ranquet, Daniel Vetter, Jitao Shi,
	AngeloGioacchino Del Regno, CK Hu, liangxu.xu, DRI Development,
	moderated list:ARM/Mediatek SoC support, linux-kernel, Linux ARM,
	Project_Global_Chrome_Upstream_Group, Dmitry Osipenko

Hi, Dmitry:

My tree has no mtk-dp driver yet. Would you like to pick this series?

Regards,
Chun-Kuang.

Bo-Chen Chen <rex-bc.chen@mediatek.com> 於 2022年9月16日 週五 晚上9:38寫道:
>
> For this series, we do some clean-up and fix a build warning.
> This series is based on linux-next-20220915.
>
> Changes for v2:
> 1. Update commit message in "drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()".
> 2. Add fix tag for "drm/mediatek: dp: Fix warning in mtk_dp_video_mute()".
>
> Bo-Chen Chen (3):
>   drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
>   drm/mediatek: dp: Remove unused register definitions
>   drm/mediatek: dp: Fix warning in mtk_dp_video_mute()
>
>  drivers/gpu/drm/mediatek/mtk_dp.c     | 70 ++++++++++++++-------------
>  drivers/gpu/drm/mediatek/mtk_dp_reg.h |  6 ---
>  2 files changed, 36 insertions(+), 40 deletions(-)
>
> --
> 2.18.0
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
  2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
  2022-09-18  3:13   ` Chun-Kuang Hu
@ 2022-09-19  8:04   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-19  8:04 UTC (permalink / raw)
  To: Bo-Chen Chen, chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi, ck.hu, liangxu.xu,
	dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

Il 16/09/22 15:38, Bo-Chen Chen ha scritto:
> In order to improve human readability, reduce the indentation by
> returning early if the dp/edp cable is not plugged in.
> 
> Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute()
  2022-09-16 13:38 ` [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute() Bo-Chen Chen
  2022-09-18  3:13   ` Chun-Kuang Hu
@ 2022-09-19  8:05   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-19  8:05 UTC (permalink / raw)
  To: Bo-Chen Chen, chunkuang.hu, p.zabel, airlied
  Cc: matthias.bgg, granquet, daniel, jitao.shi, ck.hu, liangxu.xu,
	dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

Il 16/09/22 15:38, Bo-Chen Chen ha scritto:
> Warning:
> ../drivers/gpu/drm/mediatek/mtk_dp.c: In function ‘mtk_dp_video_mute’:
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:23: warning: format ‘%x’
> expects argument of type ‘unsigned int’, but argument 4 has type ‘long
> unsigned int’ [-Wformat=]
>    947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>        |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../include/linux/dev_printk.h:129:27: note: in definition of macro ‘dev_printk’
>    129 |   _dev_printk(level, dev, fmt, ##__VA_ARGS__);  \
>        |                           ^~~
> ../include/linux/dev_printk.h:163:31: note: in expansion of macro ‘dev_fmt’
>    163 |   dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
>        |                               ^~~~~~~
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:2: note: in expansion of
> macro ‘dev_dbg’
>    947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>        |  ^~~~~~~
> ../drivers/gpu/drm/mediatek/mtk_dp.c:947:36: note: format string is defined here
>    947 |  dev_dbg(mtk_dp->dev, "smc cmd: 0x%x, p1: 0x%x, ret: 0x%lx-0x%lx\n",
>        |                                   ~^
>        |                                    |
>        |                                    unsigned int
>        |                                   %lx
> 
> To fix this issue, we use %s to replace 0x%x.
> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
> Reported-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 0/3] Refactor MediaTek DP drivers
  2022-09-18  3:17 ` [PATCH v2 0/3] Refactor MediaTek DP drivers Chun-Kuang Hu
@ 2022-09-19  9:54   ` Dmitry Osipenko
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Osipenko @ 2022-09-19  9:54 UTC (permalink / raw)
  To: Chun-Kuang Hu, Bo-Chen Chen
  Cc: Guillaume Ranquet, Jitao Shi, David Airlie, liangxu.xu,
	linux-kernel, DRI Development,
	Project_Global_Chrome_Upstream_Group, Dmitry Osipenko,
	moderated list:ARM/Mediatek SoC support, Matthias Brugger,
	Linux ARM, AngeloGioacchino Del Regno

Hello Chun-Kuang,

18.09.2022 06:17, Chun-Kuang Hu пишет:
> Hi, Dmitry:
> 
> My tree has no mtk-dp driver yet. Would you like to pick this series?
> 
> Regards,
> Chun-Kuang.
> 
> Bo-Chen Chen <rex-bc.chen@mediatek.com> 於 2022年9月16日 週五 晚上9:38寫道:
>>
>> For this series, we do some clean-up and fix a build warning.
>> This series is based on linux-next-20220915.
>>
>> Changes for v2:
>> 1. Update commit message in "drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()".
>> 2. Add fix tag for "drm/mediatek: dp: Fix warning in mtk_dp_video_mute()".

I changed commit message of the "Fix warning in mtk_dp_video_mute()"
patch to make it less noisy and applied all the patches to drm-misc-next.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-19  9:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 13:38 [PATCH v2 0/3] Refactor MediaTek DP drivers Bo-Chen Chen
2022-09-16 13:38 ` [PATCH v2 1/3] drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect() Bo-Chen Chen
2022-09-18  3:13   ` Chun-Kuang Hu
2022-09-19  8:04   ` AngeloGioacchino Del Regno
2022-09-16 13:38 ` [PATCH v2 2/3] drm/mediatek: dp: Remove unused register definitions Bo-Chen Chen
2022-09-18  3:14   ` Chun-Kuang Hu
2022-09-16 13:38 ` [PATCH v2 3/3] drm/mediatek: dp: Fix warning in mtk_dp_video_mute() Bo-Chen Chen
2022-09-18  3:13   ` Chun-Kuang Hu
2022-09-19  8:05   ` AngeloGioacchino Del Regno
2022-09-18  3:17 ` [PATCH v2 0/3] Refactor MediaTek DP drivers Chun-Kuang Hu
2022-09-19  9:54   ` Dmitry Osipenko

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).