diff options
author | Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com> | 2011-09-02 12:14:15 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:04:03 +0200 |
commit | ad80a9b90974f8962be2b9670d73f9b50ddffa7e (patch) | |
tree | e6f4863fbc95983ed6fd82b582b7e51b04b013d3 | |
parent | 5741b0feaa068de2cfdea297300960684e1ce4b2 (diff) |
mcde:Migrate the patches to kernel 3.0
Migrate the mcde driver following patches to kernel 3.0
bf78368 video: mcde: correct DSI command set max pkt size
0dd4c53 video: mcde: Fix Coverity defects
ST-Ericsson ID: 352334
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: NA
Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
Change-Id: I2e89ca822915dc4c5f979f402e881b04f419b4f1
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30012
-rw-r--r-- | drivers/video/mcde/display-generic_dsi.c | 8 | ||||
-rw-r--r-- | drivers/video/mcde/mcde_fb.c | 31 | ||||
-rw-r--r-- | drivers/video/mcde/mcde_hw.c | 26 | ||||
-rw-r--r-- | include/video/mcde.h | 2 |
4 files changed, 33 insertions, 34 deletions
diff --git a/drivers/video/mcde/display-generic_dsi.c b/drivers/video/mcde/display-generic_dsi.c index 64ed3d6daa9..86c87303fa4 100644 --- a/drivers/video/mcde/display-generic_dsi.c +++ b/drivers/video/mcde/display-generic_dsi.c @@ -174,9 +174,15 @@ static int __devinit generic_probe(struct mcde_display_device *dev) pdata->regulator = NULL; goto regulator_get_failed; } - regulator_set_voltage(pdata->regulator, + ret = regulator_set_voltage(pdata->regulator, pdata->min_supply_voltage, pdata->max_supply_voltage); + if (ret < 0) { + dev_warn(&dev->dev, + "%s:Failed to set regulator '%s'\n", + __func__, pdata->regulator_id); + } + /* * When u-boot has display a startup screen. * U-boot has turned on display power however the diff --git a/drivers/video/mcde/mcde_fb.c b/drivers/video/mcde/mcde_fb.c index 332e371d54b..3de569dded0 100644 --- a/drivers/video/mcde/mcde_fb.c +++ b/drivers/video/mcde/mcde_fb.c @@ -481,6 +481,9 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev) struct pix_fmt_info *fmt; u32 line_len, size; + if (!ddev) + return -ENODEV; + dev_vdbg(&(ddev->dev), "%s\n", __func__); var = &fbi->var; @@ -502,22 +505,20 @@ static int apply_var(struct fb_info *fbi, struct mcde_display_device *ddev) if (ddev->fictive) goto apply_var_end; - if (ddev) { - /* Apply pixel format */ - fmt = var_to_pix_fmt_info(var); - mfb->pix_fmt = fmt->pix_fmt; - - /* Apply rotation */ - mcde_dss_set_rotation(ddev, var_to_rotation(var)); - /* Apply video mode */ - memset(&vmode, 0, sizeof(struct mcde_video_mode)); - var_to_vmode(var, &vmode); - ret = mcde_dss_set_video_mode(ddev, &vmode); - if (ret) - return ret; + /* Apply pixel format */ + fmt = var_to_pix_fmt_info(var); + mfb->pix_fmt = fmt->pix_fmt; - mcde_dss_apply_channel(ddev); - } + /* Apply rotation */ + mcde_dss_set_rotation(ddev, var_to_rotation(var)); + /* Apply video mode */ + memset(&vmode, 0, sizeof(struct mcde_video_mode)); + var_to_vmode(var, &vmode); + ret = mcde_dss_set_video_mode(ddev, &vmode); + if (ret) + return ret; + + mcde_dss_apply_channel(ddev); /* Apply overlay info */ for (i = 0; i < mfb->num_ovlys; i++) { diff --git a/drivers/video/mcde/mcde_hw.c b/drivers/video/mcde/mcde_hw.c index 8cf48ecad4b..d2105f0d29d 100644 --- a/drivers/video/mcde/mcde_hw.c +++ b/drivers/video/mcde/mcde_hw.c @@ -2337,6 +2337,7 @@ int mcde_dsi_dcs_read(struct mcde_chnl_state *chnl, return ret; } + /* * Set Maximum Return Packet size is a command that specifies the * maximum size of the payload transmitted from peripheral back to @@ -2348,7 +2349,7 @@ int mcde_dsi_dcs_read(struct mcde_chnl_state *chnl, * parameter should be set by the host processor to the desired value * in the initialization routine before commencing normal operation. */ -int mcde_dsi_set_max_pkt_size(struct mcde_chnl_state *chnl, int size) +int mcde_dsi_set_max_pkt_size(struct mcde_chnl_state *chnl) { u32 settings; u8 link = chnl->port.link; @@ -2357,38 +2358,29 @@ int mcde_dsi_set_max_pkt_size(struct mcde_chnl_state *chnl, int size) if (chnl->port.type != MCDE_PORTTYPE_DSI) return -EINVAL; - if (size > 4) - return -EINVAL; - mutex_lock(&mcde_hw_lock); if (enable_mcde_hw()) { mutex_unlock(&mcde_hw_lock); - return -EINVAL; + return -EIO; } /* * Set Maximum Return Packet Size is a four-byte command packet * (including ECC) that specifies the maximum size of the payload. * The order of bytes is: - * Data ID, two-byte value for maximum return packet size, - * followed by the ECC byte. */ - settings = DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_ENUM(WRITE) | - DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT(1) | + DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT(false) | DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID(virt_id) | - DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE(size) | - DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN(true); - settings |= DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_ENUM( - SET_MAX_PKT_SIZE); + DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE(2) | + DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN(true) | + DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_ENUM( + SET_MAX_PKT_SIZE); dsi_wreg(link, DSI_DIRECT_CMD_MAIN_SETTINGS, settings); - dsi_wreg(link, DSI_DIRECT_CMD_STS_CLR, ~0); + dsi_wreg(link, DSI_DIRECT_CMD_WRDAT0, MCDE_MAX_DCS_READ); dsi_wreg(link, DSI_DIRECT_CMD_SEND, true); - dsi_wreg(link, DSI_CMD_MODE_STS_CLR, ~0); - dsi_wreg(link, DSI_DIRECT_CMD_STS_CLR, ~0); - mutex_unlock(&mcde_hw_lock); return 0; } diff --git a/include/video/mcde.h b/include/video/mcde.h index 75992bf7d57..220ac167b0b 100644 --- a/include/video/mcde.h +++ b/include/video/mcde.h @@ -417,7 +417,7 @@ int mcde_dsi_dcs_write(struct mcde_chnl_state *chnl, u8 cmd, u8 *data, int len); int mcde_dsi_dcs_read(struct mcde_chnl_state *chnl, u8 cmd, u32 *data, int *len); -int mcde_dsi_set_max_pkt_size(struct mcde_chnl_state *chnl, int size); +int mcde_dsi_set_max_pkt_size(struct mcde_chnl_state *chnl); /* MCDE */ |