Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * LCD panel support for the TI OMAP H3 board
0004  *
0005  * Copyright (C) 2004 Nokia Corporation
0006  * Author: Imre Deak <imre.deak@nokia.com>
0007  */
0008 
0009 #include <linux/module.h>
0010 #include <linux/platform_device.h>
0011 #include <linux/mfd/tps65010.h>
0012 #include <linux/gpio.h>
0013 
0014 #include "omapfb.h"
0015 
0016 #define MODULE_NAME "omapfb-lcd_h3"
0017 
0018 static int h3_panel_enable(struct lcd_panel *panel)
0019 {
0020     int r = 0;
0021 
0022     /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
0023     r = tps65010_set_gpio_out_value(GPIO1, HIGH);
0024     if (!r)
0025         r = tps65010_set_gpio_out_value(GPIO2, HIGH);
0026     if (r)
0027         pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
0028 
0029     return r;
0030 }
0031 
0032 static void h3_panel_disable(struct lcd_panel *panel)
0033 {
0034     int r = 0;
0035 
0036     /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
0037     r = tps65010_set_gpio_out_value(GPIO1, LOW);
0038     if (!r)
0039         tps65010_set_gpio_out_value(GPIO2, LOW);
0040     if (r)
0041         pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
0042 }
0043 
0044 static struct lcd_panel h3_panel = {
0045     .name       = "h3",
0046     .config     = OMAP_LCDC_PANEL_TFT,
0047 
0048     .data_lines = 16,
0049     .bpp        = 16,
0050     .x_res      = 240,
0051     .y_res      = 320,
0052     .pixel_clock    = 12000,
0053     .hsw        = 12,
0054     .hfp        = 14,
0055     .hbp        = 72 - 12,
0056     .vsw        = 1,
0057     .vfp        = 1,
0058     .vbp        = 0,
0059     .pcd        = 0,
0060 
0061     .enable     = h3_panel_enable,
0062     .disable    = h3_panel_disable,
0063 };
0064 
0065 static int h3_panel_probe(struct platform_device *pdev)
0066 {
0067     omapfb_register_panel(&h3_panel);
0068     return 0;
0069 }
0070 
0071 static struct platform_driver h3_panel_driver = {
0072     .probe      = h3_panel_probe,
0073     .driver     = {
0074         .name   = "lcd_h3",
0075     },
0076 };
0077 
0078 module_platform_driver(h3_panel_driver);
0079 
0080 MODULE_AUTHOR("Imre Deak");
0081 MODULE_DESCRIPTION("LCD panel support for the TI OMAP H3 board");
0082 MODULE_LICENSE("GPL");