]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-florian' of git://gitorious.org/linux-omap-dss2/linux into fbdev...
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sat, 15 Oct 2011 00:19:52 +0000 (00:19 +0000)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sat, 15 Oct 2011 00:19:52 +0000 (00:19 +0000)
1  2 
drivers/media/video/omap/omap_vout.c
drivers/video/omap2/displays/panel-taal.c

index b3a5ecdb33ac00cac5dc3e94ed5cceaabe225655,ec4a31f577a213da36db038ff38f2241b160367d..30d8896bb710db6f4979f11ef6d70476a2896f93
@@@ -400,7 -400,6 +400,6 @@@ static int omapvid_setup_overlay(struc
  
        ovl->get_overlay_info(ovl, &info);
        info.paddr = addr;
-       info.vaddr = NULL;
        info.width = cropwidth;
        info.height = cropheight;
        info.color_mode = vout->dss_mode;
@@@ -1165,12 -1164,17 +1164,17 @@@ static int vidioc_try_fmt_vid_overlay(s
  {
        int ret = 0;
        struct omap_vout_device *vout = fh;
+       struct omap_overlay *ovl;
+       struct omapvideo_info *ovid;
        struct v4l2_window *win = &f->fmt.win;
  
+       ovid = &vout->vid_info;
+       ovl = ovid->overlays[0];
        ret = omap_vout_try_window(&vout->fbuf, win);
  
        if (!ret) {
-               if (vout->vid == OMAP_VIDEO1)
+               if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
                        win->global_alpha = 255;
                else
                        win->global_alpha = f->fmt.win.global_alpha;
@@@ -1194,8 -1198,8 +1198,8 @@@ static int vidioc_s_fmt_vid_overlay(str
  
        ret = omap_vout_new_window(&vout->crop, &vout->win, &vout->fbuf, win);
        if (!ret) {
-               /* Video1 plane does not support global alpha */
-               if (ovl->id == OMAP_DSS_VIDEO1)
+               /* Video1 plane does not support global alpha on OMAP3 */
+               if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
                        vout->win.global_alpha = 255;
                else
                        vout->win.global_alpha = f->fmt.win.global_alpha;
@@@ -1788,7 -1792,9 +1792,9 @@@ static int vidioc_s_fbuf(struct file *f
        if (ovl->manager && ovl->manager->get_manager_info &&
                        ovl->manager->set_manager_info) {
                ovl->manager->get_manager_info(ovl->manager, &info);
-               info.alpha_enabled = enable;
+               /* enable this only if there is no zorder cap */
+               if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
+                       info.partial_alpha_enabled = enable;
                if (ovl->manager->set_manager_info(ovl->manager, &info))
                        return -EINVAL;
        }
@@@ -1820,7 -1826,7 +1826,7 @@@ static int vidioc_g_fbuf(struct file *f
        }
        if (ovl->manager && ovl->manager->get_manager_info) {
                ovl->manager->get_manager_info(ovl->manager, &info);
-               if (info.alpha_enabled)
+               if (info.partial_alpha_enabled)
                        a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA;
        }
  
@@@ -2194,6 -2200,19 +2200,6 @@@ static int __init omap_vout_probe(struc
                                        "'%s' Display already enabled\n",
                                        def_display->name);
                        }
 -                      /* set the update mode */
 -                      if (def_display->caps &
 -                                      OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
 -                              if (dssdrv->enable_te)
 -                                      dssdrv->enable_te(def_display, 0);
 -                              if (dssdrv->set_update_mode)
 -                                      dssdrv->set_update_mode(def_display,
 -                                                      OMAP_DSS_UPDATE_MANUAL);
 -                      } else {
 -                              if (dssdrv->set_update_mode)
 -                                      dssdrv->set_update_mode(def_display,
 -                                                      OMAP_DSS_UPDATE_AUTO);
 -                      }
                }
        }
  
index ca00843ed2fe77752c722c920bbab451909b5ffa,7f91002cc3ba7d8d86eae64394d8c014f3bbe77f..80c3f6ab1a94d73df39d18233c8ddc4dbd91304a
  
  #include <video/omapdss.h>
  #include <video/omap-panel-nokia-dsi.h>
+ #include <video/mipi_display.h>
  
  /* DSI Virtual channel. Hardcoded for now. */
  #define TCH 0
  
  #define DCS_READ_NUM_ERRORS   0x05
- #define DCS_READ_POWER_MODE   0x0a
- #define DCS_READ_MADCTL               0x0b
- #define DCS_READ_PIXEL_FORMAT 0x0c
- #define DCS_RDDSDR            0x0f
- #define DCS_SLEEP_IN          0x10
- #define DCS_SLEEP_OUT         0x11
- #define DCS_DISPLAY_OFF               0x28
- #define DCS_DISPLAY_ON                0x29
- #define DCS_COLUMN_ADDR               0x2a
- #define DCS_PAGE_ADDR         0x2b
- #define DCS_MEMORY_WRITE      0x2c
- #define DCS_TEAR_OFF          0x34
- #define DCS_TEAR_ON           0x35
- #define DCS_MEM_ACC_CTRL      0x36
- #define DCS_PIXEL_FORMAT      0x3a
  #define DCS_BRIGHTNESS                0x51
  #define DCS_CTRL_DISPLAY      0x53
  #define DCS_WRITE_CABC                0x55
@@@ -222,8 -208,6 +208,6 @@@ struct taal_data 
  
        struct delayed_work te_timeout_work;
  
-       bool use_dsi_bl;
        bool cabc_broken;
        unsigned cabc_mode;
  
@@@ -302,7 -286,7 +286,7 @@@ static int taal_sleep_in(struct taal_da
  
        hw_guard_wait(td);
  
-       cmd = DCS_SLEEP_IN;
+       cmd = MIPI_DCS_ENTER_SLEEP_MODE;
        r = dsi_vc_dcs_write_nosync(td->dssdev, td->channel, &cmd, 1);
        if (r)
                return r;
@@@ -321,7 -305,7 +305,7 @@@ static int taal_sleep_out(struct taal_d
  
        hw_guard_wait(td);
  
-       r = taal_dcs_write_0(td, DCS_SLEEP_OUT);
+       r = taal_dcs_write_0(td, MIPI_DCS_EXIT_SLEEP_MODE);
        if (r)
                return r;
  
@@@ -356,7 -340,7 +340,7 @@@ static int taal_set_addr_mode(struct ta
        u8 mode;
        int b5, b6, b7;
  
-       r = taal_dcs_read_1(td, DCS_READ_MADCTL, &mode);
+       r = taal_dcs_read_1(td, MIPI_DCS_GET_ADDRESS_MODE, &mode);
        if (r)
                return r;
  
        mode &= ~((1<<7) | (1<<6) | (1<<5));
        mode |= (b7 << 7) | (b6 << 6) | (b5 << 5);
  
-       return taal_dcs_write_1(td, DCS_MEM_ACC_CTRL, mode);
+       return taal_dcs_write_1(td, MIPI_DCS_SET_ADDRESS_MODE, mode);
  }
  
  static int taal_set_update_window(struct taal_data *td,
        u16 y2 = y + h - 1;
  
        u8 buf[5];
-       buf[0] = DCS_COLUMN_ADDR;
+       buf[0] = MIPI_DCS_SET_COLUMN_ADDRESS;
        buf[1] = (x1 >> 8) & 0xff;
        buf[2] = (x1 >> 0) & 0xff;
        buf[3] = (x2 >> 8) & 0xff;
        if (r)
                return r;
  
-       buf[0] = DCS_PAGE_ADDR;
+       buf[0] = MIPI_DCS_SET_PAGE_ADDRESS;
        buf[1] = (y1 >> 8) & 0xff;
        buf[2] = (y1 >> 0) & 0xff;
        buf[3] = (y2 >> 8) & 0xff;
@@@ -555,7 -539,6 +539,6 @@@ static int taal_bl_update_status(struc
  {
        struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
        struct taal_data *td = dev_get_drvdata(&dssdev->dev);
-       struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
        int r;
        int level;
  
  
        mutex_lock(&td->lock);
  
-       if (td->use_dsi_bl) {
-               if (td->enabled) {
-                       dsi_bus_lock(dssdev);
+       if (td->enabled) {
+               dsi_bus_lock(dssdev);
  
-                       r = taal_wake_up(dssdev);
-                       if (!r)
-                               r = taal_dcs_write_1(td, DCS_BRIGHTNESS, level);
+               r = taal_wake_up(dssdev);
+               if (!r)
+                       r = taal_dcs_write_1(td, DCS_BRIGHTNESS, level);
  
-                       dsi_bus_unlock(dssdev);
-               } else {
-                       r = 0;
-               }
+               dsi_bus_unlock(dssdev);
        } else {
-               if (!panel_data->set_backlight)
-                       r = -EINVAL;
-               else
-                       r = panel_data->set_backlight(dssdev, level);
+               r = 0;
        }
  
        mutex_unlock(&td->lock);
@@@ -964,7 -940,7 +940,7 @@@ static int taal_probe(struct omap_dss_d
  {
        struct backlight_properties props;
        struct taal_data *td;
-       struct backlight_device *bldev;
+       struct backlight_device *bldev = NULL;
        struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
        struct panel_config *panel_config = NULL;
        int r, i;
  
        dssdev->panel.config = OMAP_DSS_LCD_TFT;
        dssdev->panel.timings = panel_config->timings;
-       dssdev->ctrl.pixel_size = 24;
+       dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888;
  
        td = kzalloc(sizeof(*td), GFP_KERNEL);
        if (!td) {
  
        taal_hw_reset(dssdev);
  
-       /* if no platform set_backlight() defined, presume DSI backlight
-        * control */
-       memset(&props, 0, sizeof(struct backlight_properties));
-       if (!panel_data->set_backlight)
-               td->use_dsi_bl = true;
-       if (td->use_dsi_bl)
+       if (panel_data->use_dsi_backlight) {
+               memset(&props, 0, sizeof(struct backlight_properties));
                props.max_brightness = 255;
-       else
-               props.max_brightness = 127;
-       props.type = BACKLIGHT_RAW;
-       bldev = backlight_device_register(dev_name(&dssdev->dev), &dssdev->dev,
-                                       dssdev, &taal_bl_ops, &props);
-       if (IS_ERR(bldev)) {
-               r = PTR_ERR(bldev);
-               goto err_bl;
-       }
  
-       td->bldev = bldev;
+               props.type = BACKLIGHT_RAW;
+               bldev = backlight_device_register(dev_name(&dssdev->dev),
+                               &dssdev->dev, dssdev, &taal_bl_ops, &props);
+               if (IS_ERR(bldev)) {
+                       r = PTR_ERR(bldev);
+                       goto err_bl;
+               }
+               td->bldev = bldev;
  
-       bldev->props.fb_blank = FB_BLANK_UNBLANK;
-       bldev->props.power = FB_BLANK_UNBLANK;
-       if (td->use_dsi_bl)
+               bldev->props.fb_blank = FB_BLANK_UNBLANK;
+               bldev->props.power = FB_BLANK_UNBLANK;
                bldev->props.brightness = 255;
-       else
-               bldev->props.brightness = 127;
  
-       taal_bl_update_status(bldev);
+               taal_bl_update_status(bldev);
+       }
  
        if (panel_data->use_ext_te) {
                int gpio = panel_data->ext_te_gpio;
                gpio_direction_input(gpio);
  
                r = request_irq(gpio_to_irq(gpio), taal_te_isr,
 -                              IRQF_DISABLED | IRQF_TRIGGER_RISING,
 +                              IRQF_TRIGGER_RISING,
                                "taal vsync", dssdev);
  
                if (r) {
@@@ -1111,7 -1078,8 +1078,8 @@@ err_irq
        if (panel_data->use_ext_te)
                gpio_free(panel_data->ext_te_gpio);
  err_gpio:
-       backlight_device_unregister(bldev);
+       if (bldev != NULL)
+               backlight_device_unregister(bldev);
  err_bl:
        destroy_workqueue(td->workqueue);
  err_wq:
@@@ -1140,9 -1108,11 +1108,11 @@@ static void __exit taal_remove(struct o
        }
  
        bldev = td->bldev;
-       bldev->props.power = FB_BLANK_POWERDOWN;
-       taal_bl_update_status(bldev);
-       backlight_device_unregister(bldev);
+       if (bldev != NULL) {
+               bldev->props.power = FB_BLANK_POWERDOWN;
+               taal_bl_update_status(bldev);
+               backlight_device_unregister(bldev);
+       }
  
        taal_cancel_ulps_work(dssdev);
        taal_cancel_esd_work(dssdev);
@@@ -1195,7 -1165,8 +1165,8 @@@ static int taal_power_on(struct omap_ds
        if (r)
                goto err;
  
-       r = taal_dcs_write_1(td, DCS_PIXEL_FORMAT, 0x7); /* 24bit/pixel */
+       r = taal_dcs_write_1(td, MIPI_DCS_SET_PIXEL_FORMAT,
+               MIPI_DCS_PIXEL_FMT_24BIT);
        if (r)
                goto err;
  
                        goto err;
        }
  
-       r = taal_dcs_write_0(td, DCS_DISPLAY_ON);
+       r = taal_dcs_write_0(td, MIPI_DCS_SET_DISPLAY_ON);
        if (r)
                goto err;
  
@@@ -1246,7 -1217,7 +1217,7 @@@ static void taal_power_off(struct omap_
        struct taal_data *td = dev_get_drvdata(&dssdev->dev);
        int r;
  
-       r = taal_dcs_write_0(td, DCS_DISPLAY_OFF);
+       r = taal_dcs_write_0(td, MIPI_DCS_SET_DISPLAY_OFF);
        if (!r)
                r = taal_sleep_in(td);
  
@@@ -1529,9 -1500,9 +1500,9 @@@ static int _taal_enable_te(struct omap_
        int r;
  
        if (enable)
-               r = taal_dcs_write_1(td, DCS_TEAR_ON, 0);
+               r = taal_dcs_write_1(td, MIPI_DCS_SET_TEAR_ON, 0);
        else
-               r = taal_dcs_write_0(td, DCS_TEAR_OFF);
+               r = taal_dcs_write_0(td, MIPI_DCS_SET_TEAR_OFF);
  
        if (!panel_data->use_ext_te)
                omapdss_dsi_enable_te(dssdev, enable);
@@@ -1851,7 -1822,7 +1822,7 @@@ static void taal_esd_work(struct work_s
                goto err;
        }
  
-       r = taal_dcs_read_1(td, DCS_RDDSDR, &state1);
+       r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state1);
        if (r) {
                dev_err(&dssdev->dev, "failed to read Taal status\n");
                goto err;
                goto err;
        }
  
-       r = taal_dcs_read_1(td, DCS_RDDSDR, &state2);
+       r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state2);
        if (r) {
                dev_err(&dssdev->dev, "failed to read Taal status\n");
                goto err;
        /* Self-diagnostics result is also shown on TE GPIO line. We need
         * to re-enable TE after self diagnostics */
        if (td->te_enabled && panel_data->use_ext_te) {
-               r = taal_dcs_write_1(td, DCS_TEAR_ON, 0);
+               r = taal_dcs_write_1(td, MIPI_DCS_SET_TEAR_ON, 0);
                if (r)
                        goto err;
        }