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
18 #include <linux/module.h>
19 #include <linux/moduleparam.h>
20 #include <linux/kernel.h>
21 #include <linux/slab.h>
22 #include <linux/delay.h>
25 #include <linux/init.h>
26 #include <linux/ioport.h>
27 #include <linux/device.h>
28 #include <linux/dma-mapping.h>
29 #include <linux/uaccess.h>
30 #include <linux/workqueue.h>
31 #include <linux/string.h>
32 #include <linux/version.h>
33 #include <linux/proc_fs.h>
34 #include <linux/vmalloc.h>
35 #include <linux/debugfs.h>
37 #include "msm_fb_panel.h"
39 int panel_next_on(struct platform_device *pdev)
42 struct msm_fb_panel_data *pdata;
43 struct msm_fb_panel_data *next_pdata;
44 struct platform_device *next_pdev;
46 pdata = (struct msm_fb_panel_data *)pdev->dev.platform_data;
49 next_pdev = pdata->next;
52 (struct msm_fb_panel_data *)next_pdev->dev.
54 if ((next_pdata) && (next_pdata->on))
55 ret = next_pdata->on(next_pdev);
62 int panel_next_off(struct platform_device *pdev)
65 struct msm_fb_panel_data *pdata;
66 struct msm_fb_panel_data *next_pdata;
67 struct platform_device *next_pdev;
69 pdata = (struct msm_fb_panel_data *)pdev->dev.platform_data;
72 next_pdev = pdata->next;
75 (struct msm_fb_panel_data *)next_pdev->dev.
77 if ((next_pdata) && (next_pdata->on))
78 ret = next_pdata->off(next_pdev);
85 struct platform_device *msm_fb_device_alloc(struct msm_fb_panel_data *pdata,
88 struct platform_device *this_dev = NULL;
93 snprintf(dev_name, sizeof(dev_name), "ebi2_lcd");
97 snprintf(dev_name, sizeof(dev_name), "mddi");
101 snprintf(dev_name, sizeof(dev_name), "mddi_ext");
105 snprintf(dev_name, sizeof(dev_name), "tvenc");
110 snprintf(dev_name, sizeof(dev_name), "lcdc");
123 platform_device_alloc(dev_name, ((u32) type << 16) | (u32) id);
126 if (platform_device_add_data
127 (this_dev, pdata, sizeof(struct msm_fb_panel_data))) {
129 ("msm_fb_device_alloc: platform_device_add_data failed!\n");
130 platform_device_put(this_dev);