brcm47xx: add initial support for kernel 3.14
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.14 / 128-MIPS-BCM47XX-Add-new-file-for-device-specific-workar.patch
1 From 1f3e1c682a0b5273e3ee8799b54319971f426e6a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Wed, 29 Jan 2014 18:06:52 +0100
4 Subject: [RFC V2][PATCH] MIPS: BCM47XX: Add new file for device specific workarounds
5
6 ---
7 V2: Drop pr_debug for devices we don't need workarounds for. It was too
8 load and not useful at all.
9 ---
10 arch/mips/bcm47xx/Makefile | 2 +-
11 arch/mips/bcm47xx/bcm47xx_private.h | 3 +++
12 arch/mips/bcm47xx/setup.c | 1 +
13 arch/mips/bcm47xx/workarounds.c | 25 +++++++++++++++++++++++++
14 4 files changed, 30 insertions(+), 1 deletion(-)
15 create mode 100644 arch/mips/bcm47xx/workarounds.c
16
17 --- a/arch/mips/bcm47xx/Makefile
18 +++ b/arch/mips/bcm47xx/Makefile
19 @@ -4,4 +4,4 @@
20 #
21
22 obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
23 -obj-y += board.o buttons.o leds.o
24 +obj-y += board.o buttons.o leds.o workarounds.o
25 --- a/arch/mips/bcm47xx/bcm47xx_private.h
26 +++ b/arch/mips/bcm47xx/bcm47xx_private.h
27 @@ -9,4 +9,7 @@ int __init bcm47xx_buttons_register(void
28 /* leds.c */
29 void __init bcm47xx_leds_register(void);
30
31 +/* workarounds.c */
32 +void __init bcm47xx_workarounds(void);
33 +
34 #endif
35 --- a/arch/mips/bcm47xx/setup.c
36 +++ b/arch/mips/bcm47xx/setup.c
37 @@ -282,6 +282,7 @@ static int __init bcm47xx_register_bus_c
38 }
39 bcm47xx_buttons_register();
40 bcm47xx_leds_register();
41 + bcm47xx_workarounds();
42
43 fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
44 return 0;
45 --- /dev/null
46 +++ b/arch/mips/bcm47xx/workarounds.c
47 @@ -0,0 +1,25 @@
48 +#include "bcm47xx_private.h"
49 +
50 +#include <linux/gpio.h>
51 +#include <bcm47xx_board.h>
52 +#include <bcm47xx.h>
53 +
54 +static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
55 +{
56 + /* Set GPIO 12 to 1 to pass power to the USB port */
57 + gpio_set_value(12, 1);
58 +}
59 +
60 +void __init bcm47xx_workarounds(void)
61 +{
62 + enum bcm47xx_board board = bcm47xx_board_get();
63 +
64 + switch (board) {
65 + case BCM47XX_BOARD_NETGEAR_WNR3500L:
66 + bcm47xx_workarounds_netgear_wnr3500l();
67 + break;
68 + default:
69 + /* No workaround(s) needed */
70 + break;
71 + }
72 +}