blob: 300da1f04487f4863b812b3c334d369656287ae3 [file] [log] [blame]
Kevin Chan412e9f92012-01-24 10:45:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Jay Chokshiea67c622011-07-29 17:12:26 -07002 *
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 Collinsf0d00732012-01-25 15:46:50 -080016#include <linux/regulator/gpio-regulator.h>
Jay Chokshiea67c622011-07-29 17:12:26 -070017#include <linux/mfd/pm8xxx/pm8921.h>
Jay Chokshi44873f72011-08-30 17:24:26 -070018#include <linux/mfd/pm8xxx/pm8821.h>
Huaibin Yang4a084e32011-12-15 15:25:52 -080019#include <mach/msm_memtypes.h>
David Collinsf0d00732012-01-25 15:46:50 -080020#include <mach/irqs.h>
21
Jay Chokshibc3d98d2011-08-10 17:14:23 -070022/* Macros assume PMIC GPIOs and MPPs start at 1 */
23#define PM8921_GPIO_BASE NR_GPIO_IRQS
24#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
25#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
26#define PM8921_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8921_MPP_BASE)
27#define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
28
Jay Chokshi44873f72011-08-30 17:24:26 -070029#define PM8821_MPP_BASE (PM8921_MPP_BASE + PM8921_NR_MPPS)
30#define PM8821_MPP_PM_TO_SYS(pm_mpp) (pm_mpp - 1 + PM8821_MPP_BASE)
31#define PM8821_IRQ_BASE (PM8921_IRQ_BASE + PM8921_NR_IRQS)
32
David Collins75016742011-12-02 15:04:25 -080033extern struct pm8xxx_regulator_platform_data
Jay Chokshiea67c622011-07-29 17:12:26 -070034 msm8064_pm8921_regulator_pdata[] __devinitdata;
35
36extern int msm8064_pm8921_regulator_pdata_len __devinitdata;
Sahitya Tummala3586ed92011-08-03 09:13:23 +053037
David Collinsf0d00732012-01-25 15:46:50 -080038#define GPIO_VREG_ID_EXT_5V 0
39#define GPIO_VREG_ID_EXT_3P3V 1
David Collins390fc332012-02-07 14:38:16 -080040#define GPIO_VREG_ID_EXT_TS_SW 2
David Collinsf0d00732012-01-25 15:46:50 -080041
42#define APQ8064_EXT_3P3V_REG_EN_GPIO 77
43
44extern struct gpio_regulator_platform_data
45 apq8064_gpio_regulator_pdata[] __devinitdata;
46
Jay Chokshi7805b5a2011-11-07 15:55:30 -080047extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s5;
48extern struct regulator_init_data msm8064_saw_regulator_pdata_8921_s6;
49extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s0;
50extern struct regulator_init_data msm8064_saw_regulator_pdata_8821_s1;
51
Sahitya Tummala3586ed92011-08-03 09:13:23 +053052struct mmc_platform_data;
53int __init apq8064_add_sdcc(unsigned int controller,
54 struct mmc_platform_data *plat);
55
Stepan Moskovchenkoe438b632011-12-06 13:44:03 -080056void apq8064_init_mmc(void);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -080057void apq8064_init_gpiomux(void);
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -080058void apq8064_init_pmic(void);
Jordan Crouseb3115fe2012-02-01 22:11:12 -070059
Kevin Chan412e9f92012-01-24 10:45:23 -080060extern struct msm_camera_board_info apq8064_camera_board_info;
61void apq8064_init_cam(void);
Jing Lin04601f92012-02-05 15:36:07 -080062#define APQ_8064_GSBI3_QUP_I2C_BUS_ID 3
Kevin Chan412e9f92012-01-24 10:45:23 -080063#define APQ_8064_GSBI4_QUP_I2C_BUS_ID 4
Huaibin Yang4a084e32011-12-15 15:25:52 -080064
65void apq8064_init_fb(void);
66void apq8064_allocate_fb_region(void);
67void apq8064_mdp_writeback(struct memtype_reserve *reserve_table);
Jordan Crouseb3115fe2012-02-01 22:11:12 -070068
69void apq8064_init_gpu(void);
Jay Chokshie8741282012-01-25 15:22:55 -080070void apq8064_pm8xxx_gpio_mpp_init(void);
Jordan Crouseb3115fe2012-02-01 22:11:12 -070071
Jay Chokshiea67c622011-07-29 17:12:26 -070072#endif