diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/omap/omapfb_main.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/omap/omapfb_main.c')
-rw-r--r-- | drivers/video/omap/omapfb_main.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 0d0c8c8b9b56..e264efd0278f 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c | |||
@@ -26,11 +26,12 @@ | |||
26 | */ | 26 | */ |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
30 | 31 | ||
31 | #include <mach/dma.h> | 32 | #include <plat/dma.h> |
32 | #include <mach/omapfb.h> | ||
33 | 33 | ||
34 | #include "omapfb.h" | ||
34 | #include "lcdc.h" | 35 | #include "lcdc.h" |
35 | #include "dispc.h" | 36 | #include "dispc.h" |
36 | 37 | ||
@@ -83,6 +84,19 @@ static struct caps_table_struct color_caps[] = { | |||
83 | { 1 << OMAPFB_COLOR_YUY422, "YUY422", }, | 84 | { 1 << OMAPFB_COLOR_YUY422, "YUY422", }, |
84 | }; | 85 | }; |
85 | 86 | ||
87 | static void omapdss_release(struct device *dev) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | /* dummy device for clocks */ | ||
92 | static struct platform_device omapdss_device = { | ||
93 | .name = "omapdss", | ||
94 | .id = -1, | ||
95 | .dev = { | ||
96 | .release = omapdss_release, | ||
97 | }, | ||
98 | }; | ||
99 | |||
86 | /* | 100 | /* |
87 | * --------------------------------------------------------------------------- | 101 | * --------------------------------------------------------------------------- |
88 | * LCD panel | 102 | * LCD panel |
@@ -473,10 +487,11 @@ static int set_color_mode(struct omapfb_plane_struct *plane, | |||
473 | return 0; | 487 | return 0; |
474 | case 12: | 488 | case 12: |
475 | var->bits_per_pixel = 16; | 489 | var->bits_per_pixel = 16; |
476 | plane->color_mode = OMAPFB_COLOR_RGB444; | ||
477 | return 0; | ||
478 | case 16: | 490 | case 16: |
479 | plane->color_mode = OMAPFB_COLOR_RGB565; | 491 | if (plane->fbdev->panel->bpp == 12) |
492 | plane->color_mode = OMAPFB_COLOR_RGB444; | ||
493 | else | ||
494 | plane->color_mode = OMAPFB_COLOR_RGB565; | ||
480 | return 0; | 495 | return 0; |
481 | default: | 496 | default: |
482 | return -EINVAL; | 497 | return -EINVAL; |
@@ -1700,6 +1715,7 @@ static int omapfb_do_probe(struct platform_device *pdev, | |||
1700 | 1715 | ||
1701 | fbdev->dev = &pdev->dev; | 1716 | fbdev->dev = &pdev->dev; |
1702 | fbdev->panel = panel; | 1717 | fbdev->panel = panel; |
1718 | fbdev->dssdev = &omapdss_device; | ||
1703 | platform_set_drvdata(pdev, fbdev); | 1719 | platform_set_drvdata(pdev, fbdev); |
1704 | 1720 | ||
1705 | mutex_init(&fbdev->rqueue_mutex); | 1721 | mutex_init(&fbdev->rqueue_mutex); |
@@ -1814,8 +1830,16 @@ cleanup: | |||
1814 | 1830 | ||
1815 | static int omapfb_probe(struct platform_device *pdev) | 1831 | static int omapfb_probe(struct platform_device *pdev) |
1816 | { | 1832 | { |
1833 | int r; | ||
1834 | |||
1817 | BUG_ON(fbdev_pdev != NULL); | 1835 | BUG_ON(fbdev_pdev != NULL); |
1818 | 1836 | ||
1837 | r = platform_device_register(&omapdss_device); | ||
1838 | if (r) { | ||
1839 | dev_err(&pdev->dev, "can't register omapdss device\n"); | ||
1840 | return r; | ||
1841 | } | ||
1842 | |||
1819 | /* Delay actual initialization until the LCD is registered */ | 1843 | /* Delay actual initialization until the LCD is registered */ |
1820 | fbdev_pdev = pdev; | 1844 | fbdev_pdev = pdev; |
1821 | if (fbdev_panel != NULL) | 1845 | if (fbdev_panel != NULL) |
@@ -1843,6 +1867,9 @@ static int omapfb_remove(struct platform_device *pdev) | |||
1843 | fbdev->state = OMAPFB_DISABLED; | 1867 | fbdev->state = OMAPFB_DISABLED; |
1844 | omapfb_free_resources(fbdev, saved_state); | 1868 | omapfb_free_resources(fbdev, saved_state); |
1845 | 1869 | ||
1870 | platform_device_unregister(&omapdss_device); | ||
1871 | fbdev->dssdev = NULL; | ||
1872 | |||
1846 | return 0; | 1873 | return 0; |
1847 | } | 1874 | } |
1848 | 1875 | ||