aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap')
-rw-r--r--drivers/video/omap/Kconfig5
-rw-r--r--drivers/video/omap/Makefile1
-rw-r--r--drivers/video/omap/blizzard.c6
-rw-r--r--drivers/video/omap/dispc.c34
-rw-r--r--drivers/video/omap/hwa742.c7
-rw-r--r--drivers/video/omap/lcd_2430sdp.c9
-rw-r--r--drivers/video/omap/lcd_ams_delta.c102
-rw-r--r--drivers/video/omap/lcd_apollon.c5
-rw-r--r--drivers/video/omap/lcd_h3.c2
-rw-r--r--drivers/video/omap/lcd_h4.c2
-rw-r--r--drivers/video/omap/lcd_htcherald.c130
-rw-r--r--drivers/video/omap/lcd_inn1510.c4
-rw-r--r--drivers/video/omap/lcd_inn1610.c2
-rw-r--r--drivers/video/omap/lcd_ldp.c9
-rw-r--r--drivers/video/omap/lcd_mipid.c10
-rw-r--r--drivers/video/omap/lcd_omap2evm.c15
-rw-r--r--drivers/video/omap/lcd_omap3beagle.c8
-rw-r--r--drivers/video/omap/lcd_omap3evm.c15
-rw-r--r--drivers/video/omap/lcd_osk.c4
-rw-r--r--drivers/video/omap/lcd_overo.c7
-rw-r--r--drivers/video/omap/lcd_palmte.c4
-rw-r--r--drivers/video/omap/lcd_palmtt.c2
-rw-r--r--drivers/video/omap/lcd_palmz71.c2
-rw-r--r--drivers/video/omap/lcdc.c41
-rw-r--r--drivers/video/omap/omapfb.h229
-rw-r--r--drivers/video/omap/omapfb_main.c37
-rw-r--r--drivers/video/omap/rfbi.c7
-rw-r--r--drivers/video/omap/sossi.c5
28 files changed, 588 insertions, 116 deletions
diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig
index 551e3e9c4cbe..455c6055325d 100644
--- a/drivers/video/omap/Kconfig
+++ b/drivers/video/omap/Kconfig
@@ -1,6 +1,7 @@
1config FB_OMAP 1config FB_OMAP
2 tristate "OMAP frame buffer support (EXPERIMENTAL)" 2 tristate "OMAP frame buffer support (EXPERIMENTAL)"
3 depends on FB && ARCH_OMAP 3 depends on FB && ARCH_OMAP && (OMAP2_DSS = "n")
4
4 select FB_CFB_FILLRECT 5 select FB_CFB_FILLRECT
5 select FB_CFB_COPYAREA 6 select FB_CFB_COPYAREA
6 select FB_CFB_IMAGEBLIT 7 select FB_CFB_IMAGEBLIT
@@ -72,7 +73,7 @@ config FB_OMAP_LCD_MIPID
72 73
73config FB_OMAP_BOOTLOADER_INIT 74config FB_OMAP_BOOTLOADER_INIT
74 bool "Check bootloader initialization" 75 bool "Check bootloader initialization"
75 depends on FB_OMAP 76 depends on FB_OMAP || FB_OMAP2
76 help 77 help
77 Say Y here if you want to enable checking if the bootloader has 78 Say Y here if you want to enable checking if the bootloader has
78 already initialized the display controller. In this case the 79 already initialized the display controller. In this case the
diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile
index b63b198d1f03..49226a1b909e 100644
--- a/drivers/video/omap/Makefile
+++ b/drivers/video/omap/Makefile
@@ -35,6 +35,7 @@ objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
35objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o 35objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
36objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o 36objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
37objs-y$(CONFIG_MACH_OVERO) += lcd_overo.o 37objs-y$(CONFIG_MACH_OVERO) += lcd_overo.o
38objs-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o
38 39
39omapfb-objs := $(objs-yy) 40omapfb-objs := $(objs-yy)
40 41
diff --git a/drivers/video/omap/blizzard.c b/drivers/video/omap/blizzard.c
index 70dadf9d2334..2ffb34af4c59 100644
--- a/drivers/video/omap/blizzard.c
+++ b/drivers/video/omap/blizzard.c
@@ -26,10 +26,10 @@
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28 28
29#include <mach/dma.h> 29#include <plat/dma.h>
30#include <mach/omapfb.h> 30#include <plat/blizzard.h>
31#include <mach/blizzard.h>
32 31
32#include "omapfb.h"
33#include "dispc.h" 33#include "dispc.h"
34 34
35#define MODULE_NAME "blizzard" 35#define MODULE_NAME "blizzard"
diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
index f16e42154229..529483467abf 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -24,11 +24,13 @@
24#include <linux/vmalloc.h> 24#include <linux/vmalloc.h>
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/platform_device.h>
28#include <linux/slab.h>
27 29
28#include <mach/sram.h> 30#include <plat/sram.h>
29#include <mach/omapfb.h> 31#include <plat/board.h>
30#include <mach/board.h>
31 32
33#include "omapfb.h"
32#include "dispc.h" 34#include "dispc.h"
33 35
34#define MODULE_NAME "dispc" 36#define MODULE_NAME "dispc"
@@ -204,6 +206,7 @@ static u32 inline dispc_read_reg(int idx)
204/* Select RFBI or bypass mode */ 206/* Select RFBI or bypass mode */
205static void enable_rfbi_mode(int enable) 207static void enable_rfbi_mode(int enable)
206{ 208{
209 void __iomem *rfbi_control;
207 u32 l; 210 u32 l;
208 211
209 l = dispc_read_reg(DISPC_CONTROL); 212 l = dispc_read_reg(DISPC_CONTROL);
@@ -216,9 +219,15 @@ static void enable_rfbi_mode(int enable)
216 dispc_write_reg(DISPC_CONTROL, l); 219 dispc_write_reg(DISPC_CONTROL, l);
217 220
218 /* Set bypass mode in RFBI module */ 221 /* Set bypass mode in RFBI module */
219 l = __raw_readl(OMAP2_IO_ADDRESS(RFBI_CONTROL)); 222 rfbi_control = ioremap(RFBI_CONTROL, SZ_1K);
223 if (!rfbi_control) {
224 pr_err("Unable to ioremap rfbi_control\n");
225 return;
226 }
227 l = __raw_readl(rfbi_control);
220 l |= enable ? 0 : (1 << 1); 228 l |= enable ? 0 : (1 << 1);
221 __raw_writel(l, OMAP2_IO_ADDRESS(RFBI_CONTROL)); 229 __raw_writel(l, rfbi_control);
230 iounmap(rfbi_control);
222} 231}
223 232
224static void set_lcd_data_lines(int data_lines) 233static void set_lcd_data_lines(int data_lines)
@@ -907,20 +916,20 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
907 916
908static int get_dss_clocks(void) 917static int get_dss_clocks(void)
909{ 918{
910 dispc.dss_ick = clk_get(dispc.fbdev->dev, "ick"); 919 dispc.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
911 if (IS_ERR(dispc.dss_ick)) { 920 if (IS_ERR(dispc.dss_ick)) {
912 dev_err(dispc.fbdev->dev, "can't get ick\n"); 921 dev_err(dispc.fbdev->dev, "can't get ick\n");
913 return PTR_ERR(dispc.dss_ick); 922 return PTR_ERR(dispc.dss_ick);
914 } 923 }
915 924
916 dispc.dss1_fck = clk_get(dispc.fbdev->dev, "dss1_fck"); 925 dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
917 if (IS_ERR(dispc.dss1_fck)) { 926 if (IS_ERR(dispc.dss1_fck)) {
918 dev_err(dispc.fbdev->dev, "can't get dss1_fck\n"); 927 dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
919 clk_put(dispc.dss_ick); 928 clk_put(dispc.dss_ick);
920 return PTR_ERR(dispc.dss1_fck); 929 return PTR_ERR(dispc.dss1_fck);
921 } 930 }
922 931
923 dispc.dss_54m_fck = clk_get(dispc.fbdev->dev, "tv_fck"); 932 dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "tv_fck");
924 if (IS_ERR(dispc.dss_54m_fck)) { 933 if (IS_ERR(dispc.dss_54m_fck)) {
925 dev_err(dispc.fbdev->dev, "can't get tv_fck\n"); 934 dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
926 clk_put(dispc.dss_ick); 935 clk_put(dispc.dss_ick);
@@ -1367,6 +1376,7 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
1367 int r; 1376 int r;
1368 u32 l; 1377 u32 l;
1369 struct lcd_panel *panel = fbdev->panel; 1378 struct lcd_panel *panel = fbdev->panel;
1379 void __iomem *ram_fw_base;
1370 int tmo = 10000; 1380 int tmo = 10000;
1371 int skip_init = 0; 1381 int skip_init = 0;
1372 int i; 1382 int i;
@@ -1441,7 +1451,13 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
1441 } 1451 }
1442 1452
1443 /* L3 firewall setting: enable access to OCM RAM */ 1453 /* L3 firewall setting: enable access to OCM RAM */
1444 __raw_writel(0x402000b0, OMAP2_IO_ADDRESS(0x680050a0)); 1454 ram_fw_base = ioremap(0x68005000, SZ_1K);
1455 if (!ram_fw_base) {
1456 dev_err(dispc.fbdev->dev, "Cannot ioremap to enable OCM RAM\n");
1457 goto fail1;
1458 }
1459 __raw_writel(0x402000b0, ram_fw_base + 0xa0);
1460 iounmap(ram_fw_base);
1445 1461
1446 if ((r = alloc_palette_ram()) < 0) 1462 if ((r = alloc_palette_ram()) < 0)
1447 goto fail2; 1463 goto fail2;
diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
index ca51583ec98a..0016f77cd13f 100644
--- a/drivers/video/omap/hwa742.c
+++ b/drivers/video/omap/hwa742.c
@@ -25,10 +25,11 @@
25#include <linux/fb.h> 25#include <linux/fb.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/interrupt.h>
28 29
29#include <mach/dma.h> 30#include <plat/dma.h>
30#include <mach/omapfb.h> 31#include <plat/hwa742.h>
31#include <mach/hwa742.h> 32#include "omapfb.h"
32 33
33#define HWA742_REV_CODE_REG 0x0 34#define HWA742_REV_CODE_REG 0x0
34#define HWA742_CONFIG_REG 0x2 35#define HWA742_CONFIG_REG 0x2
diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c
index 393712b6f369..e3eccc9af78e 100644
--- a/drivers/video/omap/lcd_2430sdp.c
+++ b/drivers/video/omap/lcd_2430sdp.c
@@ -25,12 +25,13 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/i2c/twl4030.h> 28#include <linux/i2c/twl.h>
29 29
30#include <mach/mux.h> 30#include <plat/mux.h>
31#include <mach/omapfb.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33 32
33#include "omapfb.h"
34
34#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 35#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
35#define SDP2430_LCD_PANEL_ENABLE_GPIO 154 36#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
36#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 24 37#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 24
@@ -51,7 +52,7 @@ static unsigned enable_gpio;
51#define TWL4030_VPLL2_DEV_GRP 0x33 52#define TWL4030_VPLL2_DEV_GRP 0x33
52#define TWL4030_VPLL2_DEDICATED 0x36 53#define TWL4030_VPLL2_DEDICATED 0x36
53 54
54#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v) 55#define t2_out(c, r, v) twl_i2c_write_u8(c, r, v)
55 56
56 57
57static int sdp2430_panel_init(struct lcd_panel *panel, 58static int sdp2430_panel_init(struct lcd_panel *panel,
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 1f7439955e02..6978ae4ef83a 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -24,13 +24,80 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/lcd.h>
27 28
28#include <mach/board-ams-delta.h> 29#include <plat/board-ams-delta.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/omapfb.h> 31
32#include "omapfb.h"
31 33
32#define AMS_DELTA_DEFAULT_CONTRAST 112 34#define AMS_DELTA_DEFAULT_CONTRAST 112
33 35
36#define AMS_DELTA_MAX_CONTRAST 0x00FF
37#define AMS_DELTA_LCD_POWER 0x0100
38
39
40/* LCD class device section */
41
42static int ams_delta_lcd;
43
44static int ams_delta_lcd_set_power(struct lcd_device *dev, int power)
45{
46 if (power == FB_BLANK_UNBLANK) {
47 if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER)) {
48 omap_writeb(ams_delta_lcd & AMS_DELTA_MAX_CONTRAST,
49 OMAP_PWL_ENABLE);
50 omap_writeb(1, OMAP_PWL_CLK_ENABLE);
51 ams_delta_lcd |= AMS_DELTA_LCD_POWER;
52 }
53 } else {
54 if (ams_delta_lcd & AMS_DELTA_LCD_POWER) {
55 omap_writeb(0, OMAP_PWL_ENABLE);
56 omap_writeb(0, OMAP_PWL_CLK_ENABLE);
57 ams_delta_lcd &= ~AMS_DELTA_LCD_POWER;
58 }
59 }
60 return 0;
61}
62
63static int ams_delta_lcd_set_contrast(struct lcd_device *dev, int value)
64{
65 if ((value >= 0) && (value <= AMS_DELTA_MAX_CONTRAST)) {
66 omap_writeb(value, OMAP_PWL_ENABLE);
67 ams_delta_lcd &= ~AMS_DELTA_MAX_CONTRAST;
68 ams_delta_lcd |= value;
69 }
70 return 0;
71}
72
73#ifdef CONFIG_LCD_CLASS_DEVICE
74static int ams_delta_lcd_get_power(struct lcd_device *dev)
75{
76 if (ams_delta_lcd & AMS_DELTA_LCD_POWER)
77 return FB_BLANK_UNBLANK;
78 else
79 return FB_BLANK_POWERDOWN;
80}
81
82static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
83{
84 if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER))
85 return 0;
86
87 return ams_delta_lcd & AMS_DELTA_MAX_CONTRAST;
88}
89
90static struct lcd_ops ams_delta_lcd_ops = {
91 .get_power = ams_delta_lcd_get_power,
92 .set_power = ams_delta_lcd_set_power,
93 .get_contrast = ams_delta_lcd_get_contrast,
94 .set_contrast = ams_delta_lcd_set_contrast,
95};
96#endif
97
98
99/* omapfb panel section */
100
34static int ams_delta_panel_init(struct lcd_panel *panel, 101static int ams_delta_panel_init(struct lcd_panel *panel,
35 struct omapfb_device *fbdev) 102 struct omapfb_device *fbdev)
36{ 103{
@@ -47,10 +114,6 @@ static int ams_delta_panel_enable(struct lcd_panel *panel)
47 AMS_DELTA_LATCH2_LCD_NDISP); 114 AMS_DELTA_LATCH2_LCD_NDISP);
48 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 115 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
49 AMS_DELTA_LATCH2_LCD_VBLEN); 116 AMS_DELTA_LATCH2_LCD_VBLEN);
50
51 omap_writeb(1, OMAP_PWL_CLK_ENABLE);
52 omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP_PWL_ENABLE);
53
54 return 0; 117 return 0;
55} 118}
56 119
@@ -90,8 +153,31 @@ static struct lcd_panel ams_delta_panel = {
90 .get_caps = ams_delta_panel_get_caps, 153 .get_caps = ams_delta_panel_get_caps,
91}; 154};
92 155
156
157/* platform driver section */
158
93static int ams_delta_panel_probe(struct platform_device *pdev) 159static int ams_delta_panel_probe(struct platform_device *pdev)
94{ 160{
161 struct lcd_device *lcd_device = NULL;
162#ifdef CONFIG_LCD_CLASS_DEVICE
163 int ret;
164
165 lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL,
166 &ams_delta_lcd_ops);
167
168 if (IS_ERR(lcd_device)) {
169 ret = PTR_ERR(lcd_device);
170 dev_err(&pdev->dev, "failed to register device\n");
171 return ret;
172 }
173
174 platform_set_drvdata(pdev, lcd_device);
175 lcd_device->props.max_contrast = AMS_DELTA_MAX_CONTRAST;
176#endif
177
178 ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST);
179 ams_delta_lcd_set_power(lcd_device, FB_BLANK_UNBLANK);
180
95 omapfb_register_panel(&ams_delta_panel); 181 omapfb_register_panel(&ams_delta_panel);
96 return 0; 182 return 0;
97} 183}
@@ -123,12 +209,12 @@ struct platform_driver ams_delta_panel_driver = {
123 }, 209 },
124}; 210};
125 211
126static int ams_delta_panel_drv_init(void) 212static int __init ams_delta_panel_drv_init(void)
127{ 213{
128 return platform_driver_register(&ams_delta_panel_driver); 214 return platform_driver_register(&ams_delta_panel_driver);
129} 215}
130 216
131static void ams_delta_panel_drv_cleanup(void) 217static void __exit ams_delta_panel_drv_cleanup(void)
132{ 218{
133 platform_driver_unregister(&ams_delta_panel_driver); 219 platform_driver_unregister(&ams_delta_panel_driver);
134} 220}
diff --git a/drivers/video/omap/lcd_apollon.c b/drivers/video/omap/lcd_apollon.c
index 626ae3a532ff..2be94eb3bbf5 100644
--- a/drivers/video/omap/lcd_apollon.c
+++ b/drivers/video/omap/lcd_apollon.c
@@ -25,8 +25,9 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26 26
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/mux.h> 28#include <plat/mux.h>
29#include <mach/omapfb.h> 29
30#include "omapfb.h"
30 31
31/* #define USE_35INCH_LCD 1 */ 32/* #define USE_35INCH_LCD 1 */
32 33
diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
index 417ae5efa8bb..8df688748b5a 100644
--- a/drivers/video/omap/lcd_h3.c
+++ b/drivers/video/omap/lcd_h3.c
@@ -24,7 +24,7 @@
24#include <linux/i2c/tps65010.h> 24#include <linux/i2c/tps65010.h>
25 25
26#include <mach/gpio.h> 26#include <mach/gpio.h>
27#include <mach/omapfb.h> 27#include "omapfb.h"
28 28
29#define MODULE_NAME "omapfb-lcd_h3" 29#define MODULE_NAME "omapfb-lcd_h3"
30 30
diff --git a/drivers/video/omap/lcd_h4.c b/drivers/video/omap/lcd_h4.c
index 0c398bda7601..03a06a982750 100644
--- a/drivers/video/omap/lcd_h4.c
+++ b/drivers/video/omap/lcd_h4.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <mach/omapfb.h> 25#include "omapfb.h"
26 26
27static int h4_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) 27static int h4_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
28{ 28{
diff --git a/drivers/video/omap/lcd_htcherald.c b/drivers/video/omap/lcd_htcherald.c
new file mode 100644
index 000000000000..4802419da83b
--- /dev/null
+++ b/drivers/video/omap/lcd_htcherald.c
@@ -0,0 +1,130 @@
1/*
2 * File: drivers/video/omap/lcd-htcherald.c
3 *
4 * LCD panel support for the HTC Herald
5 *
6 * Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com>
7 * Copyright (C) 2009 Wing Linux
8 *
9 * Based on the lcd_htcwizard.c file from the linwizard project:
10 * Copyright (C) linwizard.sourceforge.net
11 * Author: Angelo Arrifano <miknix@gmail.com>
12 * Based on lcd_h4 by Imre Deak <imre.deak@nokia.com>
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29#include <linux/module.h>
30#include <linux/platform_device.h>
31
32#include "omapfb.h"
33
34static int htcherald_panel_init(struct lcd_panel *panel,
35 struct omapfb_device *fbdev)
36{
37 return 0;
38}
39
40static void htcherald_panel_cleanup(struct lcd_panel *panel)
41{
42}
43
44static int htcherald_panel_enable(struct lcd_panel *panel)
45{
46 return 0;
47}
48
49static void htcherald_panel_disable(struct lcd_panel *panel)
50{
51}
52
53static unsigned long htcherald_panel_get_caps(struct lcd_panel *panel)
54{
55 return 0;
56}
57
58/* Found on WIZ200 (miknix) and some HERA110 models (darkstar62) */
59struct lcd_panel htcherald_panel_1 = {
60 .name = "lcd_herald",
61 .config = OMAP_LCDC_PANEL_TFT |
62 OMAP_LCDC_INV_HSYNC |
63 OMAP_LCDC_INV_VSYNC |
64 OMAP_LCDC_INV_PIX_CLOCK,
65 .bpp = 16,
66 .data_lines = 16,
67 .x_res = 240,
68 .y_res = 320,
69 .pixel_clock = 6093,
70 .pcd = 0, /* 15 */
71 .hsw = 10,
72 .hfp = 10,
73 .hbp = 20,
74 .vsw = 3,
75 .vfp = 2,
76 .vbp = 2,
77
78 .init = htcherald_panel_init,
79 .cleanup = htcherald_panel_cleanup,
80 .enable = htcherald_panel_enable,
81 .disable = htcherald_panel_disable,
82 .get_caps = htcherald_panel_get_caps,
83};
84
85static int htcherald_panel_probe(struct platform_device *pdev)
86{
87 omapfb_register_panel(&htcherald_panel_1);
88 return 0;
89}
90
91static int htcherald_panel_remove(struct platform_device *pdev)
92{
93 return 0;
94}
95
96static int htcherald_panel_suspend(struct platform_device *pdev,
97 pm_message_t mesg)
98{
99 return 0;
100}
101
102static int htcherald_panel_resume(struct platform_device *pdev)
103{
104 return 0;
105}
106
107struct platform_driver htcherald_panel_driver = {
108 .probe = htcherald_panel_probe,
109 .remove = htcherald_panel_remove,
110 .suspend = htcherald_panel_suspend,
111 .resume = htcherald_panel_resume,
112 .driver = {
113 .name = "lcd_htcherald",
114 .owner = THIS_MODULE,
115 },
116};
117
118static int __init htcherald_panel_drv_init(void)
119{
120 return platform_driver_register(&htcherald_panel_driver);
121}
122
123static void __exit htcherald_panel_drv_cleanup(void)
124{
125 platform_driver_unregister(&htcherald_panel_driver);
126}
127
128module_init(htcherald_panel_drv_init);
129module_exit(htcherald_panel_drv_cleanup);
130
diff --git a/drivers/video/omap/lcd_inn1510.c b/drivers/video/omap/lcd_inn1510.c
index cdbd8bb607be..3271f1643b26 100644
--- a/drivers/video/omap/lcd_inn1510.c
+++ b/drivers/video/omap/lcd_inn1510.c
@@ -23,8 +23,8 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <mach/fpga.h> 26#include <plat/fpga.h>
27#include <mach/omapfb.h> 27#include "omapfb.h"
28 28
29static int innovator1510_panel_init(struct lcd_panel *panel, 29static int innovator1510_panel_init(struct lcd_panel *panel,
30 struct omapfb_device *fbdev) 30 struct omapfb_device *fbdev)
diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
index 268f7f808a4e..9fff86f67bde 100644
--- a/drivers/video/omap/lcd_inn1610.c
+++ b/drivers/video/omap/lcd_inn1610.c
@@ -23,7 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <mach/gpio.h> 25#include <mach/gpio.h>
26#include <mach/omapfb.h> 26#include "omapfb.h"
27 27
28#define MODULE_NAME "omapfb-lcd_h3" 28#define MODULE_NAME "omapfb-lcd_h3"
29 29
diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c
index dbfe8974fb94..0f5952cae85e 100644
--- a/drivers/video/omap/lcd_ldp.c
+++ b/drivers/video/omap/lcd_ldp.c
@@ -24,13 +24,14 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/i2c/twl4030.h> 27#include <linux/i2c/twl.h>
28 28
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <mach/mux.h> 30#include <plat/mux.h>
31#include <mach/omapfb.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33 32
33#include "omapfb.h"
34
34#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES) 35#define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
35#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) 36#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
36 37
@@ -58,7 +59,7 @@
58#define TWL4030_VPLL2_DEV_GRP 0x33 59#define TWL4030_VPLL2_DEV_GRP 0x33
59#define TWL4030_VPLL2_DEDICATED 0x36 60#define TWL4030_VPLL2_DEDICATED 0x36
60 61
61#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v) 62#define t2_out(c, r, v) twl_i2c_write_u8(c, r, v)
62 63
63 64
64static int ldp_panel_init(struct lcd_panel *panel, 65static int ldp_panel_init(struct lcd_panel *panel,
diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
index 918ee8934196..64dcc7439c99 100644
--- a/drivers/video/omap/lcd_mipid.c
+++ b/drivers/video/omap/lcd_mipid.c
@@ -20,11 +20,13 @@
20 */ 20 */
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/slab.h>
23#include <linux/workqueue.h> 24#include <linux/workqueue.h>
24#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
25 26
26#include <mach/omapfb.h> 27#include <plat/lcd_mipid.h>
27#include <mach/lcd_mipid.h> 28
29#include "omapfb.h"
28 30
29#define MIPID_MODULE_NAME "lcd_mipid" 31#define MIPID_MODULE_NAME "lcd_mipid"
30 32
@@ -607,7 +609,7 @@ static struct spi_driver mipid_spi_driver = {
607 .remove = __devexit_p(mipid_spi_remove), 609 .remove = __devexit_p(mipid_spi_remove),
608}; 610};
609 611
610static int mipid_drv_init(void) 612static int __init mipid_drv_init(void)
611{ 613{
612 spi_register_driver(&mipid_spi_driver); 614 spi_register_driver(&mipid_spi_driver);
613 615
@@ -615,7 +617,7 @@ static int mipid_drv_init(void)
615} 617}
616module_init(mipid_drv_init); 618module_init(mipid_drv_init);
617 619
618static void mipid_drv_cleanup(void) 620static void __exit mipid_drv_cleanup(void)
619{ 621{
620 spi_unregister_driver(&mipid_spi_driver); 622 spi_unregister_driver(&mipid_spi_driver);
621} 623}
diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c
index 7a2bbe2ecec3..7e7a65c08452 100644
--- a/drivers/video/omap/lcd_omap2evm.c
+++ b/drivers/video/omap/lcd_omap2evm.c
@@ -24,12 +24,13 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/i2c/twl4030.h> 27#include <linux/i2c/twl.h>
28 28
29#include <mach/mux.h> 29#include <plat/mux.h>
30#include <mach/omapfb.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32 31
32#include "omapfb.h"
33
33#define LCD_PANEL_ENABLE_GPIO 154 34#define LCD_PANEL_ENABLE_GPIO 154
34#define LCD_PANEL_LR 128 35#define LCD_PANEL_LR 128
35#define LCD_PANEL_UD 129 36#define LCD_PANEL_UD 129
@@ -60,9 +61,9 @@ static int omap2evm_panel_init(struct lcd_panel *panel,
60 gpio_direction_output(LCD_PANEL_LR, 1); 61 gpio_direction_output(LCD_PANEL_LR, 1);
61 gpio_direction_output(LCD_PANEL_UD, 1); 62 gpio_direction_output(LCD_PANEL_UD, 1);
62 63
63 twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN); 64 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN);
64 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON); 65 twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON);
65 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF); 66 twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF);
66 bklight_level = 100; 67 bklight_level = 100;
67 68
68 return 0; 69 return 0;
@@ -100,7 +101,7 @@ static int omap2evm_bklight_setlevel(struct lcd_panel *panel,
100 u8 c; 101 u8 c;
101 if ((level >= 0) && (level <= 100)) { 102 if ((level >= 0) && (level <= 100)) {
102 c = (125 * (100 - level)) / 100 + 2; 103 c = (125 * (100 - level)) / 100 + 2;
103 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF); 104 twl_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF);
104 bklight_level = level; 105 bklight_level = level;
105 } 106 }
106 return 0; 107 return 0;
diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
index 4011910123bf..ca75cc2a87a5 100644
--- a/drivers/video/omap/lcd_omap3beagle.c
+++ b/drivers/video/omap/lcd_omap3beagle.c
@@ -23,12 +23,14 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/i2c/twl4030.h> 26#include <linux/i2c/twl.h>
27 27
28#include <mach/mux.h> 28#include <plat/mux.h>
29#include <mach/omapfb.h> 29#include <plat/mux.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31 31
32#include "omapfb.h"
33
32#define LCD_PANEL_ENABLE_GPIO 170 34#define LCD_PANEL_ENABLE_GPIO 170
33 35
34static int omap3beagle_panel_init(struct lcd_panel *panel, 36static int omap3beagle_panel_init(struct lcd_panel *panel,
diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c
index b6a4c2c57a2f..06840da0b094 100644
--- a/drivers/video/omap/lcd_omap3evm.c
+++ b/drivers/video/omap/lcd_omap3evm.c
@@ -23,12 +23,13 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/i2c/twl4030.h> 26#include <linux/i2c/twl.h>
27 27
28#include <mach/mux.h> 28#include <plat/mux.h>
29#include <mach/omapfb.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31 30
31#include "omapfb.h"
32
32#define LCD_PANEL_ENABLE_GPIO 153 33#define LCD_PANEL_ENABLE_GPIO 153
33#define LCD_PANEL_LR 2 34#define LCD_PANEL_LR 2
34#define LCD_PANEL_UD 3 35#define LCD_PANEL_UD 3
@@ -62,9 +63,9 @@ static int omap3evm_panel_init(struct lcd_panel *panel,
62 gpio_direction_output(LCD_PANEL_LR, 1); 63 gpio_direction_output(LCD_PANEL_LR, 1);
63 gpio_direction_output(LCD_PANEL_UD, 1); 64 gpio_direction_output(LCD_PANEL_UD, 1);
64 65
65 twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN); 66 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN);
66 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON); 67 twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON);
67 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF); 68 twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF);
68 bklight_level = 100; 69 bklight_level = 100;
69 70
70 return 0; 71 return 0;
@@ -101,7 +102,7 @@ static int omap3evm_bklight_setlevel(struct lcd_panel *panel,
101 u8 c; 102 u8 c;
102 if ((level >= 0) && (level <= 100)) { 103 if ((level >= 0) && (level <= 100)) {
103 c = (125 * (100 - level)) / 100 + 2; 104 c = (125 * (100 - level)) / 100 + 2;
104 twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF); 105 twl_i2c_write_u8(TWL4030_MODULE_PWMA, c, TWL_PWMA_PWMAOFF);
105 bklight_level = level; 106 bklight_level = level;
106 } 107 }
107 return 0; 108 return 0;
diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
index b3fa88bc6269..b87e8b83f29c 100644
--- a/drivers/video/omap/lcd_osk.c
+++ b/drivers/video/omap/lcd_osk.c
@@ -24,8 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25 25
26#include <mach/gpio.h> 26#include <mach/gpio.h>
27#include <mach/mux.h> 27#include <plat/mux.h>
28#include <mach/omapfb.h> 28#include "omapfb.h"
29 29
30static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) 30static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
31{ 31{
diff --git a/drivers/video/omap/lcd_overo.c b/drivers/video/omap/lcd_overo.c
index 2bc5c9268e5e..564933ffac6e 100644
--- a/drivers/video/omap/lcd_overo.c
+++ b/drivers/video/omap/lcd_overo.c
@@ -21,13 +21,14 @@
21 21
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/i2c/twl4030.h> 24#include <linux/i2c/twl.h>
25 25
26#include <mach/gpio.h> 26#include <mach/gpio.h>
27#include <mach/mux.h> 27#include <plat/mux.h>
28#include <mach/omapfb.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30 29
30#include "omapfb.h"
31
31#define LCD_ENABLE 144 32#define LCD_ENABLE 144
32 33
33static int overo_panel_init(struct lcd_panel *panel, 34static int overo_panel_init(struct lcd_panel *panel,
diff --git a/drivers/video/omap/lcd_palmte.c b/drivers/video/omap/lcd_palmte.c
index 4bf3c79f3cc7..4cb301750d02 100644
--- a/drivers/video/omap/lcd_palmte.c
+++ b/drivers/video/omap/lcd_palmte.c
@@ -23,8 +23,8 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <mach/fpga.h> 26#include <plat/fpga.h>
27#include <mach/omapfb.h> 27#include "omapfb.h"
28 28
29static int palmte_panel_init(struct lcd_panel *panel, 29static int palmte_panel_init(struct lcd_panel *panel,
30 struct omapfb_device *fbdev) 30 struct omapfb_device *fbdev)
diff --git a/drivers/video/omap/lcd_palmtt.c b/drivers/video/omap/lcd_palmtt.c
index 48ea1f9f2cbf..ff0e6d7ab3a2 100644
--- a/drivers/video/omap/lcd_palmtt.c
+++ b/drivers/video/omap/lcd_palmtt.c
@@ -30,7 +30,7 @@ GPIO13 - screen blanking
30#include <linux/io.h> 30#include <linux/io.h>
31 31
32#include <mach/gpio.h> 32#include <mach/gpio.h>
33#include <mach/omapfb.h> 33#include "omapfb.h"
34 34
35static int palmtt_panel_init(struct lcd_panel *panel, 35static int palmtt_panel_init(struct lcd_panel *panel,
36 struct omapfb_device *fbdev) 36 struct omapfb_device *fbdev)
diff --git a/drivers/video/omap/lcd_palmz71.c b/drivers/video/omap/lcd_palmz71.c
index 0697d29b4d3b..2334e56536bc 100644
--- a/drivers/video/omap/lcd_palmz71.c
+++ b/drivers/video/omap/lcd_palmz71.c
@@ -24,7 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/omapfb.h> 27#include "omapfb.h"
28 28
29static int palmz71_panel_init(struct lcd_panel *panel, 29static int palmz71_panel_init(struct lcd_panel *panel,
30 struct omapfb_device *fbdev) 30 struct omapfb_device *fbdev)
diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
index ab3949256677..43ab7d8b66b2 100644
--- a/drivers/video/omap/lcdc.c
+++ b/drivers/video/omap/lcdc.c
@@ -28,48 +28,19 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/vmalloc.h> 29#include <linux/vmalloc.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/gfp.h>
31 32
32#include <mach/dma.h> 33#include <mach/lcdc.h>
33#include <mach/omapfb.h> 34#include <plat/dma.h>
34 35
35#include <asm/mach-types.h> 36#include <asm/mach-types.h>
36 37
38#include "omapfb.h"
39
37#include "lcdc.h" 40#include "lcdc.h"
38 41
39#define MODULE_NAME "lcdc" 42#define MODULE_NAME "lcdc"
40 43
41#define OMAP_LCDC_BASE 0xfffec000
42#define OMAP_LCDC_SIZE 256
43#define OMAP_LCDC_IRQ INT_LCD_CTRL
44
45#define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00)
46#define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04)
47#define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08)
48#define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c)
49#define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10)
50#define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14)
51#define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18)
52#define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c)
53
54#define OMAP_LCDC_STAT_DONE (1 << 0)
55#define OMAP_LCDC_STAT_VSYNC (1 << 1)
56#define OMAP_LCDC_STAT_SYNC_LOST (1 << 2)
57#define OMAP_LCDC_STAT_ABC (1 << 3)
58#define OMAP_LCDC_STAT_LINE_INT (1 << 4)
59#define OMAP_LCDC_STAT_FUF (1 << 5)
60#define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6)
61
62#define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
63#define OMAP_LCDC_CTRL_LCD_TFT (1 << 7)
64#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10)
65
66#define OMAP_LCDC_IRQ_VSYNC (1 << 2)
67#define OMAP_LCDC_IRQ_DONE (1 << 3)
68#define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4)
69#define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5)
70#define OMAP_LCDC_IRQ_LINE (1 << 6)
71#define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2)
72
73#define MAX_PALETTE_SIZE PAGE_SIZE 44#define MAX_PALETTE_SIZE PAGE_SIZE
74 45
75enum lcdc_load_mode { 46enum lcdc_load_mode {
@@ -419,7 +390,7 @@ static int omap_lcdc_enable_plane(int plane, int enable)
419/* 390/*
420 * Configure the LCD DMA for a palette load operation and do the palette 391 * Configure the LCD DMA for a palette load operation and do the palette
421 * downloading synchronously. We don't use the frame+palette load mode of 392 * downloading synchronously. We don't use the frame+palette load mode of
422 * the controller, since the palette can always be downloaded seperately. 393 * the controller, since the palette can always be downloaded separately.
423 */ 394 */
424static void load_palette(void) 395static void load_palette(void)
425{ 396{
diff --git a/drivers/video/omap/omapfb.h b/drivers/video/omap/omapfb.h
new file mode 100644
index 000000000000..af3c9e571ec3
--- /dev/null
+++ b/drivers/video/omap/omapfb.h
@@ -0,0 +1,229 @@
1/*
2 * File: drivers/video/omap/omapfb.h
3 *
4 * Framebuffer driver for TI OMAP boards
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __OMAPFB_H
25#define __OMAPFB_H
26
27#include <linux/fb.h>
28#include <linux/mutex.h>
29#include <linux/omapfb.h>
30
31#define OMAPFB_EVENT_READY 1
32#define OMAPFB_EVENT_DISABLED 2
33
34#define OMAP_LCDC_INV_VSYNC 0x0001
35#define OMAP_LCDC_INV_HSYNC 0x0002
36#define OMAP_LCDC_INV_PIX_CLOCK 0x0004
37#define OMAP_LCDC_INV_OUTPUT_EN 0x0008
38#define OMAP_LCDC_HSVS_RISING_EDGE 0x0010
39#define OMAP_LCDC_HSVS_OPPOSITE 0x0020
40
41#define OMAP_LCDC_SIGNAL_MASK 0x003f
42
43#define OMAP_LCDC_PANEL_TFT 0x0100
44
45#define OMAPFB_PLANE_XRES_MIN 8
46#define OMAPFB_PLANE_YRES_MIN 8
47
48struct omapfb_device;
49
50struct lcd_panel {
51 const char *name;
52 int config; /* TFT/STN, signal inversion */
53 int bpp; /* Pixel format in fb mem */
54 int data_lines; /* Lines on LCD HW interface */
55
56 int x_res, y_res;
57 int pixel_clock; /* In kHz */
58 int hsw; /* Horizontal synchronization
59 pulse width */
60 int hfp; /* Horizontal front porch */
61 int hbp; /* Horizontal back porch */
62 int vsw; /* Vertical synchronization
63 pulse width */
64 int vfp; /* Vertical front porch */
65 int vbp; /* Vertical back porch */
66 int acb; /* ac-bias pin frequency */
67 int pcd; /* pixel clock divider.
68 Obsolete use pixel_clock instead */
69
70 int (*init) (struct lcd_panel *panel,
71 struct omapfb_device *fbdev);
72 void (*cleanup) (struct lcd_panel *panel);
73 int (*enable) (struct lcd_panel *panel);
74 void (*disable) (struct lcd_panel *panel);
75 unsigned long (*get_caps) (struct lcd_panel *panel);
76 int (*set_bklight_level)(struct lcd_panel *panel,
77 unsigned int level);
78 unsigned int (*get_bklight_level)(struct lcd_panel *panel);
79 unsigned int (*get_bklight_max) (struct lcd_panel *panel);
80 int (*run_test) (struct lcd_panel *panel, int test_num);
81};
82
83struct extif_timings {
84 int cs_on_time;
85 int cs_off_time;
86 int we_on_time;
87 int we_off_time;
88 int re_on_time;
89 int re_off_time;
90 int we_cycle_time;
91 int re_cycle_time;
92 int cs_pulse_width;
93 int access_time;
94
95 int clk_div;
96
97 u32 tim[5]; /* set by extif->convert_timings */
98
99 int converted;
100};
101
102struct lcd_ctrl_extif {
103 int (*init) (struct omapfb_device *fbdev);
104 void (*cleanup) (void);
105 void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
106 unsigned long (*get_max_tx_rate)(void);
107 int (*convert_timings) (struct extif_timings *timings);
108 void (*set_timings) (const struct extif_timings *timings);
109 void (*set_bits_per_cycle)(int bpc);
110 void (*write_command) (const void *buf, unsigned int len);
111 void (*read_data) (void *buf, unsigned int len);
112 void (*write_data) (const void *buf, unsigned int len);
113 void (*transfer_area) (int width, int height,
114 void (callback)(void *data), void *data);
115 int (*setup_tearsync) (unsigned pin_cnt,
116 unsigned hs_pulse_time, unsigned vs_pulse_time,
117 int hs_pol_inv, int vs_pol_inv, int div);
118 int (*enable_tearsync) (int enable, unsigned line);
119
120 unsigned long max_transmit_size;
121};
122
123struct omapfb_notifier_block {
124 struct notifier_block nb;
125 void *data;
126 int plane_idx;
127};
128
129typedef int (*omapfb_notifier_callback_t)(struct notifier_block *,
130 unsigned long event,
131 void *fbi);
132
133struct lcd_ctrl {
134 const char *name;
135 void *data;
136
137 int (*init) (struct omapfb_device *fbdev,
138 int ext_mode,
139 struct omapfb_mem_desc *req_md);
140 void (*cleanup) (void);
141 void (*bind_client) (struct omapfb_notifier_block *nb);
142 void (*get_caps) (int plane, struct omapfb_caps *caps);
143 int (*set_update_mode)(enum omapfb_update_mode mode);
144 enum omapfb_update_mode (*get_update_mode)(void);
145 int (*setup_plane) (int plane, int channel_out,
146 unsigned long offset,
147 int screen_width,
148 int pos_x, int pos_y, int width,
149 int height, int color_mode);
150 int (*set_rotate) (int angle);
151 int (*setup_mem) (int plane, size_t size,
152 int mem_type, unsigned long *paddr);
153 int (*mmap) (struct fb_info *info,
154 struct vm_area_struct *vma);
155 int (*set_scale) (int plane,
156 int orig_width, int orig_height,
157 int out_width, int out_height);
158 int (*enable_plane) (int plane, int enable);
159 int (*update_window) (struct fb_info *fbi,
160 struct omapfb_update_window *win,
161 void (*callback)(void *),
162 void *callback_data);
163 void (*sync) (void);
164 void (*suspend) (void);
165 void (*resume) (void);
166 int (*run_test) (int test_num);
167 int (*setcolreg) (u_int regno, u16 red, u16 green,
168 u16 blue, u16 transp,
169 int update_hw_mem);
170 int (*set_color_key) (struct omapfb_color_key *ck);
171 int (*get_color_key) (struct omapfb_color_key *ck);
172};
173
174enum omapfb_state {
175 OMAPFB_DISABLED = 0,
176 OMAPFB_SUSPENDED = 99,
177 OMAPFB_ACTIVE = 100
178};
179
180struct omapfb_plane_struct {
181 int idx;
182 struct omapfb_plane_info info;
183 enum omapfb_color_format color_mode;
184 struct omapfb_device *fbdev;
185};
186
187struct omapfb_device {
188 int state;
189 int ext_lcdc; /* Using external
190 LCD controller */
191 struct mutex rqueue_mutex;
192
193 int palette_size;
194 u32 pseudo_palette[17];
195
196 struct lcd_panel *panel; /* LCD panel */
197 const struct lcd_ctrl *ctrl; /* LCD controller */
198 const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
199 struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
200 interface */
201 struct device *dev;
202 struct fb_var_screeninfo new_var; /* for mode changes */
203
204 struct omapfb_mem_desc mem_desc;
205 struct fb_info *fb_info[OMAPFB_PLANE_NUM];
206
207 struct platform_device *dssdev; /* dummy dev for clocks */
208};
209
210#ifdef CONFIG_ARCH_OMAP1
211extern struct lcd_ctrl omap1_lcd_ctrl;
212#else
213extern struct lcd_ctrl omap2_disp_ctrl;
214#endif
215
216extern void omapfb_register_panel(struct lcd_panel *panel);
217extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
218extern void omapfb_notify_clients(struct omapfb_device *fbdev,
219 unsigned long event);
220extern int omapfb_register_client(struct omapfb_notifier_block *nb,
221 omapfb_notifier_callback_t callback,
222 void *callback_data);
223extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
224extern int omapfb_update_window_async(struct fb_info *fbi,
225 struct omapfb_update_window *win,
226 void (*callback)(void *),
227 void *callback_data);
228
229#endif /* __OMAPFB_H */
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 0d0c8c8b9b56..e264efd0278f 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -26,11 +26,12 @@
26 */ 26 */
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/slab.h>
29#include <linux/uaccess.h> 30#include <linux/uaccess.h>
30 31
31#include <mach/dma.h> 32#include <plat/dma.h>
32#include <mach/omapfb.h>
33 33
34#include "omapfb.h"
34#include "lcdc.h" 35#include "lcdc.h"
35#include "dispc.h" 36#include "dispc.h"
36 37
@@ -83,6 +84,19 @@ static struct caps_table_struct color_caps[] = {
83 { 1 << OMAPFB_COLOR_YUY422, "YUY422", }, 84 { 1 << OMAPFB_COLOR_YUY422, "YUY422", },
84}; 85};
85 86
87static void omapdss_release(struct device *dev)
88{
89}
90
91/* dummy device for clocks */
92static struct platform_device omapdss_device = {
93 .name = "omapdss",
94 .id = -1,
95 .dev = {
96 .release = omapdss_release,
97 },
98};
99
86/* 100/*
87 * --------------------------------------------------------------------------- 101 * ---------------------------------------------------------------------------
88 * LCD panel 102 * LCD panel
@@ -473,10 +487,11 @@ static int set_color_mode(struct omapfb_plane_struct *plane,
473 return 0; 487 return 0;
474 case 12: 488 case 12:
475 var->bits_per_pixel = 16; 489 var->bits_per_pixel = 16;
476 plane->color_mode = OMAPFB_COLOR_RGB444;
477 return 0;
478 case 16: 490 case 16:
479 plane->color_mode = OMAPFB_COLOR_RGB565; 491 if (plane->fbdev->panel->bpp == 12)
492 plane->color_mode = OMAPFB_COLOR_RGB444;
493 else
494 plane->color_mode = OMAPFB_COLOR_RGB565;
480 return 0; 495 return 0;
481 default: 496 default:
482 return -EINVAL; 497 return -EINVAL;
@@ -1700,6 +1715,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
1700 1715
1701 fbdev->dev = &pdev->dev; 1716 fbdev->dev = &pdev->dev;
1702 fbdev->panel = panel; 1717 fbdev->panel = panel;
1718 fbdev->dssdev = &omapdss_device;
1703 platform_set_drvdata(pdev, fbdev); 1719 platform_set_drvdata(pdev, fbdev);
1704 1720
1705 mutex_init(&fbdev->rqueue_mutex); 1721 mutex_init(&fbdev->rqueue_mutex);
@@ -1814,8 +1830,16 @@ cleanup:
1814 1830
1815static int omapfb_probe(struct platform_device *pdev) 1831static int omapfb_probe(struct platform_device *pdev)
1816{ 1832{
1833 int r;
1834
1817 BUG_ON(fbdev_pdev != NULL); 1835 BUG_ON(fbdev_pdev != NULL);
1818 1836
1837 r = platform_device_register(&omapdss_device);
1838 if (r) {
1839 dev_err(&pdev->dev, "can't register omapdss device\n");
1840 return r;
1841 }
1842
1819 /* Delay actual initialization until the LCD is registered */ 1843 /* Delay actual initialization until the LCD is registered */
1820 fbdev_pdev = pdev; 1844 fbdev_pdev = pdev;
1821 if (fbdev_panel != NULL) 1845 if (fbdev_panel != NULL)
@@ -1843,6 +1867,9 @@ static int omapfb_remove(struct platform_device *pdev)
1843 fbdev->state = OMAPFB_DISABLED; 1867 fbdev->state = OMAPFB_DISABLED;
1844 omapfb_free_resources(fbdev, saved_state); 1868 omapfb_free_resources(fbdev, saved_state);
1845 1869
1870 platform_device_unregister(&omapdss_device);
1871 fbdev->dssdev = NULL;
1872
1846 return 0; 1873 return 0;
1847} 1874}
1848 1875
diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c
index ee01e84e19c1..1162603c72e5 100644
--- a/drivers/video/omap/rfbi.c
+++ b/drivers/video/omap/rfbi.c
@@ -27,8 +27,7 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <mach/omapfb.h> 30#include "omapfb.h"
31
32#include "dispc.h" 31#include "dispc.h"
33 32
34/* To work around an RFBI transfer rate limitation */ 33/* To work around an RFBI transfer rate limitation */
@@ -84,13 +83,13 @@ static inline u32 rfbi_read_reg(int idx)
84 83
85static int rfbi_get_clocks(void) 84static int rfbi_get_clocks(void)
86{ 85{
87 rfbi.dss_ick = clk_get(rfbi.fbdev->dev, "ick"); 86 rfbi.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
88 if (IS_ERR(rfbi.dss_ick)) { 87 if (IS_ERR(rfbi.dss_ick)) {
89 dev_err(rfbi.fbdev->dev, "can't get ick\n"); 88 dev_err(rfbi.fbdev->dev, "can't get ick\n");
90 return PTR_ERR(rfbi.dss_ick); 89 return PTR_ERR(rfbi.dss_ick);
91 } 90 }
92 91
93 rfbi.dss1_fck = clk_get(rfbi.fbdev->dev, "dss1_fck"); 92 rfbi.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
94 if (IS_ERR(rfbi.dss1_fck)) { 93 if (IS_ERR(rfbi.dss1_fck)) {
95 dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n"); 94 dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
96 clk_put(rfbi.dss_ick); 95 clk_put(rfbi.dss_ick);
diff --git a/drivers/video/omap/sossi.c b/drivers/video/omap/sossi.c
index a76946220249..8fb7c708f563 100644
--- a/drivers/video/omap/sossi.c
+++ b/drivers/video/omap/sossi.c
@@ -23,10 +23,11 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/interrupt.h>
26 27
27#include <mach/dma.h> 28#include <plat/dma.h>
28#include <mach/omapfb.h>
29 29
30#include "omapfb.h"
30#include "lcdc.h" 31#include "lcdc.h"
31 32
32#define MODULE_NAME "omapfb-sossi" 33#define MODULE_NAME "omapfb-sossi"