aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-05-12 07:56:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-12 12:30:26 -0400
commit1ffefe755c2681752a10ae50b2b17e70147bb194 (patch)
treea714387a1c5591169f1247ae2b2393f3e2465e6b /drivers
parent41b21aebe6a9c06e0b906f14bcab7c49b9b72d7a (diff)
OMAP: DSS2: DSI: Add extra omap_dss_device argument in functions exported by dsi
Add pointer to omap_dss_device struct as an argument in the functions which are exported to dsi panel drivers. This argument will tell the DSI driver which DSI interface's data it has to choose. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c120
-rw-r--r--drivers/video/omap2/dss/dsi.c48
2 files changed, 88 insertions, 80 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index be230b3ff875..90d79c0bc9f4 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -271,7 +271,7 @@ static int taal_dcs_read_1(struct taal_data *td, u8 dcs_cmd, u8 *data)
271 int r; 271 int r;
272 u8 buf[1]; 272 u8 buf[1];
273 273
274 r = dsi_vc_dcs_read(td->channel, dcs_cmd, buf, 1); 274 r = dsi_vc_dcs_read(td->dssdev, td->channel, dcs_cmd, buf, 1);
275 275
276 if (r < 0) 276 if (r < 0)
277 return r; 277 return r;
@@ -283,7 +283,7 @@ static int taal_dcs_read_1(struct taal_data *td, u8 dcs_cmd, u8 *data)
283 283
284static int taal_dcs_write_0(struct taal_data *td, u8 dcs_cmd) 284static int taal_dcs_write_0(struct taal_data *td, u8 dcs_cmd)
285{ 285{
286 return dsi_vc_dcs_write(td->channel, &dcs_cmd, 1); 286 return dsi_vc_dcs_write(td->dssdev, td->channel, &dcs_cmd, 1);
287} 287}
288 288
289static int taal_dcs_write_1(struct taal_data *td, u8 dcs_cmd, u8 param) 289static int taal_dcs_write_1(struct taal_data *td, u8 dcs_cmd, u8 param)
@@ -291,7 +291,7 @@ static int taal_dcs_write_1(struct taal_data *td, u8 dcs_cmd, u8 param)
291 u8 buf[2]; 291 u8 buf[2];
292 buf[0] = dcs_cmd; 292 buf[0] = dcs_cmd;
293 buf[1] = param; 293 buf[1] = param;
294 return dsi_vc_dcs_write(td->channel, buf, 2); 294 return dsi_vc_dcs_write(td->dssdev, td->channel, buf, 2);
295} 295}
296 296
297static int taal_sleep_in(struct taal_data *td) 297static int taal_sleep_in(struct taal_data *td)
@@ -303,7 +303,7 @@ static int taal_sleep_in(struct taal_data *td)
303 hw_guard_wait(td); 303 hw_guard_wait(td);
304 304
305 cmd = DCS_SLEEP_IN; 305 cmd = DCS_SLEEP_IN;
306 r = dsi_vc_dcs_write_nosync(td->channel, &cmd, 1); 306 r = dsi_vc_dcs_write_nosync(td->dssdev, td->channel, &cmd, 1);
307 if (r) 307 if (r)
308 return r; 308 return r;
309 309
@@ -409,7 +409,7 @@ static int taal_set_update_window(struct taal_data *td,
409 buf[3] = (x2 >> 8) & 0xff; 409 buf[3] = (x2 >> 8) & 0xff;
410 buf[4] = (x2 >> 0) & 0xff; 410 buf[4] = (x2 >> 0) & 0xff;
411 411
412 r = dsi_vc_dcs_write_nosync(td->channel, buf, sizeof(buf)); 412 r = dsi_vc_dcs_write_nosync(td->dssdev, td->channel, buf, sizeof(buf));
413 if (r) 413 if (r)
414 return r; 414 return r;
415 415
@@ -419,11 +419,11 @@ static int taal_set_update_window(struct taal_data *td,
419 buf[3] = (y2 >> 8) & 0xff; 419 buf[3] = (y2 >> 8) & 0xff;
420 buf[4] = (y2 >> 0) & 0xff; 420 buf[4] = (y2 >> 0) & 0xff;
421 421
422 r = dsi_vc_dcs_write_nosync(td->channel, buf, sizeof(buf)); 422 r = dsi_vc_dcs_write_nosync(td->dssdev, td->channel, buf, sizeof(buf));
423 if (r) 423 if (r)
424 return r; 424 return r;
425 425
426 dsi_vc_send_bta_sync(td->channel); 426 dsi_vc_send_bta_sync(td->dssdev, td->channel);
427 427
428 return r; 428 return r;
429} 429}
@@ -507,7 +507,7 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev)
507 if (r) 507 if (r)
508 goto err; 508 goto err;
509 509
510 omapdss_dsi_vc_enable_hs(td->channel, true); 510 omapdss_dsi_vc_enable_hs(dssdev, td->channel, true);
511 511
512 r = _taal_enable_te(dssdev, true); 512 r = _taal_enable_te(dssdev, true);
513 if (r) 513 if (r)
@@ -565,13 +565,13 @@ static int taal_bl_update_status(struct backlight_device *dev)
565 565
566 if (td->use_dsi_bl) { 566 if (td->use_dsi_bl) {
567 if (td->enabled) { 567 if (td->enabled) {
568 dsi_bus_lock(); 568 dsi_bus_lock(dssdev);
569 569
570 r = taal_wake_up(dssdev); 570 r = taal_wake_up(dssdev);
571 if (!r) 571 if (!r)
572 r = taal_dcs_write_1(td, DCS_BRIGHTNESS, level); 572 r = taal_dcs_write_1(td, DCS_BRIGHTNESS, level);
573 573
574 dsi_bus_unlock(); 574 dsi_bus_unlock(dssdev);
575 } else { 575 } else {
576 r = 0; 576 r = 0;
577 } 577 }
@@ -632,13 +632,13 @@ static ssize_t taal_num_errors_show(struct device *dev,
632 mutex_lock(&td->lock); 632 mutex_lock(&td->lock);
633 633
634 if (td->enabled) { 634 if (td->enabled) {
635 dsi_bus_lock(); 635 dsi_bus_lock(dssdev);
636 636
637 r = taal_wake_up(dssdev); 637 r = taal_wake_up(dssdev);
638 if (!r) 638 if (!r)
639 r = taal_dcs_read_1(td, DCS_READ_NUM_ERRORS, &errors); 639 r = taal_dcs_read_1(td, DCS_READ_NUM_ERRORS, &errors);
640 640
641 dsi_bus_unlock(); 641 dsi_bus_unlock(dssdev);
642 } else { 642 } else {
643 r = -ENODEV; 643 r = -ENODEV;
644 } 644 }
@@ -662,13 +662,13 @@ static ssize_t taal_hw_revision_show(struct device *dev,
662 mutex_lock(&td->lock); 662 mutex_lock(&td->lock);
663 663
664 if (td->enabled) { 664 if (td->enabled) {
665 dsi_bus_lock(); 665 dsi_bus_lock(dssdev);
666 666
667 r = taal_wake_up(dssdev); 667 r = taal_wake_up(dssdev);
668 if (!r) 668 if (!r)
669 r = taal_get_id(td, &id1, &id2, &id3); 669 r = taal_get_id(td, &id1, &id2, &id3);
670 670
671 dsi_bus_unlock(); 671 dsi_bus_unlock(dssdev);
672 } else { 672 } else {
673 r = -ENODEV; 673 r = -ENODEV;
674 } 674 }
@@ -728,7 +728,7 @@ static ssize_t store_cabc_mode(struct device *dev,
728 mutex_lock(&td->lock); 728 mutex_lock(&td->lock);
729 729
730 if (td->enabled) { 730 if (td->enabled) {
731 dsi_bus_lock(); 731 dsi_bus_lock(dssdev);
732 732
733 if (!td->cabc_broken) { 733 if (!td->cabc_broken) {
734 r = taal_wake_up(dssdev); 734 r = taal_wake_up(dssdev);
@@ -740,7 +740,7 @@ static ssize_t store_cabc_mode(struct device *dev,
740 goto err; 740 goto err;
741 } 741 }
742 742
743 dsi_bus_unlock(); 743 dsi_bus_unlock(dssdev);
744 } 744 }
745 745
746 td->cabc_mode = i; 746 td->cabc_mode = i;
@@ -749,7 +749,7 @@ static ssize_t store_cabc_mode(struct device *dev,
749 749
750 return count; 750 return count;
751err: 751err:
752 dsi_bus_unlock(); 752 dsi_bus_unlock(dssdev);
753 mutex_unlock(&td->lock); 753 mutex_unlock(&td->lock);
754 return r; 754 return r;
755} 755}
@@ -825,14 +825,14 @@ static ssize_t taal_store_ulps(struct device *dev,
825 mutex_lock(&td->lock); 825 mutex_lock(&td->lock);
826 826
827 if (td->enabled) { 827 if (td->enabled) {
828 dsi_bus_lock(); 828 dsi_bus_lock(dssdev);
829 829
830 if (t) 830 if (t)
831 r = taal_enter_ulps(dssdev); 831 r = taal_enter_ulps(dssdev);
832 else 832 else
833 r = taal_wake_up(dssdev); 833 r = taal_wake_up(dssdev);
834 834
835 dsi_bus_unlock(); 835 dsi_bus_unlock(dssdev);
836 } 836 }
837 837
838 mutex_unlock(&td->lock); 838 mutex_unlock(&td->lock);
@@ -876,9 +876,9 @@ static ssize_t taal_store_ulps_timeout(struct device *dev,
876 876
877 if (td->enabled) { 877 if (td->enabled) {
878 /* taal_wake_up will restart the timer */ 878 /* taal_wake_up will restart the timer */
879 dsi_bus_lock(); 879 dsi_bus_lock(dssdev);
880 r = taal_wake_up(dssdev); 880 r = taal_wake_up(dssdev);
881 dsi_bus_unlock(); 881 dsi_bus_unlock(dssdev);
882 } 882 }
883 883
884 mutex_unlock(&td->lock); 884 mutex_unlock(&td->lock);
@@ -1165,7 +1165,7 @@ static int taal_power_on(struct omap_dss_device *dssdev)
1165 1165
1166 taal_hw_reset(dssdev); 1166 taal_hw_reset(dssdev);
1167 1167
1168 omapdss_dsi_vc_enable_hs(td->channel, false); 1168 omapdss_dsi_vc_enable_hs(dssdev, td->channel, false);
1169 1169
1170 r = taal_sleep_out(td); 1170 r = taal_sleep_out(td);
1171 if (r) 1171 if (r)
@@ -1222,7 +1222,7 @@ static int taal_power_on(struct omap_dss_device *dssdev)
1222 td->intro_printed = true; 1222 td->intro_printed = true;
1223 } 1223 }
1224 1224
1225 omapdss_dsi_vc_enable_hs(td->channel, true); 1225 omapdss_dsi_vc_enable_hs(dssdev, td->channel, true);
1226 1226
1227 return 0; 1227 return 0;
1228err: 1228err:
@@ -1281,11 +1281,11 @@ static int taal_enable(struct omap_dss_device *dssdev)
1281 goto err; 1281 goto err;
1282 } 1282 }
1283 1283
1284 dsi_bus_lock(); 1284 dsi_bus_lock(dssdev);
1285 1285
1286 r = taal_power_on(dssdev); 1286 r = taal_power_on(dssdev);
1287 1287
1288 dsi_bus_unlock(); 1288 dsi_bus_unlock(dssdev);
1289 1289
1290 if (r) 1290 if (r)
1291 goto err; 1291 goto err;
@@ -1314,14 +1314,14 @@ static void taal_disable(struct omap_dss_device *dssdev)
1314 taal_cancel_ulps_work(dssdev); 1314 taal_cancel_ulps_work(dssdev);
1315 taal_cancel_esd_work(dssdev); 1315 taal_cancel_esd_work(dssdev);
1316 1316
1317 dsi_bus_lock(); 1317 dsi_bus_lock(dssdev);
1318 1318
1319 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { 1319 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
1320 taal_wake_up(dssdev); 1320 taal_wake_up(dssdev);
1321 taal_power_off(dssdev); 1321 taal_power_off(dssdev);
1322 } 1322 }
1323 1323
1324 dsi_bus_unlock(); 1324 dsi_bus_unlock(dssdev);
1325 1325
1326 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 1326 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
1327 1327
@@ -1345,13 +1345,13 @@ static int taal_suspend(struct omap_dss_device *dssdev)
1345 taal_cancel_ulps_work(dssdev); 1345 taal_cancel_ulps_work(dssdev);
1346 taal_cancel_esd_work(dssdev); 1346 taal_cancel_esd_work(dssdev);
1347 1347
1348 dsi_bus_lock(); 1348 dsi_bus_lock(dssdev);
1349 1349
1350 r = taal_wake_up(dssdev); 1350 r = taal_wake_up(dssdev);
1351 if (!r) 1351 if (!r)
1352 taal_power_off(dssdev); 1352 taal_power_off(dssdev);
1353 1353
1354 dsi_bus_unlock(); 1354 dsi_bus_unlock(dssdev);
1355 1355
1356 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; 1356 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
1357 1357
@@ -1377,11 +1377,11 @@ static int taal_resume(struct omap_dss_device *dssdev)
1377 goto err; 1377 goto err;
1378 } 1378 }
1379 1379
1380 dsi_bus_lock(); 1380 dsi_bus_lock(dssdev);
1381 1381
1382 r = taal_power_on(dssdev); 1382 r = taal_power_on(dssdev);
1383 1383
1384 dsi_bus_unlock(); 1384 dsi_bus_unlock(dssdev);
1385 1385
1386 if (r) { 1386 if (r) {
1387 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 1387 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
@@ -1402,7 +1402,7 @@ static void taal_framedone_cb(int err, void *data)
1402{ 1402{
1403 struct omap_dss_device *dssdev = data; 1403 struct omap_dss_device *dssdev = data;
1404 dev_dbg(&dssdev->dev, "framedone, err %d\n", err); 1404 dev_dbg(&dssdev->dev, "framedone, err %d\n", err);
1405 dsi_bus_unlock(); 1405 dsi_bus_unlock(dssdev);
1406} 1406}
1407 1407
1408static irqreturn_t taal_te_isr(int irq, void *data) 1408static irqreturn_t taal_te_isr(int irq, void *data)
@@ -1430,7 +1430,7 @@ static irqreturn_t taal_te_isr(int irq, void *data)
1430 return IRQ_HANDLED; 1430 return IRQ_HANDLED;
1431err: 1431err:
1432 dev_err(&dssdev->dev, "start update failed\n"); 1432 dev_err(&dssdev->dev, "start update failed\n");
1433 dsi_bus_unlock(); 1433 dsi_bus_unlock(dssdev);
1434 return IRQ_HANDLED; 1434 return IRQ_HANDLED;
1435} 1435}
1436 1436
@@ -1443,7 +1443,7 @@ static void taal_te_timeout_work_callback(struct work_struct *work)
1443 dev_err(&dssdev->dev, "TE not received for 250ms!\n"); 1443 dev_err(&dssdev->dev, "TE not received for 250ms!\n");
1444 1444
1445 atomic_set(&td->do_update, 0); 1445 atomic_set(&td->do_update, 0);
1446 dsi_bus_unlock(); 1446 dsi_bus_unlock(dssdev);
1447} 1447}
1448 1448
1449static int taal_update(struct omap_dss_device *dssdev, 1449static int taal_update(struct omap_dss_device *dssdev,
@@ -1456,7 +1456,7 @@ static int taal_update(struct omap_dss_device *dssdev,
1456 dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h); 1456 dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
1457 1457
1458 mutex_lock(&td->lock); 1458 mutex_lock(&td->lock);
1459 dsi_bus_lock(); 1459 dsi_bus_lock(dssdev);
1460 1460
1461 r = taal_wake_up(dssdev); 1461 r = taal_wake_up(dssdev);
1462 if (r) 1462 if (r)
@@ -1495,7 +1495,7 @@ static int taal_update(struct omap_dss_device *dssdev,
1495 mutex_unlock(&td->lock); 1495 mutex_unlock(&td->lock);
1496 return 0; 1496 return 0;
1497err: 1497err:
1498 dsi_bus_unlock(); 1498 dsi_bus_unlock(dssdev);
1499 mutex_unlock(&td->lock); 1499 mutex_unlock(&td->lock);
1500 return r; 1500 return r;
1501} 1501}
@@ -1507,8 +1507,8 @@ static int taal_sync(struct omap_dss_device *dssdev)
1507 dev_dbg(&dssdev->dev, "sync\n"); 1507 dev_dbg(&dssdev->dev, "sync\n");
1508 1508
1509 mutex_lock(&td->lock); 1509 mutex_lock(&td->lock);
1510 dsi_bus_lock(); 1510 dsi_bus_lock(dssdev);
1511 dsi_bus_unlock(); 1511 dsi_bus_unlock(dssdev);
1512 mutex_unlock(&td->lock); 1512 mutex_unlock(&td->lock);
1513 1513
1514 dev_dbg(&dssdev->dev, "sync done\n"); 1514 dev_dbg(&dssdev->dev, "sync done\n");
@@ -1546,7 +1546,7 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
1546 if (td->te_enabled == enable) 1546 if (td->te_enabled == enable)
1547 goto end; 1547 goto end;
1548 1548
1549 dsi_bus_lock(); 1549 dsi_bus_lock(dssdev);
1550 1550
1551 if (td->enabled) { 1551 if (td->enabled) {
1552 r = taal_wake_up(dssdev); 1552 r = taal_wake_up(dssdev);
@@ -1560,13 +1560,13 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
1560 1560
1561 td->te_enabled = enable; 1561 td->te_enabled = enable;
1562 1562
1563 dsi_bus_unlock(); 1563 dsi_bus_unlock(dssdev);
1564end: 1564end:
1565 mutex_unlock(&td->lock); 1565 mutex_unlock(&td->lock);
1566 1566
1567 return 0; 1567 return 0;
1568err: 1568err:
1569 dsi_bus_unlock(); 1569 dsi_bus_unlock(dssdev);
1570 mutex_unlock(&td->lock); 1570 mutex_unlock(&td->lock);
1571 1571
1572 return r; 1572 return r;
@@ -1596,7 +1596,7 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
1596 if (td->rotate == rotate) 1596 if (td->rotate == rotate)
1597 goto end; 1597 goto end;
1598 1598
1599 dsi_bus_lock(); 1599 dsi_bus_lock(dssdev);
1600 1600
1601 if (td->enabled) { 1601 if (td->enabled) {
1602 r = taal_wake_up(dssdev); 1602 r = taal_wake_up(dssdev);
@@ -1610,12 +1610,12 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
1610 1610
1611 td->rotate = rotate; 1611 td->rotate = rotate;
1612 1612
1613 dsi_bus_unlock(); 1613 dsi_bus_unlock(dssdev);
1614end: 1614end:
1615 mutex_unlock(&td->lock); 1615 mutex_unlock(&td->lock);
1616 return 0; 1616 return 0;
1617err: 1617err:
1618 dsi_bus_unlock(); 1618 dsi_bus_unlock(dssdev);
1619 mutex_unlock(&td->lock); 1619 mutex_unlock(&td->lock);
1620 return r; 1620 return r;
1621} 1621}
@@ -1644,7 +1644,7 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
1644 if (td->mirror == enable) 1644 if (td->mirror == enable)
1645 goto end; 1645 goto end;
1646 1646
1647 dsi_bus_lock(); 1647 dsi_bus_lock(dssdev);
1648 if (td->enabled) { 1648 if (td->enabled) {
1649 r = taal_wake_up(dssdev); 1649 r = taal_wake_up(dssdev);
1650 if (r) 1650 if (r)
@@ -1657,12 +1657,12 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
1657 1657
1658 td->mirror = enable; 1658 td->mirror = enable;
1659 1659
1660 dsi_bus_unlock(); 1660 dsi_bus_unlock(dssdev);
1661end: 1661end:
1662 mutex_unlock(&td->lock); 1662 mutex_unlock(&td->lock);
1663 return 0; 1663 return 0;
1664err: 1664err:
1665 dsi_bus_unlock(); 1665 dsi_bus_unlock(dssdev);
1666 mutex_unlock(&td->lock); 1666 mutex_unlock(&td->lock);
1667 return r; 1667 return r;
1668} 1668}
@@ -1692,7 +1692,7 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
1692 goto err1; 1692 goto err1;
1693 } 1693 }
1694 1694
1695 dsi_bus_lock(); 1695 dsi_bus_lock(dssdev);
1696 1696
1697 r = taal_wake_up(dssdev); 1697 r = taal_wake_up(dssdev);
1698 if (r) 1698 if (r)
@@ -1708,11 +1708,11 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
1708 if (r) 1708 if (r)
1709 goto err2; 1709 goto err2;
1710 1710
1711 dsi_bus_unlock(); 1711 dsi_bus_unlock(dssdev);
1712 mutex_unlock(&td->lock); 1712 mutex_unlock(&td->lock);
1713 return 0; 1713 return 0;
1714err2: 1714err2:
1715 dsi_bus_unlock(); 1715 dsi_bus_unlock(dssdev);
1716err1: 1716err1:
1717 mutex_unlock(&td->lock); 1717 mutex_unlock(&td->lock);
1718 return r; 1718 return r;
@@ -1742,7 +1742,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1742 dssdev->panel.timings.x_res * 1742 dssdev->panel.timings.x_res *
1743 dssdev->panel.timings.y_res * 3); 1743 dssdev->panel.timings.y_res * 3);
1744 1744
1745 dsi_bus_lock(); 1745 dsi_bus_lock(dssdev);
1746 1746
1747 r = taal_wake_up(dssdev); 1747 r = taal_wake_up(dssdev);
1748 if (r) 1748 if (r)
@@ -1758,7 +1758,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1758 1758
1759 taal_set_update_window(td, x, y, w, h); 1759 taal_set_update_window(td, x, y, w, h);
1760 1760
1761 r = dsi_vc_set_max_rx_packet_size(td->channel, plen); 1761 r = dsi_vc_set_max_rx_packet_size(dssdev, td->channel, plen);
1762 if (r) 1762 if (r)
1763 goto err2; 1763 goto err2;
1764 1764
@@ -1766,7 +1766,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1766 u8 dcs_cmd = first ? 0x2e : 0x3e; 1766 u8 dcs_cmd = first ? 0x2e : 0x3e;
1767 first = 0; 1767 first = 0;
1768 1768
1769 r = dsi_vc_dcs_read(td->channel, dcs_cmd, 1769 r = dsi_vc_dcs_read(dssdev, td->channel, dcs_cmd,
1770 buf + buf_used, size - buf_used); 1770 buf + buf_used, size - buf_used);
1771 1771
1772 if (r < 0) { 1772 if (r < 0) {
@@ -1792,9 +1792,9 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
1792 r = buf_used; 1792 r = buf_used;
1793 1793
1794err3: 1794err3:
1795 dsi_vc_set_max_rx_packet_size(td->channel, 1); 1795 dsi_vc_set_max_rx_packet_size(dssdev, td->channel, 1);
1796err2: 1796err2:
1797 dsi_bus_unlock(); 1797 dsi_bus_unlock(dssdev);
1798err1: 1798err1:
1799 mutex_unlock(&td->lock); 1799 mutex_unlock(&td->lock);
1800 return r; 1800 return r;
@@ -1813,11 +1813,11 @@ static void taal_ulps_work(struct work_struct *work)
1813 return; 1813 return;
1814 } 1814 }
1815 1815
1816 dsi_bus_lock(); 1816 dsi_bus_lock(dssdev);
1817 1817
1818 taal_enter_ulps(dssdev); 1818 taal_enter_ulps(dssdev);
1819 1819
1820 dsi_bus_unlock(); 1820 dsi_bus_unlock(dssdev);
1821 mutex_unlock(&td->lock); 1821 mutex_unlock(&td->lock);
1822} 1822}
1823 1823
@@ -1837,7 +1837,7 @@ static void taal_esd_work(struct work_struct *work)
1837 return; 1837 return;
1838 } 1838 }
1839 1839
1840 dsi_bus_lock(); 1840 dsi_bus_lock(dssdev);
1841 1841
1842 r = taal_wake_up(dssdev); 1842 r = taal_wake_up(dssdev);
1843 if (r) { 1843 if (r) {
@@ -1879,7 +1879,7 @@ static void taal_esd_work(struct work_struct *work)
1879 goto err; 1879 goto err;
1880 } 1880 }
1881 1881
1882 dsi_bus_unlock(); 1882 dsi_bus_unlock(dssdev);
1883 1883
1884 taal_queue_esd_work(dssdev); 1884 taal_queue_esd_work(dssdev);
1885 1885
@@ -1890,7 +1890,7 @@ err:
1890 1890
1891 taal_panel_reset(dssdev); 1891 taal_panel_reset(dssdev);
1892 1892
1893 dsi_bus_unlock(); 1893 dsi_bus_unlock(dssdev);
1894 1894
1895 taal_queue_esd_work(dssdev); 1895 taal_queue_esd_work(dssdev);
1896 1896
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 162068f5f6ff..6d7148890aa0 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -354,13 +354,13 @@ void dsi_restore_context(void)
354{ 354{
355} 355}
356 356
357void dsi_bus_lock(void) 357void dsi_bus_lock(struct omap_dss_device *dssdev)
358{ 358{
359 down(&dsi.bus_lock); 359 down(&dsi.bus_lock);
360} 360}
361EXPORT_SYMBOL(dsi_bus_lock); 361EXPORT_SYMBOL(dsi_bus_lock);
362 362
363void dsi_bus_unlock(void) 363void dsi_bus_unlock(struct omap_dss_device *dssdev)
364{ 364{
365 up(&dsi.bus_lock); 365 up(&dsi.bus_lock);
366} 366}
@@ -2473,7 +2473,8 @@ static int dsi_vc_config_vp(int channel)
2473} 2473}
2474 2474
2475 2475
2476void omapdss_dsi_vc_enable_hs(int channel, bool enable) 2476void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
2477 bool enable)
2477{ 2478{
2478 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable); 2479 DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable);
2479 2480
@@ -2587,7 +2588,7 @@ static int dsi_vc_send_bta(int channel)
2587 return 0; 2588 return 0;
2588} 2589}
2589 2590
2590int dsi_vc_send_bta_sync(int channel) 2591int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel)
2591{ 2592{
2592 DECLARE_COMPLETION_ONSTACK(completion); 2593 DECLARE_COMPLETION_ONSTACK(completion);
2593 int r = 0; 2594 int r = 0;
@@ -2751,14 +2752,15 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
2751 return 0; 2752 return 0;
2752} 2753}
2753 2754
2754int dsi_vc_send_null(int channel) 2755int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel)
2755{ 2756{
2756 u8 nullpkg[] = {0, 0, 0, 0}; 2757 u8 nullpkg[] = {0, 0, 0, 0};
2757 return dsi_vc_send_long(channel, DSI_DT_NULL_PACKET, nullpkg, 4, 0); 2758 return dsi_vc_send_long(channel, DSI_DT_NULL_PACKET, nullpkg, 4, 0);
2758} 2759}
2759EXPORT_SYMBOL(dsi_vc_send_null); 2760EXPORT_SYMBOL(dsi_vc_send_null);
2760 2761
2761int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len) 2762int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
2763 u8 *data, int len)
2762{ 2764{
2763 int r; 2765 int r;
2764 2766
@@ -2780,15 +2782,16 @@ int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len)
2780} 2782}
2781EXPORT_SYMBOL(dsi_vc_dcs_write_nosync); 2783EXPORT_SYMBOL(dsi_vc_dcs_write_nosync);
2782 2784
2783int dsi_vc_dcs_write(int channel, u8 *data, int len) 2785int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
2786 int len)
2784{ 2787{
2785 int r; 2788 int r;
2786 2789
2787 r = dsi_vc_dcs_write_nosync(channel, data, len); 2790 r = dsi_vc_dcs_write_nosync(dssdev, channel, data, len);
2788 if (r) 2791 if (r)
2789 goto err; 2792 goto err;
2790 2793
2791 r = dsi_vc_send_bta_sync(channel); 2794 r = dsi_vc_send_bta_sync(dssdev, channel);
2792 if (r) 2795 if (r)
2793 goto err; 2796 goto err;
2794 2797
@@ -2807,22 +2810,24 @@ err:
2807} 2810}
2808EXPORT_SYMBOL(dsi_vc_dcs_write); 2811EXPORT_SYMBOL(dsi_vc_dcs_write);
2809 2812
2810int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd) 2813int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd)
2811{ 2814{
2812 return dsi_vc_dcs_write(channel, &dcs_cmd, 1); 2815 return dsi_vc_dcs_write(dssdev, channel, &dcs_cmd, 1);
2813} 2816}
2814EXPORT_SYMBOL(dsi_vc_dcs_write_0); 2817EXPORT_SYMBOL(dsi_vc_dcs_write_0);
2815 2818
2816int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param) 2819int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2820 u8 param)
2817{ 2821{
2818 u8 buf[2]; 2822 u8 buf[2];
2819 buf[0] = dcs_cmd; 2823 buf[0] = dcs_cmd;
2820 buf[1] = param; 2824 buf[1] = param;
2821 return dsi_vc_dcs_write(channel, buf, 2); 2825 return dsi_vc_dcs_write(dssdev, channel, buf, 2);
2822} 2826}
2823EXPORT_SYMBOL(dsi_vc_dcs_write_1); 2827EXPORT_SYMBOL(dsi_vc_dcs_write_1);
2824 2828
2825int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) 2829int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2830 u8 *buf, int buflen)
2826{ 2831{
2827 u32 val; 2832 u32 val;
2828 u8 dt; 2833 u8 dt;
@@ -2835,7 +2840,7 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen)
2835 if (r) 2840 if (r)
2836 goto err; 2841 goto err;
2837 2842
2838 r = dsi_vc_send_bta_sync(channel); 2843 r = dsi_vc_send_bta_sync(dssdev, channel);
2839 if (r) 2844 if (r)
2840 goto err; 2845 goto err;
2841 2846
@@ -2929,11 +2934,12 @@ err:
2929} 2934}
2930EXPORT_SYMBOL(dsi_vc_dcs_read); 2935EXPORT_SYMBOL(dsi_vc_dcs_read);
2931 2936
2932int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data) 2937int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2938 u8 *data)
2933{ 2939{
2934 int r; 2940 int r;
2935 2941
2936 r = dsi_vc_dcs_read(channel, dcs_cmd, data, 1); 2942 r = dsi_vc_dcs_read(dssdev, channel, dcs_cmd, data, 1);
2937 2943
2938 if (r < 0) 2944 if (r < 0)
2939 return r; 2945 return r;
@@ -2945,12 +2951,13 @@ int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data)
2945} 2951}
2946EXPORT_SYMBOL(dsi_vc_dcs_read_1); 2952EXPORT_SYMBOL(dsi_vc_dcs_read_1);
2947 2953
2948int dsi_vc_dcs_read_2(int channel, u8 dcs_cmd, u8 *data1, u8 *data2) 2954int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
2955 u8 *data1, u8 *data2)
2949{ 2956{
2950 u8 buf[2]; 2957 u8 buf[2];
2951 int r; 2958 int r;
2952 2959
2953 r = dsi_vc_dcs_read(channel, dcs_cmd, buf, 2); 2960 r = dsi_vc_dcs_read(dssdev, channel, dcs_cmd, buf, 2);
2954 2961
2955 if (r < 0) 2962 if (r < 0)
2956 return r; 2963 return r;
@@ -2965,7 +2972,8 @@ int dsi_vc_dcs_read_2(int channel, u8 dcs_cmd, u8 *data1, u8 *data2)
2965} 2972}
2966EXPORT_SYMBOL(dsi_vc_dcs_read_2); 2973EXPORT_SYMBOL(dsi_vc_dcs_read_2);
2967 2974
2968int dsi_vc_set_max_rx_packet_size(int channel, u16 len) 2975int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
2976 u16 len)
2969{ 2977{
2970 return dsi_vc_send_short(channel, DSI_DT_SET_MAX_RET_PKG_SIZE, 2978 return dsi_vc_send_short(channel, DSI_DT_SET_MAX_RET_PKG_SIZE,
2971 len, 0); 2979 len, 0);