diff options
| -rw-r--r-- | arch/x86/kernel/olpc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c index 74726130259..edaf3fe8dc5 100644 --- a/arch/x86/kernel/olpc.c +++ b/arch/x86/kernel/olpc.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
| 18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
| 19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
| 20 | #include <linux/platform_device.h> | ||
| 20 | 21 | ||
| 21 | #include <asm/geode.h> | 22 | #include <asm/geode.h> |
| 22 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
| @@ -223,8 +224,25 @@ static bool __init platform_detect(void) | |||
| 223 | return true; | 224 | return true; |
| 224 | } | 225 | } |
| 225 | 226 | ||
| 227 | static int __init add_xo1_platform_devices(void) | ||
| 228 | { | ||
| 229 | struct platform_device *pdev; | ||
| 230 | |||
| 231 | pdev = platform_device_register_simple("xo1-rfkill", -1, NULL, 0); | ||
| 232 | if (IS_ERR(pdev)) | ||
| 233 | return PTR_ERR(pdev); | ||
| 234 | |||
| 235 | pdev = platform_device_register_simple("olpc-xo1", -1, NULL, 0); | ||
| 236 | if (IS_ERR(pdev)) | ||
| 237 | return PTR_ERR(pdev); | ||
| 238 | |||
| 239 | return 0; | ||
| 240 | } | ||
| 241 | |||
| 226 | static int __init olpc_init(void) | 242 | static int __init olpc_init(void) |
| 227 | { | 243 | { |
| 244 | int r = 0; | ||
| 245 | |||
| 228 | if (!olpc_ofw_present() || !platform_detect()) | 246 | if (!olpc_ofw_present() || !platform_detect()) |
| 229 | return 0; | 247 | return 0; |
| 230 | 248 | ||
| @@ -251,6 +269,12 @@ static int __init olpc_init(void) | |||
| 251 | olpc_platform_info.boardrev >> 4, | 269 | olpc_platform_info.boardrev >> 4, |
| 252 | olpc_platform_info.ecver); | 270 | olpc_platform_info.ecver); |
| 253 | 271 | ||
| 272 | if (olpc_platform_info.boardrev < olpc_board_pre(0xd0)) { /* XO-1 */ | ||
| 273 | r = add_xo1_platform_devices(); | ||
| 274 | if (r) | ||
| 275 | return r; | ||
| 276 | } | ||
| 277 | |||
| 254 | return 0; | 278 | return 0; |
| 255 | } | 279 | } |
| 256 | 280 | ||
