drm/panel: raydium: 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: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Guido Günther <agx@sigxcpu.org> Cc: Robert Chiras <robert.chiras@nxp.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-4-sam@ravnborg.org
This commit is contained in:
parent
b75efff5f5
commit
c8cf6990f9
|
@ -19,7 +19,6 @@
|
|||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
/* Panel specific color-format bits */
|
||||
#define COL_FMT_16BPP 0x55
|
||||
|
@ -329,7 +328,7 @@ static int rad_panel_enable(struct drm_panel *panel)
|
|||
|
||||
ret = rad_panel_push_cmd_list(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to send MCS (%d)\n", ret);
|
||||
dev_err(dev, "Failed to send MCS (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -341,7 +340,7 @@ static int rad_panel_enable(struct drm_panel *panel)
|
|||
/* Software reset */
|
||||
ret = mipi_dsi_dcs_soft_reset(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to do Software Reset (%d)\n", ret);
|
||||
dev_err(dev, "Failed to do Software Reset (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -350,33 +349,32 @@ static int rad_panel_enable(struct drm_panel *panel)
|
|||
/* Set DSI mode */
|
||||
ret = mipi_dsi_generic_write(dsi, (u8[]){ 0xC2, 0x0B }, 2);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set DSI mode (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set DSI mode (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
/* Set tear ON */
|
||||
ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set tear ON (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set tear ON (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
/* Set tear scanline */
|
||||
ret = mipi_dsi_dcs_set_tear_scanline(dsi, 0x380);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set tear scanline (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set tear scanline (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
/* Set pixel format */
|
||||
ret = mipi_dsi_dcs_set_pixel_format(dsi, color_format);
|
||||
DRM_DEV_DEBUG_DRIVER(dev, "Interface color format set to 0x%x\n",
|
||||
color_format);
|
||||
dev_dbg(dev, "Interface color format set to 0x%x\n", color_format);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set pixel format (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set pixel format (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
/* Exit sleep mode */
|
||||
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to exit sleep mode (%d)\n", ret);
|
||||
dev_err(dev, "Failed to exit sleep mode (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -384,7 +382,7 @@ static int rad_panel_enable(struct drm_panel *panel)
|
|||
|
||||
ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set display ON (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set display ON (%d)\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -418,7 +416,7 @@ static int rad_panel_disable(struct drm_panel *panel)
|
|||
|
||||
ret = mipi_dsi_dcs_set_display_off(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to set display OFF (%d)\n", ret);
|
||||
dev_err(dev, "Failed to set display OFF (%d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -426,7 +424,7 @@ static int rad_panel_disable(struct drm_panel *panel)
|
|||
|
||||
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dev, "Failed to enter sleep mode (%d)\n", ret);
|
||||
dev_err(dev, "Failed to enter sleep mode (%d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -442,7 +440,7 @@ static int rad_panel_get_modes(struct drm_panel *panel,
|
|||
|
||||
mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
if (!mode) {
|
||||
DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
|
||||
dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
|
||||
default_mode.hdisplay, default_mode.vdisplay,
|
||||
drm_mode_vrefresh(&default_mode));
|
||||
return -ENOMEM;
|
||||
|
@ -626,8 +624,7 @@ static int rad_panel_remove(struct mipi_dsi_device *dsi)
|
|||
|
||||
ret = mipi_dsi_detach(dsi);
|
||||
if (ret)
|
||||
DRM_DEV_ERROR(dev, "Failed to detach from host (%d)\n",
|
||||
ret);
|
||||
dev_err(dev, "Failed to detach from host (%d)\n", ret);
|
||||
|
||||
drm_panel_remove(&rad->panel);
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_modes.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
/*** Manufacturer Command Set ***/
|
||||
#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */
|
||||
|
@ -110,8 +109,7 @@ static void rm68200_dcs_write_buf(struct rm68200 *ctx, const void *data,
|
|||
|
||||
err = mipi_dsi_dcs_write_buffer(dsi, data, len);
|
||||
if (err < 0)
|
||||
DRM_ERROR_RATELIMITED("MIPI DSI DCS write buffer failed: %d\n",
|
||||
err);
|
||||
dev_err_ratelimited(ctx->dev, "MIPI DSI DCS write buffer failed: %d\n", err);
|
||||
}
|
||||
|
||||
static void rm68200_dcs_write_cmd(struct rm68200 *ctx, u8 cmd, u8 value)
|
||||
|
@ -121,7 +119,7 @@ static void rm68200_dcs_write_cmd(struct rm68200 *ctx, u8 cmd, u8 value)
|
|||
|
||||
err = mipi_dsi_dcs_write(dsi, cmd, &value, 1);
|
||||
if (err < 0)
|
||||
DRM_ERROR_RATELIMITED("MIPI DSI DCS write failed: %d\n", err);
|
||||
dev_err_ratelimited(ctx->dev, "MIPI DSI DCS write failed: %d\n", err);
|
||||
}
|
||||
|
||||
#define dcs_write_seq(ctx, seq...) \
|
||||
|
@ -256,11 +254,11 @@ static int rm68200_unprepare(struct drm_panel *panel)
|
|||
|
||||
ret = mipi_dsi_dcs_set_display_off(dsi);
|
||||
if (ret)
|
||||
DRM_WARN("failed to set display off: %d\n", ret);
|
||||
dev_warn(panel->dev, "failed to set display off: %d\n", ret);
|
||||
|
||||
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
|
||||
if (ret)
|
||||
DRM_WARN("failed to enter sleep mode: %d\n", ret);
|
||||
dev_warn(panel->dev, "failed to enter sleep mode: %d\n", ret);
|
||||
|
||||
msleep(120);
|
||||
|
||||
|
@ -287,7 +285,7 @@ static int rm68200_prepare(struct drm_panel *panel)
|
|||
|
||||
ret = regulator_enable(ctx->supply);
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("failed to enable supply: %d\n", ret);
|
||||
dev_err(ctx->dev, "failed to enable supply: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -336,7 +334,7 @@ static int rm68200_get_modes(struct drm_panel *panel,
|
|||
|
||||
mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
if (!mode) {
|
||||
DRM_ERROR("failed to add mode %ux%ux@%u\n",
|
||||
dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
|
||||
default_mode.hdisplay, default_mode.vdisplay,
|
||||
drm_mode_vrefresh(&default_mode));
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue