Kyungmin Park | 28ff0c1 | 2009-09-22 16:46:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * LCD panel support for the Samsung OMAP2 Apollon board |
| 3 | * |
| 4 | * Copyright (C) 2005,2006 Samsung Electronics |
| 5 | * Author: Kyungmin Park <kyungmin.park@samsung.com> |
| 6 | * |
| 7 | * Derived from drivers/video/omap/lcd-h4.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License as published by the |
| 11 | * Free Software Foundation; either version 2 of the License, or (at your |
| 12 | * option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along |
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 22 | */ |
| 23 | |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> |
| 26 | |
| 27 | #include <mach/gpio.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 28 | #include <plat/mux.h> |
| 29 | #include <plat/omapfb.h> |
Kyungmin Park | 28ff0c1 | 2009-09-22 16:46:40 -0700 | [diff] [blame] | 30 | |
| 31 | /* #define USE_35INCH_LCD 1 */ |
| 32 | |
| 33 | static int apollon_panel_init(struct lcd_panel *panel, |
| 34 | struct omapfb_device *fbdev) |
| 35 | { |
| 36 | /* configure LCD PWR_EN */ |
| 37 | omap_cfg_reg(M21_242X_GPIO11); |
| 38 | return 0; |
| 39 | } |
| 40 | |
| 41 | static void apollon_panel_cleanup(struct lcd_panel *panel) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | static int apollon_panel_enable(struct lcd_panel *panel) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | static void apollon_panel_disable(struct lcd_panel *panel) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | static unsigned long apollon_panel_get_caps(struct lcd_panel *panel) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | struct lcd_panel apollon_panel = { |
| 60 | .name = "apollon", |
| 61 | .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | |
| 62 | OMAP_LCDC_INV_HSYNC, |
| 63 | |
| 64 | .bpp = 16, |
| 65 | .data_lines = 18, |
| 66 | #ifdef USE_35INCH_LCD |
| 67 | .x_res = 240, |
| 68 | .y_res = 320, |
| 69 | .hsw = 2, |
| 70 | .hfp = 3, |
| 71 | .hbp = 9, |
| 72 | .vsw = 4, |
| 73 | .vfp = 3, |
| 74 | .vbp = 5, |
| 75 | #else |
| 76 | .x_res = 480, |
| 77 | .y_res = 272, |
| 78 | .hsw = 41, |
| 79 | .hfp = 2, |
| 80 | .hbp = 2, |
| 81 | .vsw = 10, |
| 82 | .vfp = 2, |
| 83 | .vbp = 2, |
| 84 | #endif |
| 85 | .pixel_clock = 6250, |
| 86 | |
| 87 | .init = apollon_panel_init, |
| 88 | .cleanup = apollon_panel_cleanup, |
| 89 | .enable = apollon_panel_enable, |
| 90 | .disable = apollon_panel_disable, |
| 91 | .get_caps = apollon_panel_get_caps, |
| 92 | }; |
| 93 | |
| 94 | static int apollon_panel_probe(struct platform_device *pdev) |
| 95 | { |
| 96 | omapfb_register_panel(&apollon_panel); |
| 97 | return 0; |
| 98 | } |
| 99 | |
| 100 | static int apollon_panel_remove(struct platform_device *pdev) |
| 101 | { |
| 102 | return 0; |
| 103 | } |
| 104 | |
| 105 | static int apollon_panel_suspend(struct platform_device *pdev, |
| 106 | pm_message_t mesg) |
| 107 | { |
| 108 | return 0; |
| 109 | } |
| 110 | |
| 111 | static int apollon_panel_resume(struct platform_device *pdev) |
| 112 | { |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | struct platform_driver apollon_panel_driver = { |
| 117 | .probe = apollon_panel_probe, |
| 118 | .remove = apollon_panel_remove, |
| 119 | .suspend = apollon_panel_suspend, |
| 120 | .resume = apollon_panel_resume, |
| 121 | .driver = { |
| 122 | .name = "apollon_lcd", |
| 123 | .owner = THIS_MODULE, |
| 124 | }, |
| 125 | }; |
| 126 | |
| 127 | static int __init apollon_panel_drv_init(void) |
| 128 | { |
| 129 | return platform_driver_register(&apollon_panel_driver); |
| 130 | } |
| 131 | |
| 132 | static void __exit apollon_panel_drv_exit(void) |
| 133 | { |
| 134 | platform_driver_unregister(&apollon_panel_driver); |
| 135 | } |
| 136 | |
| 137 | module_init(apollon_panel_drv_init); |
| 138 | module_exit(apollon_panel_drv_exit); |