blob: 61eb408229fbfe0750ab2ca8b8d51f25bedb1e0b [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>
Huaibin Yanga5419422011-12-08 23:52:10 -080021#include <mach/msm_memtypes.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080022
Jay Chokshi06fa7542011-12-07 13:09:17 -080023/*
24 * TODO: When physical 8930/PM8038 hardware becomes
25 * available, remove this block.
26 */
27#ifndef MSM8930_PHASE_2
28#include <linux/mfd/pm8xxx/pm8921.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080029#define PM8921_GPIO_BASE NR_GPIO_IRQS
30#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
31#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
32#define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE)
Jay Chokshi06fa7542011-12-07 13:09:17 -080033#endif
34
35/* Macros assume PMIC GPIOs and MPPs start at 1 */
36#define PM8038_GPIO_BASE NR_GPIO_IRQS
37#define PM8038_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_GPIO_BASE)
38#define PM8038_MPP_BASE (PM8038_GPIO_BASE + PM8038_NR_GPIOS)
39#define PM8038_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_MPP_BASE)
40#define PM8038_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
41
42/*
43 * TODO: When physical 8930/PM8038 hardware becomes
44 * available, replace this block with 8930/pm8038 regulator
45 * declarations.
46 */
47#ifndef MSM8930_PHASE_2
48extern struct regulator_init_data msm_saw_regulator_pdata_s5;
49extern struct regulator_init_data msm_saw_regulator_pdata_s6;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080050
51extern struct pm8921_regulator_platform_data
52 msm_pm8921_regulator_pdata[] __devinitdata;
53
54extern int msm_pm8921_regulator_pdata_len __devinitdata;
55
Jay Chokshi06fa7542011-12-07 13:09:17 -080056extern struct gpio_regulator_platform_data
57 msm_gpio_regulator_pdata[] __devinitdata;
58
59extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata;
60#endif
61
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080062#define GPIO_VREG_ID_EXT_5V 0
63#define GPIO_VREG_ID_EXT_L2 1
64#define GPIO_VREG_ID_EXT_3P3V 2
65
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080066
67#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
68enum {
Jay Chokshi06fa7542011-12-07 13:09:17 -080069 GPIO_EXPANDER_IRQ_BASE = (PM8038_IRQ_BASE + PM8038_NR_IRQS),
70 GPIO_EXPANDER_GPIO_BASE = (PM8038_MPP_BASE + PM8038_NR_MPPS),
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080071 /* CAM Expander */
72 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
73 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
74 GPIO_CAM_GP_AFBUSY,
75 GPIO_CAM_GP_STROBE_CE,
76 GPIO_CAM_GP_CAM1MP_XCLR,
77 GPIO_CAM_GP_CAMIF_RESET_N,
78 GPIO_CAM_GP_XMT_FLASH_INT,
79 GPIO_CAM_GP_LED_EN1,
80 GPIO_CAM_GP_LED_EN2,
81
82};
83#endif
84
85enum {
86 SX150X_CAM,
87};
88
89#endif
90
91extern struct sx150x_platform_data msm8930_sx150x_data[];
92void msm8930_init_cam(void);
93void msm8930_init_fb(void);
94void msm8930_init_pmic(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -080095
96/*
97 * TODO: When physical 8930/PM8038 hardware becomes
98 * available, remove this block or add the config
99 * option.
100 */
101#ifndef MSM8930_PHASE_2
102void msm8960_init_pmic(void);
103void msm8960_pm8921_gpio_mpp_init(void);
104#endif
105
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800106void msm8930_init_mmc(void);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800107int msm8930_init_gpiomux(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800108void msm8930_allocate_fb_region(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -0800109void msm8930_pm8038_gpio_mpp_init(void);
Huaibin Yanga5419422011-12-08 23:52:10 -0800110void msm8930_mdp_writeback(struct memtype_reserve *reserve_table);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800111
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800112#define PLATFORM_IS_CHARM25() \
113 (machine_is_msm8930_cdp() && \
114 (socinfo_get_platform_subtype() == 1) \
115 )
116
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800117#define MSM_8930_GSBI4_QUP_I2C_BUS_ID 4
118#define MSM_8930_GSBI3_QUP_I2C_BUS_ID 3
119#define MSM_8930_GSBI10_QUP_I2C_BUS_ID 10