pch_phub: Care FUNCSEL register in PM
authorTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Thu, 21 Jul 2011 08:07:08 +0000 (17:07 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 00:54:28 +0000 (17:54 -0700)
Only ML7213/ML7223(Bus-n) has this register.
Currently,this driver doesn't care register "FUNCSEL" in suspend/resume.
This patch saves/restores FUNCSEL register only when the device is ML7213 or
ML7223(Bus-n).

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/misc/pch_phub.c

index 0fd7e77bee297d1da1d877cfe8af2146644ef74c..61ece53f2f4169228b673fbd92c64ea23e622e27 100644 (file)
@@ -90,6 +90,7 @@
 #define PCH_PHUB_INTPIN_REG_WPERMIT_REG3       0x002C
 #define PCH_PHUB_INT_REDUCE_CONTROL_REG_BASE   0x0040
 #define CLKCFG_REG_OFFSET                      0x500
+#define FUNCSEL_REG_OFFSET                     0x508
 
 #define PCH_PHUB_OROM_SIZE 15360
 
  * @intpin_reg_wpermit_reg3:           INTPIN_REG_WPERMIT register 3 val
  * @int_reduce_control_reg:            INT_REDUCE_CONTROL registers val
  * @clkcfg_reg:                                CLK CFG register val
+ * @funcsel_reg:                       Function select register value
  * @pch_phub_base_address:             Register base address
  * @pch_phub_extrom_base_address:      external rom base address
  * @pch_mac_start_address:             MAC address area start address
@@ -128,6 +130,7 @@ struct pch_phub_reg {
        u32 intpin_reg_wpermit_reg3;
        u32 int_reduce_control_reg[MAX_NUM_INT_REDUCE_CONTROL_REG];
        u32 clkcfg_reg;
+       u32 funcsel_reg;
        void __iomem *pch_phub_base_address;
        void __iomem *pch_phub_extrom_base_address;
        u32 pch_mac_start_address;
@@ -211,6 +214,8 @@ static void pch_phub_save_reg_conf(struct pci_dev *pdev)
                        __func__, i, chip->int_reduce_control_reg[i]);
        }
        chip->clkcfg_reg = ioread32(p + CLKCFG_REG_OFFSET);
+       if ((chip->ioh_type == 2) || (chip->ioh_type == 4))
+               chip->funcsel_reg = ioread32(p + FUNCSEL_REG_OFFSET);
 }
 
 /* pch_phub_restore_reg_conf - restore register configuration */
@@ -271,6 +276,8 @@ static void pch_phub_restore_reg_conf(struct pci_dev *pdev)
        }
 
        iowrite32(chip->clkcfg_reg, p + CLKCFG_REG_OFFSET);
+       if ((chip->ioh_type == 2) || (chip->ioh_type == 4))
+               iowrite32(chip->funcsel_reg, p + FUNCSEL_REG_OFFSET);
 }
 
 /**