]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
atl1: add PHY power save mode
authorJay Cliburn <jacliburn@bellsouth.net>
Sat, 10 May 2008 03:12:06 +0000 (22:12 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 13 May 2008 05:30:23 +0000 (01:30 -0400)
Using vendor-provided magic, add code to enter power save mode
on the PHY.  We'll need this for suspend and wake-on-lan.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/atlx/atl1.c
drivers/net/atlx/atlx.h

index 0afe522b8f7b901e2a078ff33739a0a9866299c3..3beb44e80ba0ec8ea396c02b38457130a58bca67 100644 (file)
@@ -638,21 +638,18 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
 }
 
 /*
- *TODO: do something or get rid of this
+ * Force the PHY into power saving mode using vendor magic.
  */
 #ifdef CONFIG_PM
-static s32 atl1_phy_enter_power_saving(struct atl1_hw *hw)
+static void atl1_phy_enter_power_saving(struct atl1_hw *hw)
 {
-/*    s32 ret_val;
- *    u16 phy_data;
- */
+       atl1_write_phy_reg(hw, MII_DBG_ADDR, 0);
+       atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E);
+       atl1_write_phy_reg(hw, MII_DBG_ADDR, 2);
+       atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000);
+       atl1_write_phy_reg(hw, MII_DBG_ADDR, 3);
+       atl1_write_phy_reg(hw, MII_DBG_DATA, 0);
 
-/*
-    ret_val = atl1_write_phy_reg(hw, ...);
-    ret_val = atl1_write_phy_reg(hw, ...);
-    ....
-*/
-       return 0;
 }
 #endif
 
index 3be7c09734d48bda7ab0906e0562e085f108ea94..96721881ad66e42504c1fbf0b593c3c03bee8119 100644 (file)
@@ -460,6 +460,9 @@ MODULE_VERSION(ATLX_DRIVER_VERSION);
 #define MII_ATLX_PSSR_100MBS           0x4000  /* 01=100Mbs */
 #define MII_ATLX_PSSR_1000MBS          0x8000  /* 10=1000Mbs */
 
+#define MII_DBG_ADDR                   0x1D
+#define MII_DBG_DATA                   0x1E
+
 /* PCI Command Register Bit Definitions */
 #define PCI_REG_COMMAND                        0x04    /* PCI Command Register */
 #define CMD_IO_SPACE                   0x0001