|
24 | 24 | #include <linux/slab.h>
|
25 | 25 | #include <linux/stat.h>
|
26 | 26 | #include <linux/via-core.h>
|
| 27 | +#include <asm/olpc.h> |
27 | 28 |
|
28 | 29 | #define _MASTER_FILE
|
29 | 30 | #include "global.h"
|
@@ -1011,8 +1012,13 @@ static int __init parse_active_dev(void)
|
1011 | 1012 | /* Note: The previous of active_dev is primary device,
|
1012 | 1013 | and the following is secondary device. */
|
1013 | 1014 | if (!viafb_active_dev) {
|
1014 |
| - viafb_CRT_ON = STATE_ON; |
1015 |
| - viafb_SAMM_ON = STATE_OFF; |
| 1015 | + if (machine_is_olpc()) { /* LCD only */ |
| 1016 | + viafb_LCD_ON = STATE_ON; |
| 1017 | + viafb_SAMM_ON = STATE_OFF; |
| 1018 | + } else { |
| 1019 | + viafb_CRT_ON = STATE_ON; |
| 1020 | + viafb_SAMM_ON = STATE_OFF; |
| 1021 | + } |
1016 | 1022 | } else if (!strcmp(viafb_active_dev, "CRT+DVI")) {
|
1017 | 1023 | /* CRT+DVI */
|
1018 | 1024 | viafb_CRT_ON = STATE_ON;
|
@@ -1665,8 +1671,13 @@ static int parse_mode(const char *str, u32 *xres, u32 *yres)
|
1665 | 1671 | char *ptr;
|
1666 | 1672 |
|
1667 | 1673 | if (!str) {
|
1668 |
| - *xres = 640; |
1669 |
| - *yres = 480; |
| 1674 | + if (machine_is_olpc()) { |
| 1675 | + *xres = 1200; |
| 1676 | + *yres = 900; |
| 1677 | + } else { |
| 1678 | + *xres = 640; |
| 1679 | + *yres = 480; |
| 1680 | + } |
1670 | 1681 | return 0;
|
1671 | 1682 | }
|
1672 | 1683 |
|
@@ -1922,11 +1933,16 @@ void __devexit via_fb_pci_remove(struct pci_dev *pdev)
|
1922 | 1933 | }
|
1923 | 1934 |
|
1924 | 1935 | #ifndef MODULE
|
1925 |
| -static int __init viafb_setup(char *options) |
| 1936 | +static int __init viafb_setup(void) |
1926 | 1937 | {
|
1927 | 1938 | char *this_opt;
|
| 1939 | + char *options; |
| 1940 | + |
1928 | 1941 | DEBUG_MSG(KERN_INFO "viafb_setup!\n");
|
1929 | 1942 |
|
| 1943 | + if (fb_get_options("viafb", &options)) |
| 1944 | + return -ENODEV; |
| 1945 | + |
1930 | 1946 | if (!options || !*options)
|
1931 | 1947 | return 0;
|
1932 | 1948 |
|
@@ -2000,11 +2016,16 @@ static int __init viafb_setup(char *options)
|
2000 | 2016 | int __init viafb_init(void)
|
2001 | 2017 | {
|
2002 | 2018 | u32 dummy_x, dummy_y;
|
| 2019 | + int r; |
| 2020 | + |
| 2021 | + if (machine_is_olpc()) |
| 2022 | + /* Apply XO-1.5-specific configuration. */ |
| 2023 | + viafb_lcd_panel_id = 23; |
| 2024 | + |
2003 | 2025 | #ifndef MODULE
|
2004 |
| - char *option = NULL; |
2005 |
| - if (fb_get_options("viafb", &option)) |
2006 |
| - return -ENODEV; |
2007 |
| - viafb_setup(option); |
| 2026 | + r = viafb_setup(); |
| 2027 | + if (r < 0) |
| 2028 | + return r; |
2008 | 2029 | #endif
|
2009 | 2030 | if (parse_mode(viafb_mode, &dummy_x, &dummy_y)
|
2010 | 2031 | || !viafb_get_mode(dummy_x, dummy_y)
|
|
0 commit comments