aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays/panel-n8x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/displays/panel-n8x0.c')
-rw-r--r--drivers/video/omap2/displays/panel-n8x0.c89
1 files changed, 9 insertions, 80 deletions
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index 3fc5ad081a21..d1cb722fcdbc 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -574,54 +574,6 @@ static void n8x0_panel_disable(struct omap_dss_device *dssdev)
574 mutex_unlock(&ddata->lock); 574 mutex_unlock(&ddata->lock);
575} 575}
576 576
577static int n8x0_panel_suspend(struct omap_dss_device *dssdev)
578{
579 struct panel_drv_data *ddata = get_drv_data(dssdev);
580
581 dev_dbg(&dssdev->dev, "suspend\n");
582
583 mutex_lock(&ddata->lock);
584
585 rfbi_bus_lock();
586
587 n8x0_panel_power_off(dssdev);
588
589 rfbi_bus_unlock();
590
591 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
592
593 mutex_unlock(&ddata->lock);
594
595 return 0;
596}
597
598static int n8x0_panel_resume(struct omap_dss_device *dssdev)
599{
600 struct panel_drv_data *ddata = get_drv_data(dssdev);
601 int r;
602
603 dev_dbg(&dssdev->dev, "resume\n");
604
605 mutex_lock(&ddata->lock);
606
607 rfbi_bus_lock();
608
609 r = n8x0_panel_power_on(dssdev);
610
611 rfbi_bus_unlock();
612
613 if (r) {
614 mutex_unlock(&ddata->lock);
615 return r;
616 }
617
618 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
619
620 mutex_unlock(&ddata->lock);
621
622 return 0;
623}
624
625static void n8x0_panel_get_resolution(struct omap_dss_device *dssdev, 577static void n8x0_panel_get_resolution(struct omap_dss_device *dssdev,
626 u16 *xres, u16 *yres) 578 u16 *xres, u16 *yres)
627{ 579{
@@ -683,8 +635,6 @@ static struct omap_dss_driver n8x0_panel_driver = {
683 635
684 .enable = n8x0_panel_enable, 636 .enable = n8x0_panel_enable,
685 .disable = n8x0_panel_disable, 637 .disable = n8x0_panel_disable,
686 .suspend = n8x0_panel_suspend,
687 .resume = n8x0_panel_resume,
688 638
689 .update = n8x0_panel_update, 639 .update = n8x0_panel_update,
690 .sync = n8x0_panel_sync, 640 .sync = n8x0_panel_sync,
@@ -702,18 +652,25 @@ static struct omap_dss_driver n8x0_panel_driver = {
702 652
703static int mipid_spi_probe(struct spi_device *spi) 653static int mipid_spi_probe(struct spi_device *spi)
704{ 654{
655 int r;
656
705 dev_dbg(&spi->dev, "mipid_spi_probe\n"); 657 dev_dbg(&spi->dev, "mipid_spi_probe\n");
706 658
707 spi->mode = SPI_MODE_0; 659 spi->mode = SPI_MODE_0;
708 660
709 s_drv_data.spidev = spi; 661 s_drv_data.spidev = spi;
710 662
711 return 0; 663 r = omap_dss_register_driver(&n8x0_panel_driver);
664 if (r)
665 pr_err("n8x0_panel: dss driver registration failed\n");
666
667 return r;
712} 668}
713 669
714static int mipid_spi_remove(struct spi_device *spi) 670static int mipid_spi_remove(struct spi_device *spi)
715{ 671{
716 dev_dbg(&spi->dev, "mipid_spi_remove\n"); 672 dev_dbg(&spi->dev, "mipid_spi_remove\n");
673 omap_dss_unregister_driver(&n8x0_panel_driver);
717 return 0; 674 return 0;
718} 675}
719 676
@@ -725,34 +682,6 @@ static struct spi_driver mipid_spi_driver = {
725 .probe = mipid_spi_probe, 682 .probe = mipid_spi_probe,
726 .remove = __devexit_p(mipid_spi_remove), 683 .remove = __devexit_p(mipid_spi_remove),
727}; 684};
685module_spi_driver(mipid_spi_driver);
728 686
729static int __init n8x0_panel_drv_init(void)
730{
731 int r;
732
733 r = spi_register_driver(&mipid_spi_driver);
734 if (r) {
735 pr_err("n8x0_panel: spi driver registration failed\n");
736 return r;
737 }
738
739 r = omap_dss_register_driver(&n8x0_panel_driver);
740 if (r) {
741 pr_err("n8x0_panel: dss driver registration failed\n");
742 spi_unregister_driver(&mipid_spi_driver);
743 return r;
744 }
745
746 return 0;
747}
748
749static void __exit n8x0_panel_drv_exit(void)
750{
751 spi_unregister_driver(&mipid_spi_driver);
752
753 omap_dss_unregister_driver(&n8x0_panel_driver);
754}
755
756module_init(n8x0_panel_drv_init);
757module_exit(n8x0_panel_drv_exit);
758MODULE_LICENSE("GPL"); 687MODULE_LICENSE("GPL");