]> Git Repo - linux.git/commitdiff
Merge branch 'for-florian' of git://gitorious.org/linux-omap-dss2/linux into fbdev...
authorFlorian Tobias Schandinat <[email protected]>
Sun, 8 Jan 2012 15:30:34 +0000 (15:30 +0000)
committerFlorian Tobias Schandinat <[email protected]>
Sun, 8 Jan 2012 15:30:34 +0000 (15:30 +0000)
1  2 
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c

index 8365e77e09ffc41d8e48b48e08e26c0798fc646e,94e0f207342e3653ca52c600511d56641a449332..0eb31caddca86cddea33b8a90d4e6c2b13fef711
@@@ -163,50 -163,93 +163,93 @@@ static void nec_8048_panel_remove(struc
        kfree(necd);
  }
  
- static int nec_8048_panel_enable(struct omap_dss_device *dssdev)
+ static int nec_8048_panel_power_on(struct omap_dss_device *dssdev)
  {
-       int r = 0;
+       int r;
        struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev);
        struct backlight_device *bl = necd->bl;
  
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+       r = omapdss_dpi_display_enable(dssdev);
+       if (r)
+               goto err0;
        if (dssdev->platform_enable) {
                r = dssdev->platform_enable(dssdev);
                if (r)
-                       return r;
+                       goto err1;
        }
  
        r = nec_8048_bl_update_status(bl);
        if (r < 0)
                dev_err(&dssdev->dev, "failed to set lcd brightness\n");
  
-       r = omapdss_dpi_display_enable(dssdev);
+       return 0;
+ err1:
+       omapdss_dpi_display_disable(dssdev);
+ err0:
        return r;
  }
  
- static void nec_8048_panel_disable(struct omap_dss_device *dssdev)
+ static void nec_8048_panel_power_off(struct omap_dss_device *dssdev)
  {
        struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev);
        struct backlight_device *bl = necd->bl;
  
-       omapdss_dpi_display_disable(dssdev);
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
  
        bl->props.brightness = 0;
        nec_8048_bl_update_status(bl);
  
        if (dssdev->platform_disable)
                dssdev->platform_disable(dssdev);
+       omapdss_dpi_display_disable(dssdev);
+ }
+ static int nec_8048_panel_enable(struct omap_dss_device *dssdev)
+ {
+       int r;
+       r = nec_8048_panel_power_on(dssdev);
+       if (r)
+               return r;
+       dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+       return 0;
+ }
+ static void nec_8048_panel_disable(struct omap_dss_device *dssdev)
+ {
+       nec_8048_panel_power_off(dssdev);
+       dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
  }
  
  static int nec_8048_panel_suspend(struct omap_dss_device *dssdev)
  {
-       nec_8048_panel_disable(dssdev);
+       nec_8048_panel_power_off(dssdev);
+       dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
        return 0;
  }
  
  static int nec_8048_panel_resume(struct omap_dss_device *dssdev)
  {
-       return nec_8048_panel_enable(dssdev);
+       int r;
+       r = nec_8048_panel_power_on(dssdev);
+       if (r)
+               return r;
+       dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+       return 0;
  }
  
  static int nec_8048_recommended_bpp(struct omap_dss_device *dssdev)
@@@ -303,6 -346,7 +346,6 @@@ static struct spi_driver nec_8048_spi_d
        .resume         = nec_8048_spi_resume,
        .driver         = {
                .name   = "nec_8048_spi",
 -              .bus    = &spi_bus_type,
                .owner  = THIS_MODULE,
        },
  };
This page took 0.06723 seconds and 4 git commands to generate.