1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * LCD panel support for the TI OMAP1510 Innovator board
4 *
5 * Copyright (C) 2004 Nokia Corporation
6 * Author: Imre Deak <imre.deak@nokia.com>
7 */
8
9 #include <linux/module.h>
10 #include <linux/platform_device.h>
11 #include <linux/io.h>
12
13 #include <linux/soc/ti/omap1-soc.h>
14
15 #include "omapfb.h"
16
17 static void __iomem *omap1510_fpga_lcd_panel_control;
18
innovator1510_panel_enable(struct lcd_panel * panel)19 static int innovator1510_panel_enable(struct lcd_panel *panel)
20 {
21 __raw_writeb(0x7, omap1510_fpga_lcd_panel_control);
22 return 0;
23 }
24
innovator1510_panel_disable(struct lcd_panel * panel)25 static void innovator1510_panel_disable(struct lcd_panel *panel)
26 {
27 __raw_writeb(0x0, omap1510_fpga_lcd_panel_control);
28 }
29
30 static struct lcd_panel innovator1510_panel = {
31 .name = "inn1510",
32 .config = OMAP_LCDC_PANEL_TFT,
33
34 .bpp = 16,
35 .data_lines = 16,
36 .x_res = 240,
37 .y_res = 320,
38 .pixel_clock = 12500,
39 .hsw = 40,
40 .hfp = 40,
41 .hbp = 72,
42 .vsw = 1,
43 .vfp = 1,
44 .vbp = 0,
45 .pcd = 12,
46
47 .enable = innovator1510_panel_enable,
48 .disable = innovator1510_panel_disable,
49 };
50
innovator1510_panel_probe(struct platform_device * pdev)51 static int innovator1510_panel_probe(struct platform_device *pdev)
52 {
53 omap1510_fpga_lcd_panel_control = (void __iomem *)pdev->dev.platform_data;
54 omapfb_register_panel(&innovator1510_panel);
55 return 0;
56 }
57
58 static struct platform_driver innovator1510_panel_driver = {
59 .probe = innovator1510_panel_probe,
60 .driver = {
61 .name = "lcd_inn1510",
62 },
63 };
64
65 module_platform_driver(innovator1510_panel_driver);
66
67 MODULE_AUTHOR("Imre Deak");
68 MODULE_DESCRIPTION("LCD panel support for the TI OMAP1510 Innovator board");
69 MODULE_LICENSE("GPL");
70