struct mutex lock;
struct mutex pm_lock;
+ struct mutex rcv_lock; /* recovery lock */
spinlock_t slock;
#if defined(CONFIG_EXYNOS_READ_ESD_SOLUTION)
struct decon_esd esd;
int decon_set_out_sd_state(struct decon_device *decon, enum decon_state state);
int decon_update_last_regs(struct decon_device *decon,
struct decon_reg_data *regs);
+int decon_handle_recovery(struct decon_device *decon);
int register_lcd_status_notifier(struct notifier_block *nb);
int unregister_lcd_status_notifier(struct notifier_block *nb);
#if defined(CONFIG_EXYNOS_READ_ESD_SOLUTION)
mutex_init(&decon->esd.lock);
#endif
+ mutex_init(&decon->rcv_lock);
decon_enter_shutdown_reset(decon);
#if defined(CONFIG_EXYNOS_READ_ESD_SOLUTION)
#define ESD_RECOVERY_RETRY_CNT 5
-static int decon_handle_esd(struct decon_device *decon)
+int decon_handle_recovery(struct decon_device *decon)
{
struct dsim_device *dsim;
int ret = 0;
return -EINVAL;
}
+ mutex_lock(&decon->rcv_lock);
+
decon_bypass_on(decon);
dsim = container_of(decon->out_sd[0], struct dsim_device, sd);
dsim->esd_recovering = true;
decon_set_bypass(decon, true);
decon_bypass_off(decon);
+
+ mutex_unlock(&decon->rcv_lock);
+
decon_info("%s -\n", __func__);
return ret;
case DSIM_ESD_CHECK_ERROR:
decon_err("%s, It is not ESD, \
but DDI is abnormal state(%d)\n", __func__, esd);
- ret = decon_handle_esd(decon);
+ ret = decon_handle_recovery(decon);
if (ret)
decon_err("%s, failed to recover ESD\n", __func__);
break;
break;
case DSIM_ESD_ERROR:
decon_err("%s, ESD is detected(%d)\n", __func__, esd);
- ret = decon_handle_esd(decon);
+ ret = decon_handle_recovery(decon);
if (ret)
decon_err("%s, failed to recover ESD\n", __func__);
break;
u32 rx_fifo_depth = DSIM_RX_FIFO_MAX_DEPTH;
struct decon_device *decon = get_decon_drvdata(0);
struct dsim_regs regs;
+ int ret2 = 0;
decon_hiber_block_exit(decon);
dsim_write_data(dsim, id, addr, 0);
if (!wait_for_completion_timeout(&dsim->rd_comp, MIPI_RD_TIMEOUT)) {
dsim_err("MIPI DSIM read Timeout!\n");
+ decon_handle_recovery(decon);
+ if (decon->esd.thread) {
+ ret2 = wake_up_process(decon->esd.thread);
+ dsim_info("%s:%d, wakeup esd thread(%d)\n", __func__,
+ __LINE__, ret2);
+ }
return -ETIMEDOUT;
}
switch (cmd) {
case 1:
- ret = dsim_cmd_sysfs_read(dsim);
#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
#endif
+ ret = dsim_cmd_sysfs_read(dsim);
call_panel_ops(dsim, dump, dsim);
#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
for (i = 0; i < RETRY; i++) {
ret = dsim_read_data(dsim, MIPI_DSI_DCS_READ,
MIPI_DCS_GET_POWER_MODE, 0x1, buf);
- if (ret < 0) {
+ if (ret == -ETIMEDOUT) {
+ dsim_info("recovery is already operated\n");
+ return DSIM_ESD_OK;
+ } else if ((ret < 0) && (ret != -ETIMEDOUT)) {
dsim_err("Failed to read panel REG 0x%02X!: 0x%02x, i(%d)\n",
MIPI_DCS_GET_POWER_MODE,
*(unsigned int *)buf & 0xFF, i);
for (i = 0; i < RETRY; i++) {
ret = dsim_read_data(dsim, MIPI_DSI_DCS_READ,
MIPI_DCS_GET_POWER_MODE, 0x1, buf);
- if (ret < 0) {
+ if (ret == -ETIMEDOUT) {
+ dsim_info("recovery is already operated\n");
+ return DSIM_ESD_OK;
+ } else if ((ret < 0) && (ret != -ETIMEDOUT)) {
dsim_err("Failed to read panel REG 0x%02X!: 0x%02x, i(%d)\n",
MIPI_DCS_GET_POWER_MODE,
*(unsigned int *)buf & 0xFF, i);
for (i = 0; i < RETRY; i++) {
ret = dsim_read_data(dsim, MIPI_DSI_DCS_READ,
MIPI_DCS_GET_POWER_MODE, 0x1, buf);
- if (ret < 0) {
+ if (ret == -ETIMEDOUT) {
+ dsim_info("recovery is already operated\n");
+ return DSIM_ESD_OK;
+ } else if ((ret < 0) && (ret != -ETIMEDOUT)) {
dsim_err("Failed to read panel REG 0x%02X!: 0x%02x, i(%d)\n",
MIPI_DCS_GET_POWER_MODE,
*(unsigned int *)buf & 0xFF, i);