.. | .. |
---|
1208 | 1208 | case 1: |
---|
1209 | 1209 | if (mc & 0x4) |
---|
1210 | 1210 | break; |
---|
1211 | | - /* fall through */ |
---|
| 1211 | + fallthrough; |
---|
1212 | 1212 | case 2: |
---|
1213 | 1213 | dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP; |
---|
1214 | 1214 | dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET; |
---|
1215 | | - /* fall through */ |
---|
| 1215 | + fallthrough; |
---|
1216 | 1216 | case 0: |
---|
1217 | 1217 | dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP; |
---|
1218 | 1218 | dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET; |
---|
.. | .. |
---|
1221 | 1221 | case 1: |
---|
1222 | 1222 | if (!(mc & 0x4)) |
---|
1223 | 1223 | break; |
---|
1224 | | - /* fall through */ |
---|
| 1224 | + fallthrough; |
---|
1225 | 1225 | case 2: |
---|
1226 | 1226 | dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP; |
---|
1227 | 1227 | dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET; |
---|
.. | .. |
---|
1431 | 1431 | mdelay( 15); |
---|
1432 | 1432 | } |
---|
1433 | 1433 | |
---|
1434 | | -#if defined(CONFIG_PM) |
---|
1435 | 1434 | #if defined(CONFIG_X86) || defined(CONFIG_PPC_PMAC) |
---|
1436 | 1435 | static void radeon_pm_reset_pad_ctlr_strength(struct radeonfb_info *rinfo) |
---|
1437 | 1436 | { |
---|
.. | .. |
---|
2210 | 2209 | radeon_pm_m10_enable_lvds_spread_spectrum(rinfo); |
---|
2211 | 2210 | } |
---|
2212 | 2211 | #endif |
---|
2213 | | -#endif |
---|
2214 | 2212 | |
---|
2215 | 2213 | #if 0 /* Not ready yet */ |
---|
2216 | 2214 | static void radeon_reinitialize_QW(struct radeonfb_info *rinfo) |
---|
.. | .. |
---|
2593 | 2591 | * calling pci_set_power_state() |
---|
2594 | 2592 | */ |
---|
2595 | 2593 | radeonfb_whack_power_state(rinfo, PCI_D2); |
---|
2596 | | - __pci_complete_power_transition(rinfo->pdev, PCI_D2); |
---|
| 2594 | + pci_platform_power_transition(rinfo->pdev, PCI_D2); |
---|
2597 | 2595 | } else { |
---|
2598 | 2596 | printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n", |
---|
2599 | 2597 | pci_name(rinfo->pdev)); |
---|
.. | .. |
---|
2613 | 2611 | } |
---|
2614 | 2612 | } |
---|
2615 | 2613 | |
---|
2616 | | -int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) |
---|
| 2614 | +static int radeonfb_pci_suspend_late(struct device *dev, pm_message_t mesg) |
---|
2617 | 2615 | { |
---|
| 2616 | + struct pci_dev *pdev = to_pci_dev(dev); |
---|
2618 | 2617 | struct fb_info *info = pci_get_drvdata(pdev); |
---|
2619 | 2618 | struct radeonfb_info *rinfo = info->par; |
---|
2620 | 2619 | |
---|
.. | .. |
---|
2662 | 2661 | pmac_suspend_agp_for_card(pdev); |
---|
2663 | 2662 | #endif /* CONFIG_PPC_PMAC */ |
---|
2664 | 2663 | |
---|
2665 | | - /* It's unclear whether or when the generic code will do that, so let's |
---|
2666 | | - * do it ourselves. We save state before we do any power management |
---|
2667 | | - */ |
---|
2668 | | - pci_save_state(pdev); |
---|
2669 | | - |
---|
2670 | 2664 | /* If we support wakeup from poweroff, we save all regs we can including cfg |
---|
2671 | 2665 | * space |
---|
2672 | 2666 | */ |
---|
.. | .. |
---|
2691 | 2685 | msleep(20); |
---|
2692 | 2686 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON)); |
---|
2693 | 2687 | } |
---|
2694 | | - pci_disable_device(pdev); |
---|
2695 | 2688 | } |
---|
2696 | 2689 | /* If we support D2, we go to it (should be fixed later with a flag forcing |
---|
2697 | 2690 | * D3 only for some laptops) |
---|
.. | .. |
---|
2707 | 2700 | return 0; |
---|
2708 | 2701 | } |
---|
2709 | 2702 | |
---|
| 2703 | +static int radeonfb_pci_suspend(struct device *dev) |
---|
| 2704 | +{ |
---|
| 2705 | + return radeonfb_pci_suspend_late(dev, PMSG_SUSPEND); |
---|
| 2706 | +} |
---|
| 2707 | + |
---|
| 2708 | +static int radeonfb_pci_hibernate(struct device *dev) |
---|
| 2709 | +{ |
---|
| 2710 | + return radeonfb_pci_suspend_late(dev, PMSG_HIBERNATE); |
---|
| 2711 | +} |
---|
| 2712 | + |
---|
| 2713 | +static int radeonfb_pci_freeze(struct device *dev) |
---|
| 2714 | +{ |
---|
| 2715 | + return radeonfb_pci_suspend_late(dev, PMSG_FREEZE); |
---|
| 2716 | +} |
---|
| 2717 | + |
---|
2710 | 2718 | static int radeon_check_power_loss(struct radeonfb_info *rinfo) |
---|
2711 | 2719 | { |
---|
2712 | 2720 | return rinfo->save_regs[4] != INPLL(CLK_PIN_CNTL) || |
---|
.. | .. |
---|
2714 | 2722 | rinfo->save_regs[3] != INPLL(SCLK_CNTL); |
---|
2715 | 2723 | } |
---|
2716 | 2724 | |
---|
2717 | | -int radeonfb_pci_resume(struct pci_dev *pdev) |
---|
| 2725 | +static int radeonfb_pci_resume(struct device *dev) |
---|
2718 | 2726 | { |
---|
| 2727 | + struct pci_dev *pdev = to_pci_dev(dev); |
---|
2719 | 2728 | struct fb_info *info = pci_get_drvdata(pdev); |
---|
2720 | 2729 | struct radeonfb_info *rinfo = info->par; |
---|
2721 | 2730 | int rc = 0; |
---|
.. | .. |
---|
2797 | 2806 | return rc; |
---|
2798 | 2807 | } |
---|
2799 | 2808 | |
---|
| 2809 | +const struct dev_pm_ops radeonfb_pci_pm_ops = { |
---|
| 2810 | + .suspend = radeonfb_pci_suspend, |
---|
| 2811 | + .resume = radeonfb_pci_resume, |
---|
| 2812 | + .freeze = radeonfb_pci_freeze, |
---|
| 2813 | + .thaw = radeonfb_pci_resume, |
---|
| 2814 | + .poweroff = radeonfb_pci_hibernate, |
---|
| 2815 | + .restore = radeonfb_pci_resume, |
---|
| 2816 | +}; |
---|
| 2817 | + |
---|
2800 | 2818 | #ifdef CONFIG_PPC__disabled |
---|
2801 | 2819 | static void radeonfb_early_resume(void *data) |
---|
2802 | 2820 | { |
---|
.. | .. |
---|
2844 | 2862 | * in some desktop G4s), Via (M9+ chip on iBook G4) and |
---|
2845 | 2863 | * Snowy (M11 chip on iBook G4 manufactured after July 2005) |
---|
2846 | 2864 | */ |
---|
2847 | | - if (!strcmp(rinfo->of_node->name, "ATY,JasperParent") || |
---|
2848 | | - !strcmp(rinfo->of_node->name, "ATY,SnowyParent")) { |
---|
| 2865 | + if (of_node_name_eq(rinfo->of_node, "ATY,JasperParent") || |
---|
| 2866 | + of_node_name_eq(rinfo->of_node, "ATY,SnowyParent")) { |
---|
2849 | 2867 | rinfo->reinit_func = radeon_reinitialize_M10; |
---|
2850 | 2868 | rinfo->pm_mode |= radeon_pm_off; |
---|
2851 | 2869 | } |
---|
.. | .. |
---|
2855 | 2873 | rinfo->pm_mode |= radeon_pm_off; |
---|
2856 | 2874 | } |
---|
2857 | 2875 | #endif |
---|
2858 | | - if (!strcmp(rinfo->of_node->name, "ATY,ViaParent")) { |
---|
| 2876 | + if (of_node_name_eq(rinfo->of_node, "ATY,ViaParent")) { |
---|
2859 | 2877 | rinfo->reinit_func = radeon_reinitialize_M9P; |
---|
2860 | 2878 | rinfo->pm_mode |= radeon_pm_off; |
---|
2861 | 2879 | } |
---|