brcm63xx: Add profile and build image for Sagemcom F@ST2704V2 ADSL router
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-3.10 / 039-MIPS-BCM63XX-let-board-specify-an-external-GPIO-to-r.patch
1 From 0a97aafe7fe50ed183e7fa0121fa7838e2e20306 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Tue, 18 Jun 2013 16:55:43 +0000
4 Subject: [PATCH 5/6] MIPS: BCM63XX: let board specify an external GPIO to
5 reset PHY
6
7 Some boards may need to reset their external PHY or switch they are
8 attached to, add a hook for doing this along with providing custom
9 linux/gpio.h flags for doing this.
10
11 Signed-off-by: Florian Fainelli <florian@openwrt.org>
12 Cc: linux-mips@linux-mips.org
13 Cc: cernekee@gmail.com
14 Cc: jogo@openwrt.org
15 Cc: Florian Fainelli <florian@openwrt.org>
16 Patchwork: https://patchwork.linux-mips.org/patch/5501/
17 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
18 ---
19 arch/mips/bcm63xx/boards/board_bcm963xx.c | 4 ++++
20 arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 6 ++++++
21 2 files changed, 10 insertions(+)
22
23 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
24 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
25 @@ -883,5 +883,9 @@ int __init board_register_devices(void)
26
27 platform_device_register(&bcm63xx_gpio_leds);
28
29 + if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags)
30 + gpio_request_one(board.ephy_reset_gpio,
31 + board.ephy_reset_gpio_flags, "ephy-reset");
32 +
33 return 0;
34 }
35 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
36 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
37 @@ -45,6 +45,12 @@ struct board_info {
38
39 /* GPIO LEDs */
40 struct gpio_led leds[5];
41 +
42 + /* External PHY reset GPIO */
43 + unsigned int ephy_reset_gpio;
44 +
45 + /* External PHY reset GPIO flags from gpio.h */
46 + unsigned long ephy_reset_gpio_flags;
47 };
48
49 #endif /* ! BOARD_BCM963XX_H_ */