summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Cai <robby.cai@nxp.com>2017-07-06 20:36:44 +0800
committerRobby Cai <robby.cai@nxp.com>2017-07-07 11:10:04 +0800
commitcf961f26861eead5f2d10d7c6c24507b707cef45 (patch)
tree0bb7806b89eff701a67d339e49953126c7e95226
parent283ea84523684c3dce843abc6baa703176f5ec2c (diff)
MLK-15079 video: mipi_dsi_samsung: fix reset failure for mipi dsi
mxc_mipi_dsi_samsung 30760000.mipi-dsi: MIPI DSI dispdrv inited! mxsfb 30730000.lcdif: registered mxc display driver mipi_dsi_samsung mxc_mipi_dsi_samsung 30760000.mipi-dsi: failed to reset device: -517 mxsfb 30730000.lcdif: failed to enable dispdrv:mipi_dsi_samsung due to the commit e188cbf7564fba80e8339b9406e8740f3e495c63 "gpio: mxc: shift gpio_mxc_init() to subsys_initcall level", and gpio_reset uses arch_initcall level, the gpio driver is not yet ready when call device_reset() thus return -EPROBE_DEFER. But the caller of device_reset(), mipi_dsi_enable() has no defer strategy. use of_reset_control_get() function in init() function, which will be called in probe function in mxsfb driver, to workaround the defer case. Acked-by: Fang Chen <chen.fang@nxp.com> Acked-by: Cristina-mihaela Ciocan <cristina-mihaela.ciocan@nxp.com> Signed-off-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit 5e90ffe698d08010b52104431409b2c45dcbca52)
-rw-r--r--drivers/video/fbdev/mxc/mipi_dsi_samsung.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/video/fbdev/mxc/mipi_dsi_samsung.c b/drivers/video/fbdev/mxc/mipi_dsi_samsung.c
index 3b2a0ee10c8e..d6bcf2a3de9f 100644
--- a/drivers/video/fbdev/mxc/mipi_dsi_samsung.c
+++ b/drivers/video/fbdev/mxc/mipi_dsi_samsung.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2017 NXP.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -514,16 +515,24 @@ static int mipi_dsi_disp_init(struct mxc_dispdrv_handle *disp,
{
struct mipi_dsi_info *mipi_dsi = mxc_dispdrv_getdata(disp);
struct device *dev = &mipi_dsi->pdev->dev;
+ struct device_node *np = dev->of_node;
+ struct reset_control *reset = NULL;
int ret = 0;
+ reset = of_reset_control_get(np, NULL);
+ if (IS_ERR(reset))
+ return PTR_ERR(reset);
+
ret = mipi_dsi_lcd_init(mipi_dsi, setting);
if (ret) {
dev_err(dev, "failed to init mipi dsi lcd\n");
- return ret;
+ goto out;
}
dev_info(dev, "MIPI DSI dispdrv inited!\n");
+out:
+ reset_control_put(reset);
return ret;
}