linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration

To: Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Thu, 3 Nov 2011 23:04:08 +0100
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Hauke Mehrtens <hauke@hauke-m.de>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=1tZE7ezX44ehJ5LMMaO0LxfTRN4D65Tb/nGLmn5edCM=; b=GTGF5zP2VIPZ/BA7q3fJMdzOGY0Qt9xTY2d+00tKjghe2gg8aV81h/oJO0cFBHZrpR VcRqT1DGJV5Ce1kEDgZl5XWYZN8QvCS6/A36fcT0pyxiaZAMPvITOZn2UEPDX3HwXFP+ d38Le6t5SabOe4QtwFBTXnADz6sH+9lsCTRYg=
In-reply-to: <2526064.yKTpR1Kdyv@flexo>
References: <2526064.yKTpR1Kdyv@flexo>
Sender: linux-mips-bounce@linux-mips.org
Hi,

On 3 November 2011 16:05, Florian Fainelli <f.fainelli@gmail.com> wrote:
> Since eb9ae7f2 (gpio: fix build error in include/asm-generic/gpio.h)
> the generic version of gpio.h calls __gpio_{set,get}_value which we
> do not define. Get rid of asm-generic/gpio.h and define the missing
> stubs directly for BCM47xx to build.
>
> Reported-by: Ralf Baechle <ralf@linux-mips.org>
> CC: Hauke Mehrtens <hauke@hauke-m.de>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h 
> b/arch/mips/include/asm/mach-bcm47xx/gpio.h
> index 76961ca..26cc815 100644
> --- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
> +++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
> @@ -36,6 +36,8 @@ static inline int gpio_get_value(unsigned gpio)
>        return -EINVAL;
>  }
>
> +#define gpio_get_value_cansleep        gpio_get_value
> +
>  static inline void gpio_set_value(unsigned gpio, int value)
>  {
>        switch (bcm47xx_bus_type) {
> @@ -54,6 +56,19 @@ static inline void gpio_set_value(unsigned gpio, int value)
>        }
>  }
>
> +#define gpio_set_value_cansleep gpio_set_value
> +
> +static inline int gpio_cansleep(unsigned gpio)
> +{
> +       return 0;
> +}
> +
> +static inline int gpio_is_valid(unsigned gpio)
> +{
> +       return gpio < (BCM47XX_EXTIF_GPIO_LINES + BCM47XX_EXTIF_GPIO_LINES);

This looks wrong; did you perhaps mean BCM47XX_EXTIF_GPIO_LINES +
BCM47XX_CHIPCO_GPIO_LINES?

BCM47XX_CHIPCO_GPIO_LINES (=16) is bigger than (2 *
BCM47XX_EXTIF_GPIO_LINES(=5)), which would make the upper 6 chipco
gpios always invalid.


Regards,
Jonas

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