lcd_osk.c (1677B)
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * LCD panel support for the TI OMAP OSK board 4 * 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 */ 9 10#include <linux/module.h> 11#include <linux/platform_device.h> 12#include <linux/gpio.h> 13 14#include <linux/soc/ti/omap1-io.h> 15#include <linux/soc/ti/omap1-mux.h> 16 17#include "omapfb.h" 18 19static int osk_panel_enable(struct lcd_panel *panel) 20{ 21 /* configure PWL pin */ 22 omap_cfg_reg(PWL); 23 24 /* Enable PWL unit */ 25 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE); 26 27 /* Set PWL level */ 28 omap_writeb(0xFF, OMAP_PWL_ENABLE); 29 30 /* set GPIO2 high (lcd power enabled) */ 31 gpio_set_value(2, 1); 32 33 return 0; 34} 35 36static void osk_panel_disable(struct lcd_panel *panel) 37{ 38 /* Set PWL level to zero */ 39 omap_writeb(0x00, OMAP_PWL_ENABLE); 40 41 /* Disable PWL unit */ 42 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE); 43 44 /* set GPIO2 low */ 45 gpio_set_value(2, 0); 46} 47 48static struct lcd_panel osk_panel = { 49 .name = "osk", 50 .config = OMAP_LCDC_PANEL_TFT, 51 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, 64 65 .enable = osk_panel_enable, 66 .disable = osk_panel_disable, 67}; 68 69static int osk_panel_probe(struct platform_device *pdev) 70{ 71 omapfb_register_panel(&osk_panel); 72 return 0; 73} 74 75static struct platform_driver osk_panel_driver = { 76 .probe = osk_panel_probe, 77 .driver = { 78 .name = "lcd_osk", 79 }, 80}; 81 82module_platform_driver(osk_panel_driver); 83 84MODULE_AUTHOR("Imre Deak"); 85MODULE_DESCRIPTION("LCD panel support for the TI OMAP OSK board"); 86MODULE_LICENSE("GPL");