Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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_MSM8960_H |
| 14 | #define __ARCH_ARM_MACH_MSM_BOARD_MSM8960_H |
| 15 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/regulator/msm-gpio-regulator.h> |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 17 | #include <linux/mfd/pm8xxx/pm8921.h> |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 18 | #include <linux/i2c.h> |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 19 | #include <linux/i2c/sx150x.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | #include <mach/irqs.h> |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 21 | #include <mach/rpm-regulator.h> |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 22 | #include <mach/msm_memtypes.h> |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 23 | #include <mach/msm_rtb.h> |
Laura Abbott | 2ae8f36 | 2012-04-12 11:03:04 -0700 | [diff] [blame] | 24 | #include <mach/msm_cache_dump.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 25 | |
| 26 | /* Macros assume PMIC GPIOs and MPPs start at 1 */ |
| 27 | #define PM8921_GPIO_BASE NR_GPIO_IRQS |
| 28 | #define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE) |
| 29 | #define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS) |
| 30 | #define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE) |
| 31 | #define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 32 | |
David Collins | 7501674 | 2011-12-02 15:04:25 -0800 | [diff] [blame] | 33 | extern struct pm8xxx_regulator_platform_data |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 34 | msm_pm8921_regulator_pdata[] __devinitdata; |
| 35 | |
| 36 | extern int msm_pm8921_regulator_pdata_len __devinitdata; |
| 37 | |
| 38 | #define GPIO_VREG_ID_EXT_5V 0 |
| 39 | #define GPIO_VREG_ID_EXT_L2 1 |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 40 | #define GPIO_VREG_ID_EXT_3P3V 2 |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 41 | #define GPIO_VREG_ID_EXT_OTG_SW 3 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | |
| 43 | extern struct gpio_regulator_platform_data |
| 44 | msm_gpio_regulator_pdata[] __devinitdata; |
| 45 | |
| 46 | extern struct regulator_init_data msm_saw_regulator_pdata_s5; |
| 47 | extern struct regulator_init_data msm_saw_regulator_pdata_s6; |
| 48 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 49 | extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata; |
| 50 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 51 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
| 52 | enum { |
| 53 | GPIO_EXPANDER_IRQ_BASE = (PM8921_IRQ_BASE + PM8921_NR_IRQS), |
| 54 | GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS), |
| 55 | /* CAM Expander */ |
| 56 | GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE, |
| 57 | GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE, |
| 58 | GPIO_CAM_GP_AFBUSY, |
| 59 | GPIO_CAM_GP_STROBE_CE, |
| 60 | GPIO_CAM_GP_CAM1MP_XCLR, |
| 61 | GPIO_CAM_GP_CAMIF_RESET_N, |
| 62 | GPIO_CAM_GP_XMT_FLASH_INT, |
| 63 | GPIO_CAM_GP_LED_EN1, |
| 64 | GPIO_CAM_GP_LED_EN2, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 65 | GPIO_LIQUID_EXPANDER_BASE = GPIO_CAM_EXPANDER_BASE + 8, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 66 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 67 | #endif |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 68 | |
| 69 | enum { |
| 70 | SX150X_CAM, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 71 | SX150X_LIQUID, |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 72 | }; |
| 73 | |
| 74 | #endif |
| 75 | |
| 76 | extern struct sx150x_platform_data msm8960_sx150x_data[]; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 77 | extern struct msm_camera_board_info msm8960_camera_board_info; |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 78 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 79 | void msm8960_init_cam(void); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 80 | void msm8960_init_fb(void); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 81 | void msm8960_init_pmic(void); |
Stepan Moskovchenko | 0c547bb | 2011-11-30 13:29:12 -0800 | [diff] [blame] | 82 | void msm8960_init_mmc(void); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 83 | int msm8960_init_gpiomux(void); |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 84 | void __init configure_msm8960_power_grid(void); |
Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 85 | unsigned char msm8960_hdmi_as_primary_selected(void); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 86 | void msm8960_allocate_fb_region(void); |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 87 | void msm8960_set_display_params(char *prim_panel, char *ext_panel); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 88 | void msm8960_pm8921_gpio_mpp_init(void); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 89 | void msm8960_mdp_writeback(struct memtype_reserve *reserve_table); |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 90 | #define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4 |
| 91 | #define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3 |
| 92 | #define MSM_8960_GSBI10_QUP_I2C_BUS_ID 10 |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 93 | |
| 94 | extern struct msm_rtb_platform_data msm8960_rtb_pdata; |
Laura Abbott | 2ae8f36 | 2012-04-12 11:03:04 -0700 | [diff] [blame] | 95 | extern struct msm_cache_dump_platform_data msm8960_cache_dump_pdata; |
Arun Menon | 697e91b | 2012-08-20 15:25:50 -0700 | [diff] [blame] | 96 | extern void msm8960_add_vidc_device(void); |