drm/radeon/kms: improve aux error handling
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / msm / lcdc_panel.c
blobb40974e1f27cb2dc52fd69c4781996136bce9af3
1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
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.
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.
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.
18 #include "msm_fb.h"
20 static int lcdc_panel_on(struct platform_device *pdev)
22 return 0;
25 static int lcdc_panel_off(struct platform_device *pdev)
27 return 0;
30 static int __init lcdc_panel_probe(struct platform_device *pdev)
32 msm_fb_add_device(pdev);
34 return 0;
37 static struct platform_driver this_driver = {
38 .probe = lcdc_panel_probe,
39 .driver = {
40 .name = "lcdc_panel",
44 static struct msm_fb_panel_data lcdc_panel_data = {
45 .on = lcdc_panel_on,
46 .off = lcdc_panel_off,
49 static int lcdc_dev_id;
51 int lcdc_device_register(struct msm_panel_info *pinfo)
53 struct platform_device *pdev = NULL;
54 int ret;
56 pdev = platform_device_alloc("lcdc_panel", ++lcdc_dev_id);
57 if (!pdev)
58 return -ENOMEM;
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;
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;
76 return 0;
78 err_device_put:
79 platform_device_put(pdev);
80 return ret;
83 static int __init lcdc_panel_init(void)
85 return platform_driver_register(&this_driver);
88 module_init(lcdc_panel_init);