diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-21 16:46:26 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-21 16:46:26 +0200 |
commit | 335332770c68649ffeaf5dc2b58d9cd40041e295 (patch) | |
tree | a48e86b9f9a80913399a182a152b4c580a9c3836 /arch/arm/mach-tegra | |
parent | 3b3c281073288ebdc6161108bdc4c9f1b08bdee3 (diff) | |
parent | f55be1bf52aad524dc1bf556ae26c90262c87825 (diff) | |
download | talos-op-linux-335332770c68649ffeaf5dc2b58d9cd40041e295.tar.gz talos-op-linux-335332770c68649ffeaf5dc2b58d9cd40041e295.zip |
Merge branch 'depends/rmk/gpio' into next/board
Conflicts:
arch/arm/mach-at91/board-usb-a9260.c
arch/arm/mach-at91/board-usb-a9263.c
arch/arm/mach-tegra/board-paz00.h
arch/arm/mach-tegra/board-seaboard.h
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-paz00.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-paz00.h | 16 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-seaboard.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-trimslice-pinmux.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-trimslice.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-trimslice.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/gpio-tegra.h | 39 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/gpio.h | 60 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 1 |
11 files changed, 62 insertions, 77 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index 9c27b95b8d86..6db7d699ef1c 100644 --- a/arch/arm/mach-tegra/board-harmony-pcie.c +++ b/arch/arm/mach-tegra/board-harmony-pcie.c @@ -24,12 +24,10 @@ #include <mach/pinmux.h> #include "board.h" +#include "board-harmony.h" #ifdef CONFIG_TEGRA_PCI -/* GPIO 3 of the PMIC */ -#define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2) - static int __init harmony_pcie_init(void) { struct regulator *regulator = NULL; @@ -38,11 +36,11 @@ static int __init harmony_pcie_init(void) if (!machine_is_harmony()) return 0; - err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); + err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); if (err) return err; - gpio_direction_output(EN_VDD_1V05_GPIO, 1); + gpio_direction_output(TEGRA_GPIO_EN_VDD_1V05_GPIO, 1); regulator = regulator_get(NULL, "pex_clk"); if (IS_ERR_OR_NULL(regulator)) @@ -68,7 +66,7 @@ err_pcie: regulator_disable(regulator); regulator_put(regulator); err_reg: - gpio_free(EN_VDD_1V05_GPIO); + gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO); return err; } diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h index d85142edaf6b..139d96c93843 100644 --- a/arch/arm/mach-tegra/board-harmony.h +++ b/arch/arm/mach-tegra/board-harmony.h @@ -17,6 +17,8 @@ #ifndef _MACH_TEGRA_BOARD_HARMONY_H #define _MACH_TEGRA_BOARD_HARMONY_H +#include <mach/gpio-tegra.h> + #define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_)) #define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_)) @@ -31,6 +33,7 @@ #define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2 #define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0 #define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1 +#define TEGRA_GPIO_EN_VDD_1V05_GPIO HARMONY_GPIO_TPS6586X(2) void harmony_pinmux_init(void); int harmony_regulator_init(void); diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index d161590c99c2..ac809b6e3def 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c @@ -26,6 +26,7 @@ #include <linux/pda_power.h> #include <linux/io.h> #include <linux/i2c.h> +#include <linux/gpio.h> #include <linux/rfkill-gpio.h> #include <asm/mach-types.h> @@ -36,7 +37,6 @@ #include <mach/iomap.h> #include <mach/irqs.h> #include <mach/sdhci.h> -#include <mach/gpio.h> #include "board.h" #include "board-paz00.h" diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h index 86057c3fb9a0..8aff06eb58c3 100644 --- a/arch/arm/mach-tegra/board-paz00.h +++ b/arch/arm/mach-tegra/board-paz00.h @@ -17,18 +17,20 @@ #ifndef _MACH_TEGRA_BOARD_PAZ00_H #define _MACH_TEGRA_BOARD_PAZ00_H +#include <mach/gpio-tegra.h> + /* SDCARD */ -#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 -#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 -#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 +#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 +#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 +#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 /* ULPI */ -#define TEGRA_ULPI_RST TEGRA_GPIO_PV0 +#define TEGRA_ULPI_RST TEGRA_GPIO_PV0 /* WIFI */ -#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 -#define TEGRA_WIFI_RST TEGRA_GPIO_PD1 -#define TEGRA_WIFI_LED TEGRA_GPIO_PD0 +#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +#define TEGRA_WIFI_RST TEGRA_GPIO_PD1 +#define TEGRA_WIFI_LED TEGRA_GPIO_PD0 void paz00_pinmux_init(void); diff --git a/arch/arm/mach-tegra/board-seaboard.h b/arch/arm/mach-tegra/board-seaboard.h index d06c3342e2c4..4c45d4ca3c49 100644 --- a/arch/arm/mach-tegra/board-seaboard.h +++ b/arch/arm/mach-tegra/board-seaboard.h @@ -17,6 +17,8 @@ #ifndef _MACH_TEGRA_BOARD_SEABOARD_H #define _MACH_TEGRA_BOARD_SEABOARD_H +#include <mach/gpio-tegra.h> + #define SEABOARD_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_)) #define SEABOARD_GPIO_WM8903(_x_) (SEABOARD_GPIO_TPS6586X(4) + (_x_)) diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c index 47c596cdbf32..bcb1916e68b9 100644 --- a/arch/arm/mach-tegra/board-trimslice-pinmux.c +++ b/arch/arm/mach-tegra/board-trimslice-pinmux.c @@ -13,12 +13,11 @@ * GNU General Public License for more details. * */ - +#include <linux/gpio.h> #include <linux/kernel.h> #include <linux/init.h> #include <mach/pinmux.h> -#include <mach/gpio.h> #include "gpio-names.h" #include "board-trimslice.h" diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c index 91875b975563..c3aff9fdffd3 100644 --- a/arch/arm/mach-tegra/board-trimslice.c +++ b/arch/arm/mach-tegra/board-trimslice.c @@ -32,7 +32,6 @@ #include <mach/iomap.h> #include <mach/sdhci.h> -#include <mach/gpio.h> #include "board.h" #include "clock.h" diff --git a/arch/arm/mach-tegra/board-trimslice.h b/arch/arm/mach-tegra/board-trimslice.h index 7a7dee86b4da..50f128d87779 100644 --- a/arch/arm/mach-tegra/board-trimslice.h +++ b/arch/arm/mach-tegra/board-trimslice.h @@ -17,6 +17,8 @@ #ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H #define _MACH_TEGRA_BOARD_TRIMSLICE_H +#include <mach/gpio-tegra.h> + #define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */ #define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */ diff --git a/arch/arm/mach-tegra/include/mach/gpio-tegra.h b/arch/arm/mach-tegra/include/mach/gpio-tegra.h new file mode 100644 index 000000000000..87d37fdf5084 --- /dev/null +++ b/arch/arm/mach-tegra/include/mach/gpio-tegra.h @@ -0,0 +1,39 @@ +/* + * arch/arm/mach-tegra/include/mach/gpio.h + * + * Copyright (C) 2010 Google, Inc. + * + * Author: + * Erik Gilling <konkers@google.com> + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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 __MACH_TEGRA_GPIO_TEGRA_H +#define __MACH_TEGRA_GPIO_TEGRA_H + +#include <linux/types.h> +#include <mach/irqs.h> + +#define TEGRA_NR_GPIOS INT_GPIO_NR + +#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) + +struct tegra_gpio_table { + int gpio; /* GPIO number */ + bool enable; /* Enable for GPIO at init? */ +}; + +void tegra_gpio_config(struct tegra_gpio_table *table, int num); +void tegra_gpio_enable(int gpio); +void tegra_gpio_disable(int gpio); + +#endif diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h index 196f114dc241..e69de29bb2d1 100644 --- a/arch/arm/mach-tegra/include/mach/gpio.h +++ b/arch/arm/mach-tegra/include/mach/gpio.h @@ -1,60 +0,0 @@ -/* - * arch/arm/mach-tegra/include/mach/gpio.h - * - * Copyright (C) 2010 Google, Inc. - * - * Author: - * Erik Gilling <konkers@google.com> - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * 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 __MACH_TEGRA_GPIO_H -#define __MACH_TEGRA_GPIO_H - -#include <linux/init.h> -#include <mach/irqs.h> - -#define TEGRA_NR_GPIOS INT_GPIO_NR - -#include <asm-generic/gpio.h> - -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value -#define gpio_cansleep __gpio_cansleep - -#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) -#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE) - -static inline int gpio_to_irq(unsigned int gpio) -{ - if (gpio < TEGRA_NR_GPIOS) - return INT_GPIO_BASE + gpio; - return -EINVAL; -} - -static inline int irq_to_gpio(unsigned int irq) -{ - if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR)) - return irq - INT_GPIO_BASE; - return -EINVAL; -} - -struct tegra_gpio_table { - int gpio; /* GPIO number */ - bool enable; /* Enable for GPIO at init? */ -}; - -void tegra_gpio_config(struct tegra_gpio_table *table, int num); -void tegra_gpio_enable(int gpio); -void tegra_gpio_disable(int gpio); - -#endif diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 88081bb3ec52..37576a721aeb 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -28,6 +28,7 @@ #include <linux/usb/otg.h> #include <linux/usb/ulpi.h> #include <asm/mach-types.h> +#include <mach/gpio-tegra.h> #include <mach/usb_phy.h> #include <mach/iomap.h> |