]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: BCM63XX: let board specify an external GPIO to reset PHY
authorFlorian Fainelli <florian@openwrt.org>
Tue, 18 Jun 2013 16:55:43 +0000 (16:55 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 20 Jun 2013 14:58:08 +0000 (16:58 +0200)
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>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Cc: jogo@openwrt.org
Cc: Florian Fainelli <florian@openwrt.org>
Patchwork: https://patchwork.linux-mips.org/patch/5501/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/boards/board_bcm963xx.c
arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h

index 46eabb9aff51a0d38554890954c9f7d1d5a77131..611a420dbfdd0d41c178bab2b44d44afa2b74c98 100644 (file)
@@ -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;
 }
index 682bcf3b492ae65cdfa19fd27c6fbb62552dc185..5981fe0c3dfb3e7d9ee7c3d3d1773b4746d8ec70 100644 (file)
@@ -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_ */