Linux 4.19.133
[linux/fpc-iii.git] / drivers / video / fbdev / omap / lcd_inn1610.c
blob8d0cf68d2de330af489377f9a6b5c3700576f79d
1 /*
2 * LCD panel support for the TI OMAP1610 Innovator board
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Imre Deak <imre.deak@nokia.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include <linux/module.h>
23 #include <linux/platform_device.h>
25 #include <linux/gpio.h>
26 #include "omapfb.h"
28 #define MODULE_NAME "omapfb-lcd_h3"
30 static int innovator1610_panel_init(struct lcd_panel *panel,
31 struct omapfb_device *fbdev)
33 int r = 0;
35 /* configure GPIO(14, 15) as outputs */
36 if (gpio_request_one(14, GPIOF_OUT_INIT_LOW, "lcd_en0")) {
37 pr_err(MODULE_NAME ": can't request GPIO 14\n");
38 r = -1;
39 goto exit;
41 if (gpio_request_one(15, GPIOF_OUT_INIT_LOW, "lcd_en1")) {
42 pr_err(MODULE_NAME ": can't request GPIO 15\n");
43 gpio_free(14);
44 r = -1;
45 goto exit;
47 exit:
48 return r;
51 static void innovator1610_panel_cleanup(struct lcd_panel *panel)
53 gpio_free(15);
54 gpio_free(14);
57 static int innovator1610_panel_enable(struct lcd_panel *panel)
59 /* set GPIO14 and GPIO15 high */
60 gpio_set_value(14, 1);
61 gpio_set_value(15, 1);
62 return 0;
65 static void innovator1610_panel_disable(struct lcd_panel *panel)
67 /* set GPIO13, GPIO14 and GPIO15 low */
68 gpio_set_value(14, 0);
69 gpio_set_value(15, 0);
72 static struct lcd_panel innovator1610_panel = {
73 .name = "inn1610",
74 .config = OMAP_LCDC_PANEL_TFT,
76 .bpp = 16,
77 .data_lines = 16,
78 .x_res = 320,
79 .y_res = 240,
80 .pixel_clock = 12500,
81 .hsw = 40,
82 .hfp = 40,
83 .hbp = 72,
84 .vsw = 1,
85 .vfp = 1,
86 .vbp = 0,
87 .pcd = 12,
89 .init = innovator1610_panel_init,
90 .cleanup = innovator1610_panel_cleanup,
91 .enable = innovator1610_panel_enable,
92 .disable = innovator1610_panel_disable,
95 static int innovator1610_panel_probe(struct platform_device *pdev)
97 omapfb_register_panel(&innovator1610_panel);
98 return 0;
101 static struct platform_driver innovator1610_panel_driver = {
102 .probe = innovator1610_panel_probe,
103 .driver = {
104 .name = "lcd_inn1610",
108 module_platform_driver(innovator1610_panel_driver);
110 MODULE_AUTHOR("Imre Deak");
111 MODULE_DESCRIPTION("LCD panel support for the TI OMAP1610 Innovator board");
112 MODULE_LICENSE("GPL");