Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / video / fbdev / omap / lcd_osk.c
blob5d5762128c8dc285f51d10d786a2e0a99c22d2f6
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * LCD panel support for the TI OMAP OSK board
5 * Copyright (C) 2004 Nokia Corporation
6 * Author: Imre Deak <imre.deak@nokia.com>
7 * Adapted for OSK by <dirk.behme@de.bosch.com>
8 */
10 #include <linux/module.h>
11 #include <linux/platform_device.h>
12 #include <linux/gpio.h>
14 #include <mach/hardware.h>
15 #include <mach/mux.h>
17 #include "omapfb.h"
19 static int osk_panel_enable(struct lcd_panel *panel)
21 /* configure PWL pin */
22 omap_cfg_reg(PWL);
24 /* Enable PWL unit */
25 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
27 /* Set PWL level */
28 omap_writeb(0xFF, OMAP_PWL_ENABLE);
30 /* set GPIO2 high (lcd power enabled) */
31 gpio_set_value(2, 1);
33 return 0;
36 static void osk_panel_disable(struct lcd_panel *panel)
38 /* Set PWL level to zero */
39 omap_writeb(0x00, OMAP_PWL_ENABLE);
41 /* Disable PWL unit */
42 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
44 /* set GPIO2 low */
45 gpio_set_value(2, 0);
48 static struct lcd_panel osk_panel = {
49 .name = "osk",
50 .config = OMAP_LCDC_PANEL_TFT,
52 .bpp = 16,
53 .data_lines = 16,
54 .x_res = 240,
55 .y_res = 320,
56 .pixel_clock = 12500,
57 .hsw = 40,
58 .hfp = 40,
59 .hbp = 72,
60 .vsw = 1,
61 .vfp = 1,
62 .vbp = 0,
63 .pcd = 12,
65 .enable = osk_panel_enable,
66 .disable = osk_panel_disable,
69 static int osk_panel_probe(struct platform_device *pdev)
71 omapfb_register_panel(&osk_panel);
72 return 0;
75 static struct platform_driver osk_panel_driver = {
76 .probe = osk_panel_probe,
77 .driver = {
78 .name = "lcd_osk",
82 module_platform_driver(osk_panel_driver);
84 MODULE_AUTHOR("Imre Deak");
85 MODULE_DESCRIPTION("LCD panel support for the TI OMAP OSK board");
86 MODULE_LICENSE("GPL");