blob: ec0b867e70ef4549d30240befad4154c77547c71 [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>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080018#include <linux/i2c/sx150x.h>
19#include <mach/irqs.h>
20#include <mach/rpm-regulator.h>
21
Jay Chokshi06fa7542011-12-07 13:09:17 -080022/*
23 * TODO: When physical 8930/PM8038 hardware becomes
24 * available, remove this block.
25 */
26#ifndef MSM8930_PHASE_2
27#include <linux/mfd/pm8xxx/pm8921.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080028#define PM8921_GPIO_BASE NR_GPIO_IRQS
29#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
30#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
31#define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE)
Jay Chokshi06fa7542011-12-07 13:09:17 -080032#endif
33
34/* Macros assume PMIC GPIOs and MPPs start at 1 */
35#define PM8038_GPIO_BASE NR_GPIO_IRQS
36#define PM8038_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_GPIO_BASE)
37#define PM8038_MPP_BASE (PM8038_GPIO_BASE + PM8038_NR_GPIOS)
38#define PM8038_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_MPP_BASE)
39#define PM8038_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
40
41/*
42 * TODO: When physical 8930/PM8038 hardware becomes
43 * available, replace this block with 8930/pm8038 regulator
44 * declarations.
45 */
46#ifndef MSM8930_PHASE_2
47extern struct regulator_init_data msm_saw_regulator_pdata_s5;
48extern struct regulator_init_data msm_saw_regulator_pdata_s6;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080049
50extern struct pm8921_regulator_platform_data
51 msm_pm8921_regulator_pdata[] __devinitdata;
52
53extern int msm_pm8921_regulator_pdata_len __devinitdata;
54
Jay Chokshi06fa7542011-12-07 13:09:17 -080055extern struct gpio_regulator_platform_data
56 msm_gpio_regulator_pdata[] __devinitdata;
57
58extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata;
59#endif
60
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080061#define GPIO_VREG_ID_EXT_5V 0
62#define GPIO_VREG_ID_EXT_L2 1
63#define GPIO_VREG_ID_EXT_3P3V 2
64
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080065
66#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
67enum {
Jay Chokshi06fa7542011-12-07 13:09:17 -080068 GPIO_EXPANDER_IRQ_BASE = (PM8038_IRQ_BASE + PM8038_NR_IRQS),
69 GPIO_EXPANDER_GPIO_BASE = (PM8038_MPP_BASE + PM8038_NR_MPPS),
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080070 /* CAM Expander */
71 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
72 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
73 GPIO_CAM_GP_AFBUSY,
74 GPIO_CAM_GP_STROBE_CE,
75 GPIO_CAM_GP_CAM1MP_XCLR,
76 GPIO_CAM_GP_CAMIF_RESET_N,
77 GPIO_CAM_GP_XMT_FLASH_INT,
78 GPIO_CAM_GP_LED_EN1,
79 GPIO_CAM_GP_LED_EN2,
80
81};
82#endif
83
84enum {
85 SX150X_CAM,
86};
87
88#endif
89
90extern struct sx150x_platform_data msm8930_sx150x_data[];
91void msm8930_init_cam(void);
92void msm8930_init_fb(void);
93void msm8930_init_pmic(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -080094
95/*
96 * TODO: When physical 8930/PM8038 hardware becomes
97 * available, remove this block or add the config
98 * option.
99 */
100#ifndef MSM8930_PHASE_2
101void msm8960_init_pmic(void);
102void msm8960_pm8921_gpio_mpp_init(void);
103#endif
104
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800105void msm8930_init_mmc(void);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800106int msm8930_init_gpiomux(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800107void msm8930_allocate_fb_region(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -0800108void msm8930_pm8038_gpio_mpp_init(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800109
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800110#define PLATFORM_IS_CHARM25() \
111 (machine_is_msm8930_cdp() && \
112 (socinfo_get_platform_subtype() == 1) \
113 )
114
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800115#define MSM_8930_GSBI4_QUP_I2C_BUS_ID 4
116#define MSM_8930_GSBI3_QUP_I2C_BUS_ID 3
117#define MSM_8930_GSBI10_QUP_I2C_BUS_ID 10