Commit a25b6b27 authored by Sam Ravnborg's avatar Sam Ravnborg

drm/panel: 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: Jerry Han <hanxu5@huaqin.corp-partner.google.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Guido Günther <agx@sigxcpu.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200815125406.1153224-6-sam@ravnborg.org
parent 65d5c86f
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,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 <video/mipi_display.h> #include <video/mipi_display.h>
...@@ -93,8 +92,7 @@ static int boe_panel_disable(struct drm_panel *panel) ...@@ -93,8 +92,7 @@ static int boe_panel_disable(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_off(pinfo->link); err = mipi_dsi_dcs_set_display_off(pinfo->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", err);
err);
return err; return err;
} }
...@@ -113,13 +111,11 @@ static int boe_panel_unprepare(struct drm_panel *panel) ...@@ -113,13 +111,11 @@ static int boe_panel_unprepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_off(pinfo->link); err = mipi_dsi_dcs_set_display_off(pinfo->link);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", err);
err);
err = mipi_dsi_dcs_enter_sleep_mode(pinfo->link); err = mipi_dsi_dcs_enter_sleep_mode(pinfo->link);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
err);
/* sleep_mode_delay: 1ms - 2ms */ /* sleep_mode_delay: 1ms - 2ms */
usleep_range(1000, 2000); usleep_range(1000, 2000);
...@@ -163,15 +159,13 @@ static int boe_panel_prepare(struct drm_panel *panel) ...@@ -163,15 +159,13 @@ static int boe_panel_prepare(struct drm_panel *panel)
/* send init code */ /* send init code */
err = send_mipi_cmds(panel, pinfo->desc->on_cmds); err = send_mipi_cmds(panel, pinfo->desc->on_cmds);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to send DCS Init Code: %d\n", dev_err(panel->dev, "failed to send DCS Init Code: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
err = mipi_dsi_dcs_exit_sleep_mode(pinfo->link); err = mipi_dsi_dcs_exit_sleep_mode(pinfo->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n", dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -180,8 +174,7 @@ static int boe_panel_prepare(struct drm_panel *panel) ...@@ -180,8 +174,7 @@ static int boe_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_on(pinfo->link); err = mipi_dsi_dcs_set_display_on(pinfo->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n", dev_err(panel->dev, "failed to set display on: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -209,8 +202,7 @@ static int boe_panel_enable(struct drm_panel *panel) ...@@ -209,8 +202,7 @@ static int boe_panel_enable(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_on(pinfo->link); ret = mipi_dsi_dcs_set_display_on(pinfo->link);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n", dev_err(panel->dev, "failed to set display on: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -228,7 +220,7 @@ static int boe_panel_get_modes(struct drm_panel *panel, ...@@ -228,7 +220,7 @@ static int boe_panel_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, m); mode = drm_mode_duplicate(connector->dev, m);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(pinfo->base.dev, "failed to add mode %ux%u@%u\n", dev_err(pinfo->base.dev, "failed to add mode %ux%u@%u\n",
m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
return -ENOMEM; return -ENOMEM;
} }
...@@ -865,8 +857,7 @@ static int panel_add(struct panel_info *pinfo) ...@@ -865,8 +857,7 @@ static int panel_add(struct panel_info *pinfo)
if (IS_ERR(pinfo->pp18_gpio)) { if (IS_ERR(pinfo->pp18_gpio)) {
ret = PTR_ERR(pinfo->pp18_gpio); ret = PTR_ERR(pinfo->pp18_gpio);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to get pp18 gpio: %d\n", dev_err(dev, "failed to get pp18 gpio: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -874,8 +865,7 @@ static int panel_add(struct panel_info *pinfo) ...@@ -874,8 +865,7 @@ static int panel_add(struct panel_info *pinfo)
if (IS_ERR(pinfo->pp33_gpio)) { if (IS_ERR(pinfo->pp33_gpio)) {
ret = PTR_ERR(pinfo->pp33_gpio); ret = PTR_ERR(pinfo->pp33_gpio);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to get pp33 gpio: %d\n", dev_err(dev, "failed to get pp33 gpio: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -883,8 +873,7 @@ static int panel_add(struct panel_info *pinfo) ...@@ -883,8 +873,7 @@ static int panel_add(struct panel_info *pinfo)
if (IS_ERR(pinfo->enable_gpio)) { if (IS_ERR(pinfo->enable_gpio)) {
ret = PTR_ERR(pinfo->enable_gpio); ret = PTR_ERR(pinfo->enable_gpio);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to get enable gpio: %d\n", dev_err(dev, "failed to get enable gpio: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -937,18 +926,15 @@ static int panel_remove(struct mipi_dsi_device *dsi) ...@@ -937,18 +926,15 @@ static int panel_remove(struct mipi_dsi_device *dsi)
err = boe_panel_disable(&pinfo->base); err = boe_panel_disable(&pinfo->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", dev_err(&dsi->dev, "failed to disable panel: %d\n", err);
err);
err = boe_panel_unprepare(&pinfo->base); err = boe_panel_unprepare(&pinfo->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to unprepare panel: %d\n", dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err);
err);
err = mipi_dsi_detach(dsi); err = mipi_dsi_detach(dsi);
if (err < 0) if (err < 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", err);
err);
drm_panel_remove(&pinfo->base); drm_panel_remove(&pinfo->base);
......
...@@ -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>
/* Manufacturer specific Commands send via DSI */ /* Manufacturer specific Commands send via DSI */
#define KD35T133_CMD_INTERFACEMODECTRL 0xb0 #define KD35T133_CMD_INTERFACEMODECTRL 0xb0
...@@ -89,7 +88,7 @@ static int kd35t133_init_sequence(struct kd35t133 *ctx) ...@@ -89,7 +88,7 @@ static int kd35t133_init_sequence(struct kd35t133 *ctx)
0xa9, 0x51, 0x2c, 0x82); 0xa9, 0x51, 0x2c, 0x82);
mipi_dsi_dcs_write(dsi, MIPI_DCS_ENTER_INVERT_MODE, NULL, 0); mipi_dsi_dcs_write(dsi, MIPI_DCS_ENTER_INVERT_MODE, NULL, 0);
DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n"); dev_dbg(dev, "Panel init sequence done\n");
return 0; return 0;
} }
...@@ -104,13 +103,11 @@ static int kd35t133_unprepare(struct drm_panel *panel) ...@@ -104,13 +103,11 @@ static int kd35t133_unprepare(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, "failed to set display off: %d\n", dev_err(ctx->dev, "failed to set display off: %d\n", ret);
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, "failed to enter sleep mode: %d\n", dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -131,18 +128,16 @@ static int kd35t133_prepare(struct drm_panel *panel) ...@@ -131,18 +128,16 @@ static int kd35t133_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->vdd); ret = regulator_enable(ctx->vdd);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to enable vdd supply: %d\n", ret);
"Failed to enable vdd 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_vdd; goto disable_vdd;
} }
...@@ -156,7 +151,7 @@ static int kd35t133_prepare(struct drm_panel *panel) ...@@ -156,7 +151,7 @@ static int kd35t133_prepare(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);
goto disable_iovcc; goto disable_iovcc;
} }
...@@ -164,14 +159,13 @@ static int kd35t133_prepare(struct drm_panel *panel) ...@@ -164,14 +159,13 @@ static int kd35t133_prepare(struct drm_panel *panel)
ret = kd35t133_init_sequence(ctx); ret = kd35t133_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);
goto disable_iovcc; goto disable_iovcc;
} }
ret = mipi_dsi_dcs_set_display_on(dsi); ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, "Failed to set display on: %d\n", ret); dev_err(ctx->dev, "Failed to set display on: %d\n", ret);
goto disable_iovcc; goto disable_iovcc;
} }
...@@ -210,7 +204,7 @@ static int kd35t133_get_modes(struct drm_panel *panel, ...@@ -210,7 +204,7 @@ static int kd35t133_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_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",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
drm_mode_vrefresh(&default_mode)); drm_mode_vrefresh(&default_mode));
return -ENOMEM; return -ENOMEM;
...@@ -244,7 +238,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) ...@@ -244,7 +238,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); ctx->reset_gpio = devm_gpiod_get_optional(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);
} }
...@@ -252,9 +246,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) ...@@ -252,9 +246,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(ctx->vdd)) { if (IS_ERR(ctx->vdd)) {
ret = PTR_ERR(ctx->vdd); ret = PTR_ERR(ctx->vdd);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, dev_err(dev, "Failed to request vdd regulator: %d\n", ret);
"Failed to request vdd regulator: %d\n",
ret);
return ret; return ret;
} }
...@@ -262,9 +254,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) ...@@ -262,9 +254,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
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;
} }
...@@ -288,7 +278,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) ...@@ -288,7 +278,7 @@ static int kd35t133_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, "mipi_dsi_attach failed: %d\n", ret); dev_err(dev, "mipi_dsi_attach failed: %d\n", ret);
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
return ret; return ret;
} }
...@@ -303,13 +293,11 @@ static void kd35t133_shutdown(struct mipi_dsi_device *dsi) ...@@ -303,13 +293,11 @@ static void kd35t133_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 kd35t133_remove(struct mipi_dsi_device *dsi) static int kd35t133_remove(struct mipi_dsi_device *dsi)
...@@ -321,8 +309,7 @@ static int kd35t133_remove(struct mipi_dsi_device *dsi) ...@@ -321,8 +309,7 @@ static int kd35t133_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);
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,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 K101_IM2BA02_INIT_CMD_LEN 2 #define K101_IM2BA02_INIT_CMD_LEN 2
...@@ -374,13 +373,11 @@ static int k101_im2ba02_unprepare(struct drm_panel *panel) ...@@ -374,13 +373,11 @@ static int k101_im2ba02_unprepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_off(ctx->dsi); ret = mipi_dsi_dcs_set_display_off(ctx->dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", ret);
ret);
ret = mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); ret = mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", dev_err(panel->dev, "failed to enter sleep mode: %d\n", ret);
ret);
msleep(200); msleep(200);
...@@ -416,7 +413,7 @@ static int k101_im2ba02_get_modes(struct drm_panel *panel, ...@@ -416,7 +413,7 @@ static int k101_im2ba02_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &k101_im2ba02_default_mode); mode = drm_mode_duplicate(connector->dev, &k101_im2ba02_default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", dev_err(&ctx->dsi->dev, "failed to add mode %ux%u@%u\n",
k101_im2ba02_default_mode.hdisplay, k101_im2ba02_default_mode.hdisplay,
k101_im2ba02_default_mode.vdisplay, k101_im2ba02_default_mode.vdisplay,
drm_mode_vrefresh(&k101_im2ba02_default_mode)); drm_mode_vrefresh(&k101_im2ba02_default_mode));
...@@ -460,13 +457,13 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -460,13 +457,13 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)
ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(ctx->supplies), ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(ctx->supplies),
ctx->supplies); ctx->supplies);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get regulators\n"); dev_err(&dsi->dev, "Couldn't get regulators\n");
return ret; return ret;
} }
ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset)) { if (IS_ERR(ctx->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(ctx->reset); return PTR_ERR(ctx->reset);
} }
......
...@@ -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>
...@@ -118,13 +117,11 @@ static int feiyang_unprepare(struct drm_panel *panel) ...@@ -118,13 +117,11 @@ static int feiyang_unprepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_off(ctx->dsi); ret = mipi_dsi_dcs_set_display_off(ctx->dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", ret);
ret);
ret = mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); ret = mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", dev_err(panel->dev, "failed to enter sleep mode: %d\n", ret);
ret);
/* T13 (backlight fall + video & logic signal fall) T13 >= 200ms */ /* T13 (backlight fall + video & logic signal fall) T13 >= 200ms */
msleep(200); msleep(200);
...@@ -165,7 +162,7 @@ static int feiyang_get_modes(struct drm_panel *panel, ...@@ -165,7 +162,7 @@ static int feiyang_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode); mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", dev_err(&ctx->dsi->dev, "failed to add mode %ux%u@%u\n",
feiyang_default_mode.hdisplay, feiyang_default_mode.hdisplay,
feiyang_default_mode.vdisplay, feiyang_default_mode.vdisplay,
drm_mode_vrefresh(&feiyang_default_mode)); drm_mode_vrefresh(&feiyang_default_mode));
...@@ -204,19 +201,19 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -204,19 +201,19 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd"); ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd");
if (IS_ERR(ctx->dvdd)) { if (IS_ERR(ctx->dvdd)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get dvdd regulator\n"); dev_err(&dsi->dev, "Couldn't get dvdd regulator\n");
return PTR_ERR(ctx->dvdd); return PTR_ERR(ctx->dvdd);
} }
ctx->avdd = devm_regulator_get(&dsi->dev, "avdd"); ctx->avdd = devm_regulator_get(&dsi->dev, "avdd");
if (IS_ERR(ctx->avdd)) { if (IS_ERR(ctx->avdd)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get avdd regulator\n"); dev_err(&dsi->dev, "Couldn't get avdd regulator\n");
return PTR_ERR(ctx->avdd); return PTR_ERR(ctx->avdd);
} }
ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset)) { if (IS_ERR(ctx->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(ctx->reset); return PTR_ERR(ctx->reset);
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#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 ILI9322_CHIP_ID 0x00 #define ILI9322_CHIP_ID 0x00
#define ILI9322_CHIP_ID_MAGIC 0x96 #define ILI9322_CHIP_ID_MAGIC 0x96
...@@ -683,7 +682,7 @@ static int ili9322_get_modes(struct drm_panel *panel, ...@@ -683,7 +682,7 @@ static int ili9322_get_modes(struct drm_panel *panel,
break; break;
} }
if (!mode) { if (!mode) {
DRM_ERROR("bad mode or failed to add mode\n"); dev_err(panel->dev, "bad mode or failed to add mode\n");
return -EINVAL; return -EINVAL;
} }
drm_mode_set_name(mode); drm_mode_set_name(mode);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,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>
struct panel_init_cmd { struct panel_init_cmd {
size_t len; size_t len;
...@@ -85,13 +84,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel) ...@@ -85,13 +84,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_off(innolux->link); err = mipi_dsi_dcs_set_display_off(innolux->link);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", err);
err);
err = mipi_dsi_dcs_enter_sleep_mode(innolux->link); err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
err);
return err; return err;
} }
...@@ -147,8 +144,7 @@ static int innolux_panel_prepare(struct drm_panel *panel) ...@@ -147,8 +144,7 @@ static int innolux_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_generic_write(innolux->link, cmd->data, err = mipi_dsi_generic_write(innolux->link, cmd->data,
cmd->len); cmd->len);
if (err < 0) { if (err < 0) {
dev_err(panel->dev, dev_err(panel->dev, "failed to write command %u\n", i);
"failed to write command %u\n", i);
goto poweroff; goto poweroff;
} }
...@@ -159,8 +155,7 @@ static int innolux_panel_prepare(struct drm_panel *panel) ...@@ -159,8 +155,7 @@ static int innolux_panel_prepare(struct drm_panel *panel)
*/ */
err = mipi_dsi_dcs_nop(innolux->link); err = mipi_dsi_dcs_nop(innolux->link);
if (err < 0) { if (err < 0) {
dev_err(panel->dev, dev_err(panel->dev, "failed to send DCS nop: %d\n", err);
"failed to send DCS nop: %d\n", err);
goto poweroff; goto poweroff;
} }
} }
...@@ -168,8 +163,7 @@ static int innolux_panel_prepare(struct drm_panel *panel) ...@@ -168,8 +163,7 @@ static int innolux_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_exit_sleep_mode(innolux->link); err = mipi_dsi_dcs_exit_sleep_mode(innolux->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n", dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -178,8 +172,7 @@ static int innolux_panel_prepare(struct drm_panel *panel) ...@@ -178,8 +172,7 @@ static int innolux_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_on(innolux->link); err = mipi_dsi_dcs_set_display_on(innolux->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n", dev_err(panel->dev, "failed to set display on: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -398,7 +391,7 @@ static int innolux_panel_get_modes(struct drm_panel *panel, ...@@ -398,7 +391,7 @@ static int innolux_panel_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, m); mode = drm_mode_duplicate(connector->dev, m);
if (!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",
m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
return -ENOMEM; return -ENOMEM;
} }
...@@ -512,17 +505,15 @@ static int innolux_panel_remove(struct mipi_dsi_device *dsi) ...@@ -512,17 +505,15 @@ static int innolux_panel_remove(struct mipi_dsi_device *dsi)
err = drm_panel_unprepare(&innolux->base); err = drm_panel_unprepare(&innolux->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to unprepare panel: %d\n", dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err);
err);
err = drm_panel_disable(&innolux->base); err = drm_panel_disable(&innolux->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", err); dev_err(&dsi->dev, "failed to disable panel: %d\n", err);
err = mipi_dsi_detach(dsi); err = mipi_dsi_detach(dsi);
if (err < 0) if (err < 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", err);
err);
innolux_panel_del(innolux); innolux_panel_del(innolux);
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,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>
struct kingdisplay_panel { struct kingdisplay_panel {
struct drm_panel base; struct drm_panel base;
...@@ -191,8 +190,7 @@ static int kingdisplay_panel_disable(struct drm_panel *panel) ...@@ -191,8 +190,7 @@ static int kingdisplay_panel_disable(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_off(kingdisplay->link); err = mipi_dsi_dcs_set_display_off(kingdisplay->link);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n", dev_err(panel->dev, "failed to set display off: %d\n", err);
err);
kingdisplay->enabled = false; kingdisplay->enabled = false;
...@@ -209,8 +207,7 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel) ...@@ -209,8 +207,7 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel)
err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link); err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n", dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
err);
return err; return err;
} }
...@@ -255,16 +252,14 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -255,16 +252,14 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_generic_write(kingdisplay->link, &init_code[i], err = mipi_dsi_generic_write(kingdisplay->link, &init_code[i],
sizeof(struct kingdisplay_panel_cmd)); sizeof(struct kingdisplay_panel_cmd));
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed write init cmds: %d\n", dev_err(panel->dev, "failed write init cmds: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
} }
err = mipi_dsi_dcs_exit_sleep_mode(kingdisplay->link); err = mipi_dsi_dcs_exit_sleep_mode(kingdisplay->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n", dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -273,8 +268,7 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -273,8 +268,7 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
err = mipi_dsi_dcs_set_display_on(kingdisplay->link); err = mipi_dsi_dcs_set_display_on(kingdisplay->link);
if (err < 0) { if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n", dev_err(panel->dev, "failed to set display on: %d\n", err);
err);
goto poweroff; goto poweroff;
} }
...@@ -290,8 +284,7 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -290,8 +284,7 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
regulator_err = regulator_disable(kingdisplay->supply); regulator_err = regulator_disable(kingdisplay->supply);
if (regulator_err) if (regulator_err)
DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n", dev_err(panel->dev, "failed to disable regulator: %d\n", regulator_err);
regulator_err);
return err; return err;
} }
...@@ -327,7 +320,7 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel, ...@@ -327,7 +320,7 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!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, default_mode.hdisplay, default_mode.vdisplay,
drm_mode_vrefresh(&default_mode)); drm_mode_vrefresh(&default_mode));
return -ENOMEM; return -ENOMEM;
...@@ -423,17 +416,15 @@ static int kingdisplay_panel_remove(struct mipi_dsi_device *dsi) ...@@ -423,17 +416,15 @@ static int kingdisplay_panel_remove(struct mipi_dsi_device *dsi)
err = drm_panel_unprepare(&kingdisplay->base); err = drm_panel_unprepare(&kingdisplay->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to unprepare panel: %d\n", dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err);
err);
err = drm_panel_disable(&kingdisplay->base); err = drm_panel_disable(&kingdisplay->base);
if (err < 0) if (err < 0)
DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", err); dev_err(&dsi->dev, "failed to disable panel: %d\n", err);
err = mipi_dsi_detach(dsi); err = mipi_dsi_detach(dsi);
if (err < 0) if (err < 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", err);
err);
kingdisplay_panel_del(kingdisplay); kingdisplay_panel_del(kingdisplay);
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,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 MCS_CMD_MAUCCTR 0xF0 /* Manufacturer command enable */ #define MCS_CMD_MAUCCTR 0xF0 /* Manufacturer command enable */
#define MCS_CMD_READ_ID1 0xDA #define MCS_CMD_READ_ID1 0xDA
...@@ -404,9 +403,7 @@ static int nt35510_send_long(struct nt35510 *nt, struct mipi_dsi_device *dsi, ...@@ -404,9 +403,7 @@ static int nt35510_send_long(struct nt35510 *nt, struct mipi_dsi_device *dsi,
chunk = 15; chunk = 15;
ret = mipi_dsi_dcs_write(dsi, cmd, seqp, chunk); ret = mipi_dsi_dcs_write(dsi, cmd, seqp, chunk);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(nt->dev, dev_err(nt->dev, "error sending DCS command seq cmd %02x\n", cmd);
"error sending DCS command seq cmd %02x\n",
cmd);
return ret; return ret;
} }
cmdwritten += chunk; cmdwritten += chunk;
...@@ -418,16 +415,13 @@ static int nt35510_send_long(struct nt35510 *nt, struct mipi_dsi_device *dsi, ...@@ -418,16 +415,13 @@ static int nt35510_send_long(struct nt35510 *nt, struct mipi_dsi_device *dsi,
chunk = 15; chunk = 15;
ret = mipi_dsi_generic_write(dsi, seqp, chunk); ret = mipi_dsi_generic_write(dsi, seqp, chunk);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(nt->dev, dev_err(nt->dev, "error sending generic write seq %02x\n", cmd);
"error sending generic write seq %02x\n",
cmd);
return ret; return ret;
} }
cmdwritten += chunk; cmdwritten += chunk;
seqp += chunk; seqp += chunk;
} }
DRM_DEV_DEBUG(nt->dev, "sent command %02x %02x bytes\n", dev_dbg(nt->dev, "sent command %02x %02x bytes\n", cmd, cmdlen);
cmd, cmdlen);
return 0; return 0;
} }
...@@ -439,17 +433,17 @@ static int nt35510_read_id(struct nt35510 *nt) ...@@ -439,17 +433,17 @@ static int nt35510_read_id(struct nt35510 *nt)
ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID1, &id1, 1); ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID1, &id1, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(nt->dev, "could not read MTP ID1\n"); dev_err(nt->dev, "could not read MTP ID1\n");
return ret; return ret;
} }
ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID2, &id2, 1); ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID2, &id2, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(nt->dev, "could not read MTP ID2\n"); dev_err(nt->dev, "could not read MTP ID2\n");
return ret; return ret;
} }
ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID3, &id3, 1); ret = mipi_dsi_dcs_read(dsi, MCS_CMD_READ_ID3, &id3, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(nt->dev, "could not read MTP ID3\n"); dev_err(nt->dev, "could not read MTP ID3\n");
return ret; return ret;
} }
...@@ -458,9 +452,7 @@ static int nt35510_read_id(struct nt35510 *nt) ...@@ -458,9 +452,7 @@ static int nt35510_read_id(struct nt35510 *nt)
* ID (e.g. Hydis 0x55), driver ID (e.g. NT35510 0xc0) and * ID (e.g. Hydis 0x55), driver ID (e.g. NT35510 0xc0) and
* version. * version.
*/ */
DRM_DEV_INFO(nt->dev, dev_info(nt->dev, "MTP ID manufacturer: %02x version: %02x driver: %02x\n", id1, id2, id3);
"MTP ID manufacturer: %02x version: %02x driver: %02x\n",
id1, id2, id3);
return 0; return 0;
} }
...@@ -661,7 +653,7 @@ static int nt35510_set_brightness(struct backlight_device *bl) ...@@ -661,7 +653,7 @@ static int nt35510_set_brightness(struct backlight_device *bl)
u8 brightness = bl->props.brightness; u8 brightness = bl->props.brightness;
int ret; int ret;
DRM_DEV_DEBUG(nt->dev, "set brightness %d\n", brightness); dev_dbg(nt->dev, "set brightness %d\n", brightness);
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
&brightness, &brightness,
sizeof(brightness)); sizeof(brightness));
...@@ -796,8 +788,7 @@ static int nt35510_unprepare(struct drm_panel *panel) ...@@ -796,8 +788,7 @@ static int nt35510_unprepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_off(dsi); ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(nt->dev, "failed to turn display off (%d)\n", dev_err(nt->dev, "failed to turn display off (%d)\n", ret);
ret);
return ret; return ret;
} }
usleep_range(10000, 20000); usleep_range(10000, 20000);
...@@ -805,8 +796,7 @@ static int nt35510_unprepare(struct drm_panel *panel) ...@@ -805,8 +796,7 @@ static int nt35510_unprepare(struct drm_panel *panel)
/* Enter sleep mode */ /* Enter sleep mode */
ret = mipi_dsi_dcs_enter_sleep_mode(dsi); ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(nt->dev, "failed to enter sleep mode (%d)\n", dev_err(nt->dev, "failed to enter sleep mode (%d)\n", ret);
ret);
return ret; return ret;
} }
...@@ -833,8 +823,7 @@ static int nt35510_prepare(struct drm_panel *panel) ...@@ -833,8 +823,7 @@ static int nt35510_prepare(struct drm_panel *panel)
/* Exit sleep mode */ /* Exit sleep mode */
ret = mipi_dsi_dcs_exit_sleep_mode(dsi); ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(nt->dev, "failed to exit sleep mode (%d)\n", dev_err(nt->dev, "failed to exit sleep mode (%d)\n", ret);
ret);
return ret; return ret;
} }
/* Up to 120 ms */ /* Up to 120 ms */
...@@ -842,8 +831,7 @@ static int nt35510_prepare(struct drm_panel *panel) ...@@ -842,8 +831,7 @@ static int nt35510_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_on(dsi); ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(nt->dev, "failed to turn display on (%d)\n", dev_err(nt->dev, "failed to turn display on (%d)\n", ret);
ret);
return ret; return ret;
} }
/* Some 10 ms */ /* Some 10 ms */
...@@ -864,7 +852,7 @@ static int nt35510_get_modes(struct drm_panel *panel, ...@@ -864,7 +852,7 @@ static int nt35510_get_modes(struct drm_panel *panel,
info->height_mm = nt->conf->height_mm; info->height_mm = nt->conf->height_mm;
mode = drm_mode_duplicate(connector->dev, &nt->conf->mode); mode = drm_mode_duplicate(connector->dev, &nt->conf->mode);
if (!mode) { if (!mode) {
DRM_ERROR("bad mode or failed to add mode\n"); dev_err(panel->dev, "bad mode or failed to add mode\n");
return -EINVAL; return -EINVAL;
} }
drm_mode_set_name(mode); drm_mode_set_name(mode);
...@@ -963,7 +951,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi) ...@@ -963,7 +951,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
bl = devm_backlight_device_register(dev, "nt35510", dev, nt, bl = devm_backlight_device_register(dev, "nt35510", dev, nt,
&nt35510_bl_ops, NULL); &nt35510_bl_ops, NULL);
if (IS_ERR(bl)) { if (IS_ERR(bl)) {
DRM_DEV_ERROR(dev, "failed to register backlight device\n"); dev_err(dev, "failed to register backlight device\n");
return PTR_ERR(bl); return PTR_ERR(bl);
} }
bl->props.max_brightness = 255; bl->props.max_brightness = 255;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,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 OTM8009A_BACKLIGHT_DEFAULT 240 #define OTM8009A_BACKLIGHT_DEFAULT 240
#define OTM8009A_BACKLIGHT_MAX 255 #define OTM8009A_BACKLIGHT_MAX 255
...@@ -97,7 +96,7 @@ static void otm8009a_dcs_write_buf(struct otm8009a *ctx, const void *data, ...@@ -97,7 +96,7 @@ static void otm8009a_dcs_write_buf(struct otm8009a *ctx, const void *data,
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
if (mipi_dsi_dcs_write_buffer(dsi, data, len) < 0) if (mipi_dsi_dcs_write_buffer(dsi, data, len) < 0)
DRM_WARN("mipi dsi dcs write buffer failed\n"); dev_warn(ctx->dev, "mipi dsi dcs write buffer failed\n");
} }
static void otm8009a_dcs_write_buf_hs(struct otm8009a *ctx, const void *data, static void otm8009a_dcs_write_buf_hs(struct otm8009a *ctx, const void *data,
...@@ -313,7 +312,7 @@ static int otm8009a_prepare(struct drm_panel *panel) ...@@ -313,7 +312,7 @@ static int otm8009a_prepare(struct drm_panel *panel)
ret = regulator_enable(ctx->supply); ret = regulator_enable(ctx->supply);
if (ret < 0) { if (ret < 0) {
DRM_ERROR("failed to enable supply: %d\n", ret); dev_err(panel->dev, "failed to enable supply: %d\n", ret);
return ret; return ret;
} }
...@@ -355,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel, ...@@ -355,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!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, default_mode.hdisplay, default_mode.vdisplay,
drm_mode_vrefresh(&default_mode)); drm_mode_vrefresh(&default_mode));
return -ENOMEM; return -ENOMEM;
...@@ -390,7 +389,7 @@ static int otm8009a_backlight_update_status(struct backlight_device *bd) ...@@ -390,7 +389,7 @@ static int otm8009a_backlight_update_status(struct backlight_device *bd)
u8 data[2]; u8 data[2];
if (!ctx->prepared) { if (!ctx->prepared) {
DRM_DEBUG("lcd not ready yet for setting its backlight!\n"); dev_dbg(&bd->dev, "lcd not ready yet for setting its backlight!\n");
return -ENXIO; return -ENXIO;
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,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>
struct rb070d30_panel { struct rb070d30_panel {
struct drm_panel panel; struct drm_panel panel;
...@@ -50,7 +49,7 @@ static int rb070d30_panel_prepare(struct drm_panel *panel) ...@@ -50,7 +49,7 @@ static int rb070d30_panel_prepare(struct drm_panel *panel)
ret = regulator_enable(ctx->supply); ret = regulator_enable(ctx->supply);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(&ctx->dsi->dev, "Failed to enable supply: %d\n", ret); dev_err(&ctx->dsi->dev, "Failed to enable supply: %d\n", ret);
return ret; return ret;
} }
...@@ -117,8 +116,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel, ...@@ -117,8 +116,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&ctx->dsi->dev, dev_err(&ctx->dsi->dev, "Failed to add mode " DRM_MODE_FMT "\n",
"Failed to add mode " DRM_MODE_FMT "\n",
DRM_MODE_ARG(&default_mode)); DRM_MODE_ARG(&default_mode));
return -EINVAL; return -EINVAL;
} }
...@@ -166,13 +164,13 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -166,13 +164,13 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.reset)) { if (IS_ERR(ctx->gpios.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(ctx->gpios.reset); return PTR_ERR(ctx->gpios.reset);
} }
ctx->gpios.power = devm_gpiod_get(&dsi->dev, "power", GPIOD_OUT_LOW); ctx->gpios.power = devm_gpiod_get(&dsi->dev, "power", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.power)) { if (IS_ERR(ctx->gpios.power)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get our power GPIO\n"); dev_err(&dsi->dev, "Couldn't get our power GPIO\n");
return PTR_ERR(ctx->gpios.power); return PTR_ERR(ctx->gpios.power);
} }
...@@ -182,7 +180,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -182,7 +180,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
*/ */
ctx->gpios.updn = devm_gpiod_get(&dsi->dev, "updn", GPIOD_OUT_LOW); ctx->gpios.updn = devm_gpiod_get(&dsi->dev, "updn", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.updn)) { if (IS_ERR(ctx->gpios.updn)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get our updn GPIO\n"); dev_err(&dsi->dev, "Couldn't get our updn GPIO\n");
return PTR_ERR(ctx->gpios.updn); return PTR_ERR(ctx->gpios.updn);
} }
...@@ -192,7 +190,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -192,7 +190,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
*/ */
ctx->gpios.shlr = devm_gpiod_get(&dsi->dev, "shlr", GPIOD_OUT_LOW); ctx->gpios.shlr = devm_gpiod_get(&dsi->dev, "shlr", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.shlr)) { if (IS_ERR(ctx->gpios.shlr)) {
DRM_DEV_ERROR(&dsi->dev, "Couldn't get our shlr GPIO\n"); dev_err(&dsi->dev, "Couldn't get our shlr GPIO\n");
return PTR_ERR(ctx->gpios.shlr); return PTR_ERR(ctx->gpios.shlr);
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,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 ACX424_DCS_READ_ID1 0xDA #define ACX424_DCS_READ_ID1 0xDA
#define ACX424_DCS_READ_ID2 0xDB #define ACX424_DCS_READ_ID2 0xDB
...@@ -110,13 +109,11 @@ static int acx424akp_set_brightness(struct backlight_device *bl) ...@@ -110,13 +109,11 @@ static int acx424akp_set_brightness(struct backlight_device *bl)
SCALE_FACTOR_NS_DIV_MHZ); SCALE_FACTOR_NS_DIV_MHZ);
/* Set up PWM dutycycle ONE byte (differs from the standard) */ /* Set up PWM dutycycle ONE byte (differs from the standard) */
DRM_DEV_DEBUG(acx->dev, "calculated duty cycle %02x\n", pwm_ratio); dev_dbg(acx->dev, "calculated duty cycle %02x\n", pwm_ratio);
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
&pwm_ratio, 1); &pwm_ratio, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to set display PWM ratio (%d)\n", ret);
"failed to set display PWM ratio (%d)\n",
ret);
return ret; return ret;
} }
...@@ -132,40 +129,30 @@ static int acx424akp_set_brightness(struct backlight_device *bl) ...@@ -132,40 +129,30 @@ static int acx424akp_set_brightness(struct backlight_device *bl)
par = 0xaa; par = 0xaa;
ret = mipi_dsi_dcs_write(dsi, 0xf3, &par, 1); ret = mipi_dsi_dcs_write(dsi, 0xf3, &par, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to unlock CMD 2 (%d)\n", ret);
"failed to unlock CMD 2 (%d)\n",
ret);
return ret; return ret;
} }
par = 0x01; par = 0x01;
ret = mipi_dsi_dcs_write(dsi, 0x00, &par, 1); ret = mipi_dsi_dcs_write(dsi, 0x00, &par, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to enter page 1 (%d)\n", ret);
"failed to enter page 1 (%d)\n",
ret);
return ret; return ret;
} }
par = 0x01; par = 0x01;
ret = mipi_dsi_dcs_write(dsi, 0x7d, &par, 1); ret = mipi_dsi_dcs_write(dsi, 0x7d, &par, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to disable MTP reload (%d)\n", ret);
"failed to disable MTP reload (%d)\n",
ret);
return ret; return ret;
} }
ret = mipi_dsi_dcs_write(dsi, 0x22, &pwm_div, 1); ret = mipi_dsi_dcs_write(dsi, 0x22, &pwm_div, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to set PWM divisor (%d)\n", ret);
"failed to set PWM divisor (%d)\n",
ret);
return ret; return ret;
} }
par = 0xaa; par = 0xaa;
ret = mipi_dsi_dcs_write(dsi, 0x7f, &par, 1); ret = mipi_dsi_dcs_write(dsi, 0x7f, &par, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to lock CMD 2 (%d)\n", ret);
"failed to lock CMD 2 (%d)\n",
ret);
return ret; return ret;
} }
...@@ -174,9 +161,7 @@ static int acx424akp_set_brightness(struct backlight_device *bl) ...@@ -174,9 +161,7 @@ static int acx424akp_set_brightness(struct backlight_device *bl)
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
&par, 1); &par, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to enable display backlight (%d)\n", ret);
"failed to enable display backlight (%d)\n",
ret);
return ret; return ret;
} }
...@@ -196,22 +181,22 @@ static int acx424akp_read_id(struct acx424akp *acx) ...@@ -196,22 +181,22 @@ static int acx424akp_read_id(struct acx424akp *acx)
ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID1, &vendor, 1); ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID1, &vendor, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, "could not vendor ID byte\n"); dev_err(acx->dev, "could not vendor ID byte\n");
return ret; return ret;
} }
ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID2, &version, 1); ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID2, &version, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, "could not read device version byte\n"); dev_err(acx->dev, "could not read device version byte\n");
return ret; return ret;
} }
ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID3, &panel, 1); ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID3, &panel, 1);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, "could not read panel ID byte\n"); dev_err(acx->dev, "could not read panel ID byte\n");
return ret; return ret;
} }
if (vendor == 0x00) { if (vendor == 0x00) {
DRM_DEV_ERROR(acx->dev, "device vendor ID is zero\n"); dev_err(acx->dev, "device vendor ID is zero\n");
return -ENODEV; return -ENODEV;
} }
...@@ -220,13 +205,11 @@ static int acx424akp_read_id(struct acx424akp *acx) ...@@ -220,13 +205,11 @@ static int acx424akp_read_id(struct acx424akp *acx)
case DISPLAY_SONY_ACX424AKP_ID1: case DISPLAY_SONY_ACX424AKP_ID1:
case DISPLAY_SONY_ACX424AKP_ID2: case DISPLAY_SONY_ACX424AKP_ID2:
case DISPLAY_SONY_ACX424AKP_ID3: case DISPLAY_SONY_ACX424AKP_ID3:
DRM_DEV_INFO(acx->dev, dev_info(acx->dev, "MTP vendor: %02x, version: %02x, panel: %02x\n",
"MTP vendor: %02x, version: %02x, panel: %02x\n",
vendor, version, panel); vendor, version, panel);
break; break;
default: default:
DRM_DEV_INFO(acx->dev, dev_info(acx->dev, "unknown vendor: %02x, version: %02x, panel: %02x\n",
"unknown vendor: %02x, version: %02x, panel: %02x\n",
vendor, version, panel); vendor, version, panel);
break; break;
} }
...@@ -240,7 +223,7 @@ static int acx424akp_power_on(struct acx424akp *acx) ...@@ -240,7 +223,7 @@ static int acx424akp_power_on(struct acx424akp *acx)
ret = regulator_enable(acx->supply); ret = regulator_enable(acx->supply);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to enable supply (%d)\n", ret); dev_err(acx->dev, "failed to enable supply (%d)\n", ret);
return ret; return ret;
} }
...@@ -276,7 +259,7 @@ static int acx424akp_prepare(struct drm_panel *panel) ...@@ -276,7 +259,7 @@ static int acx424akp_prepare(struct drm_panel *panel)
ret = acx424akp_read_id(acx); ret = acx424akp_read_id(acx);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to read panel ID (%d)\n", ret); dev_err(acx->dev, "failed to read panel ID (%d)\n", ret);
goto err_power_off; goto err_power_off;
} }
...@@ -284,8 +267,7 @@ static int acx424akp_prepare(struct drm_panel *panel) ...@@ -284,8 +267,7 @@ static int acx424akp_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_tear_on(dsi, ret = mipi_dsi_dcs_set_tear_on(dsi,
MIPI_DSI_DCS_TEAR_MODE_VBLANK); MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to enable vblank TE (%d)\n", dev_err(acx->dev, "failed to enable vblank TE (%d)\n", ret);
ret);
goto err_power_off; goto err_power_off;
} }
...@@ -302,23 +284,21 @@ static int acx424akp_prepare(struct drm_panel *panel) ...@@ -302,23 +284,21 @@ static int acx424akp_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write(dsi, ACX424_DCS_SET_MDDI, ret = mipi_dsi_dcs_write(dsi, ACX424_DCS_SET_MDDI,
&mddi, sizeof(mddi)); &mddi, sizeof(mddi));
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(acx->dev, "failed to set MDDI (%d)\n", ret); dev_err(acx->dev, "failed to set MDDI (%d)\n", ret);
goto err_power_off; goto err_power_off;
} }
/* Exit sleep mode */ /* Exit sleep mode */
ret = mipi_dsi_dcs_exit_sleep_mode(dsi); ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to exit sleep mode (%d)\n", dev_err(acx->dev, "failed to exit sleep mode (%d)\n", ret);
ret);
goto err_power_off; goto err_power_off;
} }
msleep(140); msleep(140);
ret = mipi_dsi_dcs_set_display_on(dsi); ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to turn display on (%d)\n", dev_err(acx->dev, "failed to turn display on (%d)\n", ret);
ret);
goto err_power_off; goto err_power_off;
} }
if (acx->video_mode) { if (acx->video_mode) {
...@@ -351,24 +331,20 @@ static int acx424akp_unprepare(struct drm_panel *panel) ...@@ -351,24 +331,20 @@ static int acx424akp_unprepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
&par, 1); &par, 1);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, dev_err(acx->dev, "failed to disable display backlight (%d)\n", ret);
"failed to disable display backlight (%d)\n",
ret);
return ret; return ret;
} }
ret = mipi_dsi_dcs_set_display_off(dsi); ret = mipi_dsi_dcs_set_display_off(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to turn display off (%d)\n", dev_err(acx->dev, "failed to turn display off (%d)\n", ret);
ret);
return ret; return ret;
} }
/* Enter sleep mode */ /* Enter sleep mode */
ret = mipi_dsi_dcs_enter_sleep_mode(dsi); ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret) { if (ret) {
DRM_DEV_ERROR(acx->dev, "failed to enter sleep mode (%d)\n", dev_err(acx->dev, "failed to enter sleep mode (%d)\n", ret);
ret);
return ret; return ret;
} }
msleep(85); msleep(85);
...@@ -418,7 +394,7 @@ static int acx424akp_get_modes(struct drm_panel *panel, ...@@ -418,7 +394,7 @@ static int acx424akp_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, mode = drm_mode_duplicate(connector->dev,
&sony_acx424akp_cmd_mode); &sony_acx424akp_cmd_mode);
if (!mode) { if (!mode) {
DRM_ERROR("bad mode or failed to add mode\n"); dev_err(panel->dev, "bad mode or failed to add mode\n");
return -EINVAL; return -EINVAL;
} }
drm_mode_set_name(mode); drm_mode_set_name(mode);
...@@ -486,8 +462,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi) ...@@ -486,8 +462,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(acx->reset_gpio)) { if (IS_ERR(acx->reset_gpio)) {
ret = PTR_ERR(acx->reset_gpio); ret = PTR_ERR(acx->reset_gpio);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to request GPIO (%d)\n", dev_err(dev, "failed to request GPIO (%d)\n", ret);
ret);
return ret; return ret;
} }
...@@ -497,7 +472,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi) ...@@ -497,7 +472,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi)
acx->bl = devm_backlight_device_register(dev, "acx424akp", dev, acx, acx->bl = devm_backlight_device_register(dev, "acx424akp", dev, acx,
&acx424akp_bl_ops, NULL); &acx424akp_bl_ops, NULL);
if (IS_ERR(acx->bl)) { if (IS_ERR(acx->bl)) {
DRM_DEV_ERROR(dev, "failed to register backlight device\n"); dev_err(dev, "failed to register backlight device\n");
return PTR_ERR(acx->bl); return PTR_ERR(acx->bl);
} }
acx->bl->props.max_brightness = 1023; acx->bl->props.max_brightness = 1023;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
*/ */
#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/bitops.h> #include <linux/bitops.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -238,7 +237,7 @@ static u8 tpg110_readwrite_reg(struct tpg110 *tpg, bool write, ...@@ -238,7 +237,7 @@ static u8 tpg110_readwrite_reg(struct tpg110 *tpg, bool write,
spi_message_add_tail(&t[1], &m); spi_message_add_tail(&t[1], &m);
ret = spi_sync(tpg->spi, &m); ret = spi_sync(tpg->spi, &m);
if (ret) { if (ret) {
DRM_DEV_ERROR(tpg->dev, "SPI message error %d\n", ret); dev_err(tpg->dev, "SPI message error %d\n", ret);
return ret; return ret;
} }
if (write) if (write)
...@@ -265,18 +264,18 @@ static int tpg110_startup(struct tpg110 *tpg) ...@@ -265,18 +264,18 @@ static int tpg110_startup(struct tpg110 *tpg)
/* De-assert the reset signal */ /* De-assert the reset signal */
gpiod_set_value_cansleep(tpg->grestb, 0); gpiod_set_value_cansleep(tpg->grestb, 0);
usleep_range(1000, 2000); usleep_range(1000, 2000);
DRM_DEV_DEBUG(tpg->dev, "de-asserted GRESTB\n"); dev_dbg(tpg->dev, "de-asserted GRESTB\n");
/* Test display communication */ /* Test display communication */
tpg110_write_reg(tpg, TPG110_TEST, 0x55); tpg110_write_reg(tpg, TPG110_TEST, 0x55);
val = tpg110_read_reg(tpg, TPG110_TEST); val = tpg110_read_reg(tpg, TPG110_TEST);
if (val != 0x55) { if (val != 0x55) {
DRM_DEV_ERROR(tpg->dev, "failed communication test\n"); dev_err(tpg->dev, "failed communication test\n");
return -ENODEV; return -ENODEV;
} }
val = tpg110_read_reg(tpg, TPG110_CHIPID); val = tpg110_read_reg(tpg, TPG110_CHIPID);
DRM_DEV_INFO(tpg->dev, "TPG110 chip ID: %d version: %d\n", dev_info(tpg->dev, "TPG110 chip ID: %d version: %d\n",
val >> 4, val & 0x0f); val >> 4, val & 0x0f);
/* Show display resolution */ /* Show display resolution */
...@@ -284,27 +283,25 @@ static int tpg110_startup(struct tpg110 *tpg) ...@@ -284,27 +283,25 @@ static int tpg110_startup(struct tpg110 *tpg)
val &= TPG110_RES_MASK; val &= TPG110_RES_MASK;
switch (val) { switch (val) {
case TPG110_RES_400X240_D: case TPG110_RES_400X240_D:
DRM_DEV_INFO(tpg->dev, dev_info(tpg->dev, "IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n");
"IN 400x240 RGB -> OUT 800x480 RGB (dual scan)\n");
break; break;
case TPG110_RES_480X272_D: case TPG110_RES_480X272_D:
DRM_DEV_INFO(tpg->dev, dev_info(tpg->dev, "IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n");
"IN 480x272 RGB -> OUT 800x480 RGB (dual scan)\n");
break; break;
case TPG110_RES_480X640: case TPG110_RES_480X640:
DRM_DEV_INFO(tpg->dev, "480x640 RGB\n"); dev_info(tpg->dev, "480x640 RGB\n");
break; break;
case TPG110_RES_480X272: case TPG110_RES_480X272:
DRM_DEV_INFO(tpg->dev, "480x272 RGB\n"); dev_info(tpg->dev, "480x272 RGB\n");
break; break;
case TPG110_RES_640X480: case TPG110_RES_640X480:
DRM_DEV_INFO(tpg->dev, "640x480 RGB\n"); dev_info(tpg->dev, "640x480 RGB\n");
break; break;
case TPG110_RES_800X480: case TPG110_RES_800X480:
DRM_DEV_INFO(tpg->dev, "800x480 RGB\n"); dev_info(tpg->dev, "800x480 RGB\n");
break; break;
default: default:
DRM_DEV_ERROR(tpg->dev, "ILLEGAL RESOLUTION 0x%02x\n", val); dev_err(tpg->dev, "ILLEGAL RESOLUTION 0x%02x\n", val);
break; break;
} }
...@@ -322,13 +319,12 @@ static int tpg110_startup(struct tpg110 *tpg) ...@@ -322,13 +319,12 @@ static int tpg110_startup(struct tpg110 *tpg)
} }
} }
if (i == ARRAY_SIZE(tpg110_modes)) { if (i == ARRAY_SIZE(tpg110_modes)) {
DRM_DEV_ERROR(tpg->dev, "unsupported mode (%02x) detected\n", dev_err(tpg->dev, "unsupported mode (%02x) detected\n", val);
val);
return -ENODEV; return -ENODEV;
} }
val = tpg110_read_reg(tpg, TPG110_CTRL2); val = tpg110_read_reg(tpg, TPG110_CTRL2);
DRM_DEV_INFO(tpg->dev, "resolution and standby is controlled by %s\n", dev_info(tpg->dev, "resolution and standby is controlled by %s\n",
(val & TPG110_CTRL2_RES_PM_CTRL) ? "software" : "hardware"); (val & TPG110_CTRL2_RES_PM_CTRL) ? "software" : "hardware");
/* Take control over resolution and standby */ /* Take control over resolution and standby */
val |= TPG110_CTRL2_RES_PM_CTRL; val |= TPG110_CTRL2_RES_PM_CTRL;
...@@ -414,15 +410,15 @@ static int tpg110_probe(struct spi_device *spi) ...@@ -414,15 +410,15 @@ static int tpg110_probe(struct spi_device *spi)
/* We get the physical display dimensions from the DT */ /* We get the physical display dimensions from the DT */
ret = of_property_read_u32(np, "width-mm", &tpg->width); ret = of_property_read_u32(np, "width-mm", &tpg->width);
if (ret) if (ret)
DRM_DEV_ERROR(dev, "no panel width specified\n"); dev_err(dev, "no panel width specified\n");
ret = of_property_read_u32(np, "height-mm", &tpg->height); ret = of_property_read_u32(np, "height-mm", &tpg->height);
if (ret) if (ret)
DRM_DEV_ERROR(dev, "no panel height specified\n"); dev_err(dev, "no panel height specified\n");
/* This asserts the GRESTB signal, putting the display into reset */ /* This asserts the GRESTB signal, putting the display into reset */
tpg->grestb = devm_gpiod_get(dev, "grestb", GPIOD_OUT_HIGH); tpg->grestb = devm_gpiod_get(dev, "grestb", GPIOD_OUT_HIGH);
if (IS_ERR(tpg->grestb)) { if (IS_ERR(tpg->grestb)) {
DRM_DEV_ERROR(dev, "no GRESTB GPIO\n"); dev_err(dev, "no GRESTB GPIO\n");
return -ENODEV; return -ENODEV;
} }
...@@ -430,7 +426,7 @@ static int tpg110_probe(struct spi_device *spi) ...@@ -430,7 +426,7 @@ static int tpg110_probe(struct spi_device *spi)
spi->mode |= SPI_3WIRE_HIZ; spi->mode |= SPI_3WIRE_HIZ;
ret = spi_setup(spi); ret = spi_setup(spi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "spi setup failed.\n"); dev_err(dev, "spi setup failed.\n");
return ret; return ret;
} }
tpg->spi = spi; tpg->spi = spi;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,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>
static const char * const regulator_names[] = { static const char * const regulator_names[] = {
"vdda", "vdda",
...@@ -231,9 +230,7 @@ static int truly_dcs_write(struct drm_panel *panel, u32 command) ...@@ -231,9 +230,7 @@ static int truly_dcs_write(struct drm_panel *panel, u32 command)
for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) { for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
ret = mipi_dsi_dcs_write(ctx->dsi[i], command, NULL, 0); ret = mipi_dsi_dcs_write(ctx->dsi[i], command, NULL, 0);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "cmd 0x%x failed for dsi = %d\n", command, i);
"cmd 0x%x failed for dsi = %d\n",
command, i);
} }
} }
...@@ -250,8 +247,7 @@ static int truly_dcs_write_buf(struct drm_panel *panel, ...@@ -250,8 +247,7 @@ static int truly_dcs_write_buf(struct drm_panel *panel,
for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) { for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
ret = mipi_dsi_dcs_write_buffer(ctx->dsi[i], buf, size); ret = mipi_dsi_dcs_write_buffer(ctx->dsi[i], buf, size);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "failed to tx cmd [%d], err: %d\n", i, ret);
"failed to tx cmd [%d], err: %d\n", i, ret);
return ret; return ret;
} }
} }
...@@ -300,16 +296,14 @@ static int truly_nt35597_power_off(struct truly_nt35597 *ctx) ...@@ -300,16 +296,14 @@ static int truly_nt35597_power_off(struct truly_nt35597 *ctx)
ret = regulator_set_load(ctx->supplies[i].consumer, ret = regulator_set_load(ctx->supplies[i].consumer,
regulator_disable_loads[i]); regulator_disable_loads[i]);
if (ret) { if (ret) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "regulator_set_load failed %d\n", ret);
"regulator_set_load failed %d\n", ret);
return ret; return ret;
} }
} }
ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
if (ret) { if (ret) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "regulator_bulk_disable failed %d\n", ret);
"regulator_bulk_disable failed %d\n", ret);
} }
return ret; return ret;
} }
...@@ -325,8 +319,7 @@ static int truly_nt35597_disable(struct drm_panel *panel) ...@@ -325,8 +319,7 @@ static int truly_nt35597_disable(struct drm_panel *panel)
if (ctx->backlight) { if (ctx->backlight) {
ret = backlight_disable(ctx->backlight); ret = backlight_disable(ctx->backlight);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->dev, "backlight disable failed %d\n", dev_err(ctx->dev, "backlight disable failed %d\n", ret);
ret);
} }
ctx->enabled = false; ctx->enabled = false;
...@@ -346,9 +339,7 @@ static int truly_nt35597_unprepare(struct drm_panel *panel) ...@@ -346,9 +339,7 @@ static int truly_nt35597_unprepare(struct drm_panel *panel)
ret = truly_dcs_write(panel, MIPI_DCS_SET_DISPLAY_OFF); ret = truly_dcs_write(panel, MIPI_DCS_SET_DISPLAY_OFF);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "set_display_off cmd failed ret = %d\n", ret);
"set_display_off cmd failed ret = %d\n",
ret);
} }
/* 120ms delay required here as per DCS spec */ /* 120ms delay required here as per DCS spec */
...@@ -356,13 +347,12 @@ static int truly_nt35597_unprepare(struct drm_panel *panel) ...@@ -356,13 +347,12 @@ static int truly_nt35597_unprepare(struct drm_panel *panel)
ret = truly_dcs_write(panel, MIPI_DCS_ENTER_SLEEP_MODE); ret = truly_dcs_write(panel, MIPI_DCS_ENTER_SLEEP_MODE);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "enter_sleep cmd failed ret = %d\n", ret);
"enter_sleep cmd failed ret = %d\n", ret);
} }
ret = truly_nt35597_power_off(ctx); ret = truly_nt35597_power_off(ctx);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->dev, "power_off failed ret = %d\n", ret); dev_err(ctx->dev, "power_off failed ret = %d\n", ret);
ctx->prepared = false; ctx->prepared = false;
return ret; return ret;
...@@ -396,18 +386,14 @@ static int truly_nt35597_prepare(struct drm_panel *panel) ...@@ -396,18 +386,14 @@ static int truly_nt35597_prepare(struct drm_panel *panel)
panel_on_cmds[i].size, panel_on_cmds[i].size,
panel_on_cmds[i].commands); panel_on_cmds[i].commands);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "cmd set tx failed i = %d ret = %d\n", i, ret);
"cmd set tx failed i = %d ret = %d\n",
i, ret);
goto power_off; goto power_off;
} }
} }
ret = truly_dcs_write(panel, MIPI_DCS_EXIT_SLEEP_MODE); ret = truly_dcs_write(panel, MIPI_DCS_EXIT_SLEEP_MODE);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "exit_sleep_mode cmd failed ret = %d\n", ret);
"exit_sleep_mode cmd failed ret = %d\n",
ret);
goto power_off; goto power_off;
} }
...@@ -416,8 +402,7 @@ static int truly_nt35597_prepare(struct drm_panel *panel) ...@@ -416,8 +402,7 @@ static int truly_nt35597_prepare(struct drm_panel *panel)
ret = truly_dcs_write(panel, MIPI_DCS_SET_DISPLAY_ON); ret = truly_dcs_write(panel, MIPI_DCS_SET_DISPLAY_ON);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "set_display_on cmd failed ret = %d\n", ret);
"set_display_on cmd failed ret = %d\n", ret);
goto power_off; goto power_off;
} }
...@@ -430,7 +415,7 @@ static int truly_nt35597_prepare(struct drm_panel *panel) ...@@ -430,7 +415,7 @@ static int truly_nt35597_prepare(struct drm_panel *panel)
power_off: power_off:
if (truly_nt35597_power_off(ctx)) if (truly_nt35597_power_off(ctx))
DRM_DEV_ERROR(ctx->dev, "power_off failed\n"); dev_err(ctx->dev, "power_off failed\n");
return ret; return ret;
} }
...@@ -445,8 +430,7 @@ static int truly_nt35597_enable(struct drm_panel *panel) ...@@ -445,8 +430,7 @@ static int truly_nt35597_enable(struct drm_panel *panel)
if (ctx->backlight) { if (ctx->backlight) {
ret = backlight_enable(ctx->backlight); ret = backlight_enable(ctx->backlight);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->dev, "backlight enable failed %d\n", dev_err(ctx->dev, "backlight enable failed %d\n", ret);
ret);
} }
ctx->enabled = true; ctx->enabled = true;
...@@ -464,8 +448,7 @@ static int truly_nt35597_get_modes(struct drm_panel *panel, ...@@ -464,8 +448,7 @@ static int truly_nt35597_get_modes(struct drm_panel *panel,
config = ctx->config; config = ctx->config;
mode = drm_mode_create(connector->dev); mode = drm_mode_create(connector->dev);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "failed to create a new display mode\n");
"failed to create a new display mode\n");
return 0; return 0;
} }
...@@ -501,15 +484,13 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx) ...@@ -501,15 +484,13 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx)
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 %ld\n", dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio));
PTR_ERR(ctx->reset_gpio));
return PTR_ERR(ctx->reset_gpio); return PTR_ERR(ctx->reset_gpio);
} }
ctx->mode_gpio = devm_gpiod_get(dev, "mode", GPIOD_OUT_LOW); ctx->mode_gpio = devm_gpiod_get(dev, "mode", GPIOD_OUT_LOW);
if (IS_ERR(ctx->mode_gpio)) { if (IS_ERR(ctx->mode_gpio)) {
DRM_DEV_ERROR(dev, "cannot get mode gpio %ld\n", dev_err(dev, "cannot get mode gpio %ld\n", PTR_ERR(ctx->mode_gpio));
PTR_ERR(ctx->mode_gpio));
return PTR_ERR(ctx->mode_gpio); return PTR_ERR(ctx->mode_gpio);
} }
...@@ -584,22 +565,21 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi) ...@@ -584,22 +565,21 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1); dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
if (!dsi1) { if (!dsi1) {
DRM_DEV_ERROR(dev, dev_err(dev, "failed to get remote node for dsi1_device\n");
"failed to get remote node for dsi1_device\n");
return -ENODEV; return -ENODEV;
} }
dsi1_host = of_find_mipi_dsi_host_by_node(dsi1); dsi1_host = of_find_mipi_dsi_host_by_node(dsi1);
of_node_put(dsi1); of_node_put(dsi1);
if (!dsi1_host) { if (!dsi1_host) {
DRM_DEV_ERROR(dev, "failed to find dsi host\n"); dev_err(dev, "failed to find dsi host\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
/* register the second DSI device */ /* register the second DSI device */
dsi1_device = mipi_dsi_device_register_full(dsi1_host, &info); dsi1_device = mipi_dsi_device_register_full(dsi1_host, &info);
if (IS_ERR(dsi1_device)) { if (IS_ERR(dsi1_device)) {
DRM_DEV_ERROR(dev, "failed to create dsi device\n"); dev_err(dev, "failed to create dsi device\n");
return PTR_ERR(dsi1_device); return PTR_ERR(dsi1_device);
} }
...@@ -611,7 +591,7 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi) ...@@ -611,7 +591,7 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
ret = truly_nt35597_panel_add(ctx); ret = truly_nt35597_panel_add(ctx);
if (ret) { if (ret) {
DRM_DEV_ERROR(dev, "failed to add panel\n"); dev_err(dev, "failed to add panel\n");
goto err_panel_add; goto err_panel_add;
} }
...@@ -623,8 +603,7 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi) ...@@ -623,8 +603,7 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_CLOCK_NON_CONTINUOUS; MIPI_DSI_CLOCK_NON_CONTINUOUS;
ret = mipi_dsi_attach(dsi_dev); ret = mipi_dsi_attach(dsi_dev);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, dev_err(dev, "dsi attach failed i = %d\n", i);
"dsi attach failed i = %d\n", i);
goto err_dsi_attach; goto err_dsi_attach;
} }
} }
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,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>
struct visionox_rm69299 { struct visionox_rm69299 {
struct drm_panel panel; struct drm_panel panel;
...@@ -69,16 +68,14 @@ static int visionox_rm69299_unprepare(struct drm_panel *panel) ...@@ -69,16 +68,14 @@ static int visionox_rm69299_unprepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0); ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
if (ret < 0) if (ret < 0)
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "set_display_off cmd failed ret = %d\n", ret);
"set_display_off cmd failed ret = %d\n", ret);
/* 120ms delay required here as per DCS spec */ /* 120ms delay required here as per DCS spec */
msleep(120); msleep(120);
ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0); ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "enter_sleep cmd failed ret = %d\n", ret);
"enter_sleep cmd failed ret = %d\n", ret);
} }
ret = visionox_rm69299_power_off(ctx); ret = visionox_rm69299_power_off(ctx);
...@@ -103,36 +100,31 @@ static int visionox_rm69299_prepare(struct drm_panel *panel) ...@@ -103,36 +100,31 @@ static int visionox_rm69299_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xfe, 0x00 }, 2); ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xfe, 0x00 }, 2);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "cmd set tx 0 failed, ret = %d\n", ret);
"cmd set tx 0 failed, ret = %d\n", ret);
goto power_off; goto power_off;
} }
ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xc2, 0x08 }, 2); ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xc2, 0x08 }, 2);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "cmd set tx 1 failed, ret = %d\n", ret);
"cmd set tx 1 failed, ret = %d\n", ret);
goto power_off; goto power_off;
} }
ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x35, 0x00 }, 2); ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x35, 0x00 }, 2);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "cmd set tx 2 failed, ret = %d\n", ret);
"cmd set tx 2 failed, ret = %d\n", ret);
goto power_off; goto power_off;
} }
ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x51, 0xff }, 2); ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x51, 0xff }, 2);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "cmd set tx 3 failed, ret = %d\n", ret);
"cmd set tx 3 failed, ret = %d\n", ret);
goto power_off; goto power_off;
} }
ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0); ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "exit_sleep_mode cmd failed ret = %d\n", ret);
"exit_sleep_mode cmd failed ret = %d\n", ret);
goto power_off; goto power_off;
} }
...@@ -141,8 +133,7 @@ static int visionox_rm69299_prepare(struct drm_panel *panel) ...@@ -141,8 +133,7 @@ static int visionox_rm69299_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0); ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "set_display_on cmd failed ret = %d\n", ret);
"set_display_on cmd failed ret = %d\n", ret);
goto power_off; goto power_off;
} }
...@@ -179,8 +170,7 @@ static int visionox_rm69299_get_modes(struct drm_panel *panel, ...@@ -179,8 +170,7 @@ static int visionox_rm69299_get_modes(struct drm_panel *panel,
mode = drm_mode_create(connector->dev); mode = drm_mode_create(connector->dev);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(ctx->panel.dev, dev_err(ctx->panel.dev, "failed to create a new display mode\n");
"failed to create a new display mode\n");
return 0; return 0;
} }
...@@ -225,8 +215,7 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi) ...@@ -225,8 +215,7 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev, ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
"reset", GPIOD_OUT_LOW); "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset_gpio)) { if (IS_ERR(ctx->reset_gpio)) {
DRM_DEV_ERROR(dev, "cannot get reset gpio %ld\n", dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio));
PTR_ERR(ctx->reset_gpio));
return PTR_ERR(ctx->reset_gpio); return PTR_ERR(ctx->reset_gpio);
} }
...@@ -242,23 +231,19 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi) ...@@ -242,23 +231,19 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_CLOCK_NON_CONTINUOUS; MIPI_DSI_CLOCK_NON_CONTINUOUS;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "dsi attach failed ret = %d\n", ret); dev_err(dev, "dsi attach failed ret = %d\n", ret);
goto err_dsi_attach; goto err_dsi_attach;
} }
ret = regulator_set_load(ctx->supplies[0].consumer, 32000); ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
if (ret) { if (ret) {
DRM_DEV_ERROR(dev, dev_err(dev, "regulator set load failed for vdda supply ret = %d\n", ret);
"regulator set load failed for vdda supply ret = %d\n",
ret);
goto err_set_load; goto err_set_load;
} }
ret = regulator_set_load(ctx->supplies[1].consumer, 13200); ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
if (ret) { if (ret) {
DRM_DEV_ERROR(dev, dev_err(dev, "regulator set load failed for vdd3p3 supply ret = %d\n", ret);
"regulator set load failed for vdd3p3 supply ret = %d\n",
ret);
goto err_set_load; goto err_set_load;
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,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 <video/display_timing.h> #include <video/display_timing.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
...@@ -135,7 +134,7 @@ static int xpp055c272_init_sequence(struct xpp055c272 *ctx) ...@@ -135,7 +134,7 @@ static int xpp055c272_init_sequence(struct xpp055c272 *ctx)
msleep(60); msleep(60);
DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n"); dev_dbg(dev, "Panel init sequence done\n");
return 0; return 0;
} }
...@@ -150,13 +149,11 @@ static int xpp055c272_unprepare(struct drm_panel *panel) ...@@ -150,13 +149,11 @@ static int xpp055c272_unprepare(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, "failed to set display off: %d\n", dev_err(ctx->dev, "failed to set display off: %d\n", ret);
ret);
mipi_dsi_dcs_enter_sleep_mode(dsi); mipi_dsi_dcs_enter_sleep_mode(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, "failed to enter sleep mode: %d\n", dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -177,17 +174,15 @@ static int xpp055c272_prepare(struct drm_panel *panel) ...@@ -177,17 +174,15 @@ static int xpp055c272_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->vci); ret = regulator_enable(ctx->vci);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret);
"Failed to enable vci 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_vci; goto disable_vci;
} }
...@@ -201,14 +196,13 @@ static int xpp055c272_prepare(struct drm_panel *panel) ...@@ -201,14 +196,13 @@ static int xpp055c272_prepare(struct drm_panel *panel)
ret = xpp055c272_init_sequence(ctx); ret = xpp055c272_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);
goto disable_iovcc; goto disable_iovcc;
} }
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);
goto disable_iovcc; goto disable_iovcc;
} }
...@@ -217,7 +211,7 @@ static int xpp055c272_prepare(struct drm_panel *panel) ...@@ -217,7 +211,7 @@ static int xpp055c272_prepare(struct drm_panel *panel)
ret = mipi_dsi_dcs_set_display_on(dsi); ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(ctx->dev, "Failed to set display on: %d\n", ret); dev_err(ctx->dev, "Failed to set display on: %d\n", ret);
goto disable_iovcc; goto disable_iovcc;
} }
...@@ -256,7 +250,7 @@ static int xpp055c272_get_modes(struct drm_panel *panel, ...@@ -256,7 +250,7 @@ static int xpp055c272_get_modes(struct drm_panel *panel,
mode = drm_mode_duplicate(connector->dev, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_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",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
drm_mode_vrefresh(&default_mode)); drm_mode_vrefresh(&default_mode));
return -ENOMEM; return -ENOMEM;
...@@ -290,7 +284,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi) ...@@ -290,7 +284,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)
ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); ctx->reset_gpio = devm_gpiod_get_optional(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);
} }
...@@ -298,9 +292,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi) ...@@ -298,9 +292,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(ctx->vci)) { if (IS_ERR(ctx->vci)) {
ret = PTR_ERR(ctx->vci); ret = PTR_ERR(ctx->vci);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, dev_err(dev, "Failed to request vci regulator: %d\n", ret);
"Failed to request vci regulator: %d\n",
ret);
return ret; return ret;
} }
...@@ -308,9 +300,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi) ...@@ -308,9 +300,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)
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;
} }
...@@ -334,7 +324,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi) ...@@ -334,7 +324,7 @@ static int xpp055c272_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, "mipi_dsi_attach failed: %d\n", ret); dev_err(dev, "mipi_dsi_attach failed: %d\n", ret);
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
return ret; return ret;
} }
...@@ -349,13 +339,11 @@ static void xpp055c272_shutdown(struct mipi_dsi_device *dsi) ...@@ -349,13 +339,11 @@ static void xpp055c272_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 xpp055c272_remove(struct mipi_dsi_device *dsi) static int xpp055c272_remove(struct mipi_dsi_device *dsi)
...@@ -367,8 +355,7 @@ static int xpp055c272_remove(struct mipi_dsi_device *dsi) ...@@ -367,8 +355,7 @@ static int xpp055c272_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