blob: c81825fc20aacc6b35faf9ccde15aeeeb09b571a [file] [log] [blame]
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
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_MSM8930_H
14#define __ARCH_ARM_MACH_MSM_BOARD_MSM8930_H
15
16#include <linux/regulator/gpio-regulator.h>
Jay Chokshi06fa7542011-12-07 13:09:17 -080017#include <linux/mfd/pm8xxx/pm8038.h>
Kevin Chan09f4e662011-12-16 08:17:02 -080018#include <linux/i2c.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080019#include <linux/i2c/sx150x.h>
20#include <mach/irqs.h>
21#include <mach/rpm-regulator.h>
Huaibin Yanga5419422011-12-08 23:52:10 -080022#include <mach/msm_memtypes.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080023
Jay Chokshi06fa7542011-12-07 13:09:17 -080024/*
25 * TODO: When physical 8930/PM8038 hardware becomes
26 * available, remove this block.
27 */
28#ifndef MSM8930_PHASE_2
29#include <linux/mfd/pm8xxx/pm8921.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080030#define PM8921_GPIO_BASE NR_GPIO_IRQS
31#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
32#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
33#define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE)
Jay Chokshi06fa7542011-12-07 13:09:17 -080034#endif
35
36/* Macros assume PMIC GPIOs and MPPs start at 1 */
37#define PM8038_GPIO_BASE NR_GPIO_IRQS
38#define PM8038_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_GPIO_BASE)
39#define PM8038_MPP_BASE (PM8038_GPIO_BASE + PM8038_NR_GPIOS)
40#define PM8038_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_MPP_BASE)
41#define PM8038_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
42
43/*
44 * TODO: When physical 8930/PM8038 hardware becomes
45 * available, replace this block with 8930/pm8038 regulator
46 * declarations.
47 */
48#ifndef MSM8930_PHASE_2
49extern struct regulator_init_data msm_saw_regulator_pdata_s5;
50extern struct regulator_init_data msm_saw_regulator_pdata_s6;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080051
52extern struct pm8921_regulator_platform_data
53 msm_pm8921_regulator_pdata[] __devinitdata;
54
55extern int msm_pm8921_regulator_pdata_len __devinitdata;
56
Jay Chokshi06fa7542011-12-07 13:09:17 -080057extern struct gpio_regulator_platform_data
58 msm_gpio_regulator_pdata[] __devinitdata;
59
60extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata;
61#endif
62
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080063#define GPIO_VREG_ID_EXT_5V 0
64#define GPIO_VREG_ID_EXT_L2 1
65#define GPIO_VREG_ID_EXT_3P3V 2
66
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080067
68#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
69enum {
Jay Chokshi06fa7542011-12-07 13:09:17 -080070 GPIO_EXPANDER_IRQ_BASE = (PM8038_IRQ_BASE + PM8038_NR_IRQS),
71 GPIO_EXPANDER_GPIO_BASE = (PM8038_MPP_BASE + PM8038_NR_MPPS),
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080072 /* CAM Expander */
73 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
74 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
75 GPIO_CAM_GP_AFBUSY,
76 GPIO_CAM_GP_STROBE_CE,
77 GPIO_CAM_GP_CAM1MP_XCLR,
78 GPIO_CAM_GP_CAMIF_RESET_N,
79 GPIO_CAM_GP_XMT_FLASH_INT,
80 GPIO_CAM_GP_LED_EN1,
81 GPIO_CAM_GP_LED_EN2,
82
83};
84#endif
85
86enum {
87 SX150X_CAM,
88};
89
90#endif
91
92extern struct sx150x_platform_data msm8930_sx150x_data[];
Kevin Chan09f4e662011-12-16 08:17:02 -080093extern struct msm_camera_board_info msm8930_camera_board_info;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080094void msm8930_init_cam(void);
95void msm8930_init_fb(void);
96void msm8930_init_pmic(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -080097
98/*
99 * TODO: When physical 8930/PM8038 hardware becomes
100 * available, remove this block or add the config
101 * option.
102 */
103#ifndef MSM8930_PHASE_2
104void msm8960_init_pmic(void);
105void msm8960_pm8921_gpio_mpp_init(void);
106#endif
107
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800108void msm8930_init_mmc(void);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800109int msm8930_init_gpiomux(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800110void msm8930_allocate_fb_region(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -0800111void msm8930_pm8038_gpio_mpp_init(void);
Huaibin Yanga5419422011-12-08 23:52:10 -0800112void msm8930_mdp_writeback(struct memtype_reserve *reserve_table);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800113
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800114#define PLATFORM_IS_CHARM25() \
115 (machine_is_msm8930_cdp() && \
116 (socinfo_get_platform_subtype() == 1) \
117 )
118
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800119#define MSM_8930_GSBI4_QUP_I2C_BUS_ID 4
120#define MSM_8930_GSBI3_QUP_I2C_BUS_ID 3
121#define MSM_8930_GSBI10_QUP_I2C_BUS_ID 10