WIP FPC-III support
[linux/fpc-iii.git] / drivers / video / fbdev / omap / lcd_h3.c
blob1766dff767bb373bf86646ed24e02c9ffab1b358
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * LCD panel support for the TI OMAP H3 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>
11 #include <linux/mfd/tps65010.h>
12 #include <linux/gpio.h>
14 #include "omapfb.h"
16 #define MODULE_NAME "omapfb-lcd_h3"
18 static int h3_panel_enable(struct lcd_panel *panel)
20 int r = 0;
22 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
23 r = tps65010_set_gpio_out_value(GPIO1, HIGH);
24 if (!r)
25 r = tps65010_set_gpio_out_value(GPIO2, HIGH);
26 if (r)
27 pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
29 return r;
32 static void h3_panel_disable(struct lcd_panel *panel)
34 int r = 0;
36 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
37 r = tps65010_set_gpio_out_value(GPIO1, LOW);
38 if (!r)
39 tps65010_set_gpio_out_value(GPIO2, LOW);
40 if (r)
41 pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
44 static struct lcd_panel h3_panel = {
45 .name = "h3",
46 .config = OMAP_LCDC_PANEL_TFT,
48 .data_lines = 16,
49 .bpp = 16,
50 .x_res = 240,
51 .y_res = 320,
52 .pixel_clock = 12000,
53 .hsw = 12,
54 .hfp = 14,
55 .hbp = 72 - 12,
56 .vsw = 1,
57 .vfp = 1,
58 .vbp = 0,
59 .pcd = 0,
61 .enable = h3_panel_enable,
62 .disable = h3_panel_disable,
65 static int h3_panel_probe(struct platform_device *pdev)
67 omapfb_register_panel(&h3_panel);
68 return 0;
71 static struct platform_driver h3_panel_driver = {
72 .probe = h3_panel_probe,
73 .driver = {
74 .name = "lcd_h3",
78 module_platform_driver(h3_panel_driver);
80 MODULE_AUTHOR("Imre Deak");
81 MODULE_DESCRIPTION("LCD panel support for the TI OMAP H3 board");
82 MODULE_LICENSE("GPL");