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
7 V2: Drop pr_debug for devices we don't need workarounds for. It was too
8 load and not useful at all.
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
17 --- a/arch/mips/bcm47xx/Makefile
18 +++ b/arch/mips/bcm47xx/Makefile
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
29 void __init bcm47xx_leds_register(void);
32 +void __init bcm47xx_workarounds(void);
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
39 bcm47xx_buttons_register();
40 bcm47xx_leds_register();
41 + bcm47xx_workarounds();
43 fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
46 +++ b/arch/mips/bcm47xx/workarounds.c
48 +#include "bcm47xx_private.h"
50 +#include <linux/gpio.h>
51 +#include <bcm47xx_board.h>
54 +static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
56 + const int usb_power = 12;
59 + err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
61 + pr_err("Failed to request USB power gpio: %d\n", err);
63 + gpio_free(usb_power);
66 +void __init bcm47xx_workarounds(void)
68 + enum bcm47xx_board board = bcm47xx_board_get();
71 + case BCM47XX_BOARD_NETGEAR_WNR3500L:
72 + bcm47xx_workarounds_netgear_wnr3500l();
75 + /* No workaround(s) needed */