aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c10
-rw-r--r--arch/arm/mach-tegra/board-harmony.h3
-rw-r--r--arch/arm/mach-tegra/board-paz00.h2
-rw-r--r--arch/arm/mach-tegra/board-seaboard.h2
-rw-r--r--arch/arm/mach-tegra/board-trimslice-pinmux.c3
-rw-r--r--arch/arm/mach-tegra/board-trimslice.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-tegra/include/mach/gpio-tegra.h (renamed from arch/arm/mach-tegra/include/mach/memory.h)25
-rw-r--r--arch/arm/mach-tegra/include/mach/gpio.h60
-rw-r--r--arch/arm/mach-tegra/usb_phy.c1
10 files changed, 34 insertions, 76 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 @@
24 24
25#include <mach/pinmux.h> 25#include <mach/pinmux.h>
26#include "board.h" 26#include "board.h"
27#include "board-harmony.h"
27 28
28#ifdef CONFIG_TEGRA_PCI 29#ifdef CONFIG_TEGRA_PCI
29 30
30/* GPIO 3 of the PMIC */
31#define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2)
32
33static int __init harmony_pcie_init(void) 31static int __init harmony_pcie_init(void)
34{ 32{
35 struct regulator *regulator = NULL; 33 struct regulator *regulator = NULL;
@@ -38,11 +36,11 @@ static int __init harmony_pcie_init(void)
38 if (!machine_is_harmony()) 36 if (!machine_is_harmony())
39 return 0; 37 return 0;
40 38
41 err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); 39 err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05");
42 if (err) 40 if (err)
43 return err; 41 return err;
44 42
45 gpio_direction_output(EN_VDD_1V05_GPIO, 1); 43 gpio_direction_output(TEGRA_GPIO_EN_VDD_1V05_GPIO, 1);
46 44
47 regulator = regulator_get(NULL, "pex_clk"); 45 regulator = regulator_get(NULL, "pex_clk");
48 if (IS_ERR_OR_NULL(regulator)) 46 if (IS_ERR_OR_NULL(regulator))
@@ -68,7 +66,7 @@ err_pcie:
68 regulator_disable(regulator); 66 regulator_disable(regulator);
69 regulator_put(regulator); 67 regulator_put(regulator);
70err_reg: 68err_reg:
71 gpio_free(EN_VDD_1V05_GPIO); 69 gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO);
72 70
73 return err; 71 return err;
74} 72}
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 @@
17#ifndef _MACH_TEGRA_BOARD_HARMONY_H 17#ifndef _MACH_TEGRA_BOARD_HARMONY_H
18#define _MACH_TEGRA_BOARD_HARMONY_H 18#define _MACH_TEGRA_BOARD_HARMONY_H
19 19
20#include <mach/gpio-tegra.h>
21
20#define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_)) 22#define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_))
21#define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_)) 23#define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_))
22 24
@@ -31,6 +33,7 @@
31#define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2 33#define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2
32#define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0 34#define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0
33#define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1 35#define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1
36#define TEGRA_GPIO_EN_VDD_1V05_GPIO HARMONY_GPIO_TPS6586X(2)
34 37
35void harmony_pinmux_init(void); 38void harmony_pinmux_init(void);
36int harmony_regulator_init(void); 39int harmony_regulator_init(void);
diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h
index d4ff39ddaeb3..42ce8639b90c 100644
--- a/arch/arm/mach-tegra/board-paz00.h
+++ b/arch/arm/mach-tegra/board-paz00.h
@@ -17,6 +17,8 @@
17#ifndef _MACH_TEGRA_BOARD_PAZ00_H 17#ifndef _MACH_TEGRA_BOARD_PAZ00_H
18#define _MACH_TEGRA_BOARD_PAZ00_H 18#define _MACH_TEGRA_BOARD_PAZ00_H
19 19
20#include <mach/gpio-tegra.h>
21
20#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 22#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5
21#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 23#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1
22#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 24#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3
diff --git a/arch/arm/mach-tegra/board-seaboard.h b/arch/arm/mach-tegra/board-seaboard.h
index d8415e1a8434..15b6c57361be 100644
--- a/arch/arm/mach-tegra/board-seaboard.h
+++ b/arch/arm/mach-tegra/board-seaboard.h
@@ -17,6 +17,8 @@
17#ifndef _MACH_TEGRA_BOARD_SEABOARD_H 17#ifndef _MACH_TEGRA_BOARD_SEABOARD_H
18#define _MACH_TEGRA_BOARD_SEABOARD_H 18#define _MACH_TEGRA_BOARD_SEABOARD_H
19 19
20#include <mach/gpio-tegra.h>
21
20#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 22#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5
21#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 23#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1
22#define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PI6 24#define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PI6
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 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 */ 15 */
16 16#include <linux/gpio.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19 19
20#include <mach/pinmux.h> 20#include <mach/pinmux.h>
21#include <mach/gpio.h>
22 21
23#include "gpio-names.h" 22#include "gpio-names.h"
24#include "board-trimslice.h" 23#include "board-trimslice.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 @@
17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H 17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H
18#define _MACH_TEGRA_BOARD_TRIMSLICE_H 18#define _MACH_TEGRA_BOARD_TRIMSLICE_H
19 19
20#include <mach/gpio-tegra.h>
21
20#define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */ 22#define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */
21#define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */ 23#define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */
22 24
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index e0ebe65c1657..619abc63aee8 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -21,7 +21,7 @@
21#include <mach/io.h> 21#include <mach/io.h>
22#include <mach/iomap.h> 22#include <mach/iomap.h>
23 23
24 .macro addruart, rp, rv 24 .macro addruart, rp, rv, tmp
25 ldr \rp, =IO_APB_PHYS @ physical 25 ldr \rp, =IO_APB_PHYS @ physical
26 ldr \rv, =IO_APB_VIRT @ virtual 26 ldr \rv, =IO_APB_VIRT @ virtual
27 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF) 27 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF)
diff --git a/arch/arm/mach-tegra/include/mach/memory.h b/arch/arm/mach-tegra/include/mach/gpio-tegra.h
index 537db3aa81a7..87d37fdf5084 100644
--- a/arch/arm/mach-tegra/include/mach/memory.h
+++ b/arch/arm/mach-tegra/include/mach/gpio-tegra.h
@@ -1,10 +1,9 @@
1/* 1/*
2 * arch/arm/mach-tegra/include/mach/memory.h 2 * arch/arm/mach-tegra/include/mach/gpio.h
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * 5 *
6 * Author: 6 * Author:
7 * Colin Cross <ccross@google.com>
8 * Erik Gilling <konkers@google.com> 7 * Erik Gilling <konkers@google.com>
9 * 8 *
10 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
@@ -18,11 +17,23 @@
18 * 17 *
19 */ 18 */
20 19
21#ifndef __MACH_TEGRA_MEMORY_H 20#ifndef __MACH_TEGRA_GPIO_TEGRA_H
22#define __MACH_TEGRA_MEMORY_H 21#define __MACH_TEGRA_GPIO_TEGRA_H
23 22
24/* physical offset of RAM */ 23#include <linux/types.h>
25#define PLAT_PHYS_OFFSET UL(0) 24#include <mach/irqs.h>
26 25
27#endif 26#define TEGRA_NR_GPIOS INT_GPIO_NR
27
28#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
29
30struct tegra_gpio_table {
31 int gpio; /* GPIO number */
32 bool enable; /* Enable for GPIO at init? */
33};
28 34
35void tegra_gpio_config(struct tegra_gpio_table *table, int num);
36void tegra_gpio_enable(int gpio);
37void tegra_gpio_disable(int gpio);
38
39#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 @@
1/*
2 * arch/arm/mach-tegra/include/mach/gpio.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Erik Gilling <konkers@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#ifndef __MACH_TEGRA_GPIO_H
21#define __MACH_TEGRA_GPIO_H
22
23#include <linux/init.h>
24#include <mach/irqs.h>
25
26#define TEGRA_NR_GPIOS INT_GPIO_NR
27
28#include <asm-generic/gpio.h>
29
30#define gpio_get_value __gpio_get_value
31#define gpio_set_value __gpio_set_value
32#define gpio_cansleep __gpio_cansleep
33
34#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
35#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
36
37static inline int gpio_to_irq(unsigned int gpio)
38{
39 if (gpio < TEGRA_NR_GPIOS)
40 return INT_GPIO_BASE + gpio;
41 return -EINVAL;
42}
43
44static inline int irq_to_gpio(unsigned int irq)
45{
46 if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR))
47 return irq - INT_GPIO_BASE;
48 return -EINVAL;
49}
50
51struct tegra_gpio_table {
52 int gpio; /* GPIO number */
53 bool enable; /* Enable for GPIO at init? */
54};
55
56void tegra_gpio_config(struct tegra_gpio_table *table, int num);
57void tegra_gpio_enable(int gpio);
58void tegra_gpio_disable(int gpio);
59
60#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 @@
28#include <linux/usb/otg.h> 28#include <linux/usb/otg.h>
29#include <linux/usb/ulpi.h> 29#include <linux/usb/ulpi.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <mach/gpio-tegra.h>
31#include <mach/usb_phy.h> 32#include <mach/usb_phy.h>
32#include <mach/iomap.h> 33#include <mach/iomap.h>
33 34