aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-02-14 07:17:28 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:00:50 -0400
commitecc8b370898660613e846667f9c1e8a94f8d4aaa (patch)
treeb68295d545b8ca44be1e00c30046ce3341dc8add
parent94140f0d225fd1261e11a9d883be6de5692d57d8 (diff)
OMAPDSS: Add panel dev pointer to dssdev
We are about to remove the dss bus support, which also means that the omap_dss_device won't be a real device anymore. This means that the embedded "dev" struct needs to be removed from omap_dss_device. After we've finished the removal of the dss bus, we see the following changes: - struct omap_dss_device won't be a real Linux device anymore, but more like a "display entity". - struct omap_dss_driver won't be a Linux device driver, but "display entity ops". - The panel devices/drivers won't be omapdss devices/drivers, but platform/i2c/spi/etc devices/drivers, whichever fits the control mechanism of the panel. - The panel drivers will create omap_dss_device and omap_dss_driver, fill the required fields, and register the omap_dss_device to omapdss. - omap_dss_device won't have an embedded dev struct anymore, but a dev pointer to the actual device that manages the omap_dss_device. The model described above resembles the model that has been discussed with CDF (common display framework). For the duration of the conversion, we temporarily have two devs in the dssdev, the old "old_dev", which is a full embedded device struct, and the new "dev", which is a pointer to the device. "old_dev" will be removed in the future. For devices belonging to dss bus the dev is initialized to point to old_dev. This way all the code can just use the dev, for both old and new style panels. Both the new and old style panel drivers work during the conversion, and only after the dss bus support is removed will the old style panels stop to compile. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/displays/panel-acx565akm.c16
-rw-r--r--drivers/video/omap2/displays/panel-generic-dpi.c26
-rw-r--r--drivers/video/omap2/displays/panel-lgphilips-lb035q02.c10
-rw-r--r--drivers/video/omap2/displays/panel-n8x0.c30
-rw-r--r--drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c4
-rw-r--r--drivers/video/omap2/displays/panel-picodlp.c32
-rw-r--r--drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c10
-rw-r--r--drivers/video/omap2/displays/panel-taal.c164
-rw-r--r--drivers/video/omap2/displays/panel-tfp410.c32
-rw-r--r--drivers/video/omap2/displays/panel-tpo-td043mtea1.c36
-rw-r--r--drivers/video/omap2/dss/core.c18
-rw-r--r--drivers/video/omap2/dss/display-sysfs.c7
-rw-r--r--drivers/video/omap2/dss/display.c9
-rw-r--r--drivers/video/omap2/dss/venc_panel.c16
-rw-r--r--include/video/omapdss.h8
15 files changed, 212 insertions, 206 deletions
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
index d7f69c09ecf1..3fd100fc853e 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -510,7 +510,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
510 int max_brightness, brightness; 510 int max_brightness, brightness;
511 struct backlight_properties props; 511 struct backlight_properties props;
512 512
513 dev_dbg(&dssdev->dev, "%s\n", __func__); 513 dev_dbg(dssdev->dev, "%s\n", __func__);
514 514
515 if (!panel_data) 515 if (!panel_data)
516 return -EINVAL; 516 return -EINVAL;
@@ -519,7 +519,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
519 dssdev->panel.timings = acx_panel_timings; 519 dssdev->panel.timings = acx_panel_timings;
520 520
521 if (gpio_is_valid(panel_data->reset_gpio)) { 521 if (gpio_is_valid(panel_data->reset_gpio)) {
522 r = devm_gpio_request_one(&dssdev->dev, panel_data->reset_gpio, 522 r = devm_gpio_request_one(dssdev->dev, panel_data->reset_gpio,
523 GPIOF_OUT_INIT_LOW, "lcd reset"); 523 GPIOF_OUT_INIT_LOW, "lcd reset");
524 if (r) 524 if (r)
525 return r; 525 return r;
@@ -538,7 +538,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
538 538
539 r = panel_detect(md); 539 r = panel_detect(md);
540 if (r) { 540 if (r) {
541 dev_err(&dssdev->dev, "%s panel detect error\n", __func__); 541 dev_err(dssdev->dev, "%s panel detect error\n", __func__);
542 if (!md->enabled && gpio_is_valid(panel_data->reset_gpio)) 542 if (!md->enabled && gpio_is_valid(panel_data->reset_gpio))
543 gpio_set_value(panel_data->reset_gpio, 0); 543 gpio_set_value(panel_data->reset_gpio, 0);
544 544
@@ -593,7 +593,7 @@ static void acx_panel_remove(struct omap_dss_device *dssdev)
593{ 593{
594 struct acx565akm_device *md = &acx_dev; 594 struct acx565akm_device *md = &acx_dev;
595 595
596 dev_dbg(&dssdev->dev, "%s\n", __func__); 596 dev_dbg(dssdev->dev, "%s\n", __func__);
597 sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group); 597 sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group);
598 backlight_device_unregister(md->bl_dev); 598 backlight_device_unregister(md->bl_dev);
599 mutex_lock(&acx_dev.mutex); 599 mutex_lock(&acx_dev.mutex);
@@ -607,7 +607,7 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
607 struct panel_acx565akm_data *panel_data = get_panel_data(dssdev); 607 struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
608 int r; 608 int r;
609 609
610 dev_dbg(&dssdev->dev, "%s\n", __func__); 610 dev_dbg(dssdev->dev, "%s\n", __func__);
611 611
612 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 612 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
613 return 0; 613 return 0;
@@ -667,7 +667,7 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev)
667 struct acx565akm_device *md = &acx_dev; 667 struct acx565akm_device *md = &acx_dev;
668 struct panel_acx565akm_data *panel_data = get_panel_data(dssdev); 668 struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
669 669
670 dev_dbg(&dssdev->dev, "%s\n", __func__); 670 dev_dbg(dssdev->dev, "%s\n", __func__);
671 671
672 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 672 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
673 return; 673 return;
@@ -704,7 +704,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev)
704{ 704{
705 int r; 705 int r;
706 706
707 dev_dbg(&dssdev->dev, "%s\n", __func__); 707 dev_dbg(dssdev->dev, "%s\n", __func__);
708 r = acx_panel_power_on(dssdev); 708 r = acx_panel_power_on(dssdev);
709 709
710 if (r) 710 if (r)
@@ -716,7 +716,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev)
716 716
717static void acx_panel_disable(struct omap_dss_device *dssdev) 717static void acx_panel_disable(struct omap_dss_device *dssdev)
718{ 718{
719 dev_dbg(&dssdev->dev, "%s\n", __func__); 719 dev_dbg(dssdev->dev, "%s\n", __func__);
720 acx_panel_power_off(dssdev); 720 acx_panel_power_off(dssdev);
721 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 721 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
722} 722}
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 97363f733683..bebebd45847f 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -536,7 +536,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
536{ 536{
537 int r, i; 537 int r, i;
538 struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev); 538 struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
539 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 539 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
540 struct panel_config *panel_config = drv_data->panel_config; 540 struct panel_config *panel_config = drv_data->panel_config;
541 541
542 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 542 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
@@ -567,7 +567,7 @@ err0:
567static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev) 567static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev)
568{ 568{
569 struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev); 569 struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
570 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 570 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
571 struct panel_config *panel_config = drv_data->panel_config; 571 struct panel_config *panel_config = drv_data->panel_config;
572 int i; 572 int i;
573 573
@@ -593,7 +593,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
593 struct panel_drv_data *drv_data = NULL; 593 struct panel_drv_data *drv_data = NULL;
594 int i, r; 594 int i, r;
595 595
596 dev_dbg(&dssdev->dev, "probe\n"); 596 dev_dbg(dssdev->dev, "probe\n");
597 597
598 if (!panel_data || !panel_data->name) 598 if (!panel_data || !panel_data->name)
599 return -EINVAL; 599 return -EINVAL;
@@ -609,7 +609,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
609 return -EINVAL; 609 return -EINVAL;
610 610
611 for (i = 0; i < panel_data->num_gpios; ++i) { 611 for (i = 0; i < panel_data->num_gpios; ++i) {
612 r = devm_gpio_request_one(&dssdev->dev, panel_data->gpios[i], 612 r = devm_gpio_request_one(dssdev->dev, panel_data->gpios[i],
613 panel_data->gpio_invert[i] ? 613 panel_data->gpio_invert[i] ?
614 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, 614 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
615 "panel gpio"); 615 "panel gpio");
@@ -619,7 +619,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
619 619
620 dssdev->panel.timings = panel_config->timings; 620 dssdev->panel.timings = panel_config->timings;
621 621
622 drv_data = devm_kzalloc(&dssdev->dev, sizeof(*drv_data), GFP_KERNEL); 622 drv_data = devm_kzalloc(dssdev->dev, sizeof(*drv_data), GFP_KERNEL);
623 if (!drv_data) 623 if (!drv_data)
624 return -ENOMEM; 624 return -ENOMEM;
625 625
@@ -628,21 +628,21 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
628 628
629 mutex_init(&drv_data->lock); 629 mutex_init(&drv_data->lock);
630 630
631 dev_set_drvdata(&dssdev->dev, drv_data); 631 dev_set_drvdata(dssdev->dev, drv_data);
632 632
633 return 0; 633 return 0;
634} 634}
635 635
636static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev) 636static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev)
637{ 637{
638 dev_dbg(&dssdev->dev, "remove\n"); 638 dev_dbg(dssdev->dev, "remove\n");
639 639
640 dev_set_drvdata(&dssdev->dev, NULL); 640 dev_set_drvdata(dssdev->dev, NULL);
641} 641}
642 642
643static int generic_dpi_panel_enable(struct omap_dss_device *dssdev) 643static int generic_dpi_panel_enable(struct omap_dss_device *dssdev)
644{ 644{
645 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 645 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
646 int r; 646 int r;
647 647
648 mutex_lock(&drv_data->lock); 648 mutex_lock(&drv_data->lock);
@@ -660,7 +660,7 @@ err:
660 660
661static void generic_dpi_panel_disable(struct omap_dss_device *dssdev) 661static void generic_dpi_panel_disable(struct omap_dss_device *dssdev)
662{ 662{
663 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 663 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
664 664
665 mutex_lock(&drv_data->lock); 665 mutex_lock(&drv_data->lock);
666 666
@@ -674,7 +674,7 @@ static void generic_dpi_panel_disable(struct omap_dss_device *dssdev)
674static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev, 674static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
675 struct omap_video_timings *timings) 675 struct omap_video_timings *timings)
676{ 676{
677 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 677 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
678 678
679 mutex_lock(&drv_data->lock); 679 mutex_lock(&drv_data->lock);
680 680
@@ -688,7 +688,7 @@ static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
688static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev, 688static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
689 struct omap_video_timings *timings) 689 struct omap_video_timings *timings)
690{ 690{
691 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 691 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
692 692
693 mutex_lock(&drv_data->lock); 693 mutex_lock(&drv_data->lock);
694 694
@@ -700,7 +700,7 @@ static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
700static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev, 700static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
701 struct omap_video_timings *timings) 701 struct omap_video_timings *timings)
702{ 702{
703 struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); 703 struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
704 int r; 704 int r;
705 705
706 mutex_lock(&drv_data->lock); 706 mutex_lock(&drv_data->lock);
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index 4ea6548c0ae9..6c51430ddb37 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -109,12 +109,12 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
109 109
110 dssdev->panel.timings = lb035q02_timings; 110 dssdev->panel.timings = lb035q02_timings;
111 111
112 ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL); 112 ld = devm_kzalloc(dssdev->dev, sizeof(*ld), GFP_KERNEL);
113 if (!ld) 113 if (!ld)
114 return -ENOMEM; 114 return -ENOMEM;
115 115
116 for (i = 0; i < panel_data->num_gpios; ++i) { 116 for (i = 0; i < panel_data->num_gpios; ++i) {
117 r = devm_gpio_request_one(&dssdev->dev, panel_data->gpios[i], 117 r = devm_gpio_request_one(dssdev->dev, panel_data->gpios[i],
118 panel_data->gpio_invert[i] ? 118 panel_data->gpio_invert[i] ?
119 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, 119 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
120 "panel gpio"); 120 "panel gpio");
@@ -123,7 +123,7 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
123 } 123 }
124 124
125 mutex_init(&ld->lock); 125 mutex_init(&ld->lock);
126 dev_set_drvdata(&dssdev->dev, ld); 126 dev_set_drvdata(dssdev->dev, ld);
127 127
128 return 0; 128 return 0;
129} 129}
@@ -134,7 +134,7 @@ static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
134 134
135static int lb035q02_panel_enable(struct omap_dss_device *dssdev) 135static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
136{ 136{
137 struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev); 137 struct lb035q02_data *ld = dev_get_drvdata(dssdev->dev);
138 int r; 138 int r;
139 139
140 mutex_lock(&ld->lock); 140 mutex_lock(&ld->lock);
@@ -153,7 +153,7 @@ err:
153 153
154static void lb035q02_panel_disable(struct omap_dss_device *dssdev) 154static void lb035q02_panel_disable(struct omap_dss_device *dssdev)
155{ 155{
156 struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev); 156 struct lb035q02_data *ld = dev_get_drvdata(dssdev->dev);
157 157
158 mutex_lock(&ld->lock); 158 mutex_lock(&ld->lock);
159 159
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index f94ead6a3183..d3860c50d3f9 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -311,16 +311,16 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
311 switch (rev & 0xfc) { 311 switch (rev & 0xfc) {
312 case 0x9c: 312 case 0x9c:
313 ddata->blizzard_ver = BLIZZARD_VERSION_S1D13744; 313 ddata->blizzard_ver = BLIZZARD_VERSION_S1D13744;
314 dev_info(&dssdev->dev, "s1d13744 LCD controller rev %d " 314 dev_info(dssdev->dev, "s1d13744 LCD controller rev %d "
315 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); 315 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
316 break; 316 break;
317 case 0xa4: 317 case 0xa4:
318 ddata->blizzard_ver = BLIZZARD_VERSION_S1D13745; 318 ddata->blizzard_ver = BLIZZARD_VERSION_S1D13745;
319 dev_info(&dssdev->dev, "s1d13745 LCD controller rev %d " 319 dev_info(dssdev->dev, "s1d13745 LCD controller rev %d "
320 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); 320 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
321 break; 321 break;
322 default: 322 default:
323 dev_err(&dssdev->dev, "invalid s1d1374x revision %02x\n", rev); 323 dev_err(dssdev->dev, "invalid s1d1374x revision %02x\n", rev);
324 r = -ENODEV; 324 r = -ENODEV;
325 goto err_inv_chip; 325 goto err_inv_chip;
326 } 326 }
@@ -341,13 +341,13 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
341 panel_name = "ls041y3"; 341 panel_name = "ls041y3";
342 break; 342 break;
343 default: 343 default:
344 dev_err(&dssdev->dev, "invalid display ID 0x%x\n", 344 dev_err(dssdev->dev, "invalid display ID 0x%x\n",
345 display_id[0]); 345 display_id[0]);
346 r = -ENODEV; 346 r = -ENODEV;
347 goto err_inv_panel; 347 goto err_inv_panel;
348 } 348 }
349 349
350 dev_info(&dssdev->dev, "%s rev %02x LCD detected\n", 350 dev_info(dssdev->dev, "%s rev %02x LCD detected\n",
351 panel_name, display_id[1]); 351 panel_name, display_id[1]);
352 352
353 send_sleep_out(spi); 353 send_sleep_out(spi);
@@ -416,7 +416,7 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
416 struct panel_drv_data *ddata; 416 struct panel_drv_data *ddata;
417 int r; 417 int r;
418 418
419 dev_dbg(&dssdev->dev, "probe\n"); 419 dev_dbg(dssdev->dev, "probe\n");
420 420
421 if (!bdata) 421 if (!bdata)
422 return -EINVAL; 422 return -EINVAL;
@@ -434,14 +434,14 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
434 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; 434 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
435 435
436 if (gpio_is_valid(bdata->panel_reset)) { 436 if (gpio_is_valid(bdata->panel_reset)) {
437 r = devm_gpio_request_one(&dssdev->dev, bdata->panel_reset, 437 r = devm_gpio_request_one(dssdev->dev, bdata->panel_reset,
438 GPIOF_OUT_INIT_LOW, "PANEL RESET"); 438 GPIOF_OUT_INIT_LOW, "PANEL RESET");
439 if (r) 439 if (r)
440 return r; 440 return r;
441 } 441 }
442 442
443 if (gpio_is_valid(bdata->ctrl_pwrdown)) { 443 if (gpio_is_valid(bdata->ctrl_pwrdown)) {
444 r = devm_gpio_request_one(&dssdev->dev, bdata->ctrl_pwrdown, 444 r = devm_gpio_request_one(dssdev->dev, bdata->ctrl_pwrdown,
445 GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN"); 445 GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN");
446 if (r) 446 if (r)
447 return r; 447 return r;
@@ -452,9 +452,9 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
452 452
453static void n8x0_panel_remove(struct omap_dss_device *dssdev) 453static void n8x0_panel_remove(struct omap_dss_device *dssdev)
454{ 454{
455 dev_dbg(&dssdev->dev, "remove\n"); 455 dev_dbg(dssdev->dev, "remove\n");
456 456
457 dev_set_drvdata(&dssdev->dev, NULL); 457 dev_set_drvdata(dssdev->dev, NULL);
458} 458}
459 459
460static int n8x0_panel_enable(struct omap_dss_device *dssdev) 460static int n8x0_panel_enable(struct omap_dss_device *dssdev)
@@ -462,7 +462,7 @@ static int n8x0_panel_enable(struct omap_dss_device *dssdev)
462 struct panel_drv_data *ddata = get_drv_data(dssdev); 462 struct panel_drv_data *ddata = get_drv_data(dssdev);
463 int r; 463 int r;
464 464
465 dev_dbg(&dssdev->dev, "enable\n"); 465 dev_dbg(dssdev->dev, "enable\n");
466 466
467 mutex_lock(&ddata->lock); 467 mutex_lock(&ddata->lock);
468 468
@@ -488,7 +488,7 @@ static void n8x0_panel_disable(struct omap_dss_device *dssdev)
488{ 488{
489 struct panel_drv_data *ddata = get_drv_data(dssdev); 489 struct panel_drv_data *ddata = get_drv_data(dssdev);
490 490
491 dev_dbg(&dssdev->dev, "disable\n"); 491 dev_dbg(dssdev->dev, "disable\n");
492 492
493 mutex_lock(&ddata->lock); 493 mutex_lock(&ddata->lock);
494 494
@@ -521,13 +521,13 @@ static int n8x0_panel_update(struct omap_dss_device *dssdev,
521 struct panel_drv_data *ddata = get_drv_data(dssdev); 521 struct panel_drv_data *ddata = get_drv_data(dssdev);
522 u16 dw, dh; 522 u16 dw, dh;
523 523
524 dev_dbg(&dssdev->dev, "update\n"); 524 dev_dbg(dssdev->dev, "update\n");
525 525
526 dw = dssdev->panel.timings.x_res; 526 dw = dssdev->panel.timings.x_res;
527 dh = dssdev->panel.timings.y_res; 527 dh = dssdev->panel.timings.y_res;
528 528
529 if (x != 0 || y != 0 || w != dw || h != dh) { 529 if (x != 0 || y != 0 || w != dw || h != dh) {
530 dev_err(&dssdev->dev, "invaid update region %d, %d, %d, %d\n", 530 dev_err(dssdev->dev, "invaid update region %d, %d, %d, %d\n",
531 x, y, w, h); 531 x, y, w, h);
532 return -EINVAL; 532 return -EINVAL;
533 } 533 }
@@ -548,7 +548,7 @@ static int n8x0_panel_sync(struct omap_dss_device *dssdev)
548{ 548{
549 struct panel_drv_data *ddata = get_drv_data(dssdev); 549 struct panel_drv_data *ddata = get_drv_data(dssdev);
550 550
551 dev_dbg(&dssdev->dev, "sync\n"); 551 dev_dbg(dssdev->dev, "sync\n");
552 552
553 mutex_lock(&ddata->lock); 553 mutex_lock(&ddata->lock);
554 rfbi_bus_lock(); 554 rfbi_bus_lock();
diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
index 20c3cd91ff9b..6b9f7925e918 100644
--- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
+++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
@@ -98,14 +98,14 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
98 dssdev->panel.timings = nec_8048_panel_timings; 98 dssdev->panel.timings = nec_8048_panel_timings;
99 99
100 if (gpio_is_valid(pd->qvga_gpio)) { 100 if (gpio_is_valid(pd->qvga_gpio)) {
101 r = devm_gpio_request_one(&dssdev->dev, pd->qvga_gpio, 101 r = devm_gpio_request_one(dssdev->dev, pd->qvga_gpio,
102 GPIOF_OUT_INIT_HIGH, "lcd QVGA"); 102 GPIOF_OUT_INIT_HIGH, "lcd QVGA");
103 if (r) 103 if (r)
104 return r; 104 return r;
105 } 105 }
106 106
107 if (gpio_is_valid(pd->res_gpio)) { 107 if (gpio_is_valid(pd->res_gpio)) {
108 r = devm_gpio_request_one(&dssdev->dev, pd->res_gpio, 108 r = devm_gpio_request_one(dssdev->dev, pd->res_gpio,
109 GPIOF_OUT_INIT_LOW, "lcd RES"); 109 GPIOF_OUT_INIT_LOW, "lcd RES");
110 if (r) 110 if (r)
111 return r; 111 return r;
diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
index 62f2db04fbc8..875b8902f647 100644
--- a/drivers/video/omap2/displays/panel-picodlp.c
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -351,7 +351,7 @@ static struct i2c_driver picodlp_i2c_driver = {
351static int picodlp_panel_power_on(struct omap_dss_device *dssdev) 351static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
352{ 352{
353 int r, trial = 100; 353 int r, trial = 100;
354 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); 354 struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
355 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev); 355 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
356 356
357 gpio_set_value(picodlp_pdata->pwrgood_gpio, 0); 357 gpio_set_value(picodlp_pdata->pwrgood_gpio, 0);
@@ -360,7 +360,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
360 360
361 while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) { 361 while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) {
362 if (!trial--) { 362 if (!trial--) {
363 dev_err(&dssdev->dev, "emu_done signal not" 363 dev_err(dssdev->dev, "emu_done signal not"
364 " going high\n"); 364 " going high\n");
365 return -ETIMEDOUT; 365 return -ETIMEDOUT;
366 } 366 }
@@ -378,7 +378,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
378 378
379 r = omapdss_dpi_display_enable(dssdev); 379 r = omapdss_dpi_display_enable(dssdev);
380 if (r) { 380 if (r) {
381 dev_err(&dssdev->dev, "failed to enable DPI\n"); 381 dev_err(dssdev->dev, "failed to enable DPI\n");
382 goto err1; 382 goto err1;
383 } 383 }
384 384
@@ -418,7 +418,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
418 if (!picodlp_pdata) 418 if (!picodlp_pdata)
419 return -EINVAL; 419 return -EINVAL;
420 420
421 picod = devm_kzalloc(&dssdev->dev, sizeof(*picod), GFP_KERNEL); 421 picod = devm_kzalloc(dssdev->dev, sizeof(*picod), GFP_KERNEL);
422 if (!picod) 422 if (!picod)
423 return -ENOMEM; 423 return -ENOMEM;
424 424
@@ -428,23 +428,23 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
428 428
429 adapter = i2c_get_adapter(picodlp_adapter_id); 429 adapter = i2c_get_adapter(picodlp_adapter_id);
430 if (!adapter) { 430 if (!adapter) {
431 dev_err(&dssdev->dev, "can't get i2c adapter\n"); 431 dev_err(dssdev->dev, "can't get i2c adapter\n");
432 return -ENODEV; 432 return -ENODEV;
433 } 433 }
434 434
435 picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info); 435 picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info);
436 if (!picodlp_i2c_client) { 436 if (!picodlp_i2c_client) {
437 dev_err(&dssdev->dev, "can't add i2c device::" 437 dev_err(dssdev->dev, "can't add i2c device::"
438 " picodlp_i2c_client is NULL\n"); 438 " picodlp_i2c_client is NULL\n");
439 return -ENODEV; 439 return -ENODEV;
440 } 440 }
441 441
442 picod->picodlp_i2c_client = picodlp_i2c_client; 442 picod->picodlp_i2c_client = picodlp_i2c_client;
443 443
444 dev_set_drvdata(&dssdev->dev, picod); 444 dev_set_drvdata(dssdev->dev, picod);
445 445
446 if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) { 446 if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) {
447 r = devm_gpio_request_one(&dssdev->dev, 447 r = devm_gpio_request_one(dssdev->dev,
448 picodlp_pdata->emu_done_gpio, 448 picodlp_pdata->emu_done_gpio,
449 GPIOF_IN, "DLP EMU DONE"); 449 GPIOF_IN, "DLP EMU DONE");
450 if (r) 450 if (r)
@@ -452,7 +452,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
452 } 452 }
453 453
454 if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) { 454 if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) {
455 r = devm_gpio_request_one(&dssdev->dev, 455 r = devm_gpio_request_one(dssdev->dev,
456 picodlp_pdata->pwrgood_gpio, 456 picodlp_pdata->pwrgood_gpio,
457 GPIOF_OUT_INIT_LOW, "DLP PWRGOOD"); 457 GPIOF_OUT_INIT_LOW, "DLP PWRGOOD");
458 if (r) 458 if (r)
@@ -464,21 +464,21 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
464 464
465static void picodlp_panel_remove(struct omap_dss_device *dssdev) 465static void picodlp_panel_remove(struct omap_dss_device *dssdev)
466{ 466{
467 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); 467 struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
468 468
469 i2c_unregister_device(picod->picodlp_i2c_client); 469 i2c_unregister_device(picod->picodlp_i2c_client);
470 dev_set_drvdata(&dssdev->dev, NULL); 470 dev_set_drvdata(dssdev->dev, NULL);
471 dev_dbg(&dssdev->dev, "removing picodlp panel\n"); 471 dev_dbg(dssdev->dev, "removing picodlp panel\n");
472 472
473 kfree(picod); 473 kfree(picod);
474} 474}
475 475
476static int picodlp_panel_enable(struct omap_dss_device *dssdev) 476static int picodlp_panel_enable(struct omap_dss_device *dssdev)
477{ 477{
478 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); 478 struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
479 int r; 479 int r;
480 480
481 dev_dbg(&dssdev->dev, "enabling picodlp panel\n"); 481 dev_dbg(dssdev->dev, "enabling picodlp panel\n");
482 482
483 mutex_lock(&picod->lock); 483 mutex_lock(&picod->lock);
484 if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) { 484 if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
@@ -494,7 +494,7 @@ static int picodlp_panel_enable(struct omap_dss_device *dssdev)
494 494
495static void picodlp_panel_disable(struct omap_dss_device *dssdev) 495static void picodlp_panel_disable(struct omap_dss_device *dssdev)
496{ 496{
497 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); 497 struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
498 498
499 mutex_lock(&picod->lock); 499 mutex_lock(&picod->lock);
500 /* Turn off DLP Power */ 500 /* Turn off DLP Power */
@@ -504,7 +504,7 @@ static void picodlp_panel_disable(struct omap_dss_device *dssdev)
504 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 504 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
505 mutex_unlock(&picod->lock); 505 mutex_unlock(&picod->lock);
506 506
507 dev_dbg(&dssdev->dev, "disabling picodlp panel\n"); 507 dev_dbg(dssdev->dev, "disabling picodlp panel\n");
508} 508}
509 509
510static void picodlp_get_resolution(struct omap_dss_device *dssdev, 510static void picodlp_get_resolution(struct omap_dss_device *dssdev,
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index 74cb0eb45311..78f0a6779756 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -66,35 +66,35 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
66 dssdev->panel.timings = sharp_ls_timings; 66 dssdev->panel.timings = sharp_ls_timings;
67 67
68 if (gpio_is_valid(pd->mo_gpio)) { 68 if (gpio_is_valid(pd->mo_gpio)) {
69 r = devm_gpio_request_one(&dssdev->dev, pd->mo_gpio, 69 r = devm_gpio_request_one(dssdev->dev, pd->mo_gpio,
70 GPIOF_OUT_INIT_LOW, "lcd MO"); 70 GPIOF_OUT_INIT_LOW, "lcd MO");
71 if (r) 71 if (r)
72 return r; 72 return r;
73 } 73 }
74 74
75 if (gpio_is_valid(pd->lr_gpio)) { 75 if (gpio_is_valid(pd->lr_gpio)) {
76 r = devm_gpio_request_one(&dssdev->dev, pd->lr_gpio, 76 r = devm_gpio_request_one(dssdev->dev, pd->lr_gpio,
77 GPIOF_OUT_INIT_HIGH, "lcd LR"); 77 GPIOF_OUT_INIT_HIGH, "lcd LR");
78 if (r) 78 if (r)
79 return r; 79 return r;
80 } 80 }
81 81
82 if (gpio_is_valid(pd->ud_gpio)) { 82 if (gpio_is_valid(pd->ud_gpio)) {
83 r = devm_gpio_request_one(&dssdev->dev, pd->ud_gpio, 83 r = devm_gpio_request_one(dssdev->dev, pd->ud_gpio,
84 GPIOF_OUT_INIT_HIGH, "lcd UD"); 84 GPIOF_OUT_INIT_HIGH, "lcd UD");
85 if (r) 85 if (r)
86 return r; 86 return r;
87 } 87 }
88 88
89 if (gpio_is_valid(pd->resb_gpio)) { 89 if (gpio_is_valid(pd->resb_gpio)) {
90 r = devm_gpio_request_one(&dssdev->dev, pd->resb_gpio, 90 r = devm_gpio_request_one(dssdev->dev, pd->resb_gpio,
91 GPIOF_OUT_INIT_LOW, "lcd RESB"); 91 GPIOF_OUT_INIT_LOW, "lcd RESB");
92 if (r) 92 if (r)
93 return r; 93 return r;
94 } 94 }
95 95
96 if (gpio_is_valid(pd->ini_gpio)) { 96 if (gpio_is_valid(pd->ini_gpio)) {
97 r = devm_gpio_request_one(&dssdev->dev, pd->ini_gpio, 97 r = devm_gpio_request_one(dssdev->dev, pd->ini_gpio,
98 GPIOF_OUT_INIT_LOW, "lcd INI"); 98 GPIOF_OUT_INIT_LOW, "lcd INI");
99 if (r) 99 if (r)
100 return r; 100 return r;
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index c4f78bda115a..c731d3c068b4 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -237,7 +237,7 @@ static int taal_set_update_window(struct taal_data *td,
237 237
238static void taal_queue_esd_work(struct omap_dss_device *dssdev) 238static void taal_queue_esd_work(struct omap_dss_device *dssdev)
239{ 239{
240 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 240 struct taal_data *td = dev_get_drvdata(dssdev->dev);
241 241
242 if (td->esd_interval > 0) 242 if (td->esd_interval > 0)
243 queue_delayed_work(td->workqueue, &td->esd_work, 243 queue_delayed_work(td->workqueue, &td->esd_work,
@@ -246,14 +246,14 @@ static void taal_queue_esd_work(struct omap_dss_device *dssdev)
246 246
247static void taal_cancel_esd_work(struct omap_dss_device *dssdev) 247static void taal_cancel_esd_work(struct omap_dss_device *dssdev)
248{ 248{
249 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 249 struct taal_data *td = dev_get_drvdata(dssdev->dev);
250 250
251 cancel_delayed_work(&td->esd_work); 251 cancel_delayed_work(&td->esd_work);
252} 252}
253 253
254static void taal_queue_ulps_work(struct omap_dss_device *dssdev) 254static void taal_queue_ulps_work(struct omap_dss_device *dssdev)
255{ 255{
256 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 256 struct taal_data *td = dev_get_drvdata(dssdev->dev);
257 257
258 if (td->ulps_timeout > 0) 258 if (td->ulps_timeout > 0)
259 queue_delayed_work(td->workqueue, &td->ulps_work, 259 queue_delayed_work(td->workqueue, &td->ulps_work,
@@ -262,14 +262,14 @@ static void taal_queue_ulps_work(struct omap_dss_device *dssdev)
262 262
263static void taal_cancel_ulps_work(struct omap_dss_device *dssdev) 263static void taal_cancel_ulps_work(struct omap_dss_device *dssdev)
264{ 264{
265 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 265 struct taal_data *td = dev_get_drvdata(dssdev->dev);
266 266
267 cancel_delayed_work(&td->ulps_work); 267 cancel_delayed_work(&td->ulps_work);
268} 268}
269 269
270static int taal_enter_ulps(struct omap_dss_device *dssdev) 270static int taal_enter_ulps(struct omap_dss_device *dssdev)
271{ 271{
272 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 272 struct taal_data *td = dev_get_drvdata(dssdev->dev);
273 int r; 273 int r;
274 274
275 if (td->ulps_enabled) 275 if (td->ulps_enabled)
@@ -291,7 +291,7 @@ static int taal_enter_ulps(struct omap_dss_device *dssdev)
291 return 0; 291 return 0;
292 292
293err: 293err:
294 dev_err(&dssdev->dev, "enter ULPS failed"); 294 dev_err(dssdev->dev, "enter ULPS failed");
295 taal_panel_reset(dssdev); 295 taal_panel_reset(dssdev);
296 296
297 td->ulps_enabled = false; 297 td->ulps_enabled = false;
@@ -303,7 +303,7 @@ err:
303 303
304static int taal_exit_ulps(struct omap_dss_device *dssdev) 304static int taal_exit_ulps(struct omap_dss_device *dssdev)
305{ 305{
306 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 306 struct taal_data *td = dev_get_drvdata(dssdev->dev);
307 int r; 307 int r;
308 308
309 if (!td->ulps_enabled) 309 if (!td->ulps_enabled)
@@ -311,7 +311,7 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev)
311 311
312 r = omapdss_dsi_display_enable(dssdev); 312 r = omapdss_dsi_display_enable(dssdev);
313 if (r) { 313 if (r) {
314 dev_err(&dssdev->dev, "failed to enable DSI\n"); 314 dev_err(dssdev->dev, "failed to enable DSI\n");
315 goto err1; 315 goto err1;
316 } 316 }
317 317
@@ -319,7 +319,7 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev)
319 319
320 r = _taal_enable_te(dssdev, true); 320 r = _taal_enable_te(dssdev, true);
321 if (r) { 321 if (r) {
322 dev_err(&dssdev->dev, "failed to re-enable TE"); 322 dev_err(dssdev->dev, "failed to re-enable TE");
323 goto err2; 323 goto err2;
324 } 324 }
325 325
@@ -333,7 +333,7 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev)
333 return 0; 333 return 0;
334 334
335err2: 335err2:
336 dev_err(&dssdev->dev, "failed to exit ULPS"); 336 dev_err(dssdev->dev, "failed to exit ULPS");
337 337
338 r = taal_panel_reset(dssdev); 338 r = taal_panel_reset(dssdev);
339 if (!r) { 339 if (!r) {
@@ -349,7 +349,7 @@ err1:
349 349
350static int taal_wake_up(struct omap_dss_device *dssdev) 350static int taal_wake_up(struct omap_dss_device *dssdev)
351{ 351{
352 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 352 struct taal_data *td = dev_get_drvdata(dssdev->dev);
353 353
354 if (td->ulps_enabled) 354 if (td->ulps_enabled)
355 return taal_exit_ulps(dssdev); 355 return taal_exit_ulps(dssdev);
@@ -362,7 +362,7 @@ static int taal_wake_up(struct omap_dss_device *dssdev)
362static int taal_bl_update_status(struct backlight_device *dev) 362static int taal_bl_update_status(struct backlight_device *dev)
363{ 363{
364 struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev); 364 struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
365 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 365 struct taal_data *td = dev_get_drvdata(dssdev->dev);
366 int r; 366 int r;
367 int level; 367 int level;
368 368
@@ -372,7 +372,7 @@ static int taal_bl_update_status(struct backlight_device *dev)
372 else 372 else
373 level = 0; 373 level = 0;
374 374
375 dev_dbg(&dssdev->dev, "update brightness to %d\n", level); 375 dev_dbg(dssdev->dev, "update brightness to %d\n", level);
376 376
377 mutex_lock(&td->lock); 377 mutex_lock(&td->lock);
378 378
@@ -418,7 +418,7 @@ static ssize_t taal_num_errors_show(struct device *dev,
418 struct device_attribute *attr, char *buf) 418 struct device_attribute *attr, char *buf)
419{ 419{
420 struct omap_dss_device *dssdev = to_dss_device(dev); 420 struct omap_dss_device *dssdev = to_dss_device(dev);
421 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 421 struct taal_data *td = dev_get_drvdata(dssdev->dev);
422 u8 errors = 0; 422 u8 errors = 0;
423 int r; 423 int r;
424 424
@@ -448,7 +448,7 @@ static ssize_t taal_hw_revision_show(struct device *dev,
448 struct device_attribute *attr, char *buf) 448 struct device_attribute *attr, char *buf)
449{ 449{
450 struct omap_dss_device *dssdev = to_dss_device(dev); 450 struct omap_dss_device *dssdev = to_dss_device(dev);
451 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 451 struct taal_data *td = dev_get_drvdata(dssdev->dev);
452 u8 id1, id2, id3; 452 u8 id1, id2, id3;
453 int r; 453 int r;
454 454
@@ -486,7 +486,7 @@ static ssize_t show_cabc_mode(struct device *dev,
486 char *buf) 486 char *buf)
487{ 487{
488 struct omap_dss_device *dssdev = to_dss_device(dev); 488 struct omap_dss_device *dssdev = to_dss_device(dev);
489 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 489 struct taal_data *td = dev_get_drvdata(dssdev->dev);
490 const char *mode_str; 490 const char *mode_str;
491 int mode; 491 int mode;
492 int len; 492 int len;
@@ -506,7 +506,7 @@ static ssize_t store_cabc_mode(struct device *dev,
506 const char *buf, size_t count) 506 const char *buf, size_t count)
507{ 507{
508 struct omap_dss_device *dssdev = to_dss_device(dev); 508 struct omap_dss_device *dssdev = to_dss_device(dev);
509 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 509 struct taal_data *td = dev_get_drvdata(dssdev->dev);
510 int i; 510 int i;
511 int r; 511 int r;
512 512
@@ -568,7 +568,7 @@ static ssize_t taal_store_esd_interval(struct device *dev,
568 const char *buf, size_t count) 568 const char *buf, size_t count)
569{ 569{
570 struct omap_dss_device *dssdev = to_dss_device(dev); 570 struct omap_dss_device *dssdev = to_dss_device(dev);
571 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 571 struct taal_data *td = dev_get_drvdata(dssdev->dev);
572 572
573 unsigned long t; 573 unsigned long t;
574 int r; 574 int r;
@@ -592,7 +592,7 @@ static ssize_t taal_show_esd_interval(struct device *dev,
592 char *buf) 592 char *buf)
593{ 593{
594 struct omap_dss_device *dssdev = to_dss_device(dev); 594 struct omap_dss_device *dssdev = to_dss_device(dev);
595 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 595 struct taal_data *td = dev_get_drvdata(dssdev->dev);
596 unsigned t; 596 unsigned t;
597 597
598 mutex_lock(&td->lock); 598 mutex_lock(&td->lock);
@@ -607,7 +607,7 @@ static ssize_t taal_store_ulps(struct device *dev,
607 const char *buf, size_t count) 607 const char *buf, size_t count)
608{ 608{
609 struct omap_dss_device *dssdev = to_dss_device(dev); 609 struct omap_dss_device *dssdev = to_dss_device(dev);
610 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 610 struct taal_data *td = dev_get_drvdata(dssdev->dev);
611 unsigned long t; 611 unsigned long t;
612 int r; 612 int r;
613 613
@@ -641,7 +641,7 @@ static ssize_t taal_show_ulps(struct device *dev,
641 char *buf) 641 char *buf)
642{ 642{
643 struct omap_dss_device *dssdev = to_dss_device(dev); 643 struct omap_dss_device *dssdev = to_dss_device(dev);
644 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 644 struct taal_data *td = dev_get_drvdata(dssdev->dev);
645 unsigned t; 645 unsigned t;
646 646
647 mutex_lock(&td->lock); 647 mutex_lock(&td->lock);
@@ -656,7 +656,7 @@ static ssize_t taal_store_ulps_timeout(struct device *dev,
656 const char *buf, size_t count) 656 const char *buf, size_t count)
657{ 657{
658 struct omap_dss_device *dssdev = to_dss_device(dev); 658 struct omap_dss_device *dssdev = to_dss_device(dev);
659 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 659 struct taal_data *td = dev_get_drvdata(dssdev->dev);
660 unsigned long t; 660 unsigned long t;
661 int r; 661 int r;
662 662
@@ -687,7 +687,7 @@ static ssize_t taal_show_ulps_timeout(struct device *dev,
687 char *buf) 687 char *buf)
688{ 688{
689 struct omap_dss_device *dssdev = to_dss_device(dev); 689 struct omap_dss_device *dssdev = to_dss_device(dev);
690 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 690 struct taal_data *td = dev_get_drvdata(dssdev->dev);
691 unsigned t; 691 unsigned t;
692 692
693 mutex_lock(&td->lock); 693 mutex_lock(&td->lock);
@@ -727,7 +727,7 @@ static struct attribute_group taal_attr_group = {
727 727
728static void taal_hw_reset(struct omap_dss_device *dssdev) 728static void taal_hw_reset(struct omap_dss_device *dssdev)
729{ 729{
730 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 730 struct taal_data *td = dev_get_drvdata(dssdev->dev);
731 731
732 if (!gpio_is_valid(td->reset_gpio)) 732 if (!gpio_is_valid(td->reset_gpio))
733 return; 733 return;
@@ -768,13 +768,13 @@ static int taal_probe(struct omap_dss_device *dssdev)
768 struct backlight_device *bldev = NULL; 768 struct backlight_device *bldev = NULL;
769 int r; 769 int r;
770 770
771 dev_dbg(&dssdev->dev, "probe\n"); 771 dev_dbg(dssdev->dev, "probe\n");
772 772
773 td = devm_kzalloc(&dssdev->dev, sizeof(*td), GFP_KERNEL); 773 td = devm_kzalloc(dssdev->dev, sizeof(*td), GFP_KERNEL);
774 if (!td) 774 if (!td)
775 return -ENOMEM; 775 return -ENOMEM;
776 776
777 dev_set_drvdata(&dssdev->dev, td); 777 dev_set_drvdata(dssdev->dev, td);
778 td->dssdev = dssdev; 778 td->dssdev = dssdev;
779 779
780 if (dssdev->data) { 780 if (dssdev->data) {
@@ -797,41 +797,41 @@ static int taal_probe(struct omap_dss_device *dssdev)
797 atomic_set(&td->do_update, 0); 797 atomic_set(&td->do_update, 0);
798 798
799 if (gpio_is_valid(td->reset_gpio)) { 799 if (gpio_is_valid(td->reset_gpio)) {
800 r = devm_gpio_request_one(&dssdev->dev, td->reset_gpio, 800 r = devm_gpio_request_one(dssdev->dev, td->reset_gpio,
801 GPIOF_OUT_INIT_LOW, "taal rst"); 801 GPIOF_OUT_INIT_LOW, "taal rst");
802 if (r) { 802 if (r) {
803 dev_err(&dssdev->dev, "failed to request reset gpio\n"); 803 dev_err(dssdev->dev, "failed to request reset gpio\n");
804 return r; 804 return r;
805 } 805 }
806 } 806 }
807 807
808 if (gpio_is_valid(td->ext_te_gpio)) { 808 if (gpio_is_valid(td->ext_te_gpio)) {
809 r = devm_gpio_request_one(&dssdev->dev, td->ext_te_gpio, 809 r = devm_gpio_request_one(dssdev->dev, td->ext_te_gpio,
810 GPIOF_IN, "taal irq"); 810 GPIOF_IN, "taal irq");
811 if (r) { 811 if (r) {
812 dev_err(&dssdev->dev, "GPIO request failed\n"); 812 dev_err(dssdev->dev, "GPIO request failed\n");
813 return r; 813 return r;
814 } 814 }
815 815
816 r = devm_request_irq(&dssdev->dev, gpio_to_irq(td->ext_te_gpio), 816 r = devm_request_irq(dssdev->dev, gpio_to_irq(td->ext_te_gpio),
817 taal_te_isr, 817 taal_te_isr,
818 IRQF_TRIGGER_RISING, 818 IRQF_TRIGGER_RISING,
819 "taal vsync", dssdev); 819 "taal vsync", dssdev);
820 820
821 if (r) { 821 if (r) {
822 dev_err(&dssdev->dev, "IRQ request failed\n"); 822 dev_err(dssdev->dev, "IRQ request failed\n");
823 return r; 823 return r;
824 } 824 }
825 825
826 INIT_DEFERRABLE_WORK(&td->te_timeout_work, 826 INIT_DEFERRABLE_WORK(&td->te_timeout_work,
827 taal_te_timeout_work_callback); 827 taal_te_timeout_work_callback);
828 828
829 dev_dbg(&dssdev->dev, "Using GPIO TE\n"); 829 dev_dbg(dssdev->dev, "Using GPIO TE\n");
830 } 830 }
831 831
832 td->workqueue = create_singlethread_workqueue("taal_esd"); 832 td->workqueue = create_singlethread_workqueue("taal_esd");
833 if (td->workqueue == NULL) { 833 if (td->workqueue == NULL) {
834 dev_err(&dssdev->dev, "can't create ESD workqueue\n"); 834 dev_err(dssdev->dev, "can't create ESD workqueue\n");
835 return -ENOMEM; 835 return -ENOMEM;
836 } 836 }
837 INIT_DEFERRABLE_WORK(&td->esd_work, taal_esd_work); 837 INIT_DEFERRABLE_WORK(&td->esd_work, taal_esd_work);
@@ -844,8 +844,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
844 props.max_brightness = 255; 844 props.max_brightness = 255;
845 845
846 props.type = BACKLIGHT_RAW; 846 props.type = BACKLIGHT_RAW;
847 bldev = backlight_device_register(dev_name(&dssdev->dev), 847 bldev = backlight_device_register(dev_name(dssdev->dev),
848 &dssdev->dev, dssdev, &taal_bl_ops, &props); 848 dssdev->dev, dssdev, &taal_bl_ops, &props);
849 if (IS_ERR(bldev)) { 849 if (IS_ERR(bldev)) {
850 r = PTR_ERR(bldev); 850 r = PTR_ERR(bldev);
851 goto err_bl; 851 goto err_bl;
@@ -862,19 +862,19 @@ static int taal_probe(struct omap_dss_device *dssdev)
862 862
863 r = omap_dsi_request_vc(dssdev, &td->channel); 863 r = omap_dsi_request_vc(dssdev, &td->channel);
864 if (r) { 864 if (r) {
865 dev_err(&dssdev->dev, "failed to get virtual channel\n"); 865 dev_err(dssdev->dev, "failed to get virtual channel\n");
866 goto err_req_vc; 866 goto err_req_vc;
867 } 867 }
868 868
869 r = omap_dsi_set_vc_id(dssdev, td->channel, TCH); 869 r = omap_dsi_set_vc_id(dssdev, td->channel, TCH);
870 if (r) { 870 if (r) {
871 dev_err(&dssdev->dev, "failed to set VC_ID\n"); 871 dev_err(dssdev->dev, "failed to set VC_ID\n");
872 goto err_vc_id; 872 goto err_vc_id;
873 } 873 }
874 874
875 r = sysfs_create_group(&dssdev->dev.kobj, &taal_attr_group); 875 r = sysfs_create_group(&dssdev->dev->kobj, &taal_attr_group);
876 if (r) { 876 if (r) {
877 dev_err(&dssdev->dev, "failed to create sysfs files\n"); 877 dev_err(dssdev->dev, "failed to create sysfs files\n");
878 goto err_vc_id; 878 goto err_vc_id;
879 } 879 }
880 880
@@ -892,12 +892,12 @@ err_bl:
892 892
893static void __exit taal_remove(struct omap_dss_device *dssdev) 893static void __exit taal_remove(struct omap_dss_device *dssdev)
894{ 894{
895 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 895 struct taal_data *td = dev_get_drvdata(dssdev->dev);
896 struct backlight_device *bldev; 896 struct backlight_device *bldev;
897 897
898 dev_dbg(&dssdev->dev, "remove\n"); 898 dev_dbg(dssdev->dev, "remove\n");
899 899
900 sysfs_remove_group(&dssdev->dev.kobj, &taal_attr_group); 900 sysfs_remove_group(&dssdev->dev->kobj, &taal_attr_group);
901 omap_dsi_release_vc(dssdev, td->channel); 901 omap_dsi_release_vc(dssdev, td->channel);
902 902
903 bldev = td->bldev; 903 bldev = td->bldev;
@@ -917,7 +917,7 @@ static void __exit taal_remove(struct omap_dss_device *dssdev)
917 917
918static int taal_power_on(struct omap_dss_device *dssdev) 918static int taal_power_on(struct omap_dss_device *dssdev)
919{ 919{
920 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 920 struct taal_data *td = dev_get_drvdata(dssdev->dev);
921 u8 id1, id2, id3; 921 u8 id1, id2, id3;
922 int r; 922 int r;
923 struct omap_dss_dsi_config dsi_config = { 923 struct omap_dss_dsi_config dsi_config = {
@@ -932,19 +932,19 @@ static int taal_power_on(struct omap_dss_device *dssdev)
932 932
933 r = omapdss_dsi_configure_pins(dssdev, &td->pin_config); 933 r = omapdss_dsi_configure_pins(dssdev, &td->pin_config);
934 if (r) { 934 if (r) {
935 dev_err(&dssdev->dev, "failed to configure DSI pins\n"); 935 dev_err(dssdev->dev, "failed to configure DSI pins\n");
936 goto err0; 936 goto err0;
937 }; 937 };
938 938
939 r = omapdss_dsi_set_config(dssdev, &dsi_config); 939 r = omapdss_dsi_set_config(dssdev, &dsi_config);
940 if (r) { 940 if (r) {
941 dev_err(&dssdev->dev, "failed to configure DSI\n"); 941 dev_err(dssdev->dev, "failed to configure DSI\n");
942 goto err0; 942 goto err0;
943 } 943 }
944 944
945 r = omapdss_dsi_display_enable(dssdev); 945 r = omapdss_dsi_display_enable(dssdev);
946 if (r) { 946 if (r) {
947 dev_err(&dssdev->dev, "failed to enable DSI\n"); 947 dev_err(dssdev->dev, "failed to enable DSI\n");
948 goto err0; 948 goto err0;
949 } 949 }
950 950
@@ -999,10 +999,10 @@ static int taal_power_on(struct omap_dss_device *dssdev)
999 td->enabled = 1; 999 td->enabled = 1;
1000 1000
1001 if (!td->intro_printed) { 1001 if (!td->intro_printed) {
1002 dev_info(&dssdev->dev, "panel revision %02x.%02x.%02x\n", 1002 dev_info(dssdev->dev, "panel revision %02x.%02x.%02x\n",
1003 id1, id2, id3); 1003 id1, id2, id3);
1004 if (td->cabc_broken) 1004 if (td->cabc_broken)
1005 dev_info(&dssdev->dev, 1005 dev_info(dssdev->dev,
1006 "old Taal version, CABC disabled\n"); 1006 "old Taal version, CABC disabled\n");
1007 td->intro_printed = true; 1007 td->intro_printed = true;
1008 } 1008 }
@@ -1011,7 +1011,7 @@ static int taal_power_on(struct omap_dss_device *dssdev)
1011 1011
1012 return 0; 1012 return 0;
1013err: 1013err:
1014 dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n"); 1014 dev_err(dssdev->dev, "error while enabling panel, issuing HW reset\n");
1015 1015
1016 taal_hw_reset(dssdev); 1016 taal_hw_reset(dssdev);
1017 1017
@@ -1022,7 +1022,7 @@ err0:
1022 1022
1023static void taal_power_off(struct omap_dss_device *dssdev) 1023static void taal_power_off(struct omap_dss_device *dssdev)
1024{ 1024{
1025 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1025 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1026 int r; 1026 int r;
1027 1027
1028 dsi_disable_video_output(dssdev, td->channel); 1028 dsi_disable_video_output(dssdev, td->channel);
@@ -1032,7 +1032,7 @@ static void taal_power_off(struct omap_dss_device *dssdev)
1032 r = taal_sleep_in(td); 1032 r = taal_sleep_in(td);
1033 1033
1034 if (r) { 1034 if (r) {
1035 dev_err(&dssdev->dev, 1035 dev_err(dssdev->dev,
1036 "error disabling panel, issuing HW reset\n"); 1036 "error disabling panel, issuing HW reset\n");
1037 taal_hw_reset(dssdev); 1037 taal_hw_reset(dssdev);
1038 } 1038 }
@@ -1044,7 +1044,7 @@ static void taal_power_off(struct omap_dss_device *dssdev)
1044 1044
1045static int taal_panel_reset(struct omap_dss_device *dssdev) 1045static int taal_panel_reset(struct omap_dss_device *dssdev)
1046{ 1046{
1047 dev_err(&dssdev->dev, "performing LCD reset\n"); 1047 dev_err(dssdev->dev, "performing LCD reset\n");
1048 1048
1049 taal_power_off(dssdev); 1049 taal_power_off(dssdev);
1050 taal_hw_reset(dssdev); 1050 taal_hw_reset(dssdev);
@@ -1053,10 +1053,10 @@ static int taal_panel_reset(struct omap_dss_device *dssdev)
1053 1053
1054static int taal_enable(struct omap_dss_device *dssdev) 1054static int taal_enable(struct omap_dss_device *dssdev)
1055{ 1055{
1056 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1056 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1057 int r; 1057 int r;
1058 1058
1059 dev_dbg(&dssdev->dev, "enable\n"); 1059 dev_dbg(dssdev->dev, "enable\n");
1060 1060
1061 mutex_lock(&td->lock); 1061 mutex_lock(&td->lock);
1062 1062
@@ -1082,16 +1082,16 @@ static int taal_enable(struct omap_dss_device *dssdev)
1082 1082
1083 return 0; 1083 return 0;
1084err: 1084err:
1085 dev_dbg(&dssdev->dev, "enable failed\n"); 1085 dev_dbg(dssdev->dev, "enable failed\n");
1086 mutex_unlock(&td->lock); 1086 mutex_unlock(&td->lock);
1087 return r; 1087 return r;
1088} 1088}
1089 1089
1090static void taal_disable(struct omap_dss_device *dssdev) 1090static void taal_disable(struct omap_dss_device *dssdev)
1091{ 1091{
1092 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1092 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1093 1093
1094 dev_dbg(&dssdev->dev, "disable\n"); 1094 dev_dbg(dssdev->dev, "disable\n");
1095 1095
1096 mutex_lock(&td->lock); 1096 mutex_lock(&td->lock);
1097 1097
@@ -1118,14 +1118,14 @@ static void taal_disable(struct omap_dss_device *dssdev)
1118static void taal_framedone_cb(int err, void *data) 1118static void taal_framedone_cb(int err, void *data)
1119{ 1119{
1120 struct omap_dss_device *dssdev = data; 1120 struct omap_dss_device *dssdev = data;
1121 dev_dbg(&dssdev->dev, "framedone, err %d\n", err); 1121 dev_dbg(dssdev->dev, "framedone, err %d\n", err);
1122 dsi_bus_unlock(dssdev); 1122 dsi_bus_unlock(dssdev);
1123} 1123}
1124 1124
1125static irqreturn_t taal_te_isr(int irq, void *data) 1125static irqreturn_t taal_te_isr(int irq, void *data)
1126{ 1126{
1127 struct omap_dss_device *dssdev = data; 1127 struct omap_dss_device *dssdev = data;
1128 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1128 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1129 int old; 1129 int old;
1130 int r; 1130 int r;
1131 1131
@@ -1142,7 +1142,7 @@ static irqreturn_t taal_te_isr(int irq, void *data)
1142 1142
1143 return IRQ_HANDLED; 1143 return IRQ_HANDLED;
1144err: 1144err:
1145 dev_err(&dssdev->dev, "start update failed\n"); 1145 dev_err(dssdev->dev, "start update failed\n");
1146 dsi_bus_unlock(dssdev); 1146 dsi_bus_unlock(dssdev);
1147 return IRQ_HANDLED; 1147 return IRQ_HANDLED;
1148} 1148}
@@ -1153,7 +1153,7 @@ static void taal_te_timeout_work_callback(struct work_struct *work)
1153 te_timeout_work.work); 1153 te_timeout_work.work);
1154 struct omap_dss_device *dssdev = td->dssdev; 1154 struct omap_dss_device *dssdev = td->dssdev;
1155 1155
1156 dev_err(&dssdev->dev, "TE not received for 250ms!\n"); 1156 dev_err(dssdev->dev, "TE not received for 250ms!\n");
1157 1157
1158 atomic_set(&td->do_update, 0); 1158 atomic_set(&td->do_update, 0);
1159 dsi_bus_unlock(dssdev); 1159 dsi_bus_unlock(dssdev);
@@ -1162,10 +1162,10 @@ static void taal_te_timeout_work_callback(struct work_struct *work)
1162static int taal_update(struct omap_dss_device *dssdev, 1162static int taal_update(struct omap_dss_device *dssdev,
1163 u16 x, u16 y, u16 w, u16 h) 1163 u16 x, u16 y, u16 w, u16 h)
1164{ 1164{
1165 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1165 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1166 int r; 1166 int r;
1167 1167
1168 dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h); 1168 dev_dbg(dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
1169 1169
1170 mutex_lock(&td->lock); 1170 mutex_lock(&td->lock);
1171 dsi_bus_lock(dssdev); 1171 dsi_bus_lock(dssdev);
@@ -1208,23 +1208,23 @@ err:
1208 1208
1209static int taal_sync(struct omap_dss_device *dssdev) 1209static int taal_sync(struct omap_dss_device *dssdev)
1210{ 1210{
1211 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1211 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1212 1212
1213 dev_dbg(&dssdev->dev, "sync\n"); 1213 dev_dbg(dssdev->dev, "sync\n");
1214 1214
1215 mutex_lock(&td->lock); 1215 mutex_lock(&td->lock);
1216 dsi_bus_lock(dssdev); 1216 dsi_bus_lock(dssdev);
1217 dsi_bus_unlock(dssdev); 1217 dsi_bus_unlock(dssdev);
1218 mutex_unlock(&td->lock); 1218 mutex_unlock(&td->lock);
1219 1219
1220 dev_dbg(&dssdev->dev, "sync done\n"); 1220 dev_dbg(dssdev->dev, "sync done\n");
1221 1221
1222 return 0; 1222 return 0;
1223} 1223}
1224 1224
1225static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable) 1225static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable)
1226{ 1226{
1227 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1227 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1228 int r; 1228 int r;
1229 1229
1230 if (enable) 1230 if (enable)
@@ -1243,7 +1243,7 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable)
1243 1243
1244static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) 1244static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
1245{ 1245{
1246 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1246 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1247 int r; 1247 int r;
1248 1248
1249 mutex_lock(&td->lock); 1249 mutex_lock(&td->lock);
@@ -1279,7 +1279,7 @@ err:
1279 1279
1280static int taal_get_te(struct omap_dss_device *dssdev) 1280static int taal_get_te(struct omap_dss_device *dssdev)
1281{ 1281{
1282 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1282 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1283 int r; 1283 int r;
1284 1284
1285 mutex_lock(&td->lock); 1285 mutex_lock(&td->lock);
@@ -1291,7 +1291,7 @@ static int taal_get_te(struct omap_dss_device *dssdev)
1291 1291
1292static int taal_run_test(struct omap_dss_device *dssdev, int test_num) 1292static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
1293{ 1293{
1294 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1294 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1295 u8 id1, id2, id3; 1295 u8 id1, id2, id3;
1296 int r; 1296 int r;
1297 1297
@@ -1336,7 +1336,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1336 int first = 1; 1336 int first = 1;
1337 int plen; 1337 int plen;
1338 unsigned buf_used = 0; 1338 unsigned buf_used = 0;
1339 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 1339 struct taal_data *td = dev_get_drvdata(dssdev->dev);
1340 1340
1341 if (size < w * h * 3) 1341 if (size < w * h * 3)
1342 return -ENOMEM; 1342 return -ENOMEM;
@@ -1380,19 +1380,19 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1380 buf + buf_used, size - buf_used); 1380 buf + buf_used, size - buf_used);
1381 1381
1382 if (r < 0) { 1382 if (r < 0) {
1383 dev_err(&dssdev->dev, "read error\n"); 1383 dev_err(dssdev->dev, "read error\n");
1384 goto err3; 1384 goto err3;
1385 } 1385 }
1386 1386
1387 buf_used += r; 1387 buf_used += r;
1388 1388
1389 if (r < plen) { 1389 if (r < plen) {
1390 dev_err(&dssdev->dev, "short read\n"); 1390 dev_err(dssdev->dev, "short read\n");
1391 break; 1391 break;
1392 } 1392 }
1393 1393
1394 if (signal_pending(current)) { 1394 if (signal_pending(current)) {
1395 dev_err(&dssdev->dev, "signal pending, " 1395 dev_err(dssdev->dev, "signal pending, "
1396 "aborting memory read\n"); 1396 "aborting memory read\n");
1397 r = -ERESTARTSYS; 1397 r = -ERESTARTSYS;
1398 goto err3; 1398 goto err3;
@@ -1450,26 +1450,26 @@ static void taal_esd_work(struct work_struct *work)
1450 1450
1451 r = taal_wake_up(dssdev); 1451 r = taal_wake_up(dssdev);
1452 if (r) { 1452 if (r) {
1453 dev_err(&dssdev->dev, "failed to exit ULPS\n"); 1453 dev_err(dssdev->dev, "failed to exit ULPS\n");
1454 goto err; 1454 goto err;
1455 } 1455 }
1456 1456
1457 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state1); 1457 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state1);
1458 if (r) { 1458 if (r) {
1459 dev_err(&dssdev->dev, "failed to read Taal status\n"); 1459 dev_err(dssdev->dev, "failed to read Taal status\n");
1460 goto err; 1460 goto err;
1461 } 1461 }
1462 1462
1463 /* Run self diagnostics */ 1463 /* Run self diagnostics */
1464 r = taal_sleep_out(td); 1464 r = taal_sleep_out(td);
1465 if (r) { 1465 if (r) {
1466 dev_err(&dssdev->dev, "failed to run Taal self-diagnostics\n"); 1466 dev_err(dssdev->dev, "failed to run Taal self-diagnostics\n");
1467 goto err; 1467 goto err;
1468 } 1468 }
1469 1469
1470 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state2); 1470 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state2);
1471 if (r) { 1471 if (r) {
1472 dev_err(&dssdev->dev, "failed to read Taal status\n"); 1472 dev_err(dssdev->dev, "failed to read Taal status\n");
1473 goto err; 1473 goto err;
1474 } 1474 }
1475 1475
@@ -1477,7 +1477,7 @@ static void taal_esd_work(struct work_struct *work)
1477 * Bit6 if the test passes. 1477 * Bit6 if the test passes.
1478 */ 1478 */
1479 if (!((state1 ^ state2) & (1 << 6))) { 1479 if (!((state1 ^ state2) & (1 << 6))) {
1480 dev_err(&dssdev->dev, "LCD self diagnostics failed\n"); 1480 dev_err(dssdev->dev, "LCD self diagnostics failed\n");
1481 goto err; 1481 goto err;
1482 } 1482 }
1483 /* Self-diagnostics result is also shown on TE GPIO line. We need 1483 /* Self-diagnostics result is also shown on TE GPIO line. We need
@@ -1495,7 +1495,7 @@ static void taal_esd_work(struct work_struct *work)
1495 mutex_unlock(&td->lock); 1495 mutex_unlock(&td->lock);
1496 return; 1496 return;
1497err: 1497err:
1498 dev_err(&dssdev->dev, "performing LCD reset\n"); 1498 dev_err(dssdev->dev, "performing LCD reset\n");
1499 1499
1500 taal_panel_reset(dssdev); 1500 taal_panel_reset(dssdev);
1501 1501
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c
index 46039c4bf1ed..1fdfb158a2a9 100644
--- a/drivers/video/omap2/displays/panel-tfp410.c
+++ b/drivers/video/omap2/displays/panel-tfp410.c
@@ -59,7 +59,7 @@ struct panel_drv_data {
59 59
60static int tfp410_power_on(struct omap_dss_device *dssdev) 60static int tfp410_power_on(struct omap_dss_device *dssdev)
61{ 61{
62 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 62 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
63 int r; 63 int r;
64 64
65 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 65 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
@@ -82,7 +82,7 @@ err0:
82 82
83static void tfp410_power_off(struct omap_dss_device *dssdev) 83static void tfp410_power_off(struct omap_dss_device *dssdev)
84{ 84{
85 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 85 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
86 86
87 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 87 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
88 return; 88 return;
@@ -99,7 +99,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
99 int r; 99 int r;
100 int i2c_bus_num; 100 int i2c_bus_num;
101 101
102 ddata = devm_kzalloc(&dssdev->dev, sizeof(*ddata), GFP_KERNEL); 102 ddata = devm_kzalloc(dssdev->dev, sizeof(*ddata), GFP_KERNEL);
103 if (!ddata) 103 if (!ddata)
104 return -ENOMEM; 104 return -ENOMEM;
105 105
@@ -119,10 +119,10 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
119 } 119 }
120 120
121 if (gpio_is_valid(ddata->pd_gpio)) { 121 if (gpio_is_valid(ddata->pd_gpio)) {
122 r = devm_gpio_request_one(&dssdev->dev, ddata->pd_gpio, 122 r = devm_gpio_request_one(dssdev->dev, ddata->pd_gpio,
123 GPIOF_OUT_INIT_LOW, "tfp410 pd"); 123 GPIOF_OUT_INIT_LOW, "tfp410 pd");
124 if (r) { 124 if (r) {
125 dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", 125 dev_err(dssdev->dev, "Failed to request PD GPIO %d\n",
126 ddata->pd_gpio); 126 ddata->pd_gpio);
127 return r; 127 return r;
128 } 128 }
@@ -133,7 +133,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
133 133
134 adapter = i2c_get_adapter(i2c_bus_num); 134 adapter = i2c_get_adapter(i2c_bus_num);
135 if (!adapter) { 135 if (!adapter) {
136 dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", 136 dev_err(dssdev->dev, "Failed to get I2C adapter, bus %d\n",
137 i2c_bus_num); 137 i2c_bus_num);
138 return -EPROBE_DEFER; 138 return -EPROBE_DEFER;
139 } 139 }
@@ -141,28 +141,28 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
141 ddata->i2c_adapter = adapter; 141 ddata->i2c_adapter = adapter;
142 } 142 }
143 143
144 dev_set_drvdata(&dssdev->dev, ddata); 144 dev_set_drvdata(dssdev->dev, ddata);
145 145
146 return 0; 146 return 0;
147} 147}
148 148
149static void __exit tfp410_remove(struct omap_dss_device *dssdev) 149static void __exit tfp410_remove(struct omap_dss_device *dssdev)
150{ 150{
151 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 151 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
152 152
153 mutex_lock(&ddata->lock); 153 mutex_lock(&ddata->lock);
154 154
155 if (ddata->i2c_adapter) 155 if (ddata->i2c_adapter)
156 i2c_put_adapter(ddata->i2c_adapter); 156 i2c_put_adapter(ddata->i2c_adapter);
157 157
158 dev_set_drvdata(&dssdev->dev, NULL); 158 dev_set_drvdata(dssdev->dev, NULL);
159 159
160 mutex_unlock(&ddata->lock); 160 mutex_unlock(&ddata->lock);
161} 161}
162 162
163static int tfp410_enable(struct omap_dss_device *dssdev) 163static int tfp410_enable(struct omap_dss_device *dssdev)
164{ 164{
165 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 165 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
166 int r; 166 int r;
167 167
168 mutex_lock(&ddata->lock); 168 mutex_lock(&ddata->lock);
@@ -178,7 +178,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
178 178
179static void tfp410_disable(struct omap_dss_device *dssdev) 179static void tfp410_disable(struct omap_dss_device *dssdev)
180{ 180{
181 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 181 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
182 182
183 mutex_lock(&ddata->lock); 183 mutex_lock(&ddata->lock);
184 184
@@ -192,7 +192,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
192static void tfp410_set_timings(struct omap_dss_device *dssdev, 192static void tfp410_set_timings(struct omap_dss_device *dssdev,
193 struct omap_video_timings *timings) 193 struct omap_video_timings *timings)
194{ 194{
195 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 195 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
196 196
197 mutex_lock(&ddata->lock); 197 mutex_lock(&ddata->lock);
198 omapdss_dpi_set_timings(dssdev, timings); 198 omapdss_dpi_set_timings(dssdev, timings);
@@ -203,7 +203,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
203static void tfp410_get_timings(struct omap_dss_device *dssdev, 203static void tfp410_get_timings(struct omap_dss_device *dssdev,
204 struct omap_video_timings *timings) 204 struct omap_video_timings *timings)
205{ 205{
206 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 206 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
207 207
208 mutex_lock(&ddata->lock); 208 mutex_lock(&ddata->lock);
209 *timings = dssdev->panel.timings; 209 *timings = dssdev->panel.timings;
@@ -213,7 +213,7 @@ static void tfp410_get_timings(struct omap_dss_device *dssdev,
213static int tfp410_check_timings(struct omap_dss_device *dssdev, 213static int tfp410_check_timings(struct omap_dss_device *dssdev,
214 struct omap_video_timings *timings) 214 struct omap_video_timings *timings)
215{ 215{
216 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 216 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
217 int r; 217 int r;
218 218
219 mutex_lock(&ddata->lock); 219 mutex_lock(&ddata->lock);
@@ -258,7 +258,7 @@ static int tfp410_ddc_read(struct i2c_adapter *adapter,
258static int tfp410_read_edid(struct omap_dss_device *dssdev, 258static int tfp410_read_edid(struct omap_dss_device *dssdev,
259 u8 *edid, int len) 259 u8 *edid, int len)
260{ 260{
261 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 261 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
262 int r, l, bytes_read; 262 int r, l, bytes_read;
263 263
264 mutex_lock(&ddata->lock); 264 mutex_lock(&ddata->lock);
@@ -298,7 +298,7 @@ err:
298 298
299static bool tfp410_detect(struct omap_dss_device *dssdev) 299static bool tfp410_detect(struct omap_dss_device *dssdev)
300{ 300{
301 struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); 301 struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
302 unsigned char out; 302 unsigned char out;
303 int r; 303 int r;
304 304
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index abf2bc4a18ab..7729b6fa6f97 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -126,7 +126,7 @@ static int tpo_td043_write_mirror(struct spi_device *spi, bool h, bool v)
126 126
127static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable) 127static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable)
128{ 128{
129 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 129 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
130 130
131 tpo_td043->hmirror = enable; 131 tpo_td043->hmirror = enable;
132 return tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror, 132 return tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror,
@@ -135,7 +135,7 @@ static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable)
135 135
136static bool tpo_td043_get_hmirror(struct omap_dss_device *dssdev) 136static bool tpo_td043_get_hmirror(struct omap_dss_device *dssdev)
137{ 137{
138 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 138 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
139 139
140 return tpo_td043->hmirror; 140 return tpo_td043->hmirror;
141} 141}
@@ -338,7 +338,7 @@ static void tpo_td043_power_off(struct tpo_td043_device *tpo_td043)
338 338
339static int tpo_td043_enable_dss(struct omap_dss_device *dssdev) 339static int tpo_td043_enable_dss(struct omap_dss_device *dssdev)
340{ 340{
341 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 341 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
342 int r; 342 int r;
343 343
344 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 344 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
@@ -372,7 +372,7 @@ err0:
372 372
373static void tpo_td043_disable_dss(struct omap_dss_device *dssdev) 373static void tpo_td043_disable_dss(struct omap_dss_device *dssdev)
374{ 374{
375 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 375 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
376 376
377 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 377 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
378 return; 378 return;
@@ -385,14 +385,14 @@ static void tpo_td043_disable_dss(struct omap_dss_device *dssdev)
385 385
386static int tpo_td043_enable(struct omap_dss_device *dssdev) 386static int tpo_td043_enable(struct omap_dss_device *dssdev)
387{ 387{
388 dev_dbg(&dssdev->dev, "enable\n"); 388 dev_dbg(dssdev->dev, "enable\n");
389 389
390 return tpo_td043_enable_dss(dssdev); 390 return tpo_td043_enable_dss(dssdev);
391} 391}
392 392
393static void tpo_td043_disable(struct omap_dss_device *dssdev) 393static void tpo_td043_disable(struct omap_dss_device *dssdev)
394{ 394{
395 dev_dbg(&dssdev->dev, "disable\n"); 395 dev_dbg(dssdev->dev, "disable\n");
396 396
397 tpo_td043_disable_dss(dssdev); 397 tpo_td043_disable_dss(dssdev);
398 398
@@ -405,10 +405,10 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
405 struct panel_tpo_td043_data *pdata = get_panel_data(dssdev); 405 struct panel_tpo_td043_data *pdata = get_panel_data(dssdev);
406 int ret = 0; 406 int ret = 0;
407 407
408 dev_dbg(&dssdev->dev, "probe\n"); 408 dev_dbg(dssdev->dev, "probe\n");
409 409
410 if (tpo_td043 == NULL) { 410 if (tpo_td043 == NULL) {
411 dev_err(&dssdev->dev, "missing tpo_td043_device\n"); 411 dev_err(dssdev->dev, "missing tpo_td043_device\n");
412 return -ENODEV; 412 return -ENODEV;
413 } 413 }
414 414
@@ -423,28 +423,28 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
423 tpo_td043->mode = TPO_R02_MODE_800x480; 423 tpo_td043->mode = TPO_R02_MODE_800x480;
424 memcpy(tpo_td043->gamma, tpo_td043_def_gamma, sizeof(tpo_td043->gamma)); 424 memcpy(tpo_td043->gamma, tpo_td043_def_gamma, sizeof(tpo_td043->gamma));
425 425
426 tpo_td043->vcc_reg = regulator_get(&dssdev->dev, "vcc"); 426 tpo_td043->vcc_reg = regulator_get(dssdev->dev, "vcc");
427 if (IS_ERR(tpo_td043->vcc_reg)) { 427 if (IS_ERR(tpo_td043->vcc_reg)) {
428 dev_err(&dssdev->dev, "failed to get LCD VCC regulator\n"); 428 dev_err(dssdev->dev, "failed to get LCD VCC regulator\n");
429 ret = PTR_ERR(tpo_td043->vcc_reg); 429 ret = PTR_ERR(tpo_td043->vcc_reg);
430 goto fail_regulator; 430 goto fail_regulator;
431 } 431 }
432 432
433 if (gpio_is_valid(tpo_td043->nreset_gpio)) { 433 if (gpio_is_valid(tpo_td043->nreset_gpio)) {
434 ret = devm_gpio_request_one(&dssdev->dev, 434 ret = devm_gpio_request_one(dssdev->dev,
435 tpo_td043->nreset_gpio, GPIOF_OUT_INIT_LOW, 435 tpo_td043->nreset_gpio, GPIOF_OUT_INIT_LOW,
436 "lcd reset"); 436 "lcd reset");
437 if (ret < 0) { 437 if (ret < 0) {
438 dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); 438 dev_err(dssdev->dev, "couldn't request reset GPIO\n");
439 goto fail_gpio_req; 439 goto fail_gpio_req;
440 } 440 }
441 } 441 }
442 442
443 ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); 443 ret = sysfs_create_group(&dssdev->dev->kobj, &tpo_td043_attr_group);
444 if (ret) 444 if (ret)
445 dev_warn(&dssdev->dev, "failed to create sysfs files\n"); 445 dev_warn(dssdev->dev, "failed to create sysfs files\n");
446 446
447 dev_set_drvdata(&dssdev->dev, tpo_td043); 447 dev_set_drvdata(dssdev->dev, tpo_td043);
448 448
449 return 0; 449 return 0;
450 450
@@ -457,11 +457,11 @@ fail_regulator:
457 457
458static void tpo_td043_remove(struct omap_dss_device *dssdev) 458static void tpo_td043_remove(struct omap_dss_device *dssdev)
459{ 459{
460 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 460 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
461 461
462 dev_dbg(&dssdev->dev, "remove\n"); 462 dev_dbg(dssdev->dev, "remove\n");
463 463
464 sysfs_remove_group(&dssdev->dev.kobj, &tpo_td043_attr_group); 464 sysfs_remove_group(&dssdev->dev->kobj, &tpo_td043_attr_group);
465 regulator_put(tpo_td043->vcc_reg); 465 regulator_put(tpo_td043->vcc_reg);
466} 466}
467 467
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index b6ce394396e2..7118449919c1 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -437,30 +437,32 @@ struct omap_dss_device *dss_alloc_and_init_device(struct device *parent)
437 if (!dssdev) 437 if (!dssdev)
438 return NULL; 438 return NULL;
439 439
440 dssdev->dev.bus = &dss_bus_type; 440 dssdev->old_dev.bus = &dss_bus_type;
441 dssdev->dev.parent = parent; 441 dssdev->old_dev.parent = parent;
442 dssdev->dev.release = omap_dss_dev_release; 442 dssdev->old_dev.release = omap_dss_dev_release;
443 dev_set_name(&dssdev->dev, "display%d", disp_num_counter++); 443 dev_set_name(&dssdev->old_dev, "display%d", disp_num_counter++);
444 444
445 device_initialize(&dssdev->dev); 445 device_initialize(&dssdev->old_dev);
446 446
447 return dssdev; 447 return dssdev;
448} 448}
449 449
450int dss_add_device(struct omap_dss_device *dssdev) 450int dss_add_device(struct omap_dss_device *dssdev)
451{ 451{
452 dssdev->dev = &dssdev->old_dev;
453
452 omapdss_register_display(dssdev); 454 omapdss_register_display(dssdev);
453 return device_add(&dssdev->dev); 455 return device_add(&dssdev->old_dev);
454} 456}
455 457
456void dss_put_device(struct omap_dss_device *dssdev) 458void dss_put_device(struct omap_dss_device *dssdev)
457{ 459{
458 put_device(&dssdev->dev); 460 put_device(&dssdev->old_dev);
459} 461}
460 462
461void dss_unregister_device(struct omap_dss_device *dssdev) 463void dss_unregister_device(struct omap_dss_device *dssdev)
462{ 464{
463 device_unregister(&dssdev->dev); 465 device_unregister(&dssdev->old_dev);
464 omapdss_unregister_display(dssdev); 466 omapdss_unregister_display(dssdev);
465} 467}
466 468
diff --git a/drivers/video/omap2/dss/display-sysfs.c b/drivers/video/omap2/dss/display-sysfs.c
index 58abbafeab17..21d7f77df702 100644
--- a/drivers/video/omap2/dss/display-sysfs.c
+++ b/drivers/video/omap2/dss/display-sysfs.c
@@ -33,7 +33,7 @@ static struct omap_dss_device *to_dss_device_sysfs(struct device *dev)
33 struct omap_dss_device *dssdev = NULL; 33 struct omap_dss_device *dssdev = NULL;
34 34
35 for_each_dss_dev(dssdev) { 35 for_each_dss_dev(dssdev) {
36 if (&dssdev->dev == dev) { 36 if (dssdev->dev == dev) {
37 omap_dss_put_device(dssdev); 37 omap_dss_put_device(dssdev);
38 return dssdev; 38 return dssdev;
39 } 39 }
@@ -308,7 +308,7 @@ int display_init_sysfs(struct platform_device *pdev)
308 int r; 308 int r;
309 309
310 for_each_dss_dev(dssdev) { 310 for_each_dss_dev(dssdev) {
311 struct kobject *kobj = &dssdev->dev.kobj; 311 struct kobject *kobj = &dssdev->dev->kobj;
312 312
313 r = sysfs_create_files(kobj, display_sysfs_attrs); 313 r = sysfs_create_files(kobj, display_sysfs_attrs);
314 if (r) { 314 if (r) {
@@ -339,6 +339,7 @@ void display_uninit_sysfs(struct platform_device *pdev)
339 339
340 for_each_dss_dev(dssdev) { 340 for_each_dss_dev(dssdev) {
341 sysfs_remove_link(&pdev->dev.kobj, dssdev->alias); 341 sysfs_remove_link(&pdev->dev.kobj, dssdev->alias);
342 sysfs_remove_files(&dssdev->dev.kobj, display_sysfs_attrs); 342 sysfs_remove_files(&dssdev->dev->kobj,
343 display_sysfs_attrs);
343 } 344 }
344} 345}
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index dfe3322cd9ad..a9a1d5563aa0 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -160,13 +160,13 @@ EXPORT_SYMBOL(omapdss_unregister_display);
160 160
161void omap_dss_get_device(struct omap_dss_device *dssdev) 161void omap_dss_get_device(struct omap_dss_device *dssdev)
162{ 162{
163 get_device(&dssdev->dev); 163 get_device(dssdev->dev);
164} 164}
165EXPORT_SYMBOL(omap_dss_get_device); 165EXPORT_SYMBOL(omap_dss_get_device);
166 166
167void omap_dss_put_device(struct omap_dss_device *dssdev) 167void omap_dss_put_device(struct omap_dss_device *dssdev)
168{ 168{
169 put_device(&dssdev->dev); 169 put_device(dssdev->dev);
170} 170}
171EXPORT_SYMBOL(omap_dss_put_device); 171EXPORT_SYMBOL(omap_dss_put_device);
172 172
@@ -240,9 +240,8 @@ int omap_dss_start_device(struct omap_dss_device *dssdev)
240 return -ENODEV; 240 return -ENODEV;
241 } 241 }
242 242
243 if (!try_module_get(dssdev->dev.driver->owner)) { 243 if (!try_module_get(dssdev->dev->driver->owner))
244 return -ENODEV; 244 return -ENODEV;
245 }
246 245
247 return 0; 246 return 0;
248} 247}
@@ -250,7 +249,7 @@ EXPORT_SYMBOL(omap_dss_start_device);
250 249
251void omap_dss_stop_device(struct omap_dss_device *dssdev) 250void omap_dss_stop_device(struct omap_dss_device *dssdev)
252{ 251{
253 module_put(dssdev->dev.driver->owner); 252 module_put(dssdev->dev->driver->owner);
254} 253}
255EXPORT_SYMBOL(omap_dss_stop_device); 254EXPORT_SYMBOL(omap_dss_stop_device);
256 255
diff --git a/drivers/video/omap2/dss/venc_panel.c b/drivers/video/omap2/dss/venc_panel.c
index 0d2b1a0834a0..f7d92c57bd73 100644
--- a/drivers/video/omap2/dss/venc_panel.c
+++ b/drivers/video/omap2/dss/venc_panel.c
@@ -107,19 +107,19 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
107 107
108 dssdev->panel.timings = default_timings; 108 dssdev->panel.timings = default_timings;
109 109
110 return device_create_file(&dssdev->dev, &dev_attr_output_type); 110 return device_create_file(dssdev->dev, &dev_attr_output_type);
111} 111}
112 112
113static void venc_panel_remove(struct omap_dss_device *dssdev) 113static void venc_panel_remove(struct omap_dss_device *dssdev)
114{ 114{
115 device_remove_file(&dssdev->dev, &dev_attr_output_type); 115 device_remove_file(dssdev->dev, &dev_attr_output_type);
116} 116}
117 117
118static int venc_panel_enable(struct omap_dss_device *dssdev) 118static int venc_panel_enable(struct omap_dss_device *dssdev)
119{ 119{
120 int r; 120 int r;
121 121
122 dev_dbg(&dssdev->dev, "venc_panel_enable\n"); 122 dev_dbg(dssdev->dev, "venc_panel_enable\n");
123 123
124 mutex_lock(&venc_panel.lock); 124 mutex_lock(&venc_panel.lock);
125 125
@@ -150,7 +150,7 @@ err:
150 150
151static void venc_panel_disable(struct omap_dss_device *dssdev) 151static void venc_panel_disable(struct omap_dss_device *dssdev)
152{ 152{
153 dev_dbg(&dssdev->dev, "venc_panel_disable\n"); 153 dev_dbg(dssdev->dev, "venc_panel_disable\n");
154 154
155 mutex_lock(&venc_panel.lock); 155 mutex_lock(&venc_panel.lock);
156 156
@@ -167,7 +167,7 @@ end:
167static void venc_panel_set_timings(struct omap_dss_device *dssdev, 167static void venc_panel_set_timings(struct omap_dss_device *dssdev,
168 struct omap_video_timings *timings) 168 struct omap_video_timings *timings)
169{ 169{
170 dev_dbg(&dssdev->dev, "venc_panel_set_timings\n"); 170 dev_dbg(dssdev->dev, "venc_panel_set_timings\n");
171 171
172 mutex_lock(&venc_panel.lock); 172 mutex_lock(&venc_panel.lock);
173 173
@@ -180,21 +180,21 @@ static void venc_panel_set_timings(struct omap_dss_device *dssdev,
180static int venc_panel_check_timings(struct omap_dss_device *dssdev, 180static int venc_panel_check_timings(struct omap_dss_device *dssdev,
181 struct omap_video_timings *timings) 181 struct omap_video_timings *timings)
182{ 182{
183 dev_dbg(&dssdev->dev, "venc_panel_check_timings\n"); 183 dev_dbg(dssdev->dev, "venc_panel_check_timings\n");
184 184
185 return omapdss_venc_check_timings(dssdev, timings); 185 return omapdss_venc_check_timings(dssdev, timings);
186} 186}
187 187
188static u32 venc_panel_get_wss(struct omap_dss_device *dssdev) 188static u32 venc_panel_get_wss(struct omap_dss_device *dssdev)
189{ 189{
190 dev_dbg(&dssdev->dev, "venc_panel_get_wss\n"); 190 dev_dbg(dssdev->dev, "venc_panel_get_wss\n");
191 191
192 return omapdss_venc_get_wss(dssdev); 192 return omapdss_venc_get_wss(dssdev);
193} 193}
194 194
195static int venc_panel_set_wss(struct omap_dss_device *dssdev, u32 wss) 195static int venc_panel_set_wss(struct omap_dss_device *dssdev, u32 wss)
196{ 196{
197 dev_dbg(&dssdev->dev, "venc_panel_set_wss\n"); 197 dev_dbg(dssdev->dev, "venc_panel_set_wss\n");
198 198
199 return omapdss_venc_set_wss(dssdev, wss); 199 return omapdss_venc_set_wss(dssdev, wss);
200} 200}
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index ee1645336fc4..b7d975755cff 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -596,7 +596,11 @@ struct omap_dss_output {
596}; 596};
597 597
598struct omap_dss_device { 598struct omap_dss_device {
599 struct device dev; 599 /* old device, to be removed */
600 struct device old_dev;
601
602 /* new device, pointer to panel device */
603 struct device *dev;
600 604
601 struct list_head panel_list; 605 struct list_head panel_list;
602 606
@@ -856,7 +860,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
856 bool mem_to_mem); 860 bool mem_to_mem);
857 861
858#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 862#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
859#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 863#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
860 864
861void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 865void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
862 bool enable); 866 bool enable);