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 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 16 | #include <linux/regulator/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> |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 22 | |
Jay Chokshi | bc3d98d | 2011-08-10 17:14:23 -0700 | [diff] [blame] | 23 | /* Macros assume PMIC GPIOs and MPPs start at 1 */ |
| 24 | #define PM8921_GPIO_BASE NR_GPIO_IRQS |
| 25 | #define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE) |
| 26 | #define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS) |
| 27 | #define PM8921_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8921_MPP_BASE) |
| 28 | #define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) |
| 29 | |
Jay Chokshi | 44873f7 | 2011-08-30 17:24:26 -0700 | [diff] [blame] | 30 | #define PM8821_MPP_BASE (PM8921_MPP_BASE + PM8921_NR_MPPS) |
| 31 | #define PM8821_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8821_MPP_BASE) |
| 32 | #define PM8821_IRQ_BASE (PM8921_IRQ_BASE + PM8921_NR_IRQS) |
| 33 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 34 | extern struct pm8xxx_regulator_platform_data |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 35 | msm8064_pm8921_regulator_pdata[] __devinitdata; |
| 36 | |
| 37 | extern int msm8064_pm8921_regulator_pdata_len __devinitdata; |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 38 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 39 | #define GPIO_VREG_ID_EXT_5V 0 |
| 40 | #define GPIO_VREG_ID_EXT_3P3V 1 |
David Collins | 390fc33 | 2012-02-07 14:38:16 -0800 | [diff] [blame] | 41 | #define GPIO_VREG_ID_EXT_TS_SW 2 |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 42 | #define GPIO_VREG_ID_EXT_MPP8 3 |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 43 | |
| 44 | #define APQ8064_EXT_3P3V_REG_EN_GPIO 77 |
| 45 | |
| 46 | extern struct gpio_regulator_platform_data |
| 47 | apq8064_gpio_regulator_pdata[] __devinitdata; |
| 48 | |
David Collins | 2782b5c | 2012-02-06 10:02:42 -0800 | [diff] [blame] | 49 | extern struct rpm_regulator_platform_data |
| 50 | apq8064_rpm_regulator_pdata __devinitdata; |
| 51 | |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 52 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5; |
| 53 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6; |
| 54 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0; |
| 55 | extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1; |
| 56 | |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 57 | struct mmc_platform_data; |
| 58 | int __init apq8064_add_sdcc(unsigned int controller, |
| 59 | struct mmc_platform_data *plat); |
| 60 | |
Stepan Moskovchenko | e438b63 | 2011-12-06 13:44:03 -0800 | [diff] [blame] | 61 | void apq8064_init_mmc(void); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 62 | void apq8064_init_gpiomux(void); |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 63 | void apq8064_init_pmic(void); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 64 | |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 65 | extern struct msm_camera_board_info apq8064_camera_board_info; |
| 66 | void apq8064_init_cam(void); |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame^] | 67 | |
| 68 | #define APQ_8064_GSBI1_QUP_I2C_BUS_ID 0 |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 69 | #define APQ_8064_GSBI3_QUP_I2C_BUS_ID 3 |
Kevin Chan | 412e9f9 | 2012-01-24 10:45:23 -0800 | [diff] [blame] | 70 | #define APQ_8064_GSBI4_QUP_I2C_BUS_ID 4 |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 71 | |
| 72 | void apq8064_init_fb(void); |
| 73 | void apq8064_allocate_fb_region(void); |
| 74 | void apq8064_mdp_writeback(struct memtype_reserve *reserve_table); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 75 | |
| 76 | void apq8064_init_gpu(void); |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 77 | void apq8064_pm8xxx_gpio_mpp_init(void); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 78 | |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 79 | #endif |