[PATCH v3] powerpc: Basic GPIO support for GE Fanuc SBC610

Anton Vorontsov avorontsov at ru.mvista.com
Sat Nov 8 00:55:00 EST 2008


On Fri, Nov 07, 2008 at 01:00:15PM +0000, Martyn Welch wrote:
> Basic support for the GPIO available on the SBC610 VPX Single Board Computer
> from GE Fanuc (PowerPC MPC8641D).
> 
> This patch adds basic support for the GPIO in the devices I/O FPGA, the GPIO
> functionality is exposed through the AFIX pins on the backplane, unless used
> by an AFIX card.
> 
> This code currently does not support switching between totem-pole and
> open-drain outputs (when used as outputs, GPIOs default to totem-pole).
> The interrupt capabilites of the GPIO lines is also not currently supported.
> 
> Signed-off-by: Martyn Welch <martyn.welch at gefanuc.com>

Looks great.

Reviewed-by: Anton Vorontsov <avorontsov at ru.mvista.com>

[...]
> +static void gef_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
> +{
> +	struct of_mm_gpio_chip *mmchip;
> +
> +	/* Find memory mapped gpio chip structure from gpio_chip, this contains
> +	 * the mapped location of the GPIO controller
> +	 */

Just nitpicking, you might want to remove this repetitive
comment, it is quite obvious anyway. Will save 5 lines of code per
function, 20 lines in sum.

struct of_mm_gpio_chip *mmchip = to_of_mm_gpio_chip(chip);

> +	mmchip = to_of_mm_gpio_chip(chip);
> +
> +	_gef_gpio_set(mmchip->regs + GEF_GPIO_OUT, offset, value);
> +

Stray empty line here.

> +}
> +

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2



More information about the Linuxppc-dev mailing list