Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307691
b: refs/heads/master
c: adf11b6
h: refs/heads/master
i:
  307689: e714eea
  307687: a993844
v: v3
  • Loading branch information
Grant Likely committed May 18, 2012
1 parent 715f549 commit 1b2f672
Show file tree
Hide file tree
Showing 41 changed files with 968 additions and 764 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3c64bc30af67ed328a8d919e41160942b870451
refs/heads/master: adf11b62f3ef59b72f280df44f129e36091b242f
43 changes: 43 additions & 0 deletions trunk/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
NXP LPC32xx SoC GPIO controller

Required properties:
- compatible: must be "nxp,lpc3220-gpio"
- reg: Physical base address and length of the controller's registers.
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be 3:
1) bank:
0: GPIO P0
1: GPIO P1
2: GPIO P2
3: GPIO P3
4: GPI P3
5: GPO P3
2) pin number
3) optional parameters:
- bit 0 specifies polarity (0 for normal, 1 for inverted)
- reg: Index of the GPIO group

Example:

gpio: gpio@40028000 {
compatible = "nxp,lpc3220-gpio";
reg = <0x40028000 0x1000>;
gpio-controller;
#gpio-cells = <3>; /* bank, pin, flags */
};

leds {
compatible = "gpio-leds";

led0 {
gpios = <&gpio 5 1 1>; /* GPO_P3 1, active low */
linux,default-trigger = "heartbeat";
default-state = "off";
};

led1 {
gpios = <&gpio 5 14 1>; /* GPO_P3 14, active low */
linux,default-trigger = "timer";
default-state = "off";
};
};
3 changes: 3 additions & 0 deletions trunk/Documentation/gpio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ where 'flags' is currently defined to specify the following properties:
* GPIOF_OPEN_DRAIN - gpio pin is open drain type.
* GPIOF_OPEN_SOURCE - gpio pin is open source type.

* GPIOF_EXPORT_DIR_FIXED - export gpio to sysfs, keep direction
* GPIOF_EXPORT_DIR_CHANGEABLE - also export, allow changing direction

since GPIOF_INIT_* are only valid when configured as output, so group valid
combinations as:

Expand Down
59 changes: 4 additions & 55 deletions trunk/arch/alpha/include/asm/gpio.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,4 @@
/*
* Generic GPIO API implementation for Alpha.
*
* A stright copy of that for PowerPC which was:
*
* Copyright (c) 2007-2008 MontaVista Software, Inc.
*
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#ifndef _ASM_ALPHA_GPIO_H
#define _ASM_ALPHA_GPIO_H

#include <linux/errno.h>
#include <asm-generic/gpio.h>

#ifdef CONFIG_GPIOLIB

/*
* We don't (yet) implement inlined/rapid versions for on-chip gpios.
* Just call gpiolib.
*/
static inline int gpio_get_value(unsigned int gpio)
{
return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned int gpio, int value)
{
__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned int gpio)
{
return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned int gpio)
{
return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* _ASM_ALPHA_GPIO_H */
#ifndef __LINUX_GPIO_H
#warning Include linux/gpio.h instead of asm/gpio.h
#include <linux/gpio.h>
#endif
1 change: 1 addition & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config ARM
bool
default y
select ARCH_HAVE_CUSTOM_GPIO_H
select HAVE_AOUT
select HAVE_DMA_API_DEBUG
select HAVE_IDE if PCI || ISA || PCMCIA
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-imx/mach-mx35_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ static struct i2c_board_info __initdata i2c_devices_3ds[] = {

static int lcd_power_gpio = -ENXIO;

static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip,
const void *data)
static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, void *data)
{
return !strcmp(chip->label, data);
}
Expand Down
9 changes: 8 additions & 1 deletion trunk/arch/arm/mach-lpc32xx/include/mach/gpio.h
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/* empty */
#ifndef __MACH_GPIO_H
#define __MACH_GPIO_H

#include "gpio-lpc32xx.h"

#define ARCH_NR_GPIOS (LPC32XX_GPO_P3_GRP + LPC32XX_GPO_P3_MAX)

#endif /* __MACH_GPIO_H */
1 change: 1 addition & 0 deletions trunk/arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config AVR32
select GENERIC_ATOMIC64
select HARDIRQS_SW_RESEND
select GENERIC_IRQ_SHOW
select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_HAVE_NMI_SAFE_CMPXCHG
help
AVR32 is a high-performance 32-bit RISC microprocessor core,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ config BLACKFIN
select HAVE_KERNEL_LZO if RAMKERNEL
select HAVE_OPROFILE
select HAVE_PERF_EVENTS
select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_WANT_OPTIONAL_GPIOLIB
select HAVE_GENERIC_HARDIRQS
select GENERIC_ATOMIC64
Expand Down
59 changes: 4 additions & 55 deletions trunk/arch/ia64/include/asm/gpio.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,4 @@
/*
* Generic GPIO API implementation for IA-64.
*
* A stright copy of that for PowerPC which was:
*
* Copyright (c) 2007-2008 MontaVista Software, Inc.
*
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#ifndef _ASM_IA64_GPIO_H
#define _ASM_IA64_GPIO_H

#include <linux/errno.h>
#include <asm-generic/gpio.h>

#ifdef CONFIG_GPIOLIB

/*
* We don't (yet) implement inlined/rapid versions for on-chip gpios.
* Just call gpiolib.
*/
static inline int gpio_get_value(unsigned int gpio)
{
return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned int gpio, int value)
{
__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned int gpio)
{
return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned int gpio)
{
return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* _ASM_IA64_GPIO_H */
#ifndef __LINUX_GPIO_H
#warning Include linux/gpio.h instead of asm/gpio.h
#include <linux/gpio.h>
#endif
1 change: 1 addition & 0 deletions trunk/arch/m68k/Kconfig.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ config COLDFIRE
bool "Coldfire CPU family support"
select GENERIC_GPIO
select ARCH_REQUIRE_GPIOLIB
select ARCH_HAVE_CUSTOM_GPIO_H
select CPU_HAS_NO_BITFIELDS
select CPU_HAS_NO_MULDIV64
select GENERIC_CSUM
Expand Down
57 changes: 4 additions & 53 deletions trunk/arch/microblaze/include/asm/gpio.h
Original file line number Diff line number Diff line change
@@ -1,53 +1,4 @@
/*
* Generic GPIO API implementation for PowerPC.
*
* Copyright (c) 2007-2008 MontaVista Software, Inc.
*
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#ifndef _ASM_MICROBLAZE_GPIO_H
#define _ASM_MICROBLAZE_GPIO_H

#include <linux/errno.h>
#include <asm-generic/gpio.h>

#ifdef CONFIG_GPIOLIB

/*
* We don't (yet) implement inlined/rapid versions for on-chip gpios.
* Just call gpiolib.
*/
static inline int gpio_get_value(unsigned int gpio)
{
return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned int gpio, int value)
{
__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned int gpio)
{
return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned int gpio)
{
return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* _ASM_MICROBLAZE_GPIO_H */
#ifndef __LINUX_GPIO_H
#warning Include linux/gpio.h instead of asm/gpio.h
#include <linux/gpio.h>
#endif
1 change: 1 addition & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config MIPS
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_ARCH_KGDB
select ARCH_HAVE_CUSTOM_GPIO_H
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_DYNAMIC_FTRACE
Expand Down
69 changes: 4 additions & 65 deletions trunk/arch/openrisc/include/asm/gpio.h
Original file line number Diff line number Diff line change
@@ -1,65 +1,4 @@
/*
* OpenRISC Linux
*
* Linux architectural port borrowing liberally from similar works of
* others. All original copyrights apply as per the original source
* declaration.
*
* OpenRISC implementation:
* Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
* Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
* et al.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#ifndef __ASM_OPENRISC_GPIO_H
#define __ASM_OPENRISC_GPIO_H

#include <linux/errno.h>
#include <asm-generic/gpio.h>

#ifdef CONFIG_GPIOLIB

/*
* OpenRISC (or1k) does not have on-chip GPIO's so there is not really
* any standardized implementation that makes sense here. If passing
* through gpiolib becomes a bottleneck then it may make sense, on a
* case-by-case basis, to implement these inlined/rapid versions.
*
* Just call gpiolib.
*/
static inline int gpio_get_value(unsigned int gpio)
{
return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned int gpio, int value)
{
__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned int gpio)
{
return __gpio_cansleep(gpio);
}

/*
* Not implemented, yet.
*/
static inline int gpio_to_irq(unsigned int gpio)
{
return -ENOSYS;
}

static inline int irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* __ASM_OPENRISC_GPIO_H */
#ifndef __LINUX_GPIO_H
#warning Include linux/gpio.h instead of asm/gpio.h
#include <linux/gpio.h>
#endif
Loading

0 comments on commit 1b2f672

Please sign in to comment.