blob: 90adb6266780f144d59b24844717e3108d507584 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002 *
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
David Collinse92b76a2012-01-05 10:57:24 -080016#define MSM8930_PHASE_2
17
Steve Mucklef132c6c2012-06-06 18:30:57 -070018#include <linux/regulator/msm-gpio-regulator.h>
Jay Chokshi06fa7542011-12-07 13:09:17 -080019#include <linux/mfd/pm8xxx/pm8038.h>
David Collinsfc736722012-08-06 12:07:11 -070020#include <linux/mfd/pm8xxx/pm8921.h>
Kevin Chan09f4e662011-12-16 08:17:02 -080021#include <linux/i2c.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080022#include <linux/i2c/sx150x.h>
23#include <mach/irqs.h>
24#include <mach/rpm-regulator.h>
Huaibin Yanga5419422011-12-08 23:52:10 -080025#include <mach/msm_memtypes.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070026#include <mach/msm_rtb.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080027
Jay Chokshi06fa7542011-12-07 13:09:17 -080028/*
29 * TODO: When physical 8930/PM8038 hardware becomes
30 * available, remove this block.
31 */
32#ifndef MSM8930_PHASE_2
33#include <linux/mfd/pm8xxx/pm8921.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080034#define PM8921_GPIO_BASE NR_GPIO_IRQS
35#define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE)
36#define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS)
37#define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE)
Jay Chokshi06fa7542011-12-07 13:09:17 -080038#endif
39
40/* Macros assume PMIC GPIOs and MPPs start at 1 */
David Collinsfc736722012-08-06 12:07:11 -070041/*
42 * PM8917 has more GPIOs and MPPs than PM8038; therefore, use PM8038 sizes at
43 * all times so that PM8038 vs PM8917 can be chosen at runtime. This results in
44 * the Linux GPIO address space being contiguous for PM8917 and discontiguous
45 * for PM8038.
46 */
Jay Chokshi06fa7542011-12-07 13:09:17 -080047#define PM8038_GPIO_BASE NR_GPIO_IRQS
48#define PM8038_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_GPIO_BASE)
David Collinsfc736722012-08-06 12:07:11 -070049#define PM8038_MPP_BASE (PM8038_GPIO_BASE + PM8917_NR_GPIOS)
Jay Chokshi06fa7542011-12-07 13:09:17 -080050#define PM8038_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8038_MPP_BASE)
51#define PM8038_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
52
David Collinsfc736722012-08-06 12:07:11 -070053/* These PM8917 alias macros are used to provide context in board files. */
54#define PM8917_GPIO_PM_TO_SYS(pm_gpio) PM8038_GPIO_PM_TO_SYS(pm_gpio)
55#define PM8917_MPP_PM_TO_SYS(pm_gpio) PM8038_MPP_PM_TO_SYS(pm_gpio)
56#define PM8917_IRQ_BASE PM8038_IRQ_BASE
57
Jay Chokshi06fa7542011-12-07 13:09:17 -080058/*
59 * TODO: When physical 8930/PM8038 hardware becomes
60 * available, replace this block with 8930/pm8038 regulator
61 * declarations.
62 */
63#ifndef MSM8930_PHASE_2
David Collins75016742011-12-02 15:04:25 -080064extern struct pm8xxx_regulator_platform_data
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080065 msm_pm8921_regulator_pdata[] __devinitdata;
66
67extern int msm_pm8921_regulator_pdata_len __devinitdata;
68
Jay Chokshi06fa7542011-12-07 13:09:17 -080069extern struct gpio_regulator_platform_data
70 msm_gpio_regulator_pdata[] __devinitdata;
71
72extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata;
Jay Chokshi06fa7542011-12-07 13:09:17 -080073
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080074#define GPIO_VREG_ID_EXT_5V 0
75#define GPIO_VREG_ID_EXT_L2 1
76#define GPIO_VREG_ID_EXT_3P3V 2
David Collins1d4061b2011-12-06 15:36:40 -080077#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080078
David Collins4614cb92012-08-20 12:17:09 -070079extern struct regulator_init_data msm8930_pm8038_saw_regulator_core0_pdata;
80extern struct regulator_init_data msm8930_pm8038_saw_regulator_core1_pdata;
81extern struct regulator_init_data msm8930_pm8917_saw_regulator_core0_pdata;
82extern struct regulator_init_data msm8930_pm8917_saw_regulator_core1_pdata;
David Collinsb4558422012-01-05 10:50:49 -080083
David Collins1d4061b2011-12-06 15:36:40 -080084extern struct pm8xxx_regulator_platform_data
85 msm8930_pm8038_regulator_pdata[] __devinitdata;
David Collins1d4061b2011-12-06 15:36:40 -080086extern int msm8930_pm8038_regulator_pdata_len __devinitdata;
87
David Collins4614cb92012-08-20 12:17:09 -070088extern struct pm8xxx_regulator_platform_data
89 msm8930_pm8917_regulator_pdata[] __devinitdata;
90extern int msm8930_pm8917_regulator_pdata_len __devinitdata;
91
David Collins1d4061b2011-12-06 15:36:40 -080092#define MSM8930_GPIO_VREG_ID_EXT_5V 0
93#define MSM8930_GPIO_VREG_ID_EXT_OTG_SW 1
94
95extern struct gpio_regulator_platform_data
David Collins4614cb92012-08-20 12:17:09 -070096 msm8930_pm8038_gpio_regulator_pdata[] __devinitdata;
97extern struct gpio_regulator_platform_data
98 msm8930_pm8917_gpio_regulator_pdata[] __devinitdata;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080099
David Collins8af872e2012-01-06 11:31:56 -0800100extern struct rpm_regulator_platform_data
David Collins4614cb92012-08-20 12:17:09 -0700101 msm8930_pm8038_rpm_regulator_pdata __devinitdata;
102extern struct rpm_regulator_platform_data
103 msm8930_pm8917_rpm_regulator_pdata __devinitdata;
David Collins8af872e2012-01-06 11:31:56 -0800104
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800105#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
106enum {
Jay Chokshi06fa7542011-12-07 13:09:17 -0800107 GPIO_EXPANDER_IRQ_BASE = (PM8038_IRQ_BASE + PM8038_NR_IRQS),
David Collinsfc736722012-08-06 12:07:11 -0700108 GPIO_EXPANDER_GPIO_BASE = (PM8038_MPP_BASE + PM8917_NR_MPPS),
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800109 /* CAM Expander */
110 GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
111 GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
112 GPIO_CAM_GP_AFBUSY,
113 GPIO_CAM_GP_STROBE_CE,
114 GPIO_CAM_GP_CAM1MP_XCLR,
115 GPIO_CAM_GP_CAMIF_RESET_N,
116 GPIO_CAM_GP_XMT_FLASH_INT,
117 GPIO_CAM_GP_LED_EN1,
118 GPIO_CAM_GP_LED_EN2,
119
120};
121#endif
122
123enum {
124 SX150X_CAM,
125};
126
127#endif
128
129extern struct sx150x_platform_data msm8930_sx150x_data[];
Kevin Chan09f4e662011-12-16 08:17:02 -0800130extern struct msm_camera_board_info msm8930_camera_board_info;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800131void msm8930_init_cam(void);
132void msm8930_init_fb(void);
133void msm8930_init_pmic(void);
Arun Menonaabf2632012-02-24 15:30:47 -0800134extern void msm8930_add_vidc_device(void);
Aravind Venkateswaran06a46352012-08-16 14:52:39 -0700135unsigned char msm8930_mhl_display_enabled(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -0800136
137/*
138 * TODO: When physical 8930/PM8038 hardware becomes
139 * available, remove this block or add the config
140 * option.
141 */
142#ifndef MSM8930_PHASE_2
143void msm8960_init_pmic(void);
144void msm8960_pm8921_gpio_mpp_init(void);
145#endif
146
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800147void msm8930_init_mmc(void);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800148int msm8930_init_gpiomux(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800149void msm8930_allocate_fb_region(void);
Jay Chokshi06fa7542011-12-07 13:09:17 -0800150void msm8930_pm8038_gpio_mpp_init(void);
David Collinsfd344aa2012-08-06 15:02:03 -0700151void msm8930_pm8917_gpio_mpp_init(void);
Aravind Venkateswaran06a46352012-08-16 14:52:39 -0700152void msm8930_set_display_params(char *prim_panel, char *ext_panel);
Huaibin Yanga5419422011-12-08 23:52:10 -0800153void msm8930_mdp_writeback(struct memtype_reserve *reserve_table);
Sudhakara Rao Tentu8b5c8ed2012-03-05 14:48:41 +0530154void __init msm8930_init_gpu(void);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800155
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -0800156#define PLATFORM_IS_CHARM25() \
157 (machine_is_msm8930_cdp() && \
158 (socinfo_get_platform_subtype() == 1) \
159 )
160
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800161#define MSM_8930_GSBI3_QUP_I2C_BUS_ID 3
Amy Malochee8de95d2012-02-23 10:40:25 -0800162#define MSM_8930_GSBI4_QUP_I2C_BUS_ID 4
163#define MSM_8930_GSBI9_QUP_I2C_BUS_ID 0
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800164#define MSM_8930_GSBI10_QUP_I2C_BUS_ID 10
Wentao Xuf59ce4e2012-05-22 17:30:13 -0400165#define MSM_8930_GSBI12_QUP_I2C_BUS_ID 12
Laura Abbott532b2df2012-04-12 10:53:48 -0700166
Manoj Rao908ad742012-08-08 15:03:39 -0700167#define HDMI_MHL_MUX_GPIO 73
168
Laura Abbott532b2df2012-04-12 10:53:48 -0700169extern struct msm_rtb_platform_data msm8930_rtb_pdata;
Laura Abbottf3173042012-05-29 15:23:18 -0700170extern struct msm_cache_dump_platform_data msm8930_cache_dump_pdata;