diff options
Diffstat (limited to 'drivers/video/omap/dispc.c')
-rw-r--r-- | drivers/video/omap/dispc.c | 34 |
1 files changed, 25 insertions, 9 deletions
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 */ |
205 | static void enable_rfbi_mode(int enable) | 207 | static 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 | ||
224 | static void set_lcd_data_lines(int data_lines) | 233 | static 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 | ||
908 | static int get_dss_clocks(void) | 917 | static 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; |