diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/video/pxafb.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r-- | drivers/video/pxafb.c | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 580f80cc586..0f4e8c942f9 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -54,14 +54,13 @@ | |||
54 | #include <linux/mutex.h> | 54 | #include <linux/mutex.h> |
55 | #include <linux/kthread.h> | 55 | #include <linux/kthread.h> |
56 | #include <linux/freezer.h> | 56 | #include <linux/freezer.h> |
57 | #include <linux/console.h> | ||
58 | 57 | ||
59 | #include <mach/hardware.h> | 58 | #include <mach/hardware.h> |
60 | #include <asm/io.h> | 59 | #include <asm/io.h> |
61 | #include <asm/irq.h> | 60 | #include <asm/irq.h> |
62 | #include <asm/div64.h> | 61 | #include <asm/div64.h> |
63 | #include <mach/bitfield.h> | 62 | #include <mach/bitfield.h> |
64 | #include <linux/platform_data/video-pxafb.h> | 63 | #include <mach/pxafb.h> |
65 | 64 | ||
66 | /* | 65 | /* |
67 | * Complain if VAR is out of range. | 66 | * Complain if VAR is out of range. |
@@ -731,12 +730,9 @@ static int overlayfb_open(struct fb_info *info, int user) | |||
731 | if (user == 0) | 730 | if (user == 0) |
732 | return -ENODEV; | 731 | return -ENODEV; |
733 | 732 | ||
734 | if (ofb->usage++ == 0) { | 733 | if (ofb->usage++ == 0) |
735 | /* unblank the base framebuffer */ | 734 | /* unblank the base framebuffer */ |
736 | console_lock(); | ||
737 | fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK); | 735 | fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK); |
738 | console_unlock(); | ||
739 | } | ||
740 | 736 | ||
741 | return 0; | 737 | return 0; |
742 | } | 738 | } |
@@ -869,8 +865,8 @@ static struct fb_ops overlay_fb_ops = { | |||
869 | .fb_set_par = overlayfb_set_par, | 865 | .fb_set_par = overlayfb_set_par, |
870 | }; | 866 | }; |
871 | 867 | ||
872 | static void init_pxafb_overlay(struct pxafb_info *fbi, struct pxafb_layer *ofb, | 868 | static void __devinit init_pxafb_overlay(struct pxafb_info *fbi, |
873 | int id) | 869 | struct pxafb_layer *ofb, int id) |
874 | { | 870 | { |
875 | sprintf(ofb->fb.fix.id, "overlay%d", id + 1); | 871 | sprintf(ofb->fb.fix.id, "overlay%d", id + 1); |
876 | 872 | ||
@@ -903,8 +899,8 @@ static inline int pxafb_overlay_supported(void) | |||
903 | return 0; | 899 | return 0; |
904 | } | 900 | } |
905 | 901 | ||
906 | static int pxafb_overlay_map_video_memory(struct pxafb_info *pxafb, | 902 | static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb, |
907 | struct pxafb_layer *ofb) | 903 | struct pxafb_layer *ofb) |
908 | { | 904 | { |
909 | /* We assume that user will use at most video_mem_size for overlay fb, | 905 | /* We assume that user will use at most video_mem_size for overlay fb, |
910 | * anyway, it's useless to use 16bpp main plane and 24bpp overlay | 906 | * anyway, it's useless to use 16bpp main plane and 24bpp overlay |
@@ -927,7 +923,7 @@ static int pxafb_overlay_map_video_memory(struct pxafb_info *pxafb, | |||
927 | return 0; | 923 | return 0; |
928 | } | 924 | } |
929 | 925 | ||
930 | static void pxafb_overlay_init(struct pxafb_info *fbi) | 926 | static void __devinit pxafb_overlay_init(struct pxafb_info *fbi) |
931 | { | 927 | { |
932 | int i, ret; | 928 | int i, ret; |
933 | 929 | ||
@@ -959,7 +955,7 @@ static void pxafb_overlay_init(struct pxafb_info *fbi) | |||
959 | pr_info("PXA Overlay driver loaded successfully!\n"); | 955 | pr_info("PXA Overlay driver loaded successfully!\n"); |
960 | } | 956 | } |
961 | 957 | ||
962 | static void pxafb_overlay_exit(struct pxafb_info *fbi) | 958 | static void __devexit pxafb_overlay_exit(struct pxafb_info *fbi) |
963 | { | 959 | { |
964 | int i; | 960 | int i; |
965 | 961 | ||
@@ -1313,6 +1309,16 @@ static int pxafb_smart_init(struct pxafb_info *fbi) | |||
1313 | return 0; | 1309 | return 0; |
1314 | } | 1310 | } |
1315 | #else | 1311 | #else |
1312 | int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds) | ||
1313 | { | ||
1314 | return 0; | ||
1315 | } | ||
1316 | |||
1317 | int pxafb_smart_flush(struct fb_info *info) | ||
1318 | { | ||
1319 | return 0; | ||
1320 | } | ||
1321 | |||
1316 | static inline int pxafb_smart_init(struct pxafb_info *fbi) { return 0; } | 1322 | static inline int pxafb_smart_init(struct pxafb_info *fbi) { return 0; } |
1317 | #endif /* CONFIG_FB_PXA_SMARTPANEL */ | 1323 | #endif /* CONFIG_FB_PXA_SMARTPANEL */ |
1318 | 1324 | ||
@@ -1435,7 +1441,7 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) | |||
1435 | pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); | 1441 | pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); |
1436 | 1442 | ||
1437 | /* enable LCD controller clock */ | 1443 | /* enable LCD controller clock */ |
1438 | clk_prepare_enable(fbi->clk); | 1444 | clk_enable(fbi->clk); |
1439 | 1445 | ||
1440 | if (fbi->lccr0 & LCCR0_LCDT) | 1446 | if (fbi->lccr0 & LCCR0_LCDT) |
1441 | return; | 1447 | return; |
@@ -1475,7 +1481,7 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) | |||
1475 | wait_for_completion_timeout(&fbi->disable_done, 200 * HZ / 1000); | 1481 | wait_for_completion_timeout(&fbi->disable_done, 200 * HZ / 1000); |
1476 | 1482 | ||
1477 | /* disable LCD controller clock */ | 1483 | /* disable LCD controller clock */ |
1478 | clk_disable_unprepare(fbi->clk); | 1484 | clk_disable(fbi->clk); |
1479 | } | 1485 | } |
1480 | 1486 | ||
1481 | /* | 1487 | /* |
@@ -1706,7 +1712,7 @@ static const struct dev_pm_ops pxafb_pm_ops = { | |||
1706 | }; | 1712 | }; |
1707 | #endif | 1713 | #endif |
1708 | 1714 | ||
1709 | static int pxafb_init_video_memory(struct pxafb_info *fbi) | 1715 | static int __devinit pxafb_init_video_memory(struct pxafb_info *fbi) |
1710 | { | 1716 | { |
1711 | int size = PAGE_ALIGN(fbi->video_mem_size); | 1717 | int size = PAGE_ALIGN(fbi->video_mem_size); |
1712 | 1718 | ||
@@ -1789,7 +1795,7 @@ decode_mode: | |||
1789 | fbi->video_mem_size = video_mem_size; | 1795 | fbi->video_mem_size = video_mem_size; |
1790 | } | 1796 | } |
1791 | 1797 | ||
1792 | static struct pxafb_info *pxafb_init_fbinfo(struct device *dev) | 1798 | static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev) |
1793 | { | 1799 | { |
1794 | struct pxafb_info *fbi; | 1800 | struct pxafb_info *fbi; |
1795 | void *addr; | 1801 | void *addr; |
@@ -1853,7 +1859,7 @@ static struct pxafb_info *pxafb_init_fbinfo(struct device *dev) | |||
1853 | } | 1859 | } |
1854 | 1860 | ||
1855 | #ifdef CONFIG_FB_PXA_PARAMETERS | 1861 | #ifdef CONFIG_FB_PXA_PARAMETERS |
1856 | static int parse_opt_mode(struct device *dev, const char *this_opt) | 1862 | static int __devinit parse_opt_mode(struct device *dev, const char *this_opt) |
1857 | { | 1863 | { |
1858 | struct pxafb_mach_info *inf = dev->platform_data; | 1864 | struct pxafb_mach_info *inf = dev->platform_data; |
1859 | 1865 | ||
@@ -1912,7 +1918,7 @@ done: | |||
1912 | return 0; | 1918 | return 0; |
1913 | } | 1919 | } |
1914 | 1920 | ||
1915 | static int parse_opt(struct device *dev, char *this_opt) | 1921 | static int __devinit parse_opt(struct device *dev, char *this_opt) |
1916 | { | 1922 | { |
1917 | struct pxafb_mach_info *inf = dev->platform_data; | 1923 | struct pxafb_mach_info *inf = dev->platform_data; |
1918 | struct pxafb_mode_info *mode = &inf->modes[0]; | 1924 | struct pxafb_mode_info *mode = &inf->modes[0]; |
@@ -2012,7 +2018,7 @@ static int parse_opt(struct device *dev, char *this_opt) | |||
2012 | return 0; | 2018 | return 0; |
2013 | } | 2019 | } |
2014 | 2020 | ||
2015 | static int pxafb_parse_options(struct device *dev, char *options) | 2021 | static int __devinit pxafb_parse_options(struct device *dev, char *options) |
2016 | { | 2022 | { |
2017 | char *this_opt; | 2023 | char *this_opt; |
2018 | int ret; | 2024 | int ret; |
@@ -2031,7 +2037,7 @@ static int pxafb_parse_options(struct device *dev, char *options) | |||
2031 | return 0; | 2037 | return 0; |
2032 | } | 2038 | } |
2033 | 2039 | ||
2034 | static char g_options[256] = ""; | 2040 | static char g_options[256] __devinitdata = ""; |
2035 | 2041 | ||
2036 | #ifndef MODULE | 2042 | #ifndef MODULE |
2037 | static int __init pxafb_setup_options(void) | 2043 | static int __init pxafb_setup_options(void) |
@@ -2061,7 +2067,8 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); | |||
2061 | #ifdef DEBUG_VAR | 2067 | #ifdef DEBUG_VAR |
2062 | /* Check for various illegal bit-combinations. Currently only | 2068 | /* Check for various illegal bit-combinations. Currently only |
2063 | * a warning is given. */ | 2069 | * a warning is given. */ |
2064 | static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf) | 2070 | static void __devinit pxafb_check_options(struct device *dev, |
2071 | struct pxafb_mach_info *inf) | ||
2065 | { | 2072 | { |
2066 | if (inf->lcd_conn) | 2073 | if (inf->lcd_conn) |
2067 | return; | 2074 | return; |
@@ -2093,7 +2100,7 @@ static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf) | |||
2093 | #define pxafb_check_options(...) do {} while (0) | 2100 | #define pxafb_check_options(...) do {} while (0) |
2094 | #endif | 2101 | #endif |
2095 | 2102 | ||
2096 | static int pxafb_probe(struct platform_device *dev) | 2103 | static int __devinit pxafb_probe(struct platform_device *dev) |
2097 | { | 2104 | { |
2098 | struct pxafb_info *fbi; | 2105 | struct pxafb_info *fbi; |
2099 | struct pxafb_mach_info *inf; | 2106 | struct pxafb_mach_info *inf; |
@@ -2184,7 +2191,7 @@ static int pxafb_probe(struct platform_device *dev) | |||
2184 | goto failed_free_mem; | 2191 | goto failed_free_mem; |
2185 | } | 2192 | } |
2186 | 2193 | ||
2187 | ret = request_irq(irq, pxafb_handle_irq, 0, "LCD", fbi); | 2194 | ret = request_irq(irq, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi); |
2188 | if (ret) { | 2195 | if (ret) { |
2189 | dev_err(&dev->dev, "request_irq failed: %d\n", ret); | 2196 | dev_err(&dev->dev, "request_irq failed: %d\n", ret); |
2190 | ret = -EBUSY; | 2197 | ret = -EBUSY; |
@@ -2262,7 +2269,7 @@ failed: | |||
2262 | return ret; | 2269 | return ret; |
2263 | } | 2270 | } |
2264 | 2271 | ||
2265 | static int pxafb_remove(struct platform_device *dev) | 2272 | static int __devexit pxafb_remove(struct platform_device *dev) |
2266 | { | 2273 | { |
2267 | struct pxafb_info *fbi = platform_get_drvdata(dev); | 2274 | struct pxafb_info *fbi = platform_get_drvdata(dev); |
2268 | struct resource *r; | 2275 | struct resource *r; |
@@ -2303,7 +2310,7 @@ static int pxafb_remove(struct platform_device *dev) | |||
2303 | 2310 | ||
2304 | static struct platform_driver pxafb_driver = { | 2311 | static struct platform_driver pxafb_driver = { |
2305 | .probe = pxafb_probe, | 2312 | .probe = pxafb_probe, |
2306 | .remove = pxafb_remove, | 2313 | .remove = __devexit_p(pxafb_remove), |
2307 | .driver = { | 2314 | .driver = { |
2308 | .owner = THIS_MODULE, | 2315 | .owner = THIS_MODULE, |
2309 | .name = "pxa2xx-fb", | 2316 | .name = "pxa2xx-fb", |