aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel/panel-sony-acx424akp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/panel/panel-sony-acx424akp.c')
-rw-r--r--drivers/gpu/drm/panel/panel-sony-acx424akp.c85
1 files changed, 29 insertions, 56 deletions
diff --git a/drivers/gpu/drm/panel/panel-sony-acx424akp.c b/drivers/gpu/drm/panel/panel-sony-acx424akp.c
index 97a1b4790d3c..065efae213f5 100644
--- a/drivers/gpu/drm/panel/panel-sony-acx424akp.c
+++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c
@@ -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,16 +472,14 @@ 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;
acx->bl->props.brightness = 512;
acx->bl->props.power = FB_BLANK_POWERDOWN;
- ret = drm_panel_add(&acx->panel);
- if (ret < 0)
- return ret;
+ drm_panel_add(&acx->panel);
ret = mipi_dsi_attach(dsi);
if (ret < 0) {