Commit | Line | Data |
---|---|---|
9d200153 SM |
1 | /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License version 2 and | |
5 | * only version 2 as published by the Free Software Foundation. | |
6 | * | |
7 | * This program is distributed in the hope that it will be useful, | |
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | * GNU General Public License for more details. | |
11 | * | |
12 | * You should have received a copy of the GNU General Public License | |
13 | * along with this program; if not, write to the Free Software | |
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |
15 | * 02110-1301, USA. | |
16 | */ | |
17 | ||
18 | #include "msm_fb.h" | |
19 | ||
20 | static int lcdc_panel_on(struct platform_device *pdev) | |
21 | { | |
22 | return 0; | |
23 | } | |
24 | ||
25 | static int lcdc_panel_off(struct platform_device *pdev) | |
26 | { | |
27 | return 0; | |
28 | } | |
29 | ||
30 | static int __init lcdc_panel_probe(struct platform_device *pdev) | |
31 | { | |
32 | msm_fb_add_device(pdev); | |
33 | ||
34 | return 0; | |
35 | } | |
36 | ||
37 | static struct platform_driver this_driver = { | |
38 | .probe = lcdc_panel_probe, | |
39 | .driver = { | |
40 | .name = "lcdc_panel", | |
41 | }, | |
42 | }; | |
43 | ||
44 | static struct msm_fb_panel_data lcdc_panel_data = { | |
45 | .on = lcdc_panel_on, | |
46 | .off = lcdc_panel_off, | |
47 | }; | |
48 | ||
49 | static int lcdc_dev_id; | |
50 | ||
51 | int lcdc_device_register(struct msm_panel_info *pinfo) | |
52 | { | |
53 | struct platform_device *pdev = NULL; | |
54 | int ret; | |
55 | ||
56 | pdev = platform_device_alloc("lcdc_panel", ++lcdc_dev_id); | |
57 | if (!pdev) | |
58 | return -ENOMEM; | |
59 | ||
60 | lcdc_panel_data.panel_info = *pinfo; | |
61 | ret = platform_device_add_data(pdev, &lcdc_panel_data, | |
62 | sizeof(lcdc_panel_data)); | |
63 | if (ret) { | |
64 | printk(KERN_ERR | |
65 | "%s: platform_device_add_data failed!\n", __func__); | |
66 | goto err_device_put; | |
67 | } | |
68 | ||
69 | ret = platform_device_add(pdev); | |
70 | if (ret) { | |
71 | printk(KERN_ERR | |
72 | "%s: platform_device_register failed!\n", __func__); | |
73 | goto err_device_put; | |
74 | } | |
75 | ||
76 | return 0; | |
77 | ||
78 | err_device_put: | |
79 | platform_device_put(pdev); | |
80 | return ret; | |
81 | } | |
82 | ||
83 | static int __init lcdc_panel_init(void) | |
84 | { | |
85 | return platform_driver_register(&this_driver); | |
86 | } | |
87 | ||
88 | module_init(lcdc_panel_init); |