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/sm501fb.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/video/sm501fb.c')
-rw-r--r-- | drivers/video/sm501fb.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index 1501979099d..6294dca9550 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c | |||
@@ -46,7 +46,7 @@ | |||
46 | static char *fb_mode = "640x480-16@60"; | 46 | static char *fb_mode = "640x480-16@60"; |
47 | static unsigned long default_bpp = 16; | 47 | static unsigned long default_bpp = 16; |
48 | 48 | ||
49 | static struct fb_videomode sm501_default_mode = { | 49 | static struct fb_videomode __devinitdata sm501_default_mode = { |
50 | .refresh = 60, | 50 | .refresh = 60, |
51 | .xres = 640, | 51 | .xres = 640, |
52 | .yres = 480, | 52 | .yres = 480, |
@@ -582,7 +582,7 @@ static int sm501fb_pan_crt(struct fb_var_screeninfo *var, | |||
582 | { | 582 | { |
583 | struct sm501fb_par *par = info->par; | 583 | struct sm501fb_par *par = info->par; |
584 | struct sm501fb_info *fbi = par->info; | 584 | struct sm501fb_info *fbi = par->info; |
585 | unsigned int bytes_pixel = info->var.bits_per_pixel / 8; | 585 | unsigned int bytes_pixel = var->bits_per_pixel / 8; |
586 | unsigned long reg; | 586 | unsigned long reg; |
587 | unsigned long xoffs; | 587 | unsigned long xoffs; |
588 | 588 | ||
@@ -614,10 +614,10 @@ static int sm501fb_pan_pnl(struct fb_var_screeninfo *var, | |||
614 | struct sm501fb_info *fbi = par->info; | 614 | struct sm501fb_info *fbi = par->info; |
615 | unsigned long reg; | 615 | unsigned long reg; |
616 | 616 | ||
617 | reg = var->xoffset | (info->var.xres_virtual << 16); | 617 | reg = var->xoffset | (var->xres_virtual << 16); |
618 | smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_WIDTH); | 618 | smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_WIDTH); |
619 | 619 | ||
620 | reg = var->yoffset | (info->var.yres_virtual << 16); | 620 | reg = var->yoffset | (var->yres_virtual << 16); |
621 | smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_HEIGHT); | 621 | smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_HEIGHT); |
622 | 622 | ||
623 | sm501fb_sync_regs(fbi); | 623 | sm501fb_sync_regs(fbi); |
@@ -1664,7 +1664,8 @@ static void sm501fb_stop(struct sm501fb_info *info) | |||
1664 | resource_size(info->regs_res)); | 1664 | resource_size(info->regs_res)); |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head, | 1667 | static int __devinit sm501fb_init_fb(struct fb_info *fb, |
1668 | enum sm501_controller head, | ||
1668 | const char *fbname) | 1669 | const char *fbname) |
1669 | { | 1670 | { |
1670 | struct sm501_platdata_fbsub *pd; | 1671 | struct sm501_platdata_fbsub *pd; |
@@ -1849,8 +1850,8 @@ static struct sm501_platdata_fb sm501fb_def_pdata = { | |||
1849 | static char driver_name_crt[] = "sm501fb-crt"; | 1850 | static char driver_name_crt[] = "sm501fb-crt"; |
1850 | static char driver_name_pnl[] = "sm501fb-panel"; | 1851 | static char driver_name_pnl[] = "sm501fb-panel"; |
1851 | 1852 | ||
1852 | static int sm501fb_probe_one(struct sm501fb_info *info, | 1853 | static int __devinit sm501fb_probe_one(struct sm501fb_info *info, |
1853 | enum sm501_controller head) | 1854 | enum sm501_controller head) |
1854 | { | 1855 | { |
1855 | unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel"; | 1856 | unsigned char *name = (head == HEAD_CRT) ? "crt" : "panel"; |
1856 | struct sm501_platdata_fbsub *pd; | 1857 | struct sm501_platdata_fbsub *pd; |
@@ -1891,8 +1892,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info, | |||
1891 | fb_dealloc_cmap(&fbi->cmap); | 1892 | fb_dealloc_cmap(&fbi->cmap); |
1892 | } | 1893 | } |
1893 | 1894 | ||
1894 | static int sm501fb_start_one(struct sm501fb_info *info, | 1895 | static int __devinit sm501fb_start_one(struct sm501fb_info *info, |
1895 | enum sm501_controller head, const char *drvname) | 1896 | enum sm501_controller head, |
1897 | const char *drvname) | ||
1896 | { | 1898 | { |
1897 | struct fb_info *fbi = info->fb[head]; | 1899 | struct fb_info *fbi = info->fb[head]; |
1898 | int ret; | 1900 | int ret; |
@@ -1920,7 +1922,7 @@ static int sm501fb_start_one(struct sm501fb_info *info, | |||
1920 | return 0; | 1922 | return 0; |
1921 | } | 1923 | } |
1922 | 1924 | ||
1923 | static int sm501fb_probe(struct platform_device *pdev) | 1925 | static int __devinit sm501fb_probe(struct platform_device *pdev) |
1924 | { | 1926 | { |
1925 | struct sm501fb_info *info; | 1927 | struct sm501fb_info *info; |
1926 | struct device *dev = &pdev->dev; | 1928 | struct device *dev = &pdev->dev; |
@@ -2228,7 +2230,18 @@ static struct platform_driver sm501fb_driver = { | |||
2228 | }, | 2230 | }, |
2229 | }; | 2231 | }; |
2230 | 2232 | ||
2231 | module_platform_driver(sm501fb_driver); | 2233 | static int __devinit sm501fb_init(void) |
2234 | { | ||
2235 | return platform_driver_register(&sm501fb_driver); | ||
2236 | } | ||
2237 | |||
2238 | static void __exit sm501fb_cleanup(void) | ||
2239 | { | ||
2240 | platform_driver_unregister(&sm501fb_driver); | ||
2241 | } | ||
2242 | |||
2243 | module_init(sm501fb_init); | ||
2244 | module_exit(sm501fb_cleanup); | ||
2232 | 2245 | ||
2233 | module_param_named(mode, fb_mode, charp, 0); | 2246 | module_param_named(mode, fb_mode, charp, 0); |
2234 | MODULE_PARM_DESC(mode, | 2247 | MODULE_PARM_DESC(mode, |