Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
| 7 | */ |
| 8 | #include <linux/init.h> |
| 9 | #include <linux/platform_device.h> |
| 10 | |
| 11 | static struct resource __initdata sead3_lcd_resource = { |
| 12 | .start = 0x1f000400, |
| 13 | .end = 0x1f00041f, |
| 14 | .flags = IORESOURCE_MEM, |
| 15 | }; |
| 16 | |
| 17 | static __init int sead3_lcd_add(void) |
| 18 | { |
| 19 | struct platform_device *pdev; |
| 20 | int retval; |
| 21 | |
| 22 | /* SEAD-3 and Cobalt platforms use same display type. */ |
| 23 | pdev = platform_device_alloc("cobalt-lcd", -1); |
| 24 | if (!pdev) |
| 25 | return -ENOMEM; |
| 26 | |
| 27 | retval = platform_device_add_resources(pdev, &sead3_lcd_resource, 1); |
| 28 | if (retval) |
| 29 | goto err_free_device; |
| 30 | |
| 31 | retval = platform_device_add(pdev); |
| 32 | if (retval) |
| 33 | goto err_free_device; |
| 34 | |
| 35 | return 0; |
| 36 | |
| 37 | err_free_device: |
| 38 | platform_device_put(pdev); |
| 39 | |
| 40 | return retval; |
| 41 | } |
| 42 | |
| 43 | device_initcall(sead3_lcd_add); |