Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __ARCH_ARM_MACH_MSM_BOARD_APQ8064_H |
| 14 | #define __ARCH_ARM_MACH_MSM_BOARD_APQ8064_H |
| 15 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/regulator/msm-gpio-regulator.h> |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 17 | #include <linux/mfd/pm8xxx/pm8921.h> |
Jay Chokshi | 44873f7 | 2011-08-30 17:24:26 -0700 | [diff] [blame] | 18 | #include <linux/mfd/pm8xxx/pm8821.h> |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 19 | #include <mach/msm_memtypes.h> |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 20 | #include <mach/irqs.h> |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 21 | #include <mach/rpm-regulator.h> |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 22 | #include <mach/msm_rtb.h> |
Laura Abbott | 93a4a35 | 2012-05-25 09:26:35 -0700 | [diff] [blame] | 23 | #include <mach/msm_cache_dump.h> |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 24 | |
Jay Chokshi | bc3d98d | 2011-08-10 17:14:23 -0700 | [diff] [blame] | 25 | /* Macros assume PMIC GPIOs and MPPs start at 1 */ |
| 26 | #define PM8921_GPIO_BASE NR_GPIO_IRQS |
| 27 | #define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE) |
| 28 | #define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS) |
| 29 | #define PM8921_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8921_MPP_BASE) |
| 30 | #define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) |
| 31 | |
Jay Chokshi | 44873f7 | 2011-08-30 17:24:26 -0700 | [diff] [blame] | 32 | #define PM8821_MPP_BASE (PM8921_MPP_BASE + PM8921_NR_MPPS) |
| 33 | #define PM8821_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8821_MPP_BASE) |
| 34 | #define PM8821_IRQ_BASE (PM8921_IRQ_BASE + PM8921_NR_IRQS) |
| 35 | |
Swaminathan Sathappan | 1707d4a | 2012-04-02 14:42:28 -0700 | [diff] [blame] | 36 | #define TABLA_INTERRUPT_BASE (PM8821_IRQ_BASE + PM8821_NR_IRQS) |
| 37 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 38 | extern struct pm8xxx_regulator_platform_data |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 39 | msm8064_pm8921_regulator_pdata[] __devinitdata; |
| 40 | |
| 41 | extern int msm8064_pm8921_regulator_pdata_len __devinitdata; |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 42 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 43 | #define GPIO_VREG_ID_EXT_5V 0 |
| 44 | #define GPIO_VREG_ID_EXT_3P3V 1 |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 45 | #define GPIO_VREG_ID_EXT_TS_SW 2 |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 46 | #define GPIO_VREG_ID_EXT_MPP8 3 |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 47 | |
Jay Chokshi | 6d64bd7 | 2012-05-02 16:47:03 -0700 | [diff] [blame] | 48 | #define GPIO_VREG_ID_AVC_1P2V 0 |
| 49 | #define GPIO_VREG_ID_AVC_1P8V 1 |
| 50 | #define GPIO_VREG_ID_AVC_2P2V 2 |
| 51 | #define GPIO_VREG_ID_AVC_5V 3 |
| 52 | #define GPIO_VREG_ID_AVC_3P3V 4 |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 53 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 54 | #define APQ8064_EXT_3P3V_REG_EN_GPIO 77 |
| 55 | |
| 56 | extern struct gpio_regulator_platform_data |
| 57 | apq8064_gpio_regulator_pdata[] __devinitdata; |
| 58 | |
Jay Chokshi | 1b7eaa9 | 2012-04-04 14:53:14 -0700 | [diff] [blame] | 59 | extern struct gpio_regulator_platform_data |
| 60 | mpq8064_gpio_regulator_pdata[] __devinitdata; |
| 61 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 62 | extern struct rpm_regulator_platform_data |
| 63 | apq8064_rpm_regulator_pdata __devinitdata; |
| 64 | |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 65 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5; |
| 66 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6; |
| 67 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0; |
| 68 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1; |
| 69 | |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 70 | struct mmc_platform_data; |
| 71 | int __init apq8064_add_sdcc(unsigned int controller, |
| 72 | struct mmc_platform_data *plat); |
| 73 | |
Stepan Moskovchenko | e438b63 | 2011-12-06 13:44:03 -0800 | [diff] [blame] | 74 | void apq8064_init_mmc(void); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 75 | void apq8064_init_gpiomux(void); |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 76 | void apq8064_init_pmic(void); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 77 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 78 | extern struct msm_camera_board_info apq8064_camera_board_info; |
| 79 | void apq8064_init_cam(void); |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 80 | |
| 81 | #define APQ_8064_GSBI1_QUP_I2C_BUS_ID 0 |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 82 | #define APQ_8064_GSBI3_QUP_I2C_BUS_ID 3 |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 83 | #define APQ_8064_GSBI4_QUP_I2C_BUS_ID 4 |
Santosh Mardi | eff9a74 | 2012-04-09 23:23:39 +0530 | [diff] [blame] | 84 | #define APQ_8064_GSBI5_QUP_I2C_BUS_ID 5 |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 85 | |
Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 86 | unsigned char apq8064_hdmi_as_primary_selected(void); |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 87 | void apq8064_init_fb(void); |
| 88 | void apq8064_allocate_fb_region(void); |
| 89 | void apq8064_mdp_writeback(struct memtype_reserve *reserve_table); |
Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 90 | void __init apq8064_set_display_params(char *prim_panel, char *ext_panel); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 91 | |
| 92 | void apq8064_init_gpu(void); |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 93 | void apq8064_pm8xxx_gpio_mpp_init(void); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 94 | |
Jay Chokshi | e7d8d4f | 2012-04-04 14:47:57 -0700 | [diff] [blame] | 95 | #define PLATFORM_IS_MPQ8064() \ |
| 96 | (machine_is_mpq8064_hrd() || \ |
| 97 | machine_is_mpq8064_dtv() || \ |
| 98 | machine_is_mpq8064_cdp() \ |
| 99 | ) |
| 100 | |
| 101 | |
| 102 | #define GPIO_EXPANDER_IRQ_BASE (TABLA_INTERRUPT_BASE + \ |
| 103 | NR_TABLA_IRQS) |
| 104 | #define GPIO_EXPANDER_GPIO_BASE (PM8821_MPP_BASE + PM8821_NR_MPPS) |
| 105 | |
| 106 | #define GPIO_EPM_EXPANDER_BASE GPIO_EXPANDER_GPIO_BASE |
| 107 | #define SX150X_EPM_NR_GPIOS 16 |
| 108 | #define SX150X_EPM_NR_IRQS 8 |
| 109 | |
| 110 | #define SX150X_EXP1_GPIO_BASE (GPIO_EPM_EXPANDER_BASE + \ |
| 111 | SX150X_EPM_NR_GPIOS) |
| 112 | #define SX150X_EXP1_IRQ_BASE (GPIO_EXPANDER_IRQ_BASE + \ |
| 113 | SX150X_EPM_NR_IRQS) |
| 114 | #define SX150X_EXP1_NR_IRQS 16 |
| 115 | #define SX150X_EXP1_NR_GPIOS 16 |
| 116 | |
| 117 | #define SX150X_EXP2_GPIO_BASE (SX150X_EXP1_GPIO_BASE + \ |
| 118 | SX150X_EXP1_NR_GPIOS) |
| 119 | #define SX150X_EXP2_IRQ_BASE (SX150X_EXP1_IRQ_BASE + SX150X_EXP1_NR_IRQS) |
| 120 | #define SX150X_EXP2_NR_IRQS 8 |
| 121 | #define SX150X_EXP2_NR_GPIOS 8 |
| 122 | |
| 123 | #define SX150X_EXP3_GPIO_BASE (SX150X_EXP2_GPIO_BASE + \ |
| 124 | SX150X_EXP2_NR_GPIOS) |
| 125 | #define SX150X_EXP3_IRQ_BASE (SX150X_EXP2_IRQ_BASE + SX150X_EXP2_NR_IRQS) |
| 126 | #define SX150X_EXP3_NR_IRQS 8 |
| 127 | #define SX150X_EXP3_NR_GPIOS 8 |
| 128 | |
| 129 | #define SX150X_EXP4_GPIO_BASE (SX150X_EXP3_GPIO_BASE + \ |
| 130 | SX150X_EXP3_NR_GPIOS) |
| 131 | #define SX150X_EXP4_IRQ_BASE (SX150X_EXP3_IRQ_BASE + SX150X_EXP3_NR_IRQS) |
| 132 | #define SX150X_EXP4_NR_IRQS 16 |
| 133 | #define SX150X_EXP4_NR_GPIOS 16 |
| 134 | |
| 135 | #define SX150X_GPIO(_expander, _pin) (SX150X_EXP##_expander##_GPIO_BASE + _pin) |
| 136 | |
| 137 | enum { |
| 138 | SX150X_EPM, |
| 139 | SX150X_EXP1, |
| 140 | SX150X_EXP2, |
| 141 | SX150X_EXP3, |
| 142 | SX150X_EXP4, |
| 143 | }; |
| 144 | |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 145 | extern struct msm_rtb_platform_data apq8064_rtb_pdata; |
Laura Abbott | 93a4a35 | 2012-05-25 09:26:35 -0700 | [diff] [blame] | 146 | extern struct msm_cache_dump_platform_data apq8064_cache_dump_pdata; |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 147 | #endif |