diff options
| -rw-r--r-- | drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c index 2ba9d0ca187c..94e0f207342e 100644 --- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c | |||
| @@ -163,50 +163,93 @@ static void nec_8048_panel_remove(struct omap_dss_device *dssdev) | |||
| 163 | kfree(necd); | 163 | kfree(necd); |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | static int nec_8048_panel_enable(struct omap_dss_device *dssdev) | 166 | static int nec_8048_panel_power_on(struct omap_dss_device *dssdev) |
| 167 | { | 167 | { |
| 168 | int r = 0; | 168 | int r; |
| 169 | struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev); | 169 | struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev); |
| 170 | struct backlight_device *bl = necd->bl; | 170 | struct backlight_device *bl = necd->bl; |
| 171 | 171 | ||
| 172 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
| 173 | return 0; | ||
| 174 | |||
| 175 | r = omapdss_dpi_display_enable(dssdev); | ||
| 176 | if (r) | ||
| 177 | goto err0; | ||
| 178 | |||
| 172 | if (dssdev->platform_enable) { | 179 | if (dssdev->platform_enable) { |
| 173 | r = dssdev->platform_enable(dssdev); | 180 | r = dssdev->platform_enable(dssdev); |
| 174 | if (r) | 181 | if (r) |
| 175 | return r; | 182 | goto err1; |
| 176 | } | 183 | } |
| 177 | 184 | ||
| 178 | r = nec_8048_bl_update_status(bl); | 185 | r = nec_8048_bl_update_status(bl); |
| 179 | if (r < 0) | 186 | if (r < 0) |
| 180 | dev_err(&dssdev->dev, "failed to set lcd brightness\n"); | 187 | dev_err(&dssdev->dev, "failed to set lcd brightness\n"); |
| 181 | 188 | ||
| 182 | r = omapdss_dpi_display_enable(dssdev); | 189 | return 0; |
| 183 | 190 | err1: | |
| 191 | omapdss_dpi_display_disable(dssdev); | ||
| 192 | err0: | ||
| 184 | return r; | 193 | return r; |
| 185 | } | 194 | } |
| 186 | 195 | ||
| 187 | static void nec_8048_panel_disable(struct omap_dss_device *dssdev) | 196 | static void nec_8048_panel_power_off(struct omap_dss_device *dssdev) |
| 188 | { | 197 | { |
| 189 | struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev); | 198 | struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev); |
| 190 | struct backlight_device *bl = necd->bl; | 199 | struct backlight_device *bl = necd->bl; |
| 191 | 200 | ||
| 192 | omapdss_dpi_display_disable(dssdev); | 201 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) |
| 202 | return; | ||
| 193 | 203 | ||
| 194 | bl->props.brightness = 0; | 204 | bl->props.brightness = 0; |
| 195 | nec_8048_bl_update_status(bl); | 205 | nec_8048_bl_update_status(bl); |
| 196 | 206 | ||
| 197 | if (dssdev->platform_disable) | 207 | if (dssdev->platform_disable) |
| 198 | dssdev->platform_disable(dssdev); | 208 | dssdev->platform_disable(dssdev); |
| 209 | |||
| 210 | omapdss_dpi_display_disable(dssdev); | ||
| 211 | } | ||
| 212 | |||
| 213 | static int nec_8048_panel_enable(struct omap_dss_device *dssdev) | ||
| 214 | { | ||
| 215 | int r; | ||
| 216 | |||
| 217 | r = nec_8048_panel_power_on(dssdev); | ||
| 218 | if (r) | ||
| 219 | return r; | ||
| 220 | |||
| 221 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
| 222 | |||
| 223 | return 0; | ||
| 224 | } | ||
| 225 | |||
| 226 | static void nec_8048_panel_disable(struct omap_dss_device *dssdev) | ||
| 227 | { | ||
| 228 | nec_8048_panel_power_off(dssdev); | ||
| 229 | |||
| 230 | dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | ||
| 199 | } | 231 | } |
| 200 | 232 | ||
| 201 | static int nec_8048_panel_suspend(struct omap_dss_device *dssdev) | 233 | static int nec_8048_panel_suspend(struct omap_dss_device *dssdev) |
| 202 | { | 234 | { |
| 203 | nec_8048_panel_disable(dssdev); | 235 | nec_8048_panel_power_off(dssdev); |
| 236 | |||
| 237 | dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | ||
| 238 | |||
| 204 | return 0; | 239 | return 0; |
| 205 | } | 240 | } |
| 206 | 241 | ||
| 207 | static int nec_8048_panel_resume(struct omap_dss_device *dssdev) | 242 | static int nec_8048_panel_resume(struct omap_dss_device *dssdev) |
| 208 | { | 243 | { |
| 209 | return nec_8048_panel_enable(dssdev); | 244 | int r; |
| 245 | |||
| 246 | r = nec_8048_panel_power_on(dssdev); | ||
| 247 | if (r) | ||
| 248 | return r; | ||
| 249 | |||
| 250 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
| 251 | |||
| 252 | return 0; | ||
| 210 | } | 253 | } |
| 211 | 254 | ||
| 212 | static int nec_8048_recommended_bpp(struct omap_dss_device *dssdev) | 255 | static int nec_8048_recommended_bpp(struct omap_dss_device *dssdev) |
