]> nv-tegra.nvidia Code Review - linux-3.10.git/blob - arch/arm/mach-tegra/board-loki.h
ARM: tegra: Move platform detect from <mach/hardware.h> to <linux/tegra-soc.h>
[linux-3.10.git] / arch / arm / mach-tegra / board-loki.h
1 /*
2  * arch/arm/mach-tegra/board-loki.h
3  *
4  * Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef _MACH_TEGRA_BOARD_LOKI_H
21 #define _MACH_TEGRA_BOARD_LOKI_H
22
23 #include <linux/mfd/as3722-reg.h>
24 #include <mach/gpio-tegra.h>
25 #include <mach/irqs.h>
26 #include "gpio-names.h"
27
28 int loki_pinmux_init(void);
29 int loki_panel_init(void);
30 int loki_kbc_init(void);
31 int loki_sdhci_init(void);
32 int loki_sensors_init(void);
33 int loki_regulator_init(void);
34 int loki_suspend_init(void);
35 int loki_pmon_init(void);
36
37 /* Invensense MPU Definitions */
38 #define MPU_GYRO_NAME           "mpu6050"
39 #define MPU_GYRO_IRQ_GPIO       TEGRA_GPIO_PR2
40 #define MPU_GYRO_ADDR           0x68
41 #define MPU_GYRO_BUS_NUM        0
42 #define MPU_GYRO_ORIENTATION    MTMAT_TOP_CCW_0
43
44 /* PCA954x I2C bus expander bus addresses */
45 #define PCA954x_I2C_BUS_BASE    6
46 #define PCA954x_I2C_BUS0        (PCA954x_I2C_BUS_BASE + 0)
47 #define PCA954x_I2C_BUS1        (PCA954x_I2C_BUS_BASE + 1)
48 #define PCA954x_I2C_BUS2        (PCA954x_I2C_BUS_BASE + 2)
49 #define PCA954x_I2C_BUS3        (PCA954x_I2C_BUS_BASE + 3)
50
51
52 #define PALMAS_TEGRA_GPIO_BASE  TEGRA_NR_GPIOS
53 #define PALMAS_TEGRA_IRQ_BASE   TEGRA_NR_IRQS
54 #define AS3722_GPIO_BASE        TEGRA_NR_GPIOS
55 #define AS3722_GPIO_END (AS3722_GPIO_BASE + AS3722_NUM_GPIO)
56
57 /* PMU_TCA6416 GPIOs */
58 #define PMU_TCA6416_GPIO_BASE   (AS3722_GPIO_END)
59 #define PMU_TCA6416_GPIO(x)     (PMU_TCA6416_GPIO_BASE + x)
60 #define PMU_TCA6416_NR_GPIOS    18
61 /* External peripheral act as interrupt controller */
62 /* AS3720 IRQs */
63 #define AS3722_IRQ_BASE         TEGRA_NR_IRQS
64
65 #define CAM_RSTN TEGRA_GPIO_PBB3
66 #define CAM_FLASH_STROBE TEGRA_GPIO_PBB4
67 #define CAM2_PWDN TEGRA_GPIO_PBB6
68 #define CAM1_PWDN TEGRA_GPIO_PBB5
69 #define CAM_AF_PWDN TEGRA_GPIO_PBB7
70
71 /* Modem related GPIOs */
72 #define MDM_RST                 TEGRA_GPIO_PS3
73 #define MDM_COLDBOOT            TEGRA_GPIO_PO5
74
75 /* Baseband IDs */
76 enum tegra_bb_type {
77         TEGRA_BB_BRUCE = 1,
78         TEGRA_BB_HSIC_HUB = 6,
79 };
80
81 #define UTMI1_PORT_OWNER_XUSB   0x1
82 #define UTMI2_PORT_OWNER_XUSB   0x2
83 #define UTMI3_PORT_OWNER_XUSB   0x4
84 #define HSIC1_PORT_OWNER_XUSB   0x8
85
86 /* Touchscreen definitions */
87 #define TOUCH_GPIO_IRQ_RAYDIUM_SPI      TEGRA_GPIO_PK2
88 #define TOUCH_GPIO_RST_RAYDIUM_SPI      TEGRA_GPIO_PK4
89 #define TOUCH_SPI_ID                    0       /*SPI 1 on ardbeg_interposer*/
90 #define TOUCH_SPI_CS                    0       /*CS  0 on ardbeg_interposer*/
91
92 /* Audio-related GPIOs */
93 /*Same GPIO's used for T114(Interposer) and T124*/
94 /*Below GPIO's are same for Laguna and Loki*/
95 #define TEGRA_GPIO_CDC_IRQ      TEGRA_GPIO_PH4
96 #define TEGRA_GPIO_HP_DET               TEGRA_GPIO_PR7
97 /*LDO_EN signal is required only for RT5639 and not for RT5645,
98 on Laguna the LDO_EN signal comes from a GPIO expander and
99 this is exposed as a fixed regulator directly handeled from
100 machine driver of rt5639 and for ardebeg we use the below tegra
101 GPIO, also the GPIO is same for T114 interposer and T124*/
102 #define TEGRA_GPIO_LDO_EN       TEGRA_GPIO_PV3
103
104 /*GPIOs used by board panel file */
105 #define DSI_PANEL_RST_GPIO      TEGRA_GPIO_PH3
106 #define DSI_PANEL_BL_PWM_GPIO   TEGRA_GPIO_PH1
107
108 /* HDMI Hotplug detection pin */
109 #define loki_hdmi_hpd   TEGRA_GPIO_PN7
110
111 /* I2C related GPIOs */
112 /* Same for interposer and t124 */
113 #define TEGRA_GPIO_I2C1_SCL     TEGRA_GPIO_PC4
114 #define TEGRA_GPIO_I2C1_SDA     TEGRA_GPIO_PC5
115 #define TEGRA_GPIO_I2C2_SCL     TEGRA_GPIO_PT5
116 #define TEGRA_GPIO_I2C2_SDA     TEGRA_GPIO_PT6
117 #define TEGRA_GPIO_I2C3_SCL     TEGRA_GPIO_PBB1
118 #define TEGRA_GPIO_I2C3_SDA     TEGRA_GPIO_PBB2
119 #define TEGRA_GPIO_I2C4_SCL     TEGRA_GPIO_PV4
120 #define TEGRA_GPIO_I2C4_SDA     TEGRA_GPIO_PV5
121 #define TEGRA_GPIO_I2C5_SCL     TEGRA_GPIO_PZ6
122 #define TEGRA_GPIO_I2C5_SDA     TEGRA_GPIO_PZ7
123
124 /* AUO Display related GPIO */
125 #define DSI_PANEL_RST_GPIO      TEGRA_GPIO_PH3 /* GMI_AD11 */
126 #define LCD_RST_L               TEGRA_GPIO_PH5 /* GMI_AD13 */
127 #define LCD_LR                  TEGRA_GPIO_PH6 /* GMI_AD14 */
128 #define LCD_TE                  TEGRA_GPIO_PI4 /* GMI_RST_N */
129 #define DSI_PANEL_BL_PWM        TEGRA_GPIO_PH1 /*GMI_AD9 */
130 #define en_vdd_bl       TEGRA_GPIO_PP2 /* DAP3_DOUT */
131 #define lvds_en         TEGRA_GPIO_PI0 /* GMI_WR_N */
132 #define refclk_en       TEGRA_GPIO_PG4 /* GMI_AD4 */
133
134 /* HID keyboard and trackpad irq same for interposer and t124 */
135 #define I2C_KB_IRQ      TEGRA_GPIO_PC7
136 #define I2C_TP_IRQ      TEGRA_GPIO_PW3
137
138 /* TN8 specific */
139
140 int tn8_regulator_init(void);
141
142 #endif