Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1bf7d4d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6

Pull GPIO driver changes from Grant Likely:
 "Lots of gpio changes, both to core code and drivers.

  Changes do touch architecture code to remove the need for separate
  arm/gpio.h includes in most architectures.

  Some new drivers are added, and a number of gpio drivers are converted
  to use irq_domains for gpio inputs used as interrupts.  Device tree
  support has been amended to allow multiple gpio_chips to use the same
  device tree node.

  Remaining changes are primarily bug fixes."

* tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6: (33 commits)
  gpio/generic: initialize basic_mmio_gpio shadow variables properly
  gpiolib: Remove 'const' from data argument of gpiochip_find()
  gpio/rc5t583: add gpio driver for RICOH PMIC RC5T583
  gpiolib: quiet gpiochip_add boot message noise
  gpio: mpc8xxx: Prevent NULL pointer deref in demux handler
  gpio/lpc32xx: Add device tree support
  gpio: Adjust of_xlate API to support multiple GPIO chips
  gpiolib: Implement devm_gpio_request_one()
  gpio-mcp23s08: dbg_show: fix pullup configuration display
  Add support for TCA6424A
  gpio/omap: (re)fix wakeups on level-triggered GPIOs
  gpio/omap: fix broken context restore for non-OFF mode transitions
  gpio/omap: fix missing check in *_runtime_suspend()
  gpio/omap: remove cpu_is_omapxxxx() checks from *_runtime_resume()
  gpio/omap: remove suspend/resume callbacks
  gpio/omap: remove retrigger variable in gpio_irq_handler
  gpio/omap: remove saved_wakeup field from struct gpio_bank
  gpio/omap: remove suspend_wakeup field from struct gpio_bank
  gpio/omap: remove saved_fallingdetect, saved_risingdetect
  gpio/omap: remove virtual_irq_start variable
  ...

Conflicts:
	drivers/gpio/gpio-samsung.c
parents 0708500d 3e11f7b8
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
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 −0
Original line number Diff line number Diff line
@@ -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:

+4 −55
Original line number Diff line number Diff line
/*
 * 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 −0
Original line number Diff line number Diff line
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
+1 −2
Original line number Diff line number Diff line
@@ -98,8 +98,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);
}
Loading