linux-mips
[Top] [All Lists]

[PATCH 6/7] MIPS: BCM63XX: let board specify an external GPIO to reset P

To: ralf@linux-mips.org
Subject: [PATCH 6/7] MIPS: BCM63XX: let board specify an external GPIO to reset PHY
From: "Florian Fainelli" <florian@openwrt.org>
Date: Tue, 18 Jun 2013 18:55:43 +0100
Cc: linux-mips@linux-mips.org, cernekee@gmail.com, jogo@openwrt.org, "Florian Fainelli" <florian@openwrt.org>
In-reply-to: <1371578144-12794-1-git-send-email-florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1371578144-12794-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
Some boards may need to reset their external PHY or switch they are
attached to, add a hook for doing this along with providing custom
linux/gpio.h flags for doing this.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 arch/mips/bcm63xx/boards/board_bcm963xx.c           | 4 ++++
 arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c 
b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 46eabb9..611a420 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -883,5 +883,9 @@ int __init board_register_devices(void)
 
        platform_device_register(&bcm63xx_gpio_leds);
 
+       if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags)
+               gpio_request_one(board.ephy_reset_gpio,
+                               board.ephy_reset_gpio_flags, "ephy-reset");
+
        return 0;
 }
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 
b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index 682bcf3..5981fe0 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -45,6 +45,12 @@ struct board_info {
 
        /* GPIO LEDs */
        struct gpio_led leds[5];
+
+       /* External PHY reset GPIO */
+       unsigned int ephy_reset_gpio;
+
+       /* External PHY reset GPIO flags from gpio.h */
+       unsigned long ephy_reset_gpio_flags;
 };
 
 #endif /* ! BOARD_BCM963XX_H_ */
-- 
1.8.1.2



<Prev in Thread] Current Thread [Next in Thread>