blob: 8d0cf68d2de330af489377f9a6b5c3700576f79d [file] [log] [blame]
Imre Deakd64ca862007-07-17 04:06:06 -07001/*
2 * LCD panel support for the TI OMAP1610 Innovator board
3 *
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Imre Deak <imre.deak@nokia.com>
6 *
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.
11 *
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.
16 *
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.
20 */
21
22#include <linux/module.h>
23#include <linux/platform_device.h>
24
Jingoo Hanf8bd4932012-01-26 19:32:34 +090025#include <linux/gpio.h>
Tomi Valkeinen91773a02009-08-03 15:06:36 +030026#include "omapfb.h"
Imre Deakd64ca862007-07-17 04:06:06 -070027
28#define MODULE_NAME "omapfb-lcd_h3"
29
Imre Deakd64ca862007-07-17 04:06:06 -070030static int innovator1610_panel_init(struct lcd_panel *panel,
31 struct omapfb_device *fbdev)
32{
33 int r = 0;
34
Jingoo Hanf8bd4932012-01-26 19:32:34 +090035 /* configure GPIO(14, 15) as outputs */
36 if (gpio_request_one(14, GPIOF_OUT_INIT_LOW, "lcd_en0")) {
Emil Medve1f7c8232007-10-16 23:29:48 -070037 pr_err(MODULE_NAME ": can't request GPIO 14\n");
Imre Deakd64ca862007-07-17 04:06:06 -070038 r = -1;
39 goto exit;
40 }
Jingoo Hanf8bd4932012-01-26 19:32:34 +090041 if (gpio_request_one(15, GPIOF_OUT_INIT_LOW, "lcd_en1")) {
Emil Medve1f7c8232007-10-16 23:29:48 -070042 pr_err(MODULE_NAME ": can't request GPIO 15\n");
David Brownell93a22f82008-10-15 22:03:15 -070043 gpio_free(14);
Imre Deakd64ca862007-07-17 04:06:06 -070044 r = -1;
45 goto exit;
46 }
Imre Deakd64ca862007-07-17 04:06:06 -070047exit:
48 return r;
49}
50
51static void innovator1610_panel_cleanup(struct lcd_panel *panel)
52{
David Brownell93a22f82008-10-15 22:03:15 -070053 gpio_free(15);
54 gpio_free(14);
Imre Deakd64ca862007-07-17 04:06:06 -070055}
56
57static int innovator1610_panel_enable(struct lcd_panel *panel)
58{
59 /* set GPIO14 and GPIO15 high */
David Brownell93a22f82008-10-15 22:03:15 -070060 gpio_set_value(14, 1);
61 gpio_set_value(15, 1);
Imre Deakd64ca862007-07-17 04:06:06 -070062 return 0;
63}
64
65static void innovator1610_panel_disable(struct lcd_panel *panel)
66{
67 /* set GPIO13, GPIO14 and GPIO15 low */
David Brownell93a22f82008-10-15 22:03:15 -070068 gpio_set_value(14, 0);
69 gpio_set_value(15, 0);
Imre Deakd64ca862007-07-17 04:06:06 -070070}
71
Lars-Peter Clausenb2c1e8a2017-01-30 17:39:49 +010072static struct lcd_panel innovator1610_panel = {
Imre Deakd64ca862007-07-17 04:06:06 -070073 .name = "inn1610",
74 .config = OMAP_LCDC_PANEL_TFT,
75
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,
88
89 .init = innovator1610_panel_init,
90 .cleanup = innovator1610_panel_cleanup,
91 .enable = innovator1610_panel_enable,
92 .disable = innovator1610_panel_disable,
Imre Deakd64ca862007-07-17 04:06:06 -070093};
94
95static int innovator1610_panel_probe(struct platform_device *pdev)
96{
97 omapfb_register_panel(&innovator1610_panel);
98 return 0;
99}
100
Axel Linf9905442011-12-09 09:37:57 +0800101static struct platform_driver innovator1610_panel_driver = {
Imre Deakd64ca862007-07-17 04:06:06 -0700102 .probe = innovator1610_panel_probe,
Imre Deakd64ca862007-07-17 04:06:06 -0700103 .driver = {
104 .name = "lcd_inn1610",
Imre Deakd64ca862007-07-17 04:06:06 -0700105 },
106};
107
Axel Linf806f9b2011-12-09 09:59:56 +0800108module_platform_driver(innovator1610_panel_driver);
Arnd Bergmann1bde9f22018-06-08 18:08:12 +0200109
110MODULE_AUTHOR("Imre Deak");
111MODULE_DESCRIPTION("LCD panel support for the TI OMAP1610 Innovator board");
112MODULE_LICENSE("GPL");