linux-mips
[Top] [All Lists]

Re: [PATCH V2 5/6] MIPS: lantiq: convert pci to managed gpio

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V2 5/6] MIPS: lantiq: convert pci to managed gpio
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 24 Feb 2012 14:38:33 +0400
Authentication-results: mr.google.com; spf=pass (google.com: domain of sshtylyov@mvista.com designates 10.204.151.3 as permitted sender) smtp.mail=sshtylyov@mvista.com
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <1330012913-13293-5-git-send-email-blogic@openwrt.org>
References: <1330012913-13293-1-git-send-email-blogic@openwrt.org> <1330012913-13293-5-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Hello.

On 23-02-2012 20:01, John Crispin wrote:

ltq_gpio_request() now uses devres to manage the gpios. We need to pass a
struct device pointer to make it work.

Signed-off-by: John Crispin<blogic@openwrt.org>
[...]

diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
index 3bf42c8..47b5d8e 100644
--- a/arch/mips/pci/pci-lantiq.c
+++ b/arch/mips/pci/pci-lantiq.c
@@ -150,24 +150,26 @@ static u32 ltq_calc_bar11mask(void)
        return bar11mask;
  }

-static void ltq_pci_setup_gpio(int gpio)
+static void ltq_pci_setup_gpio(struct device *dev)
  {
+       struct ltq_pci_data *conf = (struct ltq_pci_data *) dev->platform_data;
        int i;
        for (i = 0; i<  ARRAY_SIZE(ltq_pci_gpio_map); i++) {
-               if (gpio & (1 << i)) {
-                       ltq_gpio_request(ltq_pci_gpio_map[i].pin,
+               if (conf->gpio & (1 << i)) {
+                       ltq_gpio_request(dev, ltq_pci_gpio_map[i].pin,
                                ltq_pci_gpio_map[i].mux,
                                ltq_pci_gpio_map[i].dir,
                                ltq_pci_gpio_map[i].name);
                }
        }
-       ltq_gpio_request(21, 0, 1, "pci-reset");
-       ltq_pci_req_mask = (gpio>>  PCI_REQ_SHIFT)&  PCI_REQ_MASK;
+       ltq_gpio_request(dev, 21, 0, 1, "pci-reset");

   This needs to be merged with patch 1.

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>