mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	* properly format/comment all patches * merge debloat patches * merge Kconfig patches * merge swconfig patches * merge hotplug patches * drop 200-fix_localversion.patch - upstream * drop 222-arm_zimage_none.patch - unused * drop 252-mv_cesa_depends.patch - no longer required * drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused * drop 661-fq_codel_keep_dropped_stats.patch - outdated * drop 702-phy_add_aneg_done_function.patch - upstream * drop 840-rtc7301.patch - unused * drop 841-rtc_pt7c4338.patch - upstream * drop 921-use_preinit_as_init.patch - unused * drop spio-gpio-old and gpio-mmc - unused Signed-off-by: John Crispin <john@phrozen.org>
		
			
				
	
	
		
			75 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From: Florian Fainelli <f.fainelli@gmail.com>
 | 
						|
Date: Tue, 22 Nov 2016 11:40:54 -0800
 | 
						|
Subject: [PATCH] net: phy: broadcom: Move bcm54xx_auxctl_{read, write} to
 | 
						|
 common library
 | 
						|
 | 
						|
We are going to need these functions to implement support for Broadcom
 | 
						|
Wirespeed, aka downshift.
 | 
						|
 | 
						|
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
 | 
						|
Signed-off-by: David S. Miller <davem@davemloft.net>
 | 
						|
---
 | 
						|
 | 
						|
--- a/drivers/net/phy/bcm-phy-lib.c
 | 
						|
+++ b/drivers/net/phy/bcm-phy-lib.c
 | 
						|
@@ -50,6 +50,23 @@ int bcm_phy_read_exp(struct phy_device *
 | 
						|
 }
 | 
						|
 EXPORT_SYMBOL_GPL(bcm_phy_read_exp);
 | 
						|
 
 | 
						|
+int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
 | 
						|
+{
 | 
						|
+	/* The register must be written to both the Shadow Register Select and
 | 
						|
+	 * the Shadow Read Register Selector
 | 
						|
+	 */
 | 
						|
+	phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum |
 | 
						|
+		  regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT);
 | 
						|
+	return phy_read(phydev, MII_BCM54XX_AUX_CTL);
 | 
						|
+}
 | 
						|
+EXPORT_SYMBOL_GPL(bcm54xx_auxctl_read);
 | 
						|
+
 | 
						|
+int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
 | 
						|
+{
 | 
						|
+	return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
 | 
						|
+}
 | 
						|
+EXPORT_SYMBOL(bcm54xx_auxctl_write);
 | 
						|
+
 | 
						|
 int bcm_phy_write_misc(struct phy_device *phydev,
 | 
						|
 		       u16 reg, u16 chl, u16 val)
 | 
						|
 {
 | 
						|
--- a/drivers/net/phy/bcm-phy-lib.h
 | 
						|
+++ b/drivers/net/phy/bcm-phy-lib.h
 | 
						|
@@ -19,6 +19,9 @@
 | 
						|
 int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val);
 | 
						|
 int bcm_phy_read_exp(struct phy_device *phydev, u16 reg);
 | 
						|
 
 | 
						|
+int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
 | 
						|
+int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);
 | 
						|
+
 | 
						|
 int bcm_phy_write_misc(struct phy_device *phydev,
 | 
						|
 		       u16 reg, u16 chl, u16 value);
 | 
						|
 int bcm_phy_read_misc(struct phy_device *phydev,
 | 
						|
--- a/drivers/net/phy/broadcom.c
 | 
						|
+++ b/drivers/net/phy/broadcom.c
 | 
						|
@@ -30,21 +30,6 @@ MODULE_DESCRIPTION("Broadcom PHY driver"
 | 
						|
 MODULE_AUTHOR("Maciej W. Rozycki");
 | 
						|
 MODULE_LICENSE("GPL");
 | 
						|
 
 | 
						|
-static int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
 | 
						|
-{
 | 
						|
-	/* The register must be written to both the Shadow Register Select and
 | 
						|
-	 * the Shadow Read Register Selector
 | 
						|
-	 */
 | 
						|
-	phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum |
 | 
						|
-		  regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT);
 | 
						|
-	return phy_read(phydev, MII_BCM54XX_AUX_CTL);
 | 
						|
-}
 | 
						|
-
 | 
						|
-static int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
 | 
						|
-{
 | 
						|
-	return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val);
 | 
						|
-}
 | 
						|
-
 | 
						|
 static int bcm54810_config(struct phy_device *phydev)
 | 
						|
 {
 | 
						|
 	int rc, val;
 |