lantiq: add wifi eep to a803 dts file
[openwrt.git] / target / linux / lantiq / patches-3.8 / 0018-MIPS-lantiq-improve-pci-reset-gpio-handling.patch
1 From b6684dd3036513e4f91986fe982356512458f711 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sat, 19 Jan 2013 08:54:26 +0000
4 Subject: [PATCH 18/40] MIPS: lantiq: improve pci reset gpio handling
5
6 We need to make sure that the reset gpio is available and also set a sane
7 default state.
8
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Patchwork: http://patchwork.linux-mips.org/patch/4817/
11 ---
12  arch/mips/pci/pci-lantiq.c |   12 ++++++++++--
13  1 file changed, 10 insertions(+), 2 deletions(-)
14
15 --- a/arch/mips/pci/pci-lantiq.c
16 +++ b/arch/mips/pci/pci-lantiq.c
17 @@ -129,8 +129,16 @@ static int ltq_pci_startup(struct platfo
18  
19         /* setup reset gpio used by pci */
20         reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
21 -       if (gpio_is_valid(reset_gpio))
22 -               devm_gpio_request(&pdev->dev, reset_gpio, "pci-reset");
23 +       if (gpio_is_valid(reset_gpio)) {
24 +               int ret = devm_gpio_request(&pdev->dev,
25 +                                               reset_gpio, "pci-reset");
26 +               if (ret) {
27 +                       dev_err(&pdev->dev,
28 +                               "failed to request gpio %d\n", reset_gpio);
29 +                       return ret;
30 +               }
31 +               gpio_direction_output(reset_gpio, 1);
32 +       }
33  
34         /* enable auto-switching between PCI and EBU */
35         ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);