linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Standardize DSI driver logging system
@ 2021-02-22  9:22 Raphael GALLAIS-POU - foss
  2021-02-22  9:22 ` [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Raphael GALLAIS-POU - foss
  2021-02-22  9:23 ` [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Raphael GALLAIS-POU - foss
  0 siblings, 2 replies; 5+ messages in thread
From: Raphael GALLAIS-POU - foss @ 2021-02-22  9:22 UTC (permalink / raw)
  To: Yannick FERTRE, Philippe CORNU, Benjamin Gaignard,
	Vincent ABRIOU, Sam Ravnborg, Joe Perches
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre TORGUE,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Yannick FERTRE - foss, Philippe CORNU - foss,
	Raphael GALLAIS-POU - foss, Raphael GALLAIS-POU,
	Alexandre TORGUE - foss

The use of DRM logging macros was removed and dev_err_probe() replaces
condition, showing errors but not EPROBE_DEFER.

Yannick Fertre (2):
  drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER
  drm/stm: dsi: Use dev_ based logging

 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 58 +++++++++++++--------------
 1 file changed, 29 insertions(+), 29 deletions(-)

-- 
2.17.1

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

* [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER
  2021-02-22  9:22 [PATCH 0/2] Standardize DSI driver logging system Raphael GALLAIS-POU - foss
@ 2021-02-22  9:22 ` Raphael GALLAIS-POU - foss
  2021-03-08  9:10   ` yannick Fertre
  2021-02-22  9:23 ` [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Raphael GALLAIS-POU - foss
  1 sibling, 1 reply; 5+ messages in thread
From: Raphael GALLAIS-POU - foss @ 2021-02-22  9:22 UTC (permalink / raw)
  To: Yannick FERTRE, Philippe CORNU, Benjamin Gaignard,
	Vincent ABRIOU, Sam Ravnborg, Joe Perches
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre TORGUE,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Yannick FERTRE - foss, Philippe CORNU - foss,
	Raphael GALLAIS-POU - foss, Raphael GALLAIS-POU,
	Alexandre TORGUE - foss

From: Yannick Fertre <yannick.fertre@st.com>

Don't print error when probe deferred error is returned.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 2e1f2664495d..8399d337589d 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -363,8 +363,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 	dsi->vdd_supply = devm_regulator_get(dev, "phy-dsi");
 	if (IS_ERR(dsi->vdd_supply)) {
 		ret = PTR_ERR(dsi->vdd_supply);
-		if (ret != -EPROBE_DEFER)
-			DRM_ERROR("Failed to request regulator: %d\n", ret);
+		dev_err_probe(dev, ret, "Failed to request regulator\n");
 		return ret;
 	}
 
@@ -377,9 +376,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 	dsi->pllref_clk = devm_clk_get(dev, "ref");
 	if (IS_ERR(dsi->pllref_clk)) {
 		ret = PTR_ERR(dsi->pllref_clk);
-		if (ret != -EPROBE_DEFER)
-			DRM_ERROR("Unable to get pll reference clock: %d\n",
-				  ret);
+		dev_err_probe(dev, ret, "Unable to get pll reference clock\n");
 		goto err_clk_get;
 	}
 
@@ -419,7 +416,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 	dsi->dsi = dw_mipi_dsi_probe(pdev, &dw_mipi_dsi_stm_plat_data);
 	if (IS_ERR(dsi->dsi)) {
 		ret = PTR_ERR(dsi->dsi);
-		DRM_ERROR("Failed to initialize mipi dsi host: %d\n", ret);
+		dev_err_probe(dev, ret, "Failed to initialize mipi dsi host\n");
 		goto err_dsi_probe;
 	}
 
-- 
2.17.1

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

* [PATCH 2/2] drm/stm: dsi: Use dev_ based logging
  2021-02-22  9:22 [PATCH 0/2] Standardize DSI driver logging system Raphael GALLAIS-POU - foss
  2021-02-22  9:22 ` [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Raphael GALLAIS-POU - foss
@ 2021-02-22  9:23 ` Raphael GALLAIS-POU - foss
  2021-03-08  9:10   ` yannick Fertre
  1 sibling, 1 reply; 5+ messages in thread
From: Raphael GALLAIS-POU - foss @ 2021-02-22  9:23 UTC (permalink / raw)
  To: Yannick FERTRE, Philippe CORNU, Benjamin Gaignard,
	Vincent ABRIOU, Sam Ravnborg, Joe Perches
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre TORGUE,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Yannick FERTRE - foss, Philippe CORNU - foss,
	Raphael GALLAIS-POU - foss, Raphael GALLAIS-POU,
	Alexandre TORGUE - foss

From: Yannick Fertre <yannick.fertre@st.com>

Standardize on the dev_ based logging.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 49 ++++++++++++++-------------
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 8399d337589d..a7226bb3d0e8 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -76,6 +76,7 @@ enum dsi_color {
 
 struct dw_mipi_dsi_stm {
 	void __iomem *base;
+	struct device *dev;
 	struct clk *pllref_clk;
 	struct dw_mipi_dsi *dsi;
 	u32 hw_version;
@@ -110,7 +111,8 @@ static inline void dsi_update_bits(struct dw_mipi_dsi_stm *dsi, u32 reg,
 	dsi_write(dsi, reg, (dsi_read(dsi, reg) & ~mask) | val);
 }
 
-static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt)
+static enum dsi_color dsi_color_from_mipi(struct dw_mipi_dsi_stm *dsi,
+					  enum mipi_dsi_pixel_format fmt)
 {
 	switch (fmt) {
 	case MIPI_DSI_FMT_RGB888:
@@ -122,7 +124,7 @@ static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt)
 	case MIPI_DSI_FMT_RGB565:
 		return DSI_RGB565_CONF1;
 	default:
-		DRM_DEBUG_DRIVER("MIPI color invalid, so we use rgb888\n");
+		dev_dbg(dsi->dev, "MIPI color invalid, so we use rgb888\n");
 	}
 	return DSI_RGB888;
 }
@@ -205,14 +207,14 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
 	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS,
 				 SLEEP_US, TIMEOUT_US);
 	if (ret)
-		DRM_DEBUG_DRIVER("!TIMEOUT! waiting REGU, let's continue\n");
+		dev_dbg(dsi->dev, "!TIMEOUT! waiting REGU, let's continue\n");
 
 	/* Enable the DSI PLL & wait for its lock */
 	dsi_set(dsi, DSI_WRPCR, WRPCR_PLLEN);
 	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_PLLLS,
 				 SLEEP_US, TIMEOUT_US);
 	if (ret)
-		DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");
+		dev_dbg(dsi->dev, "!TIMEOUT! waiting PLL, let's continue\n");
 
 	return 0;
 }
@@ -221,7 +223,7 @@ static void dw_mipi_dsi_phy_power_on(void *priv_data)
 {
 	struct dw_mipi_dsi_stm *dsi = priv_data;
 
-	DRM_DEBUG_DRIVER("\n");
+	dev_dbg(dsi->dev, "\n");
 
 	/* Enable the DSI wrapper */
 	dsi_set(dsi, DSI_WCR, WCR_DSIEN);
@@ -231,7 +233,7 @@ static void dw_mipi_dsi_phy_power_off(void *priv_data)
 {
 	struct dw_mipi_dsi_stm *dsi = priv_data;
 
-	DRM_DEBUG_DRIVER("\n");
+	dev_dbg(dsi->dev, "\n");
 
 	/* Disable the DSI wrapper */
 	dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
@@ -267,11 +269,11 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
 
 	if (pll_out_khz > dsi->lane_max_kbps) {
 		pll_out_khz = dsi->lane_max_kbps;
-		DRM_WARN("Warning max phy mbps is used\n");
+		dev_warn(dsi->dev, "Warning max phy mbps is used\n");
 	}
 	if (pll_out_khz < dsi->lane_min_kbps) {
 		pll_out_khz = dsi->lane_min_kbps;
-		DRM_WARN("Warning min phy mbps is used\n");
+		dev_warn(dsi->dev, "Warning min phy mbps is used\n");
 	}
 
 	/* Compute best pll parameters */
@@ -281,7 +283,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
 	ret = dsi_pll_get_params(dsi, pll_in_khz, pll_out_khz,
 				 &idf, &ndiv, &odf);
 	if (ret)
-		DRM_WARN("Warning dsi_pll_get_params(): bad params\n");
+		dev_warn(dsi->dev, "Warning dsi_pll_get_params(): bad params\n");
 
 	/* Get the adjusted pll out value */
 	pll_out_khz = dsi_pll_get_clkout_khz(pll_in_khz, idf, ndiv, odf);
@@ -299,13 +301,12 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
 
 	/* Select the color coding */
 	dsi_update_bits(dsi, DSI_WCFGR, WCFGR_COLMUX,
-			dsi_color_from_mipi(format) << 1);
+			dsi_color_from_mipi(dsi, format) << 1);
 
 	*lane_mbps = pll_out_khz / 1000;
 
-	DRM_DEBUG_DRIVER("pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
-			 pll_in_khz, pll_out_khz, *lane_mbps);
-
+	dev_dbg(dsi->dev, "pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
+			pll_in_khz, pll_out_khz, *lane_mbps);
 	return 0;
 }
 
@@ -352,11 +353,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 	if (!dsi)
 		return -ENOMEM;
 
+	dsi->dev = dev;
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dsi->base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(dsi->base)) {
 		ret = PTR_ERR(dsi->base);
-		DRM_ERROR("Unable to get dsi registers %d\n", ret);
+		dev_err(dev, "Unable to get dsi registers %d\n", ret);
 		return ret;
 	}
 
@@ -369,7 +372,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 
 	ret = regulator_enable(dsi->vdd_supply);
 	if (ret) {
-		DRM_ERROR("Failed to enable regulator: %d\n", ret);
+		dev_err(dev, "Failed to enable regulator: %d\n", ret);
 		return ret;
 	}
 
@@ -382,20 +385,20 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 
 	ret = clk_prepare_enable(dsi->pllref_clk);
 	if (ret) {
-		DRM_ERROR("Failed to enable pllref_clk: %d\n", ret);
+		dev_err(dev, "Failed to enable pllref_clk: %d\n", ret);
 		goto err_clk_get;
 	}
 
 	pclk = devm_clk_get(dev, "pclk");
 	if (IS_ERR(pclk)) {
 		ret = PTR_ERR(pclk);
-		DRM_ERROR("Unable to get peripheral clock: %d\n", ret);
+		dev_err(dev, "Unable to get peripheral clock: %d\n", ret);
 		goto err_dsi_probe;
 	}
 
 	ret = clk_prepare_enable(pclk);
 	if (ret) {
-		DRM_ERROR("%s: Failed to enable peripheral clk\n", __func__);
+		dev_err(dev, "%s: Failed to enable peripheral clk\n", __func__);
 		goto err_dsi_probe;
 	}
 
@@ -404,7 +407,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 
 	if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) {
 		ret = -ENODEV;
-		DRM_ERROR("bad dsi hardware version\n");
+		dev_err(dev, "bad dsi hardware version\n");
 		goto err_dsi_probe;
 	}
 
@@ -445,7 +448,7 @@ static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
 {
 	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
 
-	DRM_DEBUG_DRIVER("\n");
+	dev_dbg(dsi->dev, "\n");
 
 	clk_disable_unprepare(dsi->pllref_clk);
 	regulator_disable(dsi->vdd_supply);
@@ -458,18 +461,18 @@ static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev)
 	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
 	int ret;
 
-	DRM_DEBUG_DRIVER("\n");
+	dev_dbg(dsi->dev, "\n");
 
 	ret = regulator_enable(dsi->vdd_supply);
 	if (ret) {
-		DRM_ERROR("Failed to enable regulator: %d\n", ret);
+		dev_err(dev, "Failed to enable regulator: %d\n", ret);
 		return ret;
 	}
 
 	ret = clk_prepare_enable(dsi->pllref_clk);
 	if (ret) {
 		regulator_disable(dsi->vdd_supply);
-		DRM_ERROR("Failed to enable pllref_clk: %d\n", ret);
+		dev_err(dev, "Failed to enable pllref_clk: %d\n", ret);
 		return ret;
 	}
 
-- 
2.17.1

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

* Re: [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER
  2021-02-22  9:22 ` [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Raphael GALLAIS-POU - foss
@ 2021-03-08  9:10   ` yannick Fertre
  0 siblings, 0 replies; 5+ messages in thread
From: yannick Fertre @ 2021-03-08  9:10 UTC (permalink / raw)
  To: Raphael GALLAIS-POU - foss, Yannick FERTRE, Philippe CORNU,
	Benjamin Gaignard, Vincent ABRIOU, Sam Ravnborg, Joe Perches
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre TORGUE,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Philippe CORNU - foss, Raphael GALLAIS-POU,
	Alexandre TORGUE - foss

Tested-by: Yannick Fertre <yannick.fertre@foss.st.com>

On 2/22/21 10:22 AM, Raphael GALLAIS-POU - foss wrote:
> From: Yannick Fertre <yannick.fertre@st.com>
> 
> Don't print error when probe deferred error is returned.
> 
> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> ---
>   drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 2e1f2664495d..8399d337589d 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -363,8 +363,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   	dsi->vdd_supply = devm_regulator_get(dev, "phy-dsi");
>   	if (IS_ERR(dsi->vdd_supply)) {
>   		ret = PTR_ERR(dsi->vdd_supply);
> -		if (ret != -EPROBE_DEFER)
> -			DRM_ERROR("Failed to request regulator: %d\n", ret);
> +		dev_err_probe(dev, ret, "Failed to request regulator\n");
>   		return ret;
>   	}
>   
> @@ -377,9 +376,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   	dsi->pllref_clk = devm_clk_get(dev, "ref");
>   	if (IS_ERR(dsi->pllref_clk)) {
>   		ret = PTR_ERR(dsi->pllref_clk);
> -		if (ret != -EPROBE_DEFER)
> -			DRM_ERROR("Unable to get pll reference clock: %d\n",
> -				  ret);
> +		dev_err_probe(dev, ret, "Unable to get pll reference clock\n");
>   		goto err_clk_get;
>   	}
>   
> @@ -419,7 +416,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   	dsi->dsi = dw_mipi_dsi_probe(pdev, &dw_mipi_dsi_stm_plat_data);
>   	if (IS_ERR(dsi->dsi)) {
>   		ret = PTR_ERR(dsi->dsi);
> -		DRM_ERROR("Failed to initialize mipi dsi host: %d\n", ret);
> +		dev_err_probe(dev, ret, "Failed to initialize mipi dsi host\n");
>   		goto err_dsi_probe;
>   	}
>   
> 

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

* Re: [PATCH 2/2] drm/stm: dsi: Use dev_ based logging
  2021-02-22  9:23 ` [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Raphael GALLAIS-POU - foss
@ 2021-03-08  9:10   ` yannick Fertre
  0 siblings, 0 replies; 5+ messages in thread
From: yannick Fertre @ 2021-03-08  9:10 UTC (permalink / raw)
  To: Raphael GALLAIS-POU - foss, Yannick FERTRE, Philippe CORNU,
	Benjamin Gaignard, Vincent ABRIOU, Sam Ravnborg, Joe Perches
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre TORGUE,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Philippe CORNU - foss, Raphael GALLAIS-POU,
	Alexandre TORGUE - foss

Tested-by: Yannick Fertre <yannick.fertre@foss.st.com>

On 2/22/21 10:23 AM, Raphael GALLAIS-POU - foss wrote:
> From: Yannick Fertre <yannick.fertre@st.com>
> 
> Standardize on the dev_ based logging.
> 
> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> ---
>   drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 49 ++++++++++++++-------------
>   1 file changed, 26 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 8399d337589d..a7226bb3d0e8 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -76,6 +76,7 @@ enum dsi_color {
>   
>   struct dw_mipi_dsi_stm {
>   	void __iomem *base;
> +	struct device *dev;
>   	struct clk *pllref_clk;
>   	struct dw_mipi_dsi *dsi;
>   	u32 hw_version;
> @@ -110,7 +111,8 @@ static inline void dsi_update_bits(struct dw_mipi_dsi_stm *dsi, u32 reg,
>   	dsi_write(dsi, reg, (dsi_read(dsi, reg) & ~mask) | val);
>   }
>   
> -static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt)
> +static enum dsi_color dsi_color_from_mipi(struct dw_mipi_dsi_stm *dsi,
> +					  enum mipi_dsi_pixel_format fmt)
>   {
>   	switch (fmt) {
>   	case MIPI_DSI_FMT_RGB888:
> @@ -122,7 +124,7 @@ static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt)
>   	case MIPI_DSI_FMT_RGB565:
>   		return DSI_RGB565_CONF1;
>   	default:
> -		DRM_DEBUG_DRIVER("MIPI color invalid, so we use rgb888\n");
> +		dev_dbg(dsi->dev, "MIPI color invalid, so we use rgb888\n");
>   	}
>   	return DSI_RGB888;
>   }
> @@ -205,14 +207,14 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
>   	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS,
>   				 SLEEP_US, TIMEOUT_US);
>   	if (ret)
> -		DRM_DEBUG_DRIVER("!TIMEOUT! waiting REGU, let's continue\n");
> +		dev_dbg(dsi->dev, "!TIMEOUT! waiting REGU, let's continue\n");
>   
>   	/* Enable the DSI PLL & wait for its lock */
>   	dsi_set(dsi, DSI_WRPCR, WRPCR_PLLEN);
>   	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_PLLLS,
>   				 SLEEP_US, TIMEOUT_US);
>   	if (ret)
> -		DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");
> +		dev_dbg(dsi->dev, "!TIMEOUT! waiting PLL, let's continue\n");
>   
>   	return 0;
>   }
> @@ -221,7 +223,7 @@ static void dw_mipi_dsi_phy_power_on(void *priv_data)
>   {
>   	struct dw_mipi_dsi_stm *dsi = priv_data;
>   
> -	DRM_DEBUG_DRIVER("\n");
> +	dev_dbg(dsi->dev, "\n");
>   
>   	/* Enable the DSI wrapper */
>   	dsi_set(dsi, DSI_WCR, WCR_DSIEN);
> @@ -231,7 +233,7 @@ static void dw_mipi_dsi_phy_power_off(void *priv_data)
>   {
>   	struct dw_mipi_dsi_stm *dsi = priv_data;
>   
> -	DRM_DEBUG_DRIVER("\n");
> +	dev_dbg(dsi->dev, "\n");
>   
>   	/* Disable the DSI wrapper */
>   	dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
> @@ -267,11 +269,11 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>   
>   	if (pll_out_khz > dsi->lane_max_kbps) {
>   		pll_out_khz = dsi->lane_max_kbps;
> -		DRM_WARN("Warning max phy mbps is used\n");
> +		dev_warn(dsi->dev, "Warning max phy mbps is used\n");
>   	}
>   	if (pll_out_khz < dsi->lane_min_kbps) {
>   		pll_out_khz = dsi->lane_min_kbps;
> -		DRM_WARN("Warning min phy mbps is used\n");
> +		dev_warn(dsi->dev, "Warning min phy mbps is used\n");
>   	}
>   
>   	/* Compute best pll parameters */
> @@ -281,7 +283,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>   	ret = dsi_pll_get_params(dsi, pll_in_khz, pll_out_khz,
>   				 &idf, &ndiv, &odf);
>   	if (ret)
> -		DRM_WARN("Warning dsi_pll_get_params(): bad params\n");
> +		dev_warn(dsi->dev, "Warning dsi_pll_get_params(): bad params\n");
>   
>   	/* Get the adjusted pll out value */
>   	pll_out_khz = dsi_pll_get_clkout_khz(pll_in_khz, idf, ndiv, odf);
> @@ -299,13 +301,12 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>   
>   	/* Select the color coding */
>   	dsi_update_bits(dsi, DSI_WCFGR, WCFGR_COLMUX,
> -			dsi_color_from_mipi(format) << 1);
> +			dsi_color_from_mipi(dsi, format) << 1);
>   
>   	*lane_mbps = pll_out_khz / 1000;
>   
> -	DRM_DEBUG_DRIVER("pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
> -			 pll_in_khz, pll_out_khz, *lane_mbps);
> -
> +	dev_dbg(dsi->dev, "pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
> +			pll_in_khz, pll_out_khz, *lane_mbps);
>   	return 0;
>   }
>   
> @@ -352,11 +353,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   	if (!dsi)
>   		return -ENOMEM;
>   
> +	dsi->dev = dev;
> +
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   	dsi->base = devm_ioremap_resource(dev, res);
>   	if (IS_ERR(dsi->base)) {
>   		ret = PTR_ERR(dsi->base);
> -		DRM_ERROR("Unable to get dsi registers %d\n", ret);
> +		dev_err(dev, "Unable to get dsi registers %d\n", ret);
>   		return ret;
>   	}
>   
> @@ -369,7 +372,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   
>   	ret = regulator_enable(dsi->vdd_supply);
>   	if (ret) {
> -		DRM_ERROR("Failed to enable regulator: %d\n", ret);
> +		dev_err(dev, "Failed to enable regulator: %d\n", ret);
>   		return ret;
>   	}
>   
> @@ -382,20 +385,20 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   
>   	ret = clk_prepare_enable(dsi->pllref_clk);
>   	if (ret) {
> -		DRM_ERROR("Failed to enable pllref_clk: %d\n", ret);
> +		dev_err(dev, "Failed to enable pllref_clk: %d\n", ret);
>   		goto err_clk_get;
>   	}
>   
>   	pclk = devm_clk_get(dev, "pclk");
>   	if (IS_ERR(pclk)) {
>   		ret = PTR_ERR(pclk);
> -		DRM_ERROR("Unable to get peripheral clock: %d\n", ret);
> +		dev_err(dev, "Unable to get peripheral clock: %d\n", ret);
>   		goto err_dsi_probe;
>   	}
>   
>   	ret = clk_prepare_enable(pclk);
>   	if (ret) {
> -		DRM_ERROR("%s: Failed to enable peripheral clk\n", __func__);
> +		dev_err(dev, "%s: Failed to enable peripheral clk\n", __func__);
>   		goto err_dsi_probe;
>   	}
>   
> @@ -404,7 +407,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   
>   	if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) {
>   		ret = -ENODEV;
> -		DRM_ERROR("bad dsi hardware version\n");
> +		dev_err(dev, "bad dsi hardware version\n");
>   		goto err_dsi_probe;
>   	}
>   
> @@ -445,7 +448,7 @@ static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
>   {
>   	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
>   
> -	DRM_DEBUG_DRIVER("\n");
> +	dev_dbg(dsi->dev, "\n");
>   
>   	clk_disable_unprepare(dsi->pllref_clk);
>   	regulator_disable(dsi->vdd_supply);
> @@ -458,18 +461,18 @@ static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev)
>   	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
>   	int ret;
>   
> -	DRM_DEBUG_DRIVER("\n");
> +	dev_dbg(dsi->dev, "\n");
>   
>   	ret = regulator_enable(dsi->vdd_supply);
>   	if (ret) {
> -		DRM_ERROR("Failed to enable regulator: %d\n", ret);
> +		dev_err(dev, "Failed to enable regulator: %d\n", ret);
>   		return ret;
>   	}
>   
>   	ret = clk_prepare_enable(dsi->pllref_clk);
>   	if (ret) {
>   		regulator_disable(dsi->vdd_supply);
> -		DRM_ERROR("Failed to enable pllref_clk: %d\n", ret);
> +		dev_err(dev, "Failed to enable pllref_clk: %d\n", ret);
>   		return ret;
>   	}
>   
> 

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

end of thread, other threads:[~2021-03-08  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  9:22 [PATCH 0/2] Standardize DSI driver logging system Raphael GALLAIS-POU - foss
2021-02-22  9:22 ` [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Raphael GALLAIS-POU - foss
2021-03-08  9:10   ` yannick Fertre
2021-02-22  9:23 ` [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Raphael GALLAIS-POU - foss
2021-03-08  9:10   ` yannick Fertre

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