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