]> Git Repo - linux.git/commitdiff
Merge tag 'fbdev-3.11-2' of git://gitorious.org/linux-omap-dss2/linux into fbdev...
authorJean-Christophe PLAGNIOL-VILLARD <[email protected]>
Fri, 28 Jun 2013 10:01:28 +0000 (18:01 +0800)
committerJean-Christophe PLAGNIOL-VILLARD <[email protected]>
Fri, 28 Jun 2013 10:01:28 +0000 (18:01 +0800)
Various fbdev changes for 3.11

* xilinxfb updates
* Small cleanups and fixes to multiple drivers

1  2 
drivers/video/Kconfig
drivers/video/fbmem.c
drivers/video/mmp/hw/mmp_ctrl.c
drivers/video/omap2/displays/panel-taal.c
drivers/video/omap2/dss/dpi.c

diff --combined drivers/video/Kconfig
index 2e937bdace6f123a1b6f1c0c055b4422dde78875,bed84b01ccd668745e81cdd355cbd42e40355c30..2c301f8441e98decdb9ec0d10f12c9c3d55a843b
@@@ -2188,7 -2188,7 +2188,7 @@@ config FB_PS3_DEFAULT_SIZE_
  
  config FB_XILINX
        tristate "Xilinx frame buffer support"
-       depends on FB && (XILINX_VIRTEX || MICROBLAZE)
+       depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ)
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
  
  config FB_GOLDFISH
        tristate "Goldfish Framebuffer"
 -      depends on FB
 +      depends on FB && HAS_DMA
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@@ -2453,23 -2453,6 +2453,23 @@@ config FB_HYPER
        help
          This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
  
 +config FB_SIMPLE
 +      bool "Simple framebuffer support"
 +      depends on (FB = y) && OF
 +      select FB_CFB_FILLRECT
 +      select FB_CFB_COPYAREA
 +      select FB_CFB_IMAGEBLIT
 +      help
 +        Say Y if you want support for a simple frame-buffer.
 +
 +        This driver assumes that the display hardware has been initialized
 +        before the kernel boots, and the kernel will simply render to the
 +        pre-allocated frame buffer surface.
 +
 +        Configuration re: surface address, size, and format must be provided
 +        through device tree, or potentially plain old platform data in the
 +        future.
 +
  source "drivers/video/omap/Kconfig"
  source "drivers/video/omap2/Kconfig"
  source "drivers/video/exynos/Kconfig"
diff --combined drivers/video/fbmem.c
index d8d5779145db773e64c154b29b56d47ff06cd365,9217be3d8f3eee56b8f31f3b170996961c322423..36e1fe21b9b5e1b2bd41750d1bedbbc833e917cf
@@@ -1305,7 -1305,9 +1305,9 @@@ static int do_fscreeninfo_to_user(struc
        err |= copy_to_user(fix32->reserved, fix->reserved,
                            sizeof(fix->reserved));
  
-       return err;
+       if (err)
+               return -EFAULT;
+       return 0;
  }
  
  static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
@@@ -1881,7 -1883,7 +1883,7 @@@ static int ofonly __read_mostly
   *
   * NOTE: Needed to maintain backwards compatibility
   */
 -int fb_get_options(char *name, char **option)
 +int fb_get_options(const char *name, char **option)
  {
        char *opt, *options = NULL;
        int retval = 0;
index 8612590ea9439f0b8a963a6ff73bde05eef236bc,c46bf5a93d38970f86b89cbc4c9a96ad34868312..75dca19bf2149a968f733ed1ff8a0cd468baa745
@@@ -165,9 -165,9 +165,9 @@@ static void overlay_set_win(struct mmp_
  
  static void dmafetch_onoff(struct mmp_overlay *overlay, int on)
  {
 -      u32 mask = overlay_is_vid(overlay) ? CFG_GRA_ENA_MASK :
 -                 CFG_DMA_ENA_MASK;
 -      u32 enable = overlay_is_vid(overlay) ? CFG_GRA_ENA(1) : CFG_DMA_ENA(1);
 +      u32 mask = overlay_is_vid(overlay) ? CFG_DMA_ENA_MASK :
 +                 CFG_GRA_ENA_MASK;
 +      u32 enable = overlay_is_vid(overlay) ? CFG_DMA_ENA(1) : CFG_GRA_ENA(1);
        u32 tmp;
        struct mmp_path *path = overlay->path;
  
@@@ -238,7 -238,7 +238,7 @@@ static int overlay_set_addr(struct mmp_
        struct lcd_regs *regs = path_regs(overlay->path);
  
        /* FIXME: assert addr supported */
 -      memcpy(&overlay->addr, addr, sizeof(struct mmp_win));
 +      memcpy(&overlay->addr, addr, sizeof(struct mmp_addr));
        writel(addr->phys[0], &regs->g_0);
  
        return overlay->addr.phys[0];
@@@ -566,7 -566,6 +566,6 @@@ failed
                devm_kfree(ctrl->dev, ctrl);
        }
  
-       platform_set_drvdata(pdev, NULL);
        dev_err(&pdev->dev, "device init failed\n");
  
        return ret;
index c731d3c068b4c36d562245cbb7f32175fb6e7abe,52541f264021e1e2dda403600b966dd87bdabcbf..54a07da8587af84c456eaf8b43e22247eaa43f47
@@@ -237,7 -237,7 +237,7 @@@ static int taal_set_update_window(struc
  
  static void taal_queue_esd_work(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        if (td->esd_interval > 0)
                queue_delayed_work(td->workqueue, &td->esd_work,
  
  static void taal_cancel_esd_work(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        cancel_delayed_work(&td->esd_work);
  }
  
  static void taal_queue_ulps_work(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        if (td->ulps_timeout > 0)
                queue_delayed_work(td->workqueue, &td->ulps_work,
  
  static void taal_cancel_ulps_work(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        cancel_delayed_work(&td->ulps_work);
  }
  
  static int taal_enter_ulps(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        if (td->ulps_enabled)
        return 0;
  
  err:
 -      dev_err(&dssdev->dev, "enter ULPS failed");
 +      dev_err(dssdev->dev, "enter ULPS failed");
        taal_panel_reset(dssdev);
  
        td->ulps_enabled = false;
  
  static int taal_exit_ulps(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        if (!td->ulps_enabled)
  
        r = omapdss_dsi_display_enable(dssdev);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to enable DSI\n");
 +              dev_err(dssdev->dev, "failed to enable DSI\n");
                goto err1;
        }
  
  
        r = _taal_enable_te(dssdev, true);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to re-enable TE");
 +              dev_err(dssdev->dev, "failed to re-enable TE");
                goto err2;
        }
  
        return 0;
  
  err2:
 -      dev_err(&dssdev->dev, "failed to exit ULPS");
 +      dev_err(dssdev->dev, "failed to exit ULPS");
  
        r = taal_panel_reset(dssdev);
        if (!r) {
@@@ -349,7 -349,7 +349,7 @@@ err1
  
  static int taal_wake_up(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        if (td->ulps_enabled)
                return taal_exit_ulps(dssdev);
  static int taal_bl_update_status(struct backlight_device *dev)
  {
        struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
        int level;
  
        else
                level = 0;
  
 -      dev_dbg(&dssdev->dev, "update brightness to %d\n", level);
 +      dev_dbg(dssdev->dev, "update brightness to %d\n", level);
  
        mutex_lock(&td->lock);
  
@@@ -418,7 -418,7 +418,7 @@@ static ssize_t taal_num_errors_show(str
                struct device_attribute *attr, char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        u8 errors = 0;
        int r;
  
@@@ -448,7 -448,7 +448,7 @@@ static ssize_t taal_hw_revision_show(st
                struct device_attribute *attr, char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        u8 id1, id2, id3;
        int r;
  
@@@ -486,7 -486,7 +486,7 @@@ static ssize_t show_cabc_mode(struct de
                char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        const char *mode_str;
        int mode;
        int len;
@@@ -506,7 -506,7 +506,7 @@@ static ssize_t store_cabc_mode(struct d
                const char *buf, size_t count)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int i;
        int r;
  
@@@ -568,12 -568,12 +568,12 @@@ static ssize_t taal_store_esd_interval(
                const char *buf, size_t count)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        unsigned long t;
        int r;
  
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
  
@@@ -592,7 -592,7 +592,7 @@@ static ssize_t taal_show_esd_interval(s
                char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        unsigned t;
  
        mutex_lock(&td->lock);
@@@ -607,11 -607,11 +607,11 @@@ static ssize_t taal_store_ulps(struct d
                const char *buf, size_t count)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        unsigned long t;
        int r;
  
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
  
@@@ -641,7 -641,7 +641,7 @@@ static ssize_t taal_show_ulps(struct de
                char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        unsigned t;
  
        mutex_lock(&td->lock);
@@@ -656,11 -656,11 +656,11 @@@ static ssize_t taal_store_ulps_timeout(
                const char *buf, size_t count)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        unsigned long t;
        int r;
  
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
  
@@@ -687,7 -687,7 +687,7 @@@ static ssize_t taal_show_ulps_timeout(s
                char *buf)
  {
        struct omap_dss_device *dssdev = to_dss_device(dev);
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        unsigned t;
  
        mutex_lock(&td->lock);
@@@ -727,7 -727,7 +727,7 @@@ static struct attribute_group taal_attr
  
  static void taal_hw_reset(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        if (!gpio_is_valid(td->reset_gpio))
                return;
@@@ -768,13 -768,13 +768,13 @@@ static int taal_probe(struct omap_dss_d
        struct backlight_device *bldev = NULL;
        int r;
  
 -      dev_dbg(&dssdev->dev, "probe\n");
 +      dev_dbg(dssdev->dev, "probe\n");
  
 -      td = devm_kzalloc(&dssdev->dev, sizeof(*td), GFP_KERNEL);
 +      td = devm_kzalloc(dssdev->dev, sizeof(*td), GFP_KERNEL);
        if (!td)
                return -ENOMEM;
  
 -      dev_set_drvdata(&dssdev->dev, td);
 +      dev_set_drvdata(dssdev->dev, td);
        td->dssdev = dssdev;
  
        if (dssdev->data) {
        atomic_set(&td->do_update, 0);
  
        if (gpio_is_valid(td->reset_gpio)) {
 -              r = devm_gpio_request_one(&dssdev->dev, td->reset_gpio,
 +              r = devm_gpio_request_one(dssdev->dev, td->reset_gpio,
                                GPIOF_OUT_INIT_LOW, "taal rst");
                if (r) {
 -                      dev_err(&dssdev->dev, "failed to request reset gpio\n");
 +                      dev_err(dssdev->dev, "failed to request reset gpio\n");
                        return r;
                }
        }
  
        if (gpio_is_valid(td->ext_te_gpio)) {
 -              r = devm_gpio_request_one(&dssdev->dev, td->ext_te_gpio,
 +              r = devm_gpio_request_one(dssdev->dev, td->ext_te_gpio,
                                GPIOF_IN, "taal irq");
                if (r) {
 -                      dev_err(&dssdev->dev, "GPIO request failed\n");
 +                      dev_err(dssdev->dev, "GPIO request failed\n");
                        return r;
                }
  
 -              r = devm_request_irq(&dssdev->dev, gpio_to_irq(td->ext_te_gpio),
 +              r = devm_request_irq(dssdev->dev, gpio_to_irq(td->ext_te_gpio),
                                taal_te_isr,
                                IRQF_TRIGGER_RISING,
                                "taal vsync", dssdev);
  
                if (r) {
 -                      dev_err(&dssdev->dev, "IRQ request failed\n");
 +                      dev_err(dssdev->dev, "IRQ request failed\n");
                        return r;
                }
  
                INIT_DEFERRABLE_WORK(&td->te_timeout_work,
                                        taal_te_timeout_work_callback);
  
 -              dev_dbg(&dssdev->dev, "Using GPIO TE\n");
 +              dev_dbg(dssdev->dev, "Using GPIO TE\n");
        }
  
        td->workqueue = create_singlethread_workqueue("taal_esd");
        if (td->workqueue == NULL) {
 -              dev_err(&dssdev->dev, "can't create ESD workqueue\n");
 +              dev_err(dssdev->dev, "can't create ESD workqueue\n");
                return -ENOMEM;
        }
        INIT_DEFERRABLE_WORK(&td->esd_work, taal_esd_work);
                props.max_brightness = 255;
  
                props.type = BACKLIGHT_RAW;
 -              bldev = backlight_device_register(dev_name(&dssdev->dev),
 -                              &dssdev->dev, dssdev, &taal_bl_ops, &props);
 +              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;
  
        r = omap_dsi_request_vc(dssdev, &td->channel);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to get virtual channel\n");
 +              dev_err(dssdev->dev, "failed to get virtual channel\n");
                goto err_req_vc;
        }
  
        r = omap_dsi_set_vc_id(dssdev, td->channel, TCH);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to set VC_ID\n");
 +              dev_err(dssdev->dev, "failed to set VC_ID\n");
                goto err_vc_id;
        }
  
 -      r = sysfs_create_group(&dssdev->dev.kobj, &taal_attr_group);
 +      r = sysfs_create_group(&dssdev->dev->kobj, &taal_attr_group);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to create sysfs files\n");
 +              dev_err(dssdev->dev, "failed to create sysfs files\n");
                goto err_vc_id;
        }
  
@@@ -892,12 -892,12 +892,12 @@@ err_bl
  
  static void __exit taal_remove(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        struct backlight_device *bldev;
  
 -      dev_dbg(&dssdev->dev, "remove\n");
 +      dev_dbg(dssdev->dev, "remove\n");
  
 -      sysfs_remove_group(&dssdev->dev.kobj, &taal_attr_group);
 +      sysfs_remove_group(&dssdev->dev->kobj, &taal_attr_group);
        omap_dsi_release_vc(dssdev, td->channel);
  
        bldev = td->bldev;
  
  static int taal_power_on(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        u8 id1, id2, id3;
        int r;
        struct omap_dss_dsi_config dsi_config = {
  
        r = omapdss_dsi_configure_pins(dssdev, &td->pin_config);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to configure DSI pins\n");
 +              dev_err(dssdev->dev, "failed to configure DSI pins\n");
                goto err0;
        };
  
        r = omapdss_dsi_set_config(dssdev, &dsi_config);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to configure DSI\n");
 +              dev_err(dssdev->dev, "failed to configure DSI\n");
                goto err0;
        }
  
        r = omapdss_dsi_display_enable(dssdev);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to enable DSI\n");
 +              dev_err(dssdev->dev, "failed to enable DSI\n");
                goto err0;
        }
  
        td->enabled = 1;
  
        if (!td->intro_printed) {
 -              dev_info(&dssdev->dev, "panel revision %02x.%02x.%02x\n",
 +              dev_info(dssdev->dev, "panel revision %02x.%02x.%02x\n",
                        id1, id2, id3);
                if (td->cabc_broken)
 -                      dev_info(&dssdev->dev,
 +                      dev_info(dssdev->dev,
                                        "old Taal version, CABC disabled\n");
                td->intro_printed = true;
        }
  
        return 0;
  err:
 -      dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n");
 +      dev_err(dssdev->dev, "error while enabling panel, issuing HW reset\n");
  
        taal_hw_reset(dssdev);
  
@@@ -1022,7 -1022,7 +1022,7 @@@ err0
  
  static void taal_power_off(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        dsi_disable_video_output(dssdev, td->channel);
                r = taal_sleep_in(td);
  
        if (r) {
 -              dev_err(&dssdev->dev,
 +              dev_err(dssdev->dev,
                                "error disabling panel, issuing HW reset\n");
                taal_hw_reset(dssdev);
        }
  
  static int taal_panel_reset(struct omap_dss_device *dssdev)
  {
 -      dev_err(&dssdev->dev, "performing LCD reset\n");
 +      dev_err(dssdev->dev, "performing LCD reset\n");
  
        taal_power_off(dssdev);
        taal_hw_reset(dssdev);
  
  static int taal_enable(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
 -      dev_dbg(&dssdev->dev, "enable\n");
 +      dev_dbg(dssdev->dev, "enable\n");
  
        mutex_lock(&td->lock);
  
  
        return 0;
  err:
 -      dev_dbg(&dssdev->dev, "enable failed\n");
 +      dev_dbg(dssdev->dev, "enable failed\n");
        mutex_unlock(&td->lock);
        return r;
  }
  
  static void taal_disable(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
 -      dev_dbg(&dssdev->dev, "disable\n");
 +      dev_dbg(dssdev->dev, "disable\n");
  
        mutex_lock(&td->lock);
  
  static void taal_framedone_cb(int err, void *data)
  {
        struct omap_dss_device *dssdev = data;
 -      dev_dbg(&dssdev->dev, "framedone, err %d\n", err);
 +      dev_dbg(dssdev->dev, "framedone, err %d\n", err);
        dsi_bus_unlock(dssdev);
  }
  
  static irqreturn_t taal_te_isr(int irq, void *data)
  {
        struct omap_dss_device *dssdev = data;
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int old;
        int r;
  
  
        return IRQ_HANDLED;
  err:
 -      dev_err(&dssdev->dev, "start update failed\n");
 +      dev_err(dssdev->dev, "start update failed\n");
        dsi_bus_unlock(dssdev);
        return IRQ_HANDLED;
  }
@@@ -1153,7 -1153,7 +1153,7 @@@ static void taal_te_timeout_work_callba
                                        te_timeout_work.work);
        struct omap_dss_device *dssdev = td->dssdev;
  
 -      dev_err(&dssdev->dev, "TE not received for 250ms!\n");
 +      dev_err(dssdev->dev, "TE not received for 250ms!\n");
  
        atomic_set(&td->do_update, 0);
        dsi_bus_unlock(dssdev);
  static int taal_update(struct omap_dss_device *dssdev,
                                    u16 x, u16 y, u16 w, u16 h)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
 -      dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
 +      dev_dbg(dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
  
        mutex_lock(&td->lock);
        dsi_bus_lock(dssdev);
  
  static int taal_sync(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
 -      dev_dbg(&dssdev->dev, "sync\n");
 +      dev_dbg(dssdev->dev, "sync\n");
  
        mutex_lock(&td->lock);
        dsi_bus_lock(dssdev);
        dsi_bus_unlock(dssdev);
        mutex_unlock(&td->lock);
  
 -      dev_dbg(&dssdev->dev, "sync done\n");
 +      dev_dbg(dssdev->dev, "sync done\n");
  
        return 0;
  }
  
  static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        if (enable)
  
  static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        mutex_lock(&td->lock);
@@@ -1279,7 -1279,7 +1279,7 @@@ err
  
  static int taal_get_te(struct omap_dss_device *dssdev)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        int r;
  
        mutex_lock(&td->lock);
  
  static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
  {
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
        u8 id1, id2, id3;
        int r;
  
@@@ -1336,7 -1336,7 +1336,7 @@@ static int taal_memory_read(struct omap
        int first = 1;
        int plen;
        unsigned buf_used = 0;
 -      struct taal_data *td = dev_get_drvdata(&dssdev->dev);
 +      struct taal_data *td = dev_get_drvdata(dssdev->dev);
  
        if (size < w * h * 3)
                return -ENOMEM;
                                buf + buf_used, size - buf_used);
  
                if (r < 0) {
 -                      dev_err(&dssdev->dev, "read error\n");
 +                      dev_err(dssdev->dev, "read error\n");
                        goto err3;
                }
  
                buf_used += r;
  
                if (r < plen) {
 -                      dev_err(&dssdev->dev, "short read\n");
 +                      dev_err(dssdev->dev, "short read\n");
                        break;
                }
  
                if (signal_pending(current)) {
 -                      dev_err(&dssdev->dev, "signal pending, "
 +                      dev_err(dssdev->dev, "signal pending, "
                                        "aborting memory read\n");
                        r = -ERESTARTSYS;
                        goto err3;
@@@ -1450,26 -1450,26 +1450,26 @@@ static void taal_esd_work(struct work_s
  
        r = taal_wake_up(dssdev);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to exit ULPS\n");
 +              dev_err(dssdev->dev, "failed to exit ULPS\n");
                goto err;
        }
  
        r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state1);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to read Taal status\n");
 +              dev_err(dssdev->dev, "failed to read Taal status\n");
                goto err;
        }
  
        /* Run self diagnostics */
        r = taal_sleep_out(td);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to run Taal self-diagnostics\n");
 +              dev_err(dssdev->dev, "failed to run Taal self-diagnostics\n");
                goto err;
        }
  
        r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state2);
        if (r) {
 -              dev_err(&dssdev->dev, "failed to read Taal status\n");
 +              dev_err(dssdev->dev, "failed to read Taal status\n");
                goto err;
        }
  
         * Bit6 if the test passes.
         */
        if (!((state1 ^ state2) & (1 << 6))) {
 -              dev_err(&dssdev->dev, "LCD self diagnostics failed\n");
 +              dev_err(dssdev->dev, "LCD self diagnostics failed\n");
                goto err;
        }
        /* Self-diagnostics result is also shown on TE GPIO line. We need
        mutex_unlock(&td->lock);
        return;
  err:
 -      dev_err(&dssdev->dev, "performing LCD reset\n");
 +      dev_err(dssdev->dev, "performing LCD reset\n");
  
        taal_panel_reset(dssdev);
  
index 6433eab6bcf28b7e41eb5ceb65186642087c8e90,0bdcd41921764345ba4f1f855cfd7c9d1172bb95..a6b331ef7763c9bd901ac8257b6d53e2b7585cdc
@@@ -37,8 -37,6 +37,8 @@@
  #include "dss_features.h"
  
  static struct {
 +      struct platform_device *pdev;
 +
        struct regulator *vdds_dsi_reg;
        struct platform_device *dsidev;
  
@@@ -48,7 -46,7 +48,7 @@@
        struct dss_lcd_mgr_config mgr_config;
        int data_lines;
  
 -      struct omap_dss_output output;
 +      struct omap_dss_device output;
  } dpi;
  
  static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
@@@ -131,7 -129,7 +131,7 @@@ static bool dpi_calc_dispc_cb(int lckd
         * shifted. So skip all odd dividers when the pixel clock is on the
         * higher side.
         */
-       if (ctx->pck_min >= 1000000) {
+       if (ctx->pck_min >= 100000000) {
                if (lckd > 1 && lckd % 2 != 0)
                        return false;
  
@@@ -158,7 -156,7 +158,7 @@@ static bool dpi_calc_hsdiv_cb(int regm_
         * shifted. So skip all odd dividers when the pixel clock is on the
         * higher side.
         */
-       if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 1000000)
+       if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 100000000)
                return false;
  
        ctx->dsi_cinfo.regm_dispc = regm_dispc;
@@@ -347,7 -345,7 +347,7 @@@ static void dpi_config_lcd_manager(stru
  
  int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
  {
 -      struct omap_dss_output *out = &dpi.output;
 +      struct omap_dss_device *out = &dpi.output;
        int r;
  
        mutex_lock(&dpi.lock);
                goto err_no_out_mgr;
        }
  
 -      r = omap_dss_start_device(dssdev);
 -      if (r) {
 -              DSSERR("failed to start device\n");
 -              goto err_start_dev;
 -      }
 -
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
                r = regulator_enable(dpi.vdds_dsi_reg);
                if (r)
@@@ -418,6 -422,8 +418,6 @@@ err_get_dispc
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
                regulator_disable(dpi.vdds_dsi_reg);
  err_reg_enable:
 -      omap_dss_stop_device(dssdev);
 -err_start_dev:
  err_no_out_mgr:
  err_no_reg:
        mutex_unlock(&dpi.lock);
@@@ -444,6 -450,8 +444,6 @@@ void omapdss_dpi_display_disable(struc
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
                regulator_disable(dpi.vdds_dsi_reg);
  
 -      omap_dss_stop_device(dssdev);
 -
        mutex_unlock(&dpi.lock);
  }
  EXPORT_SYMBOL(omapdss_dpi_display_disable);
@@@ -461,16 -469,6 +461,16 @@@ void omapdss_dpi_set_timings(struct oma
  }
  EXPORT_SYMBOL(omapdss_dpi_set_timings);
  
 +static void dpi_get_timings(struct omap_dss_device *dssdev,
 +              struct omap_video_timings *timings)
 +{
 +      mutex_lock(&dpi.lock);
 +
 +      *timings = dpi.timings;
 +
 +      mutex_unlock(&dpi.lock);
 +}
 +
  int dpi_check_timings(struct omap_dss_device *dssdev,
                        struct omap_video_timings *timings)
  {
@@@ -544,50 -542,6 +544,50 @@@ static int dpi_verify_dsi_pll(struct pl
        return 0;
  }
  
 +static int dpi_init_regulator(void)
 +{
 +      struct regulator *vdds_dsi;
 +
 +      if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
 +              return 0;
 +
 +      if (dpi.vdds_dsi_reg)
 +              return 0;
 +
 +      vdds_dsi = dss_get_vdds_dsi();
 +
 +      if (IS_ERR(vdds_dsi)) {
 +              vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
 +              if (IS_ERR(vdds_dsi)) {
 +                      DSSERR("can't get VDDS_DSI regulator\n");
 +                      return PTR_ERR(vdds_dsi);
 +              }
 +      }
 +
 +      dpi.vdds_dsi_reg = vdds_dsi;
 +
 +      return 0;
 +}
 +
 +static void dpi_init_pll(void)
 +{
 +      struct platform_device *dsidev;
 +
 +      if (dpi.dsidev)
 +              return;
 +
 +      dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
 +      if (!dsidev)
 +              return;
 +
 +      if (dpi_verify_dsi_pll(dsidev)) {
 +              DSSWARN("DSI PLL not operational\n");
 +              return;
 +      }
 +
 +      dpi.dsidev = dsidev;
 +}
 +
  /*
   * Return a hardcoded channel for the DPI output. This should work for
   * current use cases, but this can be later expanded to either resolve
@@@ -618,6 -572,41 +618,6 @@@ static enum omap_channel dpi_get_channe
        }
  }
  
 -static int dpi_init_display(struct omap_dss_device *dssdev)
 -{
 -      struct platform_device *dsidev;
 -
 -      DSSDBG("init_display\n");
 -
 -      if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) &&
 -                                      dpi.vdds_dsi_reg == NULL) {
 -              struct regulator *vdds_dsi;
 -
 -              vdds_dsi = dss_get_vdds_dsi();
 -
 -              if (IS_ERR(vdds_dsi)) {
 -                      DSSERR("can't get VDDS_DSI regulator\n");
 -                      return PTR_ERR(vdds_dsi);
 -              }
 -
 -              dpi.vdds_dsi_reg = vdds_dsi;
 -      }
 -
 -      dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
 -
 -      if (dsidev && dpi_verify_dsi_pll(dsidev)) {
 -              dsidev = NULL;
 -              DSSWARN("DSI PLL not operational\n");
 -      }
 -
 -      if (dsidev)
 -              DSSDBG("using DSI PLL for DPI clock\n");
 -
 -      dpi.dsidev = dsidev;
 -
 -      return 0;
 -}
 -
  static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev)
  {
        struct omap_dss_board_info *pdata = pdev->dev.platform_data;
@@@ -657,18 -646,19 +657,18 @@@ static int dpi_probe_pdata(struct platf
        if (!plat_dssdev)
                return 0;
  
 +      r = dpi_init_regulator();
 +      if (r)
 +              return r;
 +
 +      dpi_init_pll();
 +
        dssdev = dss_alloc_and_init_device(&dpidev->dev);
        if (!dssdev)
                return -ENOMEM;
  
        dss_copy_device_pdata(dssdev, plat_dssdev);
  
 -      r = dpi_init_display(dssdev);
 -      if (r) {
 -              DSSERR("device %s init failed: %d\n", dssdev->name, r);
 -              dss_put_device(dssdev);
 -              return r;
 -      }
 -
        r = omapdss_output_set_device(&dpi.output, dssdev);
        if (r) {
                DSSERR("failed to connect output to new device: %s\n",
        return 0;
  }
  
 +static int dpi_connect(struct omap_dss_device *dssdev,
 +              struct omap_dss_device *dst)
 +{
 +      struct omap_overlay_manager *mgr;
 +      int r;
 +
 +      r = dpi_init_regulator();
 +      if (r)
 +              return r;
 +
 +      dpi_init_pll();
 +
 +      mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
 +      if (!mgr)
 +              return -ENODEV;
 +
 +      r = dss_mgr_connect(mgr, dssdev);
 +      if (r)
 +              return r;
 +
 +      r = omapdss_output_set_device(dssdev, dst);
 +      if (r) {
 +              DSSERR("failed to connect output to new device: %s\n",
 +                              dst->name);
 +              dss_mgr_disconnect(mgr, dssdev);
 +              return r;
 +      }
 +
 +      return 0;
 +}
 +
 +static void dpi_disconnect(struct omap_dss_device *dssdev,
 +              struct omap_dss_device *dst)
 +{
 +      WARN_ON(dst != dssdev->device);
 +
 +      if (dst != dssdev->device)
 +              return;
 +
 +      omapdss_output_unset_device(dssdev);
 +
 +      if (dssdev->manager)
 +              dss_mgr_disconnect(dssdev->manager, dssdev);
 +}
 +
 +static const struct omapdss_dpi_ops dpi_ops = {
 +      .connect = dpi_connect,
 +      .disconnect = dpi_disconnect,
 +
 +      .enable = omapdss_dpi_display_enable,
 +      .disable = omapdss_dpi_display_disable,
 +
 +      .check_timings = dpi_check_timings,
 +      .set_timings = omapdss_dpi_set_timings,
 +      .get_timings = dpi_get_timings,
 +
 +      .set_data_lines = omapdss_dpi_set_data_lines,
 +};
 +
  static void dpi_init_output(struct platform_device *pdev)
  {
 -      struct omap_dss_output *out = &dpi.output;
 +      struct omap_dss_device *out = &dpi.output;
  
 -      out->pdev = pdev;
 +      out->dev = &pdev->dev;
        out->id = OMAP_DSS_OUTPUT_DPI;
 -      out->type = OMAP_DISPLAY_TYPE_DPI;
 +      out->output_type = OMAP_DISPLAY_TYPE_DPI;
        out->name = "dpi.0";
        out->dispc_channel = dpi_get_channel();
 +      out->ops.dpi = &dpi_ops;
 +      out->owner = THIS_MODULE;
  
 -      dss_register_output(out);
 +      omapdss_register_output(out);
  }
  
  static void __exit dpi_uninit_output(struct platform_device *pdev)
  {
 -      struct omap_dss_output *out = &dpi.output;
 +      struct omap_dss_device *out = &dpi.output;
  
 -      dss_unregister_output(out);
 +      omapdss_unregister_output(out);
  }
  
  static int omap_dpi_probe(struct platform_device *pdev)
  {
        int r;
  
 +      dpi.pdev = pdev;
 +
        mutex_init(&dpi.lock);
  
        dpi_init_output(pdev);
  
 -      r = dpi_probe_pdata(pdev);
 -      if (r) {
 -              dpi_uninit_output(pdev);
 -              return r;
 +      if (pdev->dev.platform_data) {
 +              r = dpi_probe_pdata(pdev);
 +              if (r)
 +                      goto err_probe;
        }
  
        return 0;
 +
 +err_probe:
 +      dpi_uninit_output(pdev);
 +      return r;
  }
  
  static int __exit omap_dpi_remove(struct platform_device *pdev)
This page took 0.121559 seconds and 4 git commands to generate.