WIP FPC-III support
[linux/fpc-iii.git] / drivers / video / fbdev / omap / lcd_inn1610.c
blob901b28f35fab0491a022f57304e41d6c81a5eae4
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * LCD panel support for the TI OMAP1610 Innovator board
5 * Copyright (C) 2004 Nokia Corporation
6 * Author: Imre Deak <imre.deak@nokia.com>
7 */
9 #include <linux/module.h>
10 #include <linux/platform_device.h>
12 #include <linux/gpio.h>
13 #include "omapfb.h"
15 #define MODULE_NAME "omapfb-lcd_h3"
17 static int innovator1610_panel_init(struct lcd_panel *panel,
18 struct omapfb_device *fbdev)
20 int r = 0;
22 /* configure GPIO(14, 15) as outputs */
23 if (gpio_request_one(14, GPIOF_OUT_INIT_LOW, "lcd_en0")) {
24 pr_err(MODULE_NAME ": can't request GPIO 14\n");
25 r = -1;
26 goto exit;
28 if (gpio_request_one(15, GPIOF_OUT_INIT_LOW, "lcd_en1")) {
29 pr_err(MODULE_NAME ": can't request GPIO 15\n");
30 gpio_free(14);
31 r = -1;
32 goto exit;
34 exit:
35 return r;
38 static void innovator1610_panel_cleanup(struct lcd_panel *panel)
40 gpio_free(15);
41 gpio_free(14);
44 static int innovator1610_panel_enable(struct lcd_panel *panel)
46 /* set GPIO14 and GPIO15 high */
47 gpio_set_value(14, 1);
48 gpio_set_value(15, 1);
49 return 0;
52 static void innovator1610_panel_disable(struct lcd_panel *panel)
54 /* set GPIO13, GPIO14 and GPIO15 low */
55 gpio_set_value(14, 0);
56 gpio_set_value(15, 0);
59 static struct lcd_panel innovator1610_panel = {
60 .name = "inn1610",
61 .config = OMAP_LCDC_PANEL_TFT,
63 .bpp = 16,
64 .data_lines = 16,
65 .x_res = 320,
66 .y_res = 240,
67 .pixel_clock = 12500,
68 .hsw = 40,
69 .hfp = 40,
70 .hbp = 72,
71 .vsw = 1,
72 .vfp = 1,
73 .vbp = 0,
74 .pcd = 12,
76 .init = innovator1610_panel_init,
77 .cleanup = innovator1610_panel_cleanup,
78 .enable = innovator1610_panel_enable,
79 .disable = innovator1610_panel_disable,
82 static int innovator1610_panel_probe(struct platform_device *pdev)
84 omapfb_register_panel(&innovator1610_panel);
85 return 0;
88 static struct platform_driver innovator1610_panel_driver = {
89 .probe = innovator1610_panel_probe,
90 .driver = {
91 .name = "lcd_inn1610",
95 module_platform_driver(innovator1610_panel_driver);
97 MODULE_AUTHOR("Imre Deak");
98 MODULE_DESCRIPTION("LCD panel support for the TI OMAP1610 Innovator board");
99 MODULE_LICENSE("GPL");