2 * LCD panel support for the Gumstix Overo
4 * Author: Steve Sakoman <steve@sakoman.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include <linux/module.h>
23 #include <linux/platform_device.h>
24 #include <linux/i2c/twl.h>
28 #include <asm/mach-types.h>
32 #define LCD_ENABLE 144
34 static int overo_panel_init(struct lcd_panel
*panel
,
35 struct omapfb_device
*fbdev
)
37 if ((gpio_request(LCD_ENABLE
, "LCD_ENABLE") == 0) &&
38 (gpio_direction_output(LCD_ENABLE
, 1) == 0))
39 gpio_export(LCD_ENABLE
, 0);
41 printk(KERN_ERR
"could not obtain gpio for LCD_ENABLE\n");
46 static void overo_panel_cleanup(struct lcd_panel
*panel
)
48 gpio_free(LCD_ENABLE
);
51 static int overo_panel_enable(struct lcd_panel
*panel
)
53 gpio_set_value(LCD_ENABLE
, 1);
57 static void overo_panel_disable(struct lcd_panel
*panel
)
59 gpio_set_value(LCD_ENABLE
, 0);
62 static unsigned long overo_panel_get_caps(struct lcd_panel
*panel
)
67 struct lcd_panel overo_panel
= {
69 .config
= OMAP_LCDC_PANEL_TFT
,
73 #if defined CONFIG_FB_OMAP_031M3R
75 /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
86 #elif defined CONFIG_FB_OMAP_048M3R
88 /* 800 x 600 @ 60 Hz Reduced blanking VESA CVT 0.48M3-R */
99 #elif defined CONFIG_FB_OMAP_079M3R
101 /* 1024 x 768 @ 60 Hz Reduced blanking VESA CVT 0.79M3-R */
110 .pixel_clock
= 56000,
112 #elif defined CONFIG_FB_OMAP_092M9R
114 /* 1280 x 720 @ 60 Hz Reduced blanking VESA CVT 0.92M9-R */
123 .pixel_clock
= 64000,
127 /* use 640 x 480 if no config option */
128 /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
137 .pixel_clock
= 23500,
141 .init
= overo_panel_init
,
142 .cleanup
= overo_panel_cleanup
,
143 .enable
= overo_panel_enable
,
144 .disable
= overo_panel_disable
,
145 .get_caps
= overo_panel_get_caps
,
148 static int overo_panel_probe(struct platform_device
*pdev
)
150 omapfb_register_panel(&overo_panel
);
154 static int overo_panel_remove(struct platform_device
*pdev
)
156 /* omapfb does not have unregister_panel */
160 static struct platform_driver overo_panel_driver
= {
161 .probe
= overo_panel_probe
,
162 .remove
= overo_panel_remove
,
165 .owner
= THIS_MODULE
,
169 static int __init
overo_panel_drv_init(void)
171 return platform_driver_register(&overo_panel_driver
);
174 static void __exit
overo_panel_drv_exit(void)
176 platform_driver_unregister(&overo_panel_driver
);
179 module_init(overo_panel_drv_init
);
180 module_exit(overo_panel_drv_exit
);