Commit 65d5c86f authored by Sam Ravnborg's avatar Sam Ravnborg

drm/panel: sitronix: Use dev_ based logging

Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarGuido Günther <agx@sigxcpu.org>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Guido Günther <agx@sigxcpu.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200815125406.1153224-5-sam@ravnborg.org
parent c8cf6990
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h> #include <drm/drm_modes.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -269,8 +268,7 @@ static int st7701_get_modes(struct drm_panel *panel, ...@@ -269,8 +268,7 @@ static int st7701_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, desc_mode); mode = drm_mode_duplicate(connector->dev, desc_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&st7701->dsi->dev, dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n",
"failed to add mode %ux%ux@%u\n",
desc_mode->hdisplay, desc_mode->vdisplay, desc_mode->hdisplay, desc_mode->vdisplay,
drm_mode_vrefresh(desc_mode)); drm_mode_vrefresh(desc_mode));
return -ENOMEM; return -ENOMEM;
...@@ -358,7 +356,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -358,7 +356,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(st7701->reset)) { if (IS_ERR(st7701->reset)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get our reset GPIO\n"); dev_err(&dsi->dev, "Couldn't get our reset GPIO\n");
return PTR_ERR(st7701->reset); return PTR_ERR(st7701->reset);
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h> #include <drm/drm_modes.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_print.h>
#define DRV_NAME "panel-sitronix-st7703" #define DRV_NAME "panel-sitronix-st7703"
...@@ -364,8 +363,7 @@ static int st7703_enable(struct drm_panel *panel) ...@@ -364,8 +363,7 @@ static int st7703_enable(struct drm_panel *panel)
ret = ctx->desc->init_sequence(ctx); ret = ctx->desc->init_sequence(ctx);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -373,7 +371,7 @@ static int st7703_enable(struct drm_panel *panel) ...@@ -373,7 +371,7 @@ static int st7703_enable(struct drm_panel *panel)
ret = mipi_dsi_dcs_exit_sleep_mode(dsi); ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret); dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
return ret; return ret;
} }
...@@ -384,7 +382,7 @@ static int st7703_enable(struct drm_panel *panel) ...@@ -384,7 +382,7 @@ static int st7703_enable(struct drm_panel *panel)
if (ret) if (ret)
return ret; return ret;
DRM_DEV_DEBUG_DRIVER(ctx->dev, "Panel init sequence done\n"); dev_dbg(ctx->dev, "Panel init sequence done\n");
return 0; return 0;
} }
...@@ -397,13 +395,11 @@ static int st7703_disable(struct drm_panel *panel) ...@@ -397,13 +395,11 @@ static int st7703_disable(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_off(dsi); ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret);
"Failed to turn off the display: %d\n", ret);
ret = mipi_dsi_dcs_enter_sleep_mode(dsi); ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret);
"Failed to enter sleep mode: %d\n", ret);
return 0; return 0;
} }
...@@ -431,17 +427,15 @@ static int st7703_prepare(struct drm_panel *panel) ...@@ -431,17 +427,15 @@ static int st7703_prepare(struct drm_panel *panel)
if (ctx->prepared) if (ctx->prepared)
return 0; return 0;
DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n"); dev_dbg(ctx->dev, "Resetting the panel\n");
ret = regulator_enable(ctx->vcc); ret = regulator_enable(ctx->vcc);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
"Failed to enable vcc supply: %d\n", ret);
return ret; return ret;
} }
ret = regulator_enable(ctx->iovcc); ret = regulator_enable(ctx->iovcc);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
"Failed to enable iovcc supply: %d\n", ret);
goto disable_vcc; goto disable_vcc;
} }
...@@ -467,7 +461,7 @@ static int st7703_get_modes(struct drm_panel *panel, ...@@ -467,7 +461,7 @@ static int st7703_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n", dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
drm_mode_vrefresh(ctx->desc->mode)); drm_mode_vrefresh(ctx->desc->mode));
return -ENOMEM; return -ENOMEM;
...@@ -496,7 +490,7 @@ static int allpixelson_set(void *data, u64 val) ...@@ -496,7 +490,7 @@ static int allpixelson_set(void *data, u64 val)
struct st7703 *ctx = data; struct st7703 *ctx = data;
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n"); dev_dbg(ctx->dev, "Setting all pixels on\n");
dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON); dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON);
msleep(val * 1000); msleep(val * 1000);
/* Reset the panel to get video back */ /* Reset the panel to get video back */
...@@ -537,7 +531,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi) ...@@ -537,7 +531,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset_gpio)) { if (IS_ERR(ctx->reset_gpio)) {
DRM_DEV_ERROR(dev, "cannot get reset gpio\n"); dev_err(dev, "cannot get reset gpio\n");
return PTR_ERR(ctx->reset_gpio); return PTR_ERR(ctx->reset_gpio);
} }
...@@ -554,18 +548,14 @@ static int st7703_probe(struct mipi_dsi_device *dsi) ...@@ -554,18 +548,14 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(ctx->vcc)) { if (IS_ERR(ctx->vcc)) {
ret = PTR_ERR(ctx->vcc); ret = PTR_ERR(ctx->vcc);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, dev_err(dev, "Failed to request vcc regulator: %d\n", ret);
"Failed to request vcc regulator: %d\n",
ret);
return ret; return ret;
} }
ctx->iovcc = devm_regulator_get(dev, "iovcc"); ctx->iovcc = devm_regulator_get(dev, "iovcc");
if (IS_ERR(ctx->iovcc)) { if (IS_ERR(ctx->iovcc)) {
ret = PTR_ERR(ctx->iovcc); ret = PTR_ERR(ctx->iovcc);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, dev_err(dev, "Failed to request iovcc regulator: %d\n", ret);
"Failed to request iovcc regulator: %d\n",
ret);
return ret; return ret;
} }
...@@ -580,14 +570,12 @@ static int st7703_probe(struct mipi_dsi_device *dsi) ...@@ -580,14 +570,12 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, dev_err(dev, "mipi_dsi_attach failed (%d). Is host ready?\n", ret);
"mipi_dsi_attach failed (%d). Is host ready?\n",
ret);
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
return ret; return ret;
} }
DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", dev_info(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
drm_mode_vrefresh(ctx->desc->mode), drm_mode_vrefresh(ctx->desc->mode),
mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
...@@ -603,13 +591,11 @@ static void st7703_shutdown(struct mipi_dsi_device *dsi) ...@@ -603,13 +591,11 @@ static void st7703_shutdown(struct mipi_dsi_device *dsi)
ret = drm_panel_unprepare(&ctx->panel); ret = drm_panel_unprepare(&ctx->panel);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n", dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret);
ret);
ret = drm_panel_disable(&ctx->panel); ret = drm_panel_disable(&ctx->panel);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(&dsi->dev, "Failed to disable panel: %d\n", dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret);
ret);
} }
static int st7703_remove(struct mipi_dsi_device *dsi) static int st7703_remove(struct mipi_dsi_device *dsi)
...@@ -621,8 +607,7 @@ static int st7703_remove(struct mipi_dsi_device *dsi) ...@@ -621,8 +607,7 @@ static int st7703_remove(struct mipi_dsi_device *dsi)
ret = mipi_dsi_detach(dsi); ret = mipi_dsi_detach(dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n", dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
ret);
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment