diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-13 17:44:51 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-13 17:44:51 -0400 |
commit | 97fb44eb6bc01f4ffed4300e475aa15e44877375 (patch) | |
tree | 481ed6efd0babe7185cae04f2fd295426b36411d /drivers/video | |
parent | e4707dd3e9d0cb57597b6568a5e51fea5d6fca41 (diff) | |
parent | 148854c65ea8046b045672fd49f4333aefaa3ab5 (diff) |
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel
Conflicts:
arch/arm/mach-at91/gpio.c
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/Kconfig | 10 | ||||
-rw-r--r-- | drivers/video/atafb.c | 22 | ||||
-rw-r--r-- | drivers/video/aty/aty128fb.c | 26 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 20 | ||||
-rw-r--r-- | drivers/video/aty/radeon_pm.c | 85 | ||||
-rw-r--r-- | drivers/video/aty/radeonfb.h | 2 | ||||
-rw-r--r-- | drivers/video/bfin-t350mcqb-fb.c | 2 | ||||
-rw-r--r-- | drivers/video/geode/gx1fb_core.c | 17 | ||||
-rw-r--r-- | drivers/video/geode/gxfb_core.c | 17 | ||||
-rw-r--r-- | drivers/video/geode/lxfb_core.c | 17 | ||||
-rw-r--r-- | drivers/video/i810/i810_main.c | 5 | ||||
-rw-r--r-- | drivers/video/imxfb.c | 66 | ||||
-rw-r--r-- | drivers/video/mx3fb.c | 2 | ||||
-rw-r--r-- | drivers/video/pxafb.c | 2 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 6 |
15 files changed, 160 insertions, 139 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 5aa099bc7690..330204a61ea8 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -397,7 +397,7 @@ config FB_SA1100 | |||
397 | 397 | ||
398 | config FB_IMX | 398 | config FB_IMX |
399 | tristate "Motorola i.MX LCD support" | 399 | tristate "Motorola i.MX LCD support" |
400 | depends on FB && ARM && ARCH_IMX | 400 | depends on FB && (ARCH_IMX || ARCH_MX2) |
401 | select FB_CFB_FILLRECT | 401 | select FB_CFB_FILLRECT |
402 | select FB_CFB_COPYAREA | 402 | select FB_CFB_COPYAREA |
403 | select FB_CFB_IMAGEBLIT | 403 | select FB_CFB_IMAGEBLIT |
@@ -1054,9 +1054,7 @@ config FB_RIVA_BACKLIGHT | |||
1054 | 1054 | ||
1055 | config FB_I810 | 1055 | config FB_I810 |
1056 | tristate "Intel 810/815 support (EXPERIMENTAL)" | 1056 | tristate "Intel 810/815 support (EXPERIMENTAL)" |
1057 | depends on FB && EXPERIMENTAL && PCI && X86_32 | 1057 | depends on EXPERIMENTAL && FB && PCI && X86_32 && AGP_INTEL |
1058 | select AGP | ||
1059 | select AGP_INTEL | ||
1060 | select FB_MODE_HELPERS | 1058 | select FB_MODE_HELPERS |
1061 | select FB_CFB_FILLRECT | 1059 | select FB_CFB_FILLRECT |
1062 | select FB_CFB_COPYAREA | 1060 | select FB_CFB_COPYAREA |
@@ -1119,9 +1117,7 @@ config FB_CARILLO_RANCH | |||
1119 | 1117 | ||
1120 | config FB_INTEL | 1118 | config FB_INTEL |
1121 | tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)" | 1119 | tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)" |
1122 | depends on FB && EXPERIMENTAL && PCI && X86 | 1120 | depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL |
1123 | select AGP | ||
1124 | select AGP_INTEL | ||
1125 | select FB_MODE_HELPERS | 1121 | select FB_MODE_HELPERS |
1126 | select FB_CFB_FILLRECT | 1122 | select FB_CFB_FILLRECT |
1127 | select FB_CFB_COPYAREA | 1123 | select FB_CFB_COPYAREA |
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 8058572a7428..018850c116c6 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -841,7 +841,7 @@ static int tt_detect(void) | |||
841 | tt_dmasnd.ctrl = DMASND_CTRL_OFF; | 841 | tt_dmasnd.ctrl = DMASND_CTRL_OFF; |
842 | udelay(20); /* wait a while for things to settle down */ | 842 | udelay(20); /* wait a while for things to settle down */ |
843 | } | 843 | } |
844 | mono_moni = (mfp.par_dt_reg & 0x80) == 0; | 844 | mono_moni = (st_mfp.par_dt_reg & 0x80) == 0; |
845 | 845 | ||
846 | tt_get_par(&par); | 846 | tt_get_par(&par); |
847 | tt_encode_var(&atafb_predefined[0], &par); | 847 | tt_encode_var(&atafb_predefined[0], &par); |
@@ -2035,7 +2035,7 @@ static int stste_detect(void) | |||
2035 | tt_dmasnd.ctrl = DMASND_CTRL_OFF; | 2035 | tt_dmasnd.ctrl = DMASND_CTRL_OFF; |
2036 | udelay(20); /* wait a while for things to settle down */ | 2036 | udelay(20); /* wait a while for things to settle down */ |
2037 | } | 2037 | } |
2038 | mono_moni = (mfp.par_dt_reg & 0x80) == 0; | 2038 | mono_moni = (st_mfp.par_dt_reg & 0x80) == 0; |
2039 | 2039 | ||
2040 | stste_get_par(&par); | 2040 | stste_get_par(&par); |
2041 | stste_encode_var(&atafb_predefined[0], &par); | 2041 | stste_encode_var(&atafb_predefined[0], &par); |
@@ -2086,20 +2086,20 @@ static void st_ovsc_switch(void) | |||
2086 | return; | 2086 | return; |
2087 | local_irq_save(flags); | 2087 | local_irq_save(flags); |
2088 | 2088 | ||
2089 | mfp.tim_ct_b = 0x10; | 2089 | st_mfp.tim_ct_b = 0x10; |
2090 | mfp.active_edge |= 8; | 2090 | st_mfp.active_edge |= 8; |
2091 | mfp.tim_ct_b = 0; | 2091 | st_mfp.tim_ct_b = 0; |
2092 | mfp.tim_dt_b = 0xf0; | 2092 | st_mfp.tim_dt_b = 0xf0; |
2093 | mfp.tim_ct_b = 8; | 2093 | st_mfp.tim_ct_b = 8; |
2094 | while (mfp.tim_dt_b > 1) /* TOS does it this way, don't ask why */ | 2094 | while (st_mfp.tim_dt_b > 1) /* TOS does it this way, don't ask why */ |
2095 | ; | 2095 | ; |
2096 | new = mfp.tim_dt_b; | 2096 | new = st_mfp.tim_dt_b; |
2097 | do { | 2097 | do { |
2098 | udelay(LINE_DELAY); | 2098 | udelay(LINE_DELAY); |
2099 | old = new; | 2099 | old = new; |
2100 | new = mfp.tim_dt_b; | 2100 | new = st_mfp.tim_dt_b; |
2101 | } while (old != new); | 2101 | } while (old != new); |
2102 | mfp.tim_ct_b = 0x10; | 2102 | st_mfp.tim_ct_b = 0x10; |
2103 | udelay(SYNC_DELAY); | 2103 | udelay(SYNC_DELAY); |
2104 | 2104 | ||
2105 | if (atari_switches & ATARI_SWITCH_OVSC_IKBD) | 2105 | if (atari_switches & ATARI_SWITCH_OVSC_IKBD) |
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index fb2b0f5b23bd..2181ce4d7ebd 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -2365,7 +2365,6 @@ static void fbcon_aty128_bmove(struct display *p, int sy, int sx, int dy, int dx | |||
2365 | static void aty128_set_suspend(struct aty128fb_par *par, int suspend) | 2365 | static void aty128_set_suspend(struct aty128fb_par *par, int suspend) |
2366 | { | 2366 | { |
2367 | u32 pmgt; | 2367 | u32 pmgt; |
2368 | u16 pwr_command; | ||
2369 | struct pci_dev *pdev = par->pdev; | 2368 | struct pci_dev *pdev = par->pdev; |
2370 | 2369 | ||
2371 | if (!par->pm_reg) | 2370 | if (!par->pm_reg) |
@@ -2374,6 +2373,8 @@ static void aty128_set_suspend(struct aty128fb_par *par, int suspend) | |||
2374 | /* Set the chip into the appropriate suspend mode (we use D2, | 2373 | /* Set the chip into the appropriate suspend mode (we use D2, |
2375 | * D3 would require a complete re-initialisation of the chip, | 2374 | * D3 would require a complete re-initialisation of the chip, |
2376 | * including PCI config registers, clocks, AGP configuration, ...) | 2375 | * including PCI config registers, clocks, AGP configuration, ...) |
2376 | * | ||
2377 | * For resume, the core will have already brought us back to D0 | ||
2377 | */ | 2378 | */ |
2378 | if (suspend) { | 2379 | if (suspend) { |
2379 | /* Make sure CRTC2 is reset. Remove that the day we decide to | 2380 | /* Make sure CRTC2 is reset. Remove that the day we decide to |
@@ -2391,17 +2392,9 @@ static void aty128_set_suspend(struct aty128fb_par *par, int suspend) | |||
2391 | aty_st_le32(BUS_CNTL1, 0x00000010); | 2392 | aty_st_le32(BUS_CNTL1, 0x00000010); |
2392 | aty_st_le32(MEM_POWER_MISC, 0x0c830000); | 2393 | aty_st_le32(MEM_POWER_MISC, 0x0c830000); |
2393 | mdelay(100); | 2394 | mdelay(100); |
2394 | pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command); | 2395 | |
2395 | /* Switch PCI power management to D2 */ | 2396 | /* Switch PCI power management to D2 */ |
2396 | pci_write_config_word(pdev, par->pm_reg+PCI_PM_CTRL, | 2397 | pci_set_power_state(pdev, PCI_D2); |
2397 | (pwr_command & ~PCI_PM_CTRL_STATE_MASK) | 2); | ||
2398 | pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command); | ||
2399 | } else { | ||
2400 | /* Switch back PCI power management to D0 */ | ||
2401 | mdelay(100); | ||
2402 | pci_write_config_word(pdev, par->pm_reg+PCI_PM_CTRL, 0); | ||
2403 | pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command); | ||
2404 | mdelay(100); | ||
2405 | } | 2398 | } |
2406 | } | 2399 | } |
2407 | 2400 | ||
@@ -2410,6 +2403,12 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2410 | struct fb_info *info = pci_get_drvdata(pdev); | 2403 | struct fb_info *info = pci_get_drvdata(pdev); |
2411 | struct aty128fb_par *par = info->par; | 2404 | struct aty128fb_par *par = info->par; |
2412 | 2405 | ||
2406 | /* Because we may change PCI D state ourselves, we need to | ||
2407 | * first save the config space content so the core can | ||
2408 | * restore it properly on resume. | ||
2409 | */ | ||
2410 | pci_save_state(pdev); | ||
2411 | |||
2413 | /* We don't do anything but D2, for now we return 0, but | 2412 | /* We don't do anything but D2, for now we return 0, but |
2414 | * we may want to change that. How do we know if the BIOS | 2413 | * we may want to change that. How do we know if the BIOS |
2415 | * can properly take care of D3 ? Also, with swsusp, we | 2414 | * can properly take care of D3 ? Also, with swsusp, we |
@@ -2476,6 +2475,11 @@ static int aty128_do_resume(struct pci_dev *pdev) | |||
2476 | if (pdev->dev.power.power_state.event == PM_EVENT_ON) | 2475 | if (pdev->dev.power.power_state.event == PM_EVENT_ON) |
2477 | return 0; | 2476 | return 0; |
2478 | 2477 | ||
2478 | /* PCI state will have been restored by the core, so | ||
2479 | * we should be in D0 now with our config space fully | ||
2480 | * restored | ||
2481 | */ | ||
2482 | |||
2479 | /* Wakeup chip */ | 2483 | /* Wakeup chip */ |
2480 | aty128_set_suspend(par, 0); | 2484 | aty128_set_suspend(par, 0); |
2481 | par->asleep = 0; | 2485 | par->asleep = 0; |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 1d6e16d346a5..1207c208a30b 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -1978,7 +1978,7 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par) | |||
1978 | 1978 | ||
1979 | return timeout ? 0 : -EIO; | 1979 | return timeout ? 0 : -EIO; |
1980 | } | 1980 | } |
1981 | #endif | 1981 | #endif /* CONFIG_PPC_PMAC */ |
1982 | 1982 | ||
1983 | static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 1983 | static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
1984 | { | 1984 | { |
@@ -2002,9 +2002,15 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2002 | par->asleep = 1; | 2002 | par->asleep = 1; |
2003 | par->lock_blank = 1; | 2003 | par->lock_blank = 1; |
2004 | 2004 | ||
2005 | /* Because we may change PCI D state ourselves, we need to | ||
2006 | * first save the config space content so the core can | ||
2007 | * restore it properly on resume. | ||
2008 | */ | ||
2009 | pci_save_state(pdev); | ||
2010 | |||
2005 | #ifdef CONFIG_PPC_PMAC | 2011 | #ifdef CONFIG_PPC_PMAC |
2006 | /* Set chip to "suspend" mode */ | 2012 | /* Set chip to "suspend" mode */ |
2007 | if (aty_power_mgmt(1, par)) { | 2013 | if (machine_is(powermac) && aty_power_mgmt(1, par)) { |
2008 | par->asleep = 0; | 2014 | par->asleep = 0; |
2009 | par->lock_blank = 0; | 2015 | par->lock_blank = 0; |
2010 | atyfb_blank(FB_BLANK_UNBLANK, info); | 2016 | atyfb_blank(FB_BLANK_UNBLANK, info); |
@@ -2047,11 +2053,15 @@ static int atyfb_pci_resume(struct pci_dev *pdev) | |||
2047 | 2053 | ||
2048 | acquire_console_sem(); | 2054 | acquire_console_sem(); |
2049 | 2055 | ||
2056 | /* PCI state will have been restored by the core, so | ||
2057 | * we should be in D0 now with our config space fully | ||
2058 | * restored | ||
2059 | */ | ||
2060 | |||
2050 | #ifdef CONFIG_PPC_PMAC | 2061 | #ifdef CONFIG_PPC_PMAC |
2051 | if (pdev->dev.power.power_state.event == 2) | 2062 | if (machine_is(powermac) && |
2063 | pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) | ||
2052 | aty_power_mgmt(0, par); | 2064 | aty_power_mgmt(0, par); |
2053 | #else | ||
2054 | pci_set_power_state(pdev, PCI_D0); | ||
2055 | #endif | 2065 | #endif |
2056 | 2066 | ||
2057 | aty_resume_chip(info); | 2067 | aty_resume_chip(info); |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index c4ac2a032fcb..ca5f0dc28546 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -2509,9 +2509,7 @@ static void radeon_reinitialize_QW(struct radeonfb_info *rinfo) | |||
2509 | 2509 | ||
2510 | static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) | 2510 | static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) |
2511 | { | 2511 | { |
2512 | u16 pwr_cmd; | ||
2513 | u32 tmp; | 2512 | u32 tmp; |
2514 | int i; | ||
2515 | 2513 | ||
2516 | if (!rinfo->pm_reg) | 2514 | if (!rinfo->pm_reg) |
2517 | return; | 2515 | return; |
@@ -2557,32 +2555,14 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) | |||
2557 | } | 2555 | } |
2558 | } | 2556 | } |
2559 | 2557 | ||
2560 | for (i = 0; i < 64; ++i) | ||
2561 | pci_read_config_dword(rinfo->pdev, i * 4, | ||
2562 | &rinfo->cfg_save[i]); | ||
2563 | |||
2564 | /* Switch PCI power management to D2. */ | 2558 | /* Switch PCI power management to D2. */ |
2565 | pci_disable_device(rinfo->pdev); | 2559 | pci_disable_device(rinfo->pdev); |
2566 | for (;;) { | 2560 | pci_save_state(rinfo->pdev); |
2567 | pci_read_config_word( | 2561 | pci_set_power_state(rinfo->pdev, PCI_D2); |
2568 | rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, | ||
2569 | &pwr_cmd); | ||
2570 | if (pwr_cmd & 2) | ||
2571 | break; | ||
2572 | pci_write_config_word( | ||
2573 | rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, | ||
2574 | (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2); | ||
2575 | mdelay(500); | ||
2576 | } | ||
2577 | } else { | 2562 | } else { |
2578 | printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n", | 2563 | printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n", |
2579 | pci_name(rinfo->pdev)); | 2564 | pci_name(rinfo->pdev)); |
2580 | 2565 | ||
2581 | /* Switch back PCI powermanagment to D0 */ | ||
2582 | mdelay(200); | ||
2583 | pci_write_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, 0); | ||
2584 | mdelay(500); | ||
2585 | |||
2586 | if (rinfo->family <= CHIP_FAMILY_RV250) { | 2566 | if (rinfo->family <= CHIP_FAMILY_RV250) { |
2587 | /* Reset the SDRAM controller */ | 2567 | /* Reset the SDRAM controller */ |
2588 | radeon_pm_full_reset_sdram(rinfo); | 2568 | radeon_pm_full_reset_sdram(rinfo); |
@@ -2598,37 +2578,10 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) | |||
2598 | } | 2578 | } |
2599 | } | 2579 | } |
2600 | 2580 | ||
2601 | static int radeon_restore_pci_cfg(struct radeonfb_info *rinfo) | ||
2602 | { | ||
2603 | int i; | ||
2604 | static u32 radeon_cfg_after_resume[64]; | ||
2605 | |||
2606 | for (i = 0; i < 64; ++i) | ||
2607 | pci_read_config_dword(rinfo->pdev, i * 4, | ||
2608 | &radeon_cfg_after_resume[i]); | ||
2609 | |||
2610 | if (radeon_cfg_after_resume[PCI_BASE_ADDRESS_0/4] | ||
2611 | == rinfo->cfg_save[PCI_BASE_ADDRESS_0/4]) | ||
2612 | return 0; /* assume everything is ok */ | ||
2613 | |||
2614 | for (i = PCI_BASE_ADDRESS_0/4; i < 64; ++i) { | ||
2615 | if (radeon_cfg_after_resume[i] != rinfo->cfg_save[i]) | ||
2616 | pci_write_config_dword(rinfo->pdev, i * 4, | ||
2617 | rinfo->cfg_save[i]); | ||
2618 | } | ||
2619 | pci_write_config_word(rinfo->pdev, PCI_CACHE_LINE_SIZE, | ||
2620 | rinfo->cfg_save[PCI_CACHE_LINE_SIZE/4]); | ||
2621 | pci_write_config_word(rinfo->pdev, PCI_COMMAND, | ||
2622 | rinfo->cfg_save[PCI_COMMAND/4]); | ||
2623 | return 1; | ||
2624 | } | ||
2625 | |||
2626 | |||
2627 | int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | 2581 | int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) |
2628 | { | 2582 | { |
2629 | struct fb_info *info = pci_get_drvdata(pdev); | 2583 | struct fb_info *info = pci_get_drvdata(pdev); |
2630 | struct radeonfb_info *rinfo = info->par; | 2584 | struct radeonfb_info *rinfo = info->par; |
2631 | int i; | ||
2632 | 2585 | ||
2633 | if (mesg.event == pdev->dev.power.power_state.event) | 2586 | if (mesg.event == pdev->dev.power.power_state.event) |
2634 | return 0; | 2587 | return 0; |
@@ -2674,6 +2627,11 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
2674 | pmac_suspend_agp_for_card(pdev); | 2627 | pmac_suspend_agp_for_card(pdev); |
2675 | #endif /* CONFIG_PPC_PMAC */ | 2628 | #endif /* CONFIG_PPC_PMAC */ |
2676 | 2629 | ||
2630 | /* It's unclear whether or when the generic code will do that, so let's | ||
2631 | * do it ourselves. We save state before we do any power management | ||
2632 | */ | ||
2633 | pci_save_state(pdev); | ||
2634 | |||
2677 | /* If we support wakeup from poweroff, we save all regs we can including cfg | 2635 | /* If we support wakeup from poweroff, we save all regs we can including cfg |
2678 | * space | 2636 | * space |
2679 | */ | 2637 | */ |
@@ -2698,9 +2656,6 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
2698 | mdelay(20); | 2656 | mdelay(20); |
2699 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON)); | 2657 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON)); |
2700 | } | 2658 | } |
2701 | // FIXME: Use PCI layer | ||
2702 | for (i = 0; i < 64; ++i) | ||
2703 | pci_read_config_dword(pdev, i * 4, &rinfo->cfg_save[i]); | ||
2704 | pci_disable_device(pdev); | 2659 | pci_disable_device(pdev); |
2705 | } | 2660 | } |
2706 | /* If we support D2, we go to it (should be fixed later with a flag forcing | 2661 | /* If we support D2, we go to it (should be fixed later with a flag forcing |
@@ -2717,6 +2672,13 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
2717 | return 0; | 2672 | return 0; |
2718 | } | 2673 | } |
2719 | 2674 | ||
2675 | static int radeon_check_power_loss(struct radeonfb_info *rinfo) | ||
2676 | { | ||
2677 | return rinfo->save_regs[4] != INPLL(CLK_PIN_CNTL) || | ||
2678 | rinfo->save_regs[2] != INPLL(MCLK_CNTL) || | ||
2679 | rinfo->save_regs[3] != INPLL(SCLK_CNTL); | ||
2680 | } | ||
2681 | |||
2720 | int radeonfb_pci_resume(struct pci_dev *pdev) | 2682 | int radeonfb_pci_resume(struct pci_dev *pdev) |
2721 | { | 2683 | { |
2722 | struct fb_info *info = pci_get_drvdata(pdev); | 2684 | struct fb_info *info = pci_get_drvdata(pdev); |
@@ -2735,20 +2697,13 @@ int radeonfb_pci_resume(struct pci_dev *pdev) | |||
2735 | printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n", | 2697 | printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n", |
2736 | pci_name(pdev), pdev->dev.power.power_state.event); | 2698 | pci_name(pdev), pdev->dev.power.power_state.event); |
2737 | 2699 | ||
2738 | 2700 | /* PCI state will have been restored by the core, so | |
2739 | if (pci_enable_device(pdev)) { | 2701 | * we should be in D0 now with our config space fully |
2740 | rc = -ENODEV; | 2702 | * restored |
2741 | printk(KERN_ERR "radeonfb (%s): can't enable PCI device !\n", | 2703 | */ |
2742 | pci_name(pdev)); | ||
2743 | goto bail; | ||
2744 | } | ||
2745 | pci_set_master(pdev); | ||
2746 | |||
2747 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { | 2704 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { |
2748 | /* Wakeup chip. Check from config space if we were powered off | 2705 | /* Wakeup chip */ |
2749 | * (todo: additionally, check CLK_PIN_CNTL too) | 2706 | if ((rinfo->pm_mode & radeon_pm_off) && radeon_check_power_loss(rinfo)) { |
2750 | */ | ||
2751 | if ((rinfo->pm_mode & radeon_pm_off) && radeon_restore_pci_cfg(rinfo)) { | ||
2752 | if (rinfo->reinit_func != NULL) | 2707 | if (rinfo->reinit_func != NULL) |
2753 | rinfo->reinit_func(rinfo); | 2708 | rinfo->reinit_func(rinfo); |
2754 | else { | 2709 | else { |
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h index 3ea1b00fdd22..7351e66c7f54 100644 --- a/drivers/video/aty/radeonfb.h +++ b/drivers/video/aty/radeonfb.h | |||
@@ -361,8 +361,6 @@ struct radeonfb_info { | |||
361 | #ifdef CONFIG_FB_RADEON_I2C | 361 | #ifdef CONFIG_FB_RADEON_I2C |
362 | struct radeon_i2c_chan i2c[4]; | 362 | struct radeon_i2c_chan i2c[4]; |
363 | #endif | 363 | #endif |
364 | |||
365 | u32 cfg_save[64]; | ||
366 | }; | 364 | }; |
367 | 365 | ||
368 | 366 | ||
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index 2a423d3a2a8e..90cfddabf1f7 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c | |||
@@ -447,7 +447,7 @@ static irqreturn_t bfin_t350mcqb_irq_error(int irq, void *dev_id) | |||
447 | return IRQ_HANDLED; | 447 | return IRQ_HANDLED; |
448 | } | 448 | } |
449 | 449 | ||
450 | static int __init bfin_t350mcqb_probe(struct platform_device *pdev) | 450 | static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) |
451 | { | 451 | { |
452 | struct bfin_t350mcqbfb_info *info; | 452 | struct bfin_t350mcqbfb_info *info; |
453 | struct fb_info *fbinfo; | 453 | struct fb_info *fbinfo; |
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c index 751e491ca8c8..f20eff8c4a81 100644 --- a/drivers/video/geode/gx1fb_core.c +++ b/drivers/video/geode/gx1fb_core.c | |||
@@ -136,13 +136,10 @@ static int gx1fb_set_par(struct fb_info *info) | |||
136 | { | 136 | { |
137 | struct geodefb_par *par = info->par; | 137 | struct geodefb_par *par = info->par; |
138 | 138 | ||
139 | if (info->var.bits_per_pixel == 16) { | 139 | if (info->var.bits_per_pixel == 16) |
140 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 140 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
141 | fb_dealloc_cmap(&info->cmap); | 141 | else |
142 | } else { | ||
143 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 142 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
144 | fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0); | ||
145 | } | ||
146 | 143 | ||
147 | info->fix.line_length = gx1_line_delta(info->var.xres, info->var.bits_per_pixel); | 144 | info->fix.line_length = gx1_line_delta(info->var.xres, info->var.bits_per_pixel); |
148 | 145 | ||
@@ -315,6 +312,10 @@ static struct fb_info * __init gx1fb_init_fbinfo(struct device *dev) | |||
315 | if (!par->panel_x) | 312 | if (!par->panel_x) |
316 | par->enable_crt = 1; /* fall back to CRT if no panel is specified */ | 313 | par->enable_crt = 1; /* fall back to CRT if no panel is specified */ |
317 | 314 | ||
315 | if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { | ||
316 | framebuffer_release(info); | ||
317 | return NULL; | ||
318 | } | ||
318 | return info; | 319 | return info; |
319 | } | 320 | } |
320 | 321 | ||
@@ -374,8 +375,11 @@ static int __init gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id * | |||
374 | release_mem_region(gx1_gx_base() + 0x8300, 0x100); | 375 | release_mem_region(gx1_gx_base() + 0x8300, 0x100); |
375 | } | 376 | } |
376 | 377 | ||
377 | if (info) | 378 | if (info) { |
379 | fb_dealloc_cmap(&info->cmap); | ||
378 | framebuffer_release(info); | 380 | framebuffer_release(info); |
381 | } | ||
382 | |||
379 | return ret; | 383 | return ret; |
380 | } | 384 | } |
381 | 385 | ||
@@ -395,6 +399,7 @@ static void gx1fb_remove(struct pci_dev *pdev) | |||
395 | iounmap(par->dc_regs); | 399 | iounmap(par->dc_regs); |
396 | release_mem_region(gx1_gx_base() + 0x8300, 0x100); | 400 | release_mem_region(gx1_gx_base() + 0x8300, 0x100); |
397 | 401 | ||
402 | fb_dealloc_cmap(&info->cmap); | ||
398 | pci_set_drvdata(pdev, NULL); | 403 | pci_set_drvdata(pdev, NULL); |
399 | 404 | ||
400 | framebuffer_release(info); | 405 | framebuffer_release(info); |
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index 484118926318..2552cac39e1c 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c | |||
@@ -171,13 +171,10 @@ static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
171 | 171 | ||
172 | static int gxfb_set_par(struct fb_info *info) | 172 | static int gxfb_set_par(struct fb_info *info) |
173 | { | 173 | { |
174 | if (info->var.bits_per_pixel > 8) { | 174 | if (info->var.bits_per_pixel > 8) |
175 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 175 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
176 | fb_dealloc_cmap(&info->cmap); | 176 | else |
177 | } else { | ||
178 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 177 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
179 | fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0); | ||
180 | } | ||
181 | 178 | ||
182 | info->fix.line_length = gx_line_delta(info->var.xres, info->var.bits_per_pixel); | 179 | info->fix.line_length = gx_line_delta(info->var.xres, info->var.bits_per_pixel); |
183 | 180 | ||
@@ -331,6 +328,11 @@ static struct fb_info * __init gxfb_init_fbinfo(struct device *dev) | |||
331 | 328 | ||
332 | info->var.grayscale = 0; | 329 | info->var.grayscale = 0; |
333 | 330 | ||
331 | if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { | ||
332 | framebuffer_release(info); | ||
333 | return NULL; | ||
334 | } | ||
335 | |||
334 | return info; | 336 | return info; |
335 | } | 337 | } |
336 | 338 | ||
@@ -443,8 +445,10 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i | |||
443 | pci_release_region(pdev, 1); | 445 | pci_release_region(pdev, 1); |
444 | } | 446 | } |
445 | 447 | ||
446 | if (info) | 448 | if (info) { |
449 | fb_dealloc_cmap(&info->cmap); | ||
447 | framebuffer_release(info); | 450 | framebuffer_release(info); |
451 | } | ||
448 | return ret; | 452 | return ret; |
449 | } | 453 | } |
450 | 454 | ||
@@ -467,6 +471,7 @@ static void gxfb_remove(struct pci_dev *pdev) | |||
467 | iounmap(par->gp_regs); | 471 | iounmap(par->gp_regs); |
468 | pci_release_region(pdev, 1); | 472 | pci_release_region(pdev, 1); |
469 | 473 | ||
474 | fb_dealloc_cmap(&info->cmap); | ||
470 | pci_set_drvdata(pdev, NULL); | 475 | pci_set_drvdata(pdev, NULL); |
471 | 476 | ||
472 | framebuffer_release(info); | 477 | framebuffer_release(info); |
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index b965ecdbc604..889cbe39e580 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c | |||
@@ -278,13 +278,10 @@ static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
278 | 278 | ||
279 | static int lxfb_set_par(struct fb_info *info) | 279 | static int lxfb_set_par(struct fb_info *info) |
280 | { | 280 | { |
281 | if (info->var.bits_per_pixel > 8) { | 281 | if (info->var.bits_per_pixel > 8) |
282 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 282 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
283 | fb_dealloc_cmap(&info->cmap); | 283 | else |
284 | } else { | ||
285 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 284 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
286 | fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0); | ||
287 | } | ||
288 | 285 | ||
289 | info->fix.line_length = lx_get_pitch(info->var.xres, | 286 | info->fix.line_length = lx_get_pitch(info->var.xres, |
290 | info->var.bits_per_pixel); | 287 | info->var.bits_per_pixel); |
@@ -451,6 +448,11 @@ static struct fb_info * __init lxfb_init_fbinfo(struct device *dev) | |||
451 | 448 | ||
452 | info->pseudo_palette = (void *)par + sizeof(struct lxfb_par); | 449 | info->pseudo_palette = (void *)par + sizeof(struct lxfb_par); |
453 | 450 | ||
451 | if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { | ||
452 | framebuffer_release(info); | ||
453 | return NULL; | ||
454 | } | ||
455 | |||
454 | info->var.grayscale = 0; | 456 | info->var.grayscale = 0; |
455 | 457 | ||
456 | return info; | 458 | return info; |
@@ -579,8 +581,10 @@ err: | |||
579 | pci_release_region(pdev, 3); | 581 | pci_release_region(pdev, 3); |
580 | } | 582 | } |
581 | 583 | ||
582 | if (info) | 584 | if (info) { |
585 | fb_dealloc_cmap(&info->cmap); | ||
583 | framebuffer_release(info); | 586 | framebuffer_release(info); |
587 | } | ||
584 | 588 | ||
585 | return ret; | 589 | return ret; |
586 | } | 590 | } |
@@ -604,6 +608,7 @@ static void lxfb_remove(struct pci_dev *pdev) | |||
604 | iounmap(par->vp_regs); | 608 | iounmap(par->vp_regs); |
605 | pci_release_region(pdev, 3); | 609 | pci_release_region(pdev, 3); |
606 | 610 | ||
611 | fb_dealloc_cmap(&info->cmap); | ||
607 | pci_set_drvdata(pdev, NULL); | 612 | pci_set_drvdata(pdev, NULL); |
608 | framebuffer_release(info); | 613 | framebuffer_release(info); |
609 | } | 614 | } |
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index a24e680d2b9c..2e940199fc89 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -993,6 +993,7 @@ static int i810_check_params(struct fb_var_screeninfo *var, | |||
993 | struct i810fb_par *par = info->par; | 993 | struct i810fb_par *par = info->par; |
994 | int line_length, vidmem, mode_valid = 0, retval = 0; | 994 | int line_length, vidmem, mode_valid = 0, retval = 0; |
995 | u32 vyres = var->yres_virtual, vxres = var->xres_virtual; | 995 | u32 vyres = var->yres_virtual, vxres = var->xres_virtual; |
996 | |||
996 | /* | 997 | /* |
997 | * Memory limit | 998 | * Memory limit |
998 | */ | 999 | */ |
@@ -1002,12 +1003,12 @@ static int i810_check_params(struct fb_var_screeninfo *var, | |||
1002 | if (vidmem > par->fb.size) { | 1003 | if (vidmem > par->fb.size) { |
1003 | vyres = par->fb.size/line_length; | 1004 | vyres = par->fb.size/line_length; |
1004 | if (vyres < var->yres) { | 1005 | if (vyres < var->yres) { |
1005 | vyres = yres; | 1006 | vyres = info->var.yres; |
1006 | vxres = par->fb.size/vyres; | 1007 | vxres = par->fb.size/vyres; |
1007 | vxres /= var->bits_per_pixel >> 3; | 1008 | vxres /= var->bits_per_pixel >> 3; |
1008 | line_length = get_line_length(par, vxres, | 1009 | line_length = get_line_length(par, vxres, |
1009 | var->bits_per_pixel); | 1010 | var->bits_per_pixel); |
1010 | vidmem = line_length * yres; | 1011 | vidmem = line_length * info->var.yres; |
1011 | if (vxres < var->xres) { | 1012 | if (vxres < var->xres) { |
1012 | printk("i810fb: required video memory, " | 1013 | printk("i810fb: required video memory, " |
1013 | "%d bytes, for %dx%d-%d (virtual) " | 1014 | "%d bytes, for %dx%d-%d (virtual) " |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index d58c68cd456e..bd1cb75cd14b 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -14,7 +14,6 @@ | |||
14 | * linux-arm-kernel@lists.arm.linux.org.uk | 14 | * linux-arm-kernel@lists.arm.linux.org.uk |
15 | */ | 15 | */ |
16 | 16 | ||
17 | |||
18 | #include <linux/module.h> | 17 | #include <linux/module.h> |
19 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
20 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
@@ -44,7 +43,12 @@ | |||
44 | 43 | ||
45 | #define LCDC_SIZE 0x04 | 44 | #define LCDC_SIZE 0x04 |
46 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) | 45 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) |
46 | |||
47 | #ifdef CONFIG_ARCH_MX1 | ||
47 | #define SIZE_YMAX(y) ((y) & 0x1ff) | 48 | #define SIZE_YMAX(y) ((y) & 0x1ff) |
49 | #else | ||
50 | #define SIZE_YMAX(y) ((y) & 0x3ff) | ||
51 | #endif | ||
48 | 52 | ||
49 | #define LCDC_VPW 0x08 | 53 | #define LCDC_VPW 0x08 |
50 | #define VPW_VPW(x) ((x) & 0x3ff) | 54 | #define VPW_VPW(x) ((x) & 0x3ff) |
@@ -54,7 +58,12 @@ | |||
54 | #define CPOS_CC0 (1<<30) | 58 | #define CPOS_CC0 (1<<30) |
55 | #define CPOS_OP (1<<28) | 59 | #define CPOS_OP (1<<28) |
56 | #define CPOS_CXP(x) (((x) & 3ff) << 16) | 60 | #define CPOS_CXP(x) (((x) & 3ff) << 16) |
61 | |||
62 | #ifdef CONFIG_ARCH_MX1 | ||
57 | #define CPOS_CYP(y) ((y) & 0x1ff) | 63 | #define CPOS_CYP(y) ((y) & 0x1ff) |
64 | #else | ||
65 | #define CPOS_CYP(y) ((y) & 0x3ff) | ||
66 | #endif | ||
58 | 67 | ||
59 | #define LCDC_LCWHB 0x10 | 68 | #define LCDC_LCWHB 0x10 |
60 | #define LCWHB_BK_EN (1<<31) | 69 | #define LCWHB_BK_EN (1<<31) |
@@ -63,9 +72,16 @@ | |||
63 | #define LCWHB_BD(x) ((x) & 0xff) | 72 | #define LCWHB_BD(x) ((x) & 0xff) |
64 | 73 | ||
65 | #define LCDC_LCHCC 0x14 | 74 | #define LCDC_LCHCC 0x14 |
75 | |||
76 | #ifdef CONFIG_ARCH_MX1 | ||
66 | #define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11) | 77 | #define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11) |
67 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5) | 78 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5) |
68 | #define LCHCC_CUR_COL_B(b) ((b) & 0x1f) | 79 | #define LCHCC_CUR_COL_B(b) ((b) & 0x1f) |
80 | #else | ||
81 | #define LCHCC_CUR_COL_R(r) (((r) & 0x3f) << 12) | ||
82 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 6) | ||
83 | #define LCHCC_CUR_COL_B(b) ((b) & 0x3f) | ||
84 | #endif | ||
69 | 85 | ||
70 | #define LCDC_PCR 0x18 | 86 | #define LCDC_PCR 0x18 |
71 | 87 | ||
@@ -92,7 +108,13 @@ | |||
92 | /* bit fields in imxfb.h */ | 108 | /* bit fields in imxfb.h */ |
93 | 109 | ||
94 | #define LCDC_RMCR 0x34 | 110 | #define LCDC_RMCR 0x34 |
111 | |||
112 | #ifdef CONFIG_ARCH_MX1 | ||
95 | #define RMCR_LCDC_EN (1<<1) | 113 | #define RMCR_LCDC_EN (1<<1) |
114 | #else | ||
115 | #define RMCR_LCDC_EN 0 | ||
116 | #endif | ||
117 | |||
96 | #define RMCR_SELF_REF (1<<0) | 118 | #define RMCR_SELF_REF (1<<0) |
97 | 119 | ||
98 | #define LCDC_LCDICR 0x38 | 120 | #define LCDC_LCDICR 0x38 |
@@ -159,6 +181,17 @@ struct imxfb_info { | |||
159 | #define MIN_XRES 64 | 181 | #define MIN_XRES 64 |
160 | #define MIN_YRES 64 | 182 | #define MIN_YRES 64 |
161 | 183 | ||
184 | /* Actually this really is 18bit support, the lowest 2 bits of each colour | ||
185 | * are unused in hardware. We claim to have 24bit support to make software | ||
186 | * like X work, which does not support 18bit. | ||
187 | */ | ||
188 | static struct imxfb_rgb def_rgb_18 = { | ||
189 | .red = {.offset = 16, .length = 8,}, | ||
190 | .green = {.offset = 8, .length = 8,}, | ||
191 | .blue = {.offset = 0, .length = 8,}, | ||
192 | .transp = {.offset = 0, .length = 0,}, | ||
193 | }; | ||
194 | |||
162 | static struct imxfb_rgb def_rgb_16_tft = { | 195 | static struct imxfb_rgb def_rgb_16_tft = { |
163 | .red = {.offset = 11, .length = 5,}, | 196 | .red = {.offset = 11, .length = 5,}, |
164 | .green = {.offset = 5, .length = 6,}, | 197 | .green = {.offset = 5, .length = 6,}, |
@@ -286,6 +319,9 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
286 | 319 | ||
287 | pr_debug("var->bits_per_pixel=%d\n", var->bits_per_pixel); | 320 | pr_debug("var->bits_per_pixel=%d\n", var->bits_per_pixel); |
288 | switch (var->bits_per_pixel) { | 321 | switch (var->bits_per_pixel) { |
322 | case 32: | ||
323 | rgb = &def_rgb_18; | ||
324 | break; | ||
289 | case 16: | 325 | case 16: |
290 | default: | 326 | default: |
291 | if (readl(fbi->regs + LCDC_PCR) & PCR_TFT) | 327 | if (readl(fbi->regs + LCDC_PCR) & PCR_TFT) |
@@ -327,9 +363,7 @@ static int imxfb_set_par(struct fb_info *info) | |||
327 | struct imxfb_info *fbi = info->par; | 363 | struct imxfb_info *fbi = info->par; |
328 | struct fb_var_screeninfo *var = &info->var; | 364 | struct fb_var_screeninfo *var = &info->var; |
329 | 365 | ||
330 | pr_debug("set_par\n"); | 366 | if (var->bits_per_pixel == 16 || var->bits_per_pixel == 32) |
331 | |||
332 | if (var->bits_per_pixel == 16) | ||
333 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 367 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
334 | else if (!fbi->cmap_static) | 368 | else if (!fbi->cmap_static) |
335 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 369 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
@@ -354,10 +388,6 @@ static void imxfb_enable_controller(struct imxfb_info *fbi) | |||
354 | { | 388 | { |
355 | pr_debug("Enabling LCD controller\n"); | 389 | pr_debug("Enabling LCD controller\n"); |
356 | 390 | ||
357 | /* initialize LCDC */ | ||
358 | writel(readl(fbi->regs + LCDC_RMCR) & ~RMCR_LCDC_EN, | ||
359 | fbi->regs + LCDC_RMCR); /* just to be safe... */ | ||
360 | |||
361 | writel(fbi->screen_dma, fbi->regs + LCDC_SSA); | 391 | writel(fbi->screen_dma, fbi->regs + LCDC_SSA); |
362 | 392 | ||
363 | /* physical screen start address */ | 393 | /* physical screen start address */ |
@@ -465,9 +495,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
465 | info->fix.id, var->lower_margin); | 495 | info->fix.id, var->lower_margin); |
466 | #endif | 496 | #endif |
467 | 497 | ||
468 | writel(HCR_H_WIDTH(var->hsync_len) | | 498 | writel(HCR_H_WIDTH(var->hsync_len - 1) | |
469 | HCR_H_WAIT_1(var->right_margin) | | 499 | HCR_H_WAIT_1(var->right_margin - 1) | |
470 | HCR_H_WAIT_2(var->left_margin), | 500 | HCR_H_WAIT_2(var->left_margin - 3), |
471 | fbi->regs + LCDC_HCR); | 501 | fbi->regs + LCDC_HCR); |
472 | 502 | ||
473 | writel(VCR_V_WIDTH(var->vsync_len) | | 503 | writel(VCR_V_WIDTH(var->vsync_len) | |
@@ -650,6 +680,12 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
650 | info->fix.smem_start = fbi->screen_dma; | 680 | info->fix.smem_start = fbi->screen_dma; |
651 | } | 681 | } |
652 | 682 | ||
683 | if (pdata->init) { | ||
684 | ret = pdata->init(fbi->pdev); | ||
685 | if (ret) | ||
686 | goto failed_platform_init; | ||
687 | } | ||
688 | |||
653 | /* | 689 | /* |
654 | * This makes sure that our colour bitfield | 690 | * This makes sure that our colour bitfield |
655 | * descriptors are correctly initialised. | 691 | * descriptors are correctly initialised. |
@@ -674,6 +710,9 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
674 | failed_register: | 710 | failed_register: |
675 | fb_dealloc_cmap(&info->cmap); | 711 | fb_dealloc_cmap(&info->cmap); |
676 | failed_cmap: | 712 | failed_cmap: |
713 | if (pdata->exit) | ||
714 | pdata->exit(fbi->pdev); | ||
715 | failed_platform_init: | ||
677 | if (!pdata->fixed_screen_cpu) | 716 | if (!pdata->fixed_screen_cpu) |
678 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, | 717 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, |
679 | fbi->map_dma); | 718 | fbi->map_dma); |
@@ -691,6 +730,7 @@ failed_init: | |||
691 | 730 | ||
692 | static int __devexit imxfb_remove(struct platform_device *pdev) | 731 | static int __devexit imxfb_remove(struct platform_device *pdev) |
693 | { | 732 | { |
733 | struct imx_fb_platform_data *pdata; | ||
694 | struct fb_info *info = platform_get_drvdata(pdev); | 734 | struct fb_info *info = platform_get_drvdata(pdev); |
695 | struct imxfb_info *fbi = info->par; | 735 | struct imxfb_info *fbi = info->par; |
696 | struct resource *res; | 736 | struct resource *res; |
@@ -701,6 +741,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev) | |||
701 | 741 | ||
702 | unregister_framebuffer(info); | 742 | unregister_framebuffer(info); |
703 | 743 | ||
744 | pdata = pdev->dev.platform_data; | ||
745 | if (pdata->exit) | ||
746 | pdata->exit(fbi->pdev); | ||
747 | |||
704 | fb_dealloc_cmap(&info->cmap); | 748 | fb_dealloc_cmap(&info->cmap); |
705 | kfree(info->pseudo_palette); | 749 | kfree(info->pseudo_palette); |
706 | framebuffer_release(info); | 750 | framebuffer_release(info); |
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index 8a75d05f4334..0c27961e47f2 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c | |||
@@ -493,7 +493,7 @@ static int sdc_init_panel(struct mx3fb_data *mx3fb, enum ipu_panel panel, | |||
493 | */ | 493 | */ |
494 | dev_dbg(mx3fb->dev, "pixel clk = %d\n", pixel_clk); | 494 | dev_dbg(mx3fb->dev, "pixel clk = %d\n", pixel_clk); |
495 | 495 | ||
496 | ipu_clk = clk_get(mx3fb->dev, "ipu_clk"); | 496 | ipu_clk = clk_get(mx3fb->dev, NULL); |
497 | div = clk_get_rate(ipu_clk) * 16 / pixel_clk; | 497 | div = clk_get_rate(ipu_clk) * 16 / pixel_clk; |
498 | clk_put(ipu_clk); | 498 | clk_put(ipu_clk); |
499 | 499 | ||
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 287aa1d2a13c..07b371b4b072 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -2229,7 +2229,7 @@ static int __devexit pxafb_remove(struct platform_device *dev) | |||
2229 | 2229 | ||
2230 | static struct platform_driver pxafb_driver = { | 2230 | static struct platform_driver pxafb_driver = { |
2231 | .probe = pxafb_probe, | 2231 | .probe = pxafb_probe, |
2232 | .remove = pxafb_remove, | 2232 | .remove = __devexit_p(pxafb_remove), |
2233 | .suspend = pxafb_suspend, | 2233 | .suspend = pxafb_suspend, |
2234 | .resume = pxafb_resume, | 2234 | .resume = pxafb_resume, |
2235 | .driver = { | 2235 | .driver = { |
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 0e2b8fd24df1..2c5d069e5f06 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -446,7 +446,6 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv) | |||
446 | { | 446 | { |
447 | struct sh_mobile_lcdc_chan *ch; | 447 | struct sh_mobile_lcdc_chan *ch; |
448 | struct sh_mobile_lcdc_board_cfg *board_cfg; | 448 | struct sh_mobile_lcdc_board_cfg *board_cfg; |
449 | unsigned long tmp; | ||
450 | int k; | 449 | int k; |
451 | 450 | ||
452 | /* tell the board code to disable the panel */ | 451 | /* tell the board code to disable the panel */ |
@@ -456,9 +455,8 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv) | |||
456 | if (board_cfg->display_off) | 455 | if (board_cfg->display_off) |
457 | board_cfg->display_off(board_cfg->board_data); | 456 | board_cfg->display_off(board_cfg->board_data); |
458 | 457 | ||
459 | /* cleanup deferred io if SYS bus */ | 458 | /* cleanup deferred io if enabled */ |
460 | tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; | 459 | if (ch->info.fbdefio) { |
461 | if (ch->ldmt1r_value & (1 << 12) && tmp) { | ||
462 | fb_deferred_io_cleanup(&ch->info); | 460 | fb_deferred_io_cleanup(&ch->info); |
463 | ch->info.fbdefio = NULL; | 461 | ch->info.fbdefio = NULL; |
464 | } | 462 | } |