Commit 4a2d732f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6:
  gpio_msm: Move Qualcomm MSM v2 gpio driver into drivers
  gpio_msm: Move Qualcomm v6 MSM driver into drivers
  msm: gpio: Fold register defs into C file
  msm: gpiomux: Move public API to public header
  msm: gpio: Remove ifdefs on gpio chip registers
  msm: gpio: Remove chip-specific register definitions
  msm: Remove chip-ifdefs for GPIO io mappings
  msm: gpio: Remove unsupported devices
  gpio: ab8500: fix MODULE_ALIAS for ab8500
  of/gpio: export of_gpio_simple_xlate
parents 965e32b1 867f503d
...@@ -11,6 +11,7 @@ config ARCH_MSM7X00A ...@@ -11,6 +11,7 @@ config ARCH_MSM7X00A
select MSM_SMD select MSM_SMD
select MSM_SMD_PKG3 select MSM_SMD_PKG3
select CPU_V6 select CPU_V6
select GPIO_MSM_V1
select MSM_PROC_COMM select MSM_PROC_COMM
select HAS_MSM_DEBUG_UART_PHYS select HAS_MSM_DEBUG_UART_PHYS
...@@ -22,6 +23,7 @@ config ARCH_MSM7X30 ...@@ -22,6 +23,7 @@ config ARCH_MSM7X30
select MSM_VIC select MSM_VIC
select CPU_V7 select CPU_V7
select MSM_GPIOMUX select MSM_GPIOMUX
select GPIO_MSM_V1
select MSM_PROC_COMM select MSM_PROC_COMM
select HAS_MSM_DEBUG_UART_PHYS select HAS_MSM_DEBUG_UART_PHYS
...@@ -33,6 +35,7 @@ config ARCH_QSD8X50 ...@@ -33,6 +35,7 @@ config ARCH_QSD8X50
select MSM_VIC select MSM_VIC
select CPU_V7 select CPU_V7
select MSM_GPIOMUX select MSM_GPIOMUX
select GPIO_MSM_V1
select MSM_PROC_COMM select MSM_PROC_COMM
select HAS_MSM_DEBUG_UART_PHYS select HAS_MSM_DEBUG_UART_PHYS
...@@ -44,6 +47,7 @@ config ARCH_MSM8X60 ...@@ -44,6 +47,7 @@ config ARCH_MSM8X60
select ARM_GIC select ARM_GIC
select CPU_V7 select CPU_V7
select MSM_V2_TLMM select MSM_V2_TLMM
select GPIO_MSM_V2
select MSM_GPIOMUX select MSM_GPIOMUX
select MSM_SCM if SMP select MSM_SCM if SMP
......
...@@ -29,11 +29,3 @@ obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o ...@@ -29,11 +29,3 @@ obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o
obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o
obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o
obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o
ifdef CONFIG_MSM_V2_TLMM
ifndef CONFIG_ARCH_MSM8960
# TODO: TLMM Mapping issues need to be resolved
obj-y += gpio-v2.o
endif
else
obj-y += gpio.o
endif
This diff is collapsed.
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <mach/msm_gpiomux.h>
#if defined(CONFIG_MSM_V2_TLMM) #if defined(CONFIG_MSM_V2_TLMM)
#include "gpiomux-v2.h" #include "gpiomux-v2.h"
...@@ -71,12 +72,6 @@ enum { ...@@ -71,12 +72,6 @@ enum {
*/ */
extern struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS]; extern struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS];
/* Increment a gpio's reference count, possibly activating the line. */
int __must_check msm_gpiomux_get(unsigned gpio);
/* Decrement a gpio's reference count, possibly suspending the line. */
int msm_gpiomux_put(unsigned gpio);
/* Install a new configuration to the gpio line. To avoid overwriting /* Install a new configuration to the gpio line. To avoid overwriting
* a configuration, leave the VALID bit out. * a configuration, leave the VALID bit out.
*/ */
...@@ -94,16 +89,6 @@ int msm_gpiomux_write(unsigned gpio, ...@@ -94,16 +89,6 @@ int msm_gpiomux_write(unsigned gpio,
*/ */
void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val); void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val);
#else #else
static inline int __must_check msm_gpiomux_get(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_put(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_write(unsigned gpio, static inline int msm_gpiomux_write(unsigned gpio,
gpiomux_config_t active, gpiomux_config_t active,
gpiomux_config_t suspended) gpiomux_config_t suspended)
......
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _LINUX_MSM_GPIOMUX_H
#define _LINUX_MSM_GPIOMUX_H
#ifdef CONFIG_MSM_GPIOMUX
/* Increment a gpio's reference count, possibly activating the line. */
int __must_check msm_gpiomux_get(unsigned gpio);
/* Decrement a gpio's reference count, possibly suspending the line. */
int msm_gpiomux_put(unsigned gpio);
#else
static inline int __must_check msm_gpiomux_get(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_put(unsigned gpio)
{
return -ENOSYS;
}
#endif
#endif /* _LINUX_MSM_GPIOMUX_H */
...@@ -55,13 +55,11 @@ ...@@ -55,13 +55,11 @@
#define MSM_DMOV_PHYS 0xA9700000 #define MSM_DMOV_PHYS 0xA9700000
#define MSM_DMOV_SIZE SZ_4K #define MSM_DMOV_SIZE SZ_4K
#define MSM_GPIO1_BASE IOMEM(0xE0003000) #define MSM7X00_GPIO1_PHYS 0xA9200000
#define MSM_GPIO1_PHYS 0xA9200000 #define MSM7X00_GPIO1_SIZE SZ_4K
#define MSM_GPIO1_SIZE SZ_4K
#define MSM_GPIO2_BASE IOMEM(0xE0004000) #define MSM7X00_GPIO2_PHYS 0xA9300000
#define MSM_GPIO2_PHYS 0xA9300000 #define MSM7X00_GPIO2_SIZE SZ_4K
#define MSM_GPIO2_SIZE SZ_4K
#define MSM_CLK_CTL_BASE IOMEM(0xE0005000) #define MSM_CLK_CTL_BASE IOMEM(0xE0005000)
#define MSM_CLK_CTL_PHYS 0xA8600000 #define MSM_CLK_CTL_PHYS 0xA8600000
......
...@@ -46,13 +46,11 @@ ...@@ -46,13 +46,11 @@
#define MSM_DMOV_PHYS 0xAC400000 #define MSM_DMOV_PHYS 0xAC400000
#define MSM_DMOV_SIZE SZ_4K #define MSM_DMOV_SIZE SZ_4K
#define MSM_GPIO1_BASE IOMEM(0xE0003000) #define MSM7X30_GPIO1_PHYS 0xAC001000
#define MSM_GPIO1_PHYS 0xAC001000 #define MSM7X30_GPIO1_SIZE SZ_4K
#define MSM_GPIO1_SIZE SZ_4K
#define MSM_GPIO2_BASE IOMEM(0xE0004000) #define MSM7X30_GPIO2_PHYS 0xAC101000
#define MSM_GPIO2_PHYS 0xAC101000 #define MSM7X30_GPIO2_SIZE SZ_4K
#define MSM_GPIO2_SIZE SZ_4K
#define MSM_CLK_CTL_BASE IOMEM(0xE0005000) #define MSM_CLK_CTL_BASE IOMEM(0xE0005000)
#define MSM_CLK_CTL_PHYS 0xAB800000 #define MSM_CLK_CTL_PHYS 0xAB800000
......
...@@ -46,13 +46,11 @@ ...@@ -46,13 +46,11 @@
#define MSM_DMOV_PHYS 0xA9700000 #define MSM_DMOV_PHYS 0xA9700000
#define MSM_DMOV_SIZE SZ_4K #define MSM_DMOV_SIZE SZ_4K
#define MSM_GPIO1_BASE IOMEM(0xE0003000) #define QSD8X50_GPIO1_PHYS 0xA9000000
#define MSM_GPIO1_PHYS 0xA9000000 #define QSD8X50_GPIO1_SIZE SZ_4K
#define MSM_GPIO1_SIZE SZ_4K
#define MSM_GPIO2_BASE IOMEM(0xE0004000) #define QSD8X50_GPIO2_PHYS 0xA9100000
#define MSM_GPIO2_PHYS 0xA9100000 #define QSD8X50_GPIO2_SIZE SZ_4K
#define MSM_GPIO2_SIZE SZ_4K
#define MSM_CLK_CTL_BASE IOMEM(0xE0005000) #define MSM_CLK_CTL_BASE IOMEM(0xE0005000)
#define MSM_CLK_CTL_PHYS 0xA8600000 #define MSM_CLK_CTL_PHYS 0xA8600000
......
...@@ -61,5 +61,7 @@ ...@@ -61,5 +61,7 @@
#define MSM_QGIC_CPU_BASE IOMEM(0xF0001000) #define MSM_QGIC_CPU_BASE IOMEM(0xF0001000)
#define MSM_TMR_BASE IOMEM(0xF0200000) #define MSM_TMR_BASE IOMEM(0xF0200000)
#define MSM_TMR0_BASE IOMEM(0xF0201000) #define MSM_TMR0_BASE IOMEM(0xF0201000)
#define MSM_GPIO1_BASE IOMEM(0xE0003000)
#define MSM_GPIO2_BASE IOMEM(0xE0004000)
#endif #endif
...@@ -43,8 +43,8 @@ static struct map_desc msm_io_desc[] __initdata = { ...@@ -43,8 +43,8 @@ static struct map_desc msm_io_desc[] __initdata = {
MSM_DEVICE(VIC), MSM_DEVICE(VIC),
MSM_CHIP_DEVICE(CSR, MSM7X00), MSM_CHIP_DEVICE(CSR, MSM7X00),
MSM_DEVICE(DMOV), MSM_DEVICE(DMOV),
MSM_DEVICE(GPIO1), MSM_CHIP_DEVICE(GPIO1, MSM7X00),
MSM_DEVICE(GPIO2), MSM_CHIP_DEVICE(GPIO2, MSM7X00),
MSM_DEVICE(CLK_CTL), MSM_DEVICE(CLK_CTL),
#ifdef CONFIG_MSM_DEBUG_UART #ifdef CONFIG_MSM_DEBUG_UART
MSM_DEVICE(DEBUG_UART), MSM_DEVICE(DEBUG_UART),
...@@ -76,8 +76,8 @@ static struct map_desc qsd8x50_io_desc[] __initdata = { ...@@ -76,8 +76,8 @@ static struct map_desc qsd8x50_io_desc[] __initdata = {
MSM_DEVICE(VIC), MSM_DEVICE(VIC),
MSM_CHIP_DEVICE(CSR, QSD8X50), MSM_CHIP_DEVICE(CSR, QSD8X50),
MSM_DEVICE(DMOV), MSM_DEVICE(DMOV),
MSM_DEVICE(GPIO1), MSM_CHIP_DEVICE(GPIO1, QSD8X50),
MSM_DEVICE(GPIO2), MSM_CHIP_DEVICE(GPIO2, QSD8X50),
MSM_DEVICE(CLK_CTL), MSM_DEVICE(CLK_CTL),
MSM_DEVICE(SIRC), MSM_DEVICE(SIRC),
MSM_DEVICE(SCPLL), MSM_DEVICE(SCPLL),
...@@ -135,8 +135,8 @@ static struct map_desc msm7x30_io_desc[] __initdata = { ...@@ -135,8 +135,8 @@ static struct map_desc msm7x30_io_desc[] __initdata = {
MSM_DEVICE(VIC), MSM_DEVICE(VIC),
MSM_CHIP_DEVICE(CSR, MSM7X30), MSM_CHIP_DEVICE(CSR, MSM7X30),
MSM_DEVICE(DMOV), MSM_DEVICE(DMOV),
MSM_DEVICE(GPIO1), MSM_CHIP_DEVICE(GPIO1, MSM7X30),
MSM_DEVICE(GPIO2), MSM_CHIP_DEVICE(GPIO2, MSM7X30),
MSM_DEVICE(CLK_CTL), MSM_DEVICE(CLK_CTL),
MSM_DEVICE(CLK_CTL_SH2), MSM_DEVICE(CLK_CTL_SH2),
MSM_DEVICE(AD5), MSM_DEVICE(AD5),
......
...@@ -103,6 +103,22 @@ config GPIO_MPC5200 ...@@ -103,6 +103,22 @@ config GPIO_MPC5200
def_bool y def_bool y
depends on PPC_MPC52xx depends on PPC_MPC52xx
config GPIO_MSM_V1
tristate "Qualcomm MSM GPIO v1"
depends on GPIOLIB && ARCH_MSM
help
Say yes here to support the GPIO interface on ARM v6 based
Qualcomm MSM chips. Most of the pins on the MSM can be
selected for GPIO, and are controlled by this driver.
config GPIO_MSM_V2
tristate "Qualcomm MSM GPIO v2"
depends on GPIOLIB && ARCH_MSM
help
Say yes here to support the GPIO interface on ARM v7 based
Qualcomm MSM chips. Most of the pins on the MSM can be
selected for GPIO, and are controlled by this driver.
config GPIO_MXC config GPIO_MXC
def_bool y def_bool y
depends on ARCH_MXC depends on ARCH_MXC
......
...@@ -27,6 +27,8 @@ obj-$(CONFIG_GPIO_MC33880) += gpio-mc33880.o ...@@ -27,6 +27,8 @@ obj-$(CONFIG_GPIO_MC33880) += gpio-mc33880.o
obj-$(CONFIG_GPIO_MCP23S08) += gpio-mcp23s08.o obj-$(CONFIG_GPIO_MCP23S08) += gpio-mcp23s08.o
obj-$(CONFIG_GPIO_ML_IOH) += gpio-ml-ioh.o obj-$(CONFIG_GPIO_ML_IOH) += gpio-ml-ioh.o
obj-$(CONFIG_GPIO_MPC5200) += gpio-mpc5200.o obj-$(CONFIG_GPIO_MPC5200) += gpio-mpc5200.o
obj-$(CONFIG_GPIO_MSM_V1) += gpio-msm-v1.o
obj-$(CONFIG_GPIO_MSM_V2) += gpio-msm-v2.o
obj-$(CONFIG_GPIO_MXC) += gpio-mxc.o obj-$(CONFIG_GPIO_MXC) += gpio-mxc.o
obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o
obj-$(CONFIG_PLAT_NOMADIK) += gpio-nomadik.o obj-$(CONFIG_PLAT_NOMADIK) += gpio-nomadik.o
......
...@@ -516,5 +516,5 @@ module_exit(ab8500_gpio_exit); ...@@ -516,5 +516,5 @@ module_exit(ab8500_gpio_exit);
MODULE_AUTHOR("BIBEK BASU <bibek.basu@stericsson.com>"); MODULE_AUTHOR("BIBEK BASU <bibek.basu@stericsson.com>");
MODULE_DESCRIPTION("Driver allows to use AB8500 unused pins to be used as GPIO"); MODULE_DESCRIPTION("Driver allows to use AB8500 unused pins to be used as GPIO");
MODULE_ALIAS("AB8500 GPIO driver"); MODULE_ALIAS("platform:ab8500-gpio");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <mach/msm_gpiomux.h>
#include <mach/msm_iomap.h> #include <mach/msm_iomap.h>
#include "gpiomux.h"
/* Bits of interest in the GPIO_IN_OUT register. /* Bits of interest in the GPIO_IN_OUT register.
*/ */
......
...@@ -127,8 +127,8 @@ EXPORT_SYMBOL(of_gpio_count); ...@@ -127,8 +127,8 @@ EXPORT_SYMBOL(of_gpio_count);
* gpio chips. This function performs only one sanity check: whether gpio * gpio chips. This function performs only one sanity check: whether gpio
* is less than ngpios (that is specified in the gpio_chip). * is less than ngpios (that is specified in the gpio_chip).
*/ */
static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
const void *gpio_spec, u32 *flags) const void *gpio_spec, u32 *flags)
{ {
const __be32 *gpio = gpio_spec; const __be32 *gpio = gpio_spec;
const u32 n = be32_to_cpup(gpio); const u32 n = be32_to_cpup(gpio);
...@@ -152,6 +152,7 @@ static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, ...@@ -152,6 +152,7 @@ static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
return n; return n;
} }
EXPORT_SYMBOL(of_gpio_simple_xlate);
/** /**
* of_mm_gpiochip_add - Add memory mapped GPIO chip (bank) * of_mm_gpiochip_add - Add memory mapped GPIO chip (bank)
......
...@@ -57,6 +57,8 @@ extern int of_mm_gpiochip_add(struct device_node *np, ...@@ -57,6 +57,8 @@ extern int of_mm_gpiochip_add(struct device_node *np,
extern void of_gpiochip_add(struct gpio_chip *gc); extern void of_gpiochip_add(struct gpio_chip *gc);
extern void of_gpiochip_remove(struct gpio_chip *gc); extern void of_gpiochip_remove(struct gpio_chip *gc);
extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
const void *gpio_spec, u32 *flags);
#else /* CONFIG_OF_GPIO */ #else /* CONFIG_OF_GPIO */
...@@ -72,6 +74,13 @@ static inline unsigned int of_gpio_count(struct device_node *np) ...@@ -72,6 +74,13 @@ static inline unsigned int of_gpio_count(struct device_node *np)
return 0; return 0;
} }
static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
struct device_node *np,
const void *gpio_spec, u32 *flags)
{
return -ENOSYS;
}
static inline void of_gpiochip_add(struct gpio_chip *gc) { } static inline void of_gpiochip_add(struct gpio_chip *gc) { }
static inline void of_gpiochip_remove(struct gpio_chip *gc) { } static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment