Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+212 -206
+8 -8
drivers/video/omap2/displays/panel-acx565akm.c
··· 510 510 int max_brightness, brightness; 511 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 515 if (!panel_data) 516 516 return -EINVAL; ··· 519 519 dssdev->panel.timings = acx_panel_timings; 520 520 521 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 523 GPIOF_OUT_INIT_LOW, "lcd reset"); 524 524 if (r) 525 525 return r; ··· 538 538 539 539 r = panel_detect(md); 540 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 542 if (!md->enabled && gpio_is_valid(panel_data->reset_gpio)) 543 543 gpio_set_value(panel_data->reset_gpio, 0); 544 544 ··· 593 593 { 594 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 597 sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group); 598 598 backlight_device_unregister(md->bl_dev); 599 599 mutex_lock(&acx_dev.mutex); ··· 607 607 struct panel_acx565akm_data *panel_data = get_panel_data(dssdev); 608 608 int r; 609 609 610 - dev_dbg(&dssdev->dev, "%s\n", __func__); 610 + dev_dbg(dssdev->dev, "%s\n", __func__); 611 611 612 612 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 613 613 return 0; ··· 667 667 struct acx565akm_device *md = &acx_dev; 668 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 672 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 673 673 return; ··· 704 704 { 705 705 int r; 706 706 707 - dev_dbg(&dssdev->dev, "%s\n", __func__); 707 + dev_dbg(dssdev->dev, "%s\n", __func__); 708 708 r = acx_panel_power_on(dssdev); 709 709 710 710 if (r) ··· 716 716 717 717 static 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 720 acx_panel_power_off(dssdev); 721 721 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 722 722 }
+13 -13
drivers/video/omap2/displays/panel-generic-dpi.c
··· 536 536 { 537 537 int r, i; 538 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 540 struct panel_config *panel_config = drv_data->panel_config; 541 541 542 542 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) ··· 567 567 static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev) 568 568 { 569 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 571 struct panel_config *panel_config = drv_data->panel_config; 572 572 int i; 573 573 ··· 593 593 struct panel_drv_data *drv_data = NULL; 594 594 int i, r; 595 595 596 - dev_dbg(&dssdev->dev, "probe\n"); 596 + dev_dbg(dssdev->dev, "probe\n"); 597 597 598 598 if (!panel_data || !panel_data->name) 599 599 return -EINVAL; ··· 609 609 return -EINVAL; 610 610 611 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 613 panel_data->gpio_invert[i] ? 614 614 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, 615 615 "panel gpio"); ··· 619 619 620 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 623 if (!drv_data) 624 624 return -ENOMEM; 625 625 ··· 628 628 629 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 633 return 0; 634 634 } 635 635 636 636 static 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 643 643 static 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 646 int r; 647 647 648 648 mutex_lock(&drv_data->lock); ··· 660 660 661 661 static 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 665 mutex_lock(&drv_data->lock); 666 666 ··· 674 674 static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev, 675 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 679 mutex_lock(&drv_data->lock); 680 680 ··· 688 688 static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev, 689 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 693 mutex_lock(&drv_data->lock); 694 694 ··· 700 700 static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev, 701 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 704 int r; 705 705 706 706 mutex_lock(&drv_data->lock);
+5 -5
drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
··· 109 109 110 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 113 if (!ld) 114 114 return -ENOMEM; 115 115 116 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 118 panel_data->gpio_invert[i] ? 119 119 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, 120 120 "panel gpio"); ··· 123 123 } 124 124 125 125 mutex_init(&ld->lock); 126 - dev_set_drvdata(&dssdev->dev, ld); 126 + dev_set_drvdata(dssdev->dev, ld); 127 127 128 128 return 0; 129 129 } ··· 134 134 135 135 static 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 138 int r; 139 139 140 140 mutex_lock(&ld->lock); ··· 153 153 154 154 static 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 158 mutex_lock(&ld->lock); 159 159
+15 -15
drivers/video/omap2/displays/panel-n8x0.c
··· 311 311 switch (rev & 0xfc) { 312 312 case 0x9c: 313 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 315 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); 316 316 break; 317 317 case 0xa4: 318 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 320 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); 321 321 break; 322 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 324 r = -ENODEV; 325 325 goto err_inv_chip; 326 326 } ··· 341 341 panel_name = "ls041y3"; 342 342 break; 343 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 345 display_id[0]); 346 346 r = -ENODEV; 347 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 351 panel_name, display_id[1]); 352 352 353 353 send_sleep_out(spi); ··· 416 416 struct panel_drv_data *ddata; 417 417 int r; 418 418 419 - dev_dbg(&dssdev->dev, "probe\n"); 419 + dev_dbg(dssdev->dev, "probe\n"); 420 420 421 421 if (!bdata) 422 422 return -EINVAL; ··· 434 434 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; 435 435 436 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 438 GPIOF_OUT_INIT_LOW, "PANEL RESET"); 439 439 if (r) 440 440 return r; 441 441 } 442 442 443 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 445 GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN"); 446 446 if (r) 447 447 return r; ··· 452 452 453 453 static 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 460 460 static int n8x0_panel_enable(struct omap_dss_device *dssdev) ··· 462 462 struct panel_drv_data *ddata = get_drv_data(dssdev); 463 463 int r; 464 464 465 - dev_dbg(&dssdev->dev, "enable\n"); 465 + dev_dbg(dssdev->dev, "enable\n"); 466 466 467 467 mutex_lock(&ddata->lock); 468 468 ··· 488 488 { 489 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 493 mutex_lock(&ddata->lock); 494 494 ··· 521 521 struct panel_drv_data *ddata = get_drv_data(dssdev); 522 522 u16 dw, dh; 523 523 524 - dev_dbg(&dssdev->dev, "update\n"); 524 + dev_dbg(dssdev->dev, "update\n"); 525 525 526 526 dw = dssdev->panel.timings.x_res; 527 527 dh = dssdev->panel.timings.y_res; 528 528 529 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 531 x, y, w, h); 532 532 return -EINVAL; 533 533 } ··· 548 548 { 549 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 553 mutex_lock(&ddata->lock); 554 554 rfbi_bus_lock();
+2 -2
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
··· 98 98 dssdev->panel.timings = nec_8048_panel_timings; 99 99 100 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 102 GPIOF_OUT_INIT_HIGH, "lcd QVGA"); 103 103 if (r) 104 104 return r; 105 105 } 106 106 107 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 109 GPIOF_OUT_INIT_LOW, "lcd RES"); 110 110 if (r) 111 111 return r;
+16 -16
drivers/video/omap2/displays/panel-picodlp.c
··· 351 351 static int picodlp_panel_power_on(struct omap_dss_device *dssdev) 352 352 { 353 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 355 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev); 356 356 357 357 gpio_set_value(picodlp_pdata->pwrgood_gpio, 0); ··· 360 360 361 361 while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) { 362 362 if (!trial--) { 363 - dev_err(&dssdev->dev, "emu_done signal not" 363 + dev_err(dssdev->dev, "emu_done signal not" 364 364 " going high\n"); 365 365 return -ETIMEDOUT; 366 366 } ··· 378 378 379 379 r = omapdss_dpi_display_enable(dssdev); 380 380 if (r) { 381 - dev_err(&dssdev->dev, "failed to enable DPI\n"); 381 + dev_err(dssdev->dev, "failed to enable DPI\n"); 382 382 goto err1; 383 383 } 384 384 ··· 418 418 if (!picodlp_pdata) 419 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 422 if (!picod) 423 423 return -ENOMEM; 424 424 ··· 428 428 429 429 adapter = i2c_get_adapter(picodlp_adapter_id); 430 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 432 return -ENODEV; 433 433 } 434 434 435 435 picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info); 436 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 438 " picodlp_i2c_client is NULL\n"); 439 439 return -ENODEV; 440 440 } 441 441 442 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 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 448 picodlp_pdata->emu_done_gpio, 449 449 GPIOF_IN, "DLP EMU DONE"); 450 450 if (r) ··· 452 452 } 453 453 454 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 456 picodlp_pdata->pwrgood_gpio, 457 457 GPIOF_OUT_INIT_LOW, "DLP PWRGOOD"); 458 458 if (r) ··· 464 464 465 465 static 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 469 i2c_unregister_device(picod->picodlp_i2c_client); 470 - dev_set_drvdata(&dssdev->dev, NULL); 471 - dev_dbg(&dssdev->dev, "removing picodlp panel\n"); 470 + dev_set_drvdata(dssdev->dev, NULL); 471 + dev_dbg(dssdev->dev, "removing picodlp panel\n"); 472 472 473 473 kfree(picod); 474 474 } 475 475 476 476 static 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 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 483 mutex_lock(&picod->lock); 484 484 if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) { ··· 494 494 495 495 static 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 499 mutex_lock(&picod->lock); 500 500 /* Turn off DLP Power */ ··· 504 504 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 505 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 510 510 static void picodlp_get_resolution(struct omap_dss_device *dssdev,
+5 -5
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
··· 66 66 dssdev->panel.timings = sharp_ls_timings; 67 67 68 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 70 GPIOF_OUT_INIT_LOW, "lcd MO"); 71 71 if (r) 72 72 return r; 73 73 } 74 74 75 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 77 GPIOF_OUT_INIT_HIGH, "lcd LR"); 78 78 if (r) 79 79 return r; 80 80 } 81 81 82 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 84 GPIOF_OUT_INIT_HIGH, "lcd UD"); 85 85 if (r) 86 86 return r; 87 87 } 88 88 89 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 91 GPIOF_OUT_INIT_LOW, "lcd RESB"); 92 92 if (r) 93 93 return r; 94 94 } 95 95 96 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 98 GPIOF_OUT_INIT_LOW, "lcd INI"); 99 99 if (r) 100 100 return r;
+82 -82
drivers/video/omap2/displays/panel-taal.c
··· 237 237 238 238 static 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 242 if (td->esd_interval > 0) 243 243 queue_delayed_work(td->workqueue, &td->esd_work, ··· 246 246 247 247 static 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 251 cancel_delayed_work(&td->esd_work); 252 252 } 253 253 254 254 static 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 258 if (td->ulps_timeout > 0) 259 259 queue_delayed_work(td->workqueue, &td->ulps_work, ··· 262 262 263 263 static 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 267 cancel_delayed_work(&td->ulps_work); 268 268 } 269 269 270 270 static 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 273 int r; 274 274 275 275 if (td->ulps_enabled) ··· 291 291 return 0; 292 292 293 293 err: 294 - dev_err(&dssdev->dev, "enter ULPS failed"); 294 + dev_err(dssdev->dev, "enter ULPS failed"); 295 295 taal_panel_reset(dssdev); 296 296 297 297 td->ulps_enabled = false; ··· 303 303 304 304 static 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 307 int r; 308 308 309 309 if (!td->ulps_enabled) ··· 311 311 312 312 r = omapdss_dsi_display_enable(dssdev); 313 313 if (r) { 314 - dev_err(&dssdev->dev, "failed to enable DSI\n"); 314 + dev_err(dssdev->dev, "failed to enable DSI\n"); 315 315 goto err1; 316 316 } 317 317 ··· 319 319 320 320 r = _taal_enable_te(dssdev, true); 321 321 if (r) { 322 - dev_err(&dssdev->dev, "failed to re-enable TE"); 322 + dev_err(dssdev->dev, "failed to re-enable TE"); 323 323 goto err2; 324 324 } 325 325 ··· 333 333 return 0; 334 334 335 335 err2: 336 - dev_err(&dssdev->dev, "failed to exit ULPS"); 336 + dev_err(dssdev->dev, "failed to exit ULPS"); 337 337 338 338 r = taal_panel_reset(dssdev); 339 339 if (!r) { ··· 349 349 350 350 static 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 354 if (td->ulps_enabled) 355 355 return taal_exit_ulps(dssdev); ··· 362 362 static int taal_bl_update_status(struct backlight_device *dev) 363 363 { 364 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 366 int r; 367 367 int level; 368 368 ··· 372 372 else 373 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 377 mutex_lock(&td->lock); 378 378 ··· 418 418 struct device_attribute *attr, char *buf) 419 419 { 420 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 422 u8 errors = 0; 423 423 int r; 424 424 ··· 448 448 struct device_attribute *attr, char *buf) 449 449 { 450 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 452 u8 id1, id2, id3; 453 453 int r; 454 454 ··· 486 486 char *buf) 487 487 { 488 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 490 const char *mode_str; 491 491 int mode; 492 492 int len; ··· 506 506 const char *buf, size_t count) 507 507 { 508 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 510 int i; 511 511 int r; 512 512 ··· 568 568 const char *buf, size_t count) 569 569 { 570 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 573 unsigned long t; 574 574 int r; ··· 592 592 char *buf) 593 593 { 594 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 596 unsigned t; 597 597 598 598 mutex_lock(&td->lock); ··· 607 607 const char *buf, size_t count) 608 608 { 609 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 611 unsigned long t; 612 612 int r; 613 613 ··· 641 641 char *buf) 642 642 { 643 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 645 unsigned t; 646 646 647 647 mutex_lock(&td->lock); ··· 656 656 const char *buf, size_t count) 657 657 { 658 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 660 unsigned long t; 661 661 int r; 662 662 ··· 687 687 char *buf) 688 688 { 689 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 691 unsigned t; 692 692 693 693 mutex_lock(&td->lock); ··· 727 727 728 728 static 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 732 if (!gpio_is_valid(td->reset_gpio)) 733 733 return; ··· 768 768 struct backlight_device *bldev = NULL; 769 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 774 if (!td) 775 775 return -ENOMEM; 776 776 777 - dev_set_drvdata(&dssdev->dev, td); 777 + dev_set_drvdata(dssdev->dev, td); 778 778 td->dssdev = dssdev; 779 779 780 780 if (dssdev->data) { ··· 797 797 atomic_set(&td->do_update, 0); 798 798 799 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 801 GPIOF_OUT_INIT_LOW, "taal rst"); 802 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 804 return r; 805 805 } 806 806 } 807 807 808 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 810 GPIOF_IN, "taal irq"); 811 811 if (r) { 812 - dev_err(&dssdev->dev, "GPIO request failed\n"); 812 + dev_err(dssdev->dev, "GPIO request failed\n"); 813 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 817 taal_te_isr, 818 818 IRQF_TRIGGER_RISING, 819 819 "taal vsync", dssdev); 820 820 821 821 if (r) { 822 - dev_err(&dssdev->dev, "IRQ request failed\n"); 822 + dev_err(dssdev->dev, "IRQ request failed\n"); 823 823 return r; 824 824 } 825 825 826 826 INIT_DEFERRABLE_WORK(&td->te_timeout_work, 827 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 832 td->workqueue = create_singlethread_workqueue("taal_esd"); 833 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 835 return -ENOMEM; 836 836 } 837 837 INIT_DEFERRABLE_WORK(&td->esd_work, taal_esd_work); ··· 844 844 props.max_brightness = 255; 845 845 846 846 props.type = BACKLIGHT_RAW; 847 - bldev = backlight_device_register(dev_name(&dssdev->dev), 848 - &dssdev->dev, dssdev, &taal_bl_ops, &props); 847 + bldev = backlight_device_register(dev_name(dssdev->dev), 848 + dssdev->dev, dssdev, &taal_bl_ops, &props); 849 849 if (IS_ERR(bldev)) { 850 850 r = PTR_ERR(bldev); 851 851 goto err_bl; ··· 862 862 863 863 r = omap_dsi_request_vc(dssdev, &td->channel); 864 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 866 goto err_req_vc; 867 867 } 868 868 869 869 r = omap_dsi_set_vc_id(dssdev, td->channel, TCH); 870 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 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 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 878 goto err_vc_id; 879 879 } 880 880 ··· 892 892 893 893 static 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 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 901 omap_dsi_release_vc(dssdev, td->channel); 902 902 903 903 bldev = td->bldev; ··· 917 917 918 918 static 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 921 u8 id1, id2, id3; 922 922 int r; 923 923 struct omap_dss_dsi_config dsi_config = { ··· 932 932 933 933 r = omapdss_dsi_configure_pins(dssdev, &td->pin_config); 934 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 936 goto err0; 937 937 }; 938 938 939 939 r = omapdss_dsi_set_config(dssdev, &dsi_config); 940 940 if (r) { 941 - dev_err(&dssdev->dev, "failed to configure DSI\n"); 941 + dev_err(dssdev->dev, "failed to configure DSI\n"); 942 942 goto err0; 943 943 } 944 944 945 945 r = omapdss_dsi_display_enable(dssdev); 946 946 if (r) { 947 - dev_err(&dssdev->dev, "failed to enable DSI\n"); 947 + dev_err(dssdev->dev, "failed to enable DSI\n"); 948 948 goto err0; 949 949 } 950 950 ··· 999 999 td->enabled = 1; 1000 1000 1001 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 1003 id1, id2, id3); 1004 1004 if (td->cabc_broken) 1005 - dev_info(&dssdev->dev, 1005 + dev_info(dssdev->dev, 1006 1006 "old Taal version, CABC disabled\n"); 1007 1007 td->intro_printed = true; 1008 1008 } ··· 1011 1011 1012 1012 return 0; 1013 1013 err: 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 1016 taal_hw_reset(dssdev); 1017 1017 ··· 1022 1022 1023 1023 static 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 1026 int r; 1027 1027 1028 1028 dsi_disable_video_output(dssdev, td->channel); ··· 1032 1032 r = taal_sleep_in(td); 1033 1033 1034 1034 if (r) { 1035 - dev_err(&dssdev->dev, 1035 + dev_err(dssdev->dev, 1036 1036 "error disabling panel, issuing HW reset\n"); 1037 1037 taal_hw_reset(dssdev); 1038 1038 } ··· 1044 1044 1045 1045 static 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 1049 taal_power_off(dssdev); 1050 1050 taal_hw_reset(dssdev); ··· 1053 1053 1054 1054 static 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 1057 int r; 1058 1058 1059 - dev_dbg(&dssdev->dev, "enable\n"); 1059 + dev_dbg(dssdev->dev, "enable\n"); 1060 1060 1061 1061 mutex_lock(&td->lock); 1062 1062 ··· 1082 1082 1083 1083 return 0; 1084 1084 err: 1085 - dev_dbg(&dssdev->dev, "enable failed\n"); 1085 + dev_dbg(dssdev->dev, "enable failed\n"); 1086 1086 mutex_unlock(&td->lock); 1087 1087 return r; 1088 1088 } 1089 1089 1090 1090 static 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 1096 mutex_lock(&td->lock); 1097 1097 ··· 1118 1118 static void taal_framedone_cb(int err, void *data) 1119 1119 { 1120 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 1122 dsi_bus_unlock(dssdev); 1123 1123 } 1124 1124 1125 1125 static irqreturn_t taal_te_isr(int irq, void *data) 1126 1126 { 1127 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 1129 int old; 1130 1130 int r; 1131 1131 ··· 1142 1142 1143 1143 return IRQ_HANDLED; 1144 1144 err: 1145 - dev_err(&dssdev->dev, "start update failed\n"); 1145 + dev_err(dssdev->dev, "start update failed\n"); 1146 1146 dsi_bus_unlock(dssdev); 1147 1147 return IRQ_HANDLED; 1148 1148 } ··· 1153 1153 te_timeout_work.work); 1154 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 1158 atomic_set(&td->do_update, 0); 1159 1159 dsi_bus_unlock(dssdev); ··· 1162 1162 static int taal_update(struct omap_dss_device *dssdev, 1163 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 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 1170 mutex_lock(&td->lock); 1171 1171 dsi_bus_lock(dssdev); ··· 1208 1208 1209 1209 static 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 1215 mutex_lock(&td->lock); 1216 1216 dsi_bus_lock(dssdev); 1217 1217 dsi_bus_unlock(dssdev); 1218 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 1222 return 0; 1223 1223 } 1224 1224 1225 1225 static 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 1228 int r; 1229 1229 1230 1230 if (enable) ··· 1243 1243 1244 1244 static 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 1247 int r; 1248 1248 1249 1249 mutex_lock(&td->lock); ··· 1279 1279 1280 1280 static 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 1283 int r; 1284 1284 1285 1285 mutex_lock(&td->lock); ··· 1291 1291 1292 1292 static 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 1295 u8 id1, id2, id3; 1296 1296 int r; 1297 1297 ··· 1336 1336 int first = 1; 1337 1337 int plen; 1338 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 1341 if (size < w * h * 3) 1342 1342 return -ENOMEM; ··· 1380 1380 buf + buf_used, size - buf_used); 1381 1381 1382 1382 if (r < 0) { 1383 - dev_err(&dssdev->dev, "read error\n"); 1383 + dev_err(dssdev->dev, "read error\n"); 1384 1384 goto err3; 1385 1385 } 1386 1386 1387 1387 buf_used += r; 1388 1388 1389 1389 if (r < plen) { 1390 - dev_err(&dssdev->dev, "short read\n"); 1390 + dev_err(dssdev->dev, "short read\n"); 1391 1391 break; 1392 1392 } 1393 1393 1394 1394 if (signal_pending(current)) { 1395 - dev_err(&dssdev->dev, "signal pending, " 1395 + dev_err(dssdev->dev, "signal pending, " 1396 1396 "aborting memory read\n"); 1397 1397 r = -ERESTARTSYS; 1398 1398 goto err3; ··· 1450 1450 1451 1451 r = taal_wake_up(dssdev); 1452 1452 if (r) { 1453 - dev_err(&dssdev->dev, "failed to exit ULPS\n"); 1453 + dev_err(dssdev->dev, "failed to exit ULPS\n"); 1454 1454 goto err; 1455 1455 } 1456 1456 1457 1457 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state1); 1458 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 1460 goto err; 1461 1461 } 1462 1462 1463 1463 /* Run self diagnostics */ 1464 1464 r = taal_sleep_out(td); 1465 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 1467 goto err; 1468 1468 } 1469 1469 1470 1470 r = taal_dcs_read_1(td, MIPI_DCS_GET_DIAGNOSTIC_RESULT, &state2); 1471 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 1473 goto err; 1474 1474 } 1475 1475 ··· 1477 1477 * Bit6 if the test passes. 1478 1478 */ 1479 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 1481 goto err; 1482 1482 } 1483 1483 /* Self-diagnostics result is also shown on TE GPIO line. We need ··· 1495 1495 mutex_unlock(&td->lock); 1496 1496 return; 1497 1497 err: 1498 - dev_err(&dssdev->dev, "performing LCD reset\n"); 1498 + dev_err(dssdev->dev, "performing LCD reset\n"); 1499 1499 1500 1500 taal_panel_reset(dssdev); 1501 1501
+16 -16
drivers/video/omap2/displays/panel-tfp410.c
··· 59 59 60 60 static 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 63 int r; 64 64 65 65 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) ··· 82 82 83 83 static 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 87 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 88 88 return; ··· 99 99 int r; 100 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 103 if (!ddata) 104 104 return -ENOMEM; 105 105 ··· 119 119 } 120 120 121 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 123 GPIOF_OUT_INIT_LOW, "tfp410 pd"); 124 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 126 ddata->pd_gpio); 127 127 return r; 128 128 } ··· 133 133 134 134 adapter = i2c_get_adapter(i2c_bus_num); 135 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 137 i2c_bus_num); 138 138 return -EPROBE_DEFER; 139 139 } ··· 141 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 146 return 0; 147 147 } 148 148 149 149 static 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 153 mutex_lock(&ddata->lock); 154 154 155 155 if (ddata->i2c_adapter) 156 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 160 mutex_unlock(&ddata->lock); 161 161 } 162 162 163 163 static 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 166 int r; 167 167 168 168 mutex_lock(&ddata->lock); ··· 178 178 179 179 static 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 183 mutex_lock(&ddata->lock); 184 184 ··· 192 192 static void tfp410_set_timings(struct omap_dss_device *dssdev, 193 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 197 mutex_lock(&ddata->lock); 198 198 omapdss_dpi_set_timings(dssdev, timings); ··· 203 203 static void tfp410_get_timings(struct omap_dss_device *dssdev, 204 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 208 mutex_lock(&ddata->lock); 209 209 *timings = dssdev->panel.timings; ··· 213 213 static int tfp410_check_timings(struct omap_dss_device *dssdev, 214 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 217 int r; 218 218 219 219 mutex_lock(&ddata->lock); ··· 258 258 static int tfp410_read_edid(struct omap_dss_device *dssdev, 259 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 262 int r, l, bytes_read; 263 263 264 264 mutex_lock(&ddata->lock); ··· 298 298 299 299 static 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 302 unsigned char out; 303 303 int r; 304 304
+18 -18
drivers/video/omap2/displays/panel-tpo-td043mtea1.c
··· 126 126 127 127 static 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 131 tpo_td043->hmirror = enable; 132 132 return tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror, ··· 135 135 136 136 static 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 140 return tpo_td043->hmirror; 141 141 } ··· 338 338 339 339 static 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 342 int r; 343 343 344 344 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) ··· 372 372 373 373 static 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 377 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 378 378 return; ··· 385 385 386 386 static 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 390 return tpo_td043_enable_dss(dssdev); 391 391 } 392 392 393 393 static 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 397 tpo_td043_disable_dss(dssdev); 398 398 ··· 405 405 struct panel_tpo_td043_data *pdata = get_panel_data(dssdev); 406 406 int ret = 0; 407 407 408 - dev_dbg(&dssdev->dev, "probe\n"); 408 + dev_dbg(dssdev->dev, "probe\n"); 409 409 410 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 412 return -ENODEV; 413 413 } 414 414 ··· 423 423 tpo_td043->mode = TPO_R02_MODE_800x480; 424 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 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 429 ret = PTR_ERR(tpo_td043->vcc_reg); 430 430 goto fail_regulator; 431 431 } 432 432 433 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 435 tpo_td043->nreset_gpio, GPIOF_OUT_INIT_LOW, 436 436 "lcd reset"); 437 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 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 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 449 return 0; 450 450 ··· 457 457 458 458 static 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 465 regulator_put(tpo_td043->vcc_reg); 466 466 } 467 467
+10 -8
drivers/video/omap2/dss/core.c
··· 437 437 if (!dssdev) 438 438 return NULL; 439 439 440 - dssdev->dev.bus = &dss_bus_type; 441 - dssdev->dev.parent = parent; 442 - dssdev->dev.release = omap_dss_dev_release; 443 - dev_set_name(&dssdev->dev, "display%d", disp_num_counter++); 440 + dssdev->old_dev.bus = &dss_bus_type; 441 + dssdev->old_dev.parent = parent; 442 + dssdev->old_dev.release = omap_dss_dev_release; 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 447 return dssdev; 448 448 } 449 449 450 450 int dss_add_device(struct omap_dss_device *dssdev) 451 451 { 452 + dssdev->dev = &dssdev->old_dev; 453 + 452 454 omapdss_register_display(dssdev); 453 - return device_add(&dssdev->dev); 455 + return device_add(&dssdev->old_dev); 454 456 } 455 457 456 458 void 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 461 463 void dss_unregister_device(struct omap_dss_device *dssdev) 462 464 { 463 - device_unregister(&dssdev->dev); 465 + device_unregister(&dssdev->old_dev); 464 466 omapdss_unregister_display(dssdev); 465 467 } 466 468
+4 -3
drivers/video/omap2/dss/display-sysfs.c
··· 33 33 struct omap_dss_device *dssdev = NULL; 34 34 35 35 for_each_dss_dev(dssdev) { 36 - if (&dssdev->dev == dev) { 36 + if (dssdev->dev == dev) { 37 37 omap_dss_put_device(dssdev); 38 38 return dssdev; 39 39 } ··· 308 308 int r; 309 309 310 310 for_each_dss_dev(dssdev) { 311 - struct kobject *kobj = &dssdev->dev.kobj; 311 + struct kobject *kobj = &dssdev->dev->kobj; 312 312 313 313 r = sysfs_create_files(kobj, display_sysfs_attrs); 314 314 if (r) { ··· 339 339 340 340 for_each_dss_dev(dssdev) { 341 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 }
+4 -5
drivers/video/omap2/dss/display.c
··· 160 160 161 161 void omap_dss_get_device(struct omap_dss_device *dssdev) 162 162 { 163 - get_device(&dssdev->dev); 163 + get_device(dssdev->dev); 164 164 } 165 165 EXPORT_SYMBOL(omap_dss_get_device); 166 166 167 167 void omap_dss_put_device(struct omap_dss_device *dssdev) 168 168 { 169 - put_device(&dssdev->dev); 169 + put_device(dssdev->dev); 170 170 } 171 171 EXPORT_SYMBOL(omap_dss_put_device); 172 172 ··· 240 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 244 return -ENODEV; 245 - } 246 245 247 246 return 0; 248 247 } ··· 249 250 250 251 void omap_dss_stop_device(struct omap_dss_device *dssdev) 251 252 { 252 - module_put(dssdev->dev.driver->owner); 253 + module_put(dssdev->dev->driver->owner); 253 254 } 254 255 EXPORT_SYMBOL(omap_dss_stop_device); 255 256
+8 -8
drivers/video/omap2/dss/venc_panel.c
··· 107 107 108 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 113 113 static 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 118 118 static int venc_panel_enable(struct omap_dss_device *dssdev) 119 119 { 120 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 124 mutex_lock(&venc_panel.lock); 125 125 ··· 150 150 151 151 static 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 155 mutex_lock(&venc_panel.lock); 156 156 ··· 167 167 static void venc_panel_set_timings(struct omap_dss_device *dssdev, 168 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 172 mutex_lock(&venc_panel.lock); 173 173 ··· 180 180 static int venc_panel_check_timings(struct omap_dss_device *dssdev, 181 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 185 return omapdss_venc_check_timings(dssdev, timings); 186 186 } 187 187 188 188 static 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 192 return omapdss_venc_get_wss(dssdev); 193 193 } 194 194 195 195 static 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 199 return omapdss_venc_set_wss(dssdev, wss); 200 200 }
+6 -2
include/video/omapdss.h
··· 596 596 }; 597 597 598 598 struct 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 605 struct list_head panel_list; 602 606 ··· 860 856 bool mem_to_mem); 861 857 862 858 #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 863 - #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 859 + #define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev) 864 860 865 861 void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 866 862 bool enable);