Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* 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_MSM8960_H |
| 14 | #define __ARCH_ARM_MACH_MSM_BOARD_MSM8960_H |
| 15 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 16 | #include <linux/regulator/gpio-regulator.h> |
| 17 | #include <linux/mfd/pm8xxx/pm8921.h> |
| 18 | #include <linux/i2c/sx150x.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | #include <mach/irqs.h> |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 20 | #include <mach/rpm-regulator.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | |
| 22 | /* Macros assume PMIC GPIOs and MPPs start at 1 */ |
| 23 | #define PM8921_GPIO_BASE NR_GPIO_IRQS |
| 24 | #define PM8921_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_GPIO_BASE) |
| 25 | #define PM8921_MPP_BASE (PM8921_GPIO_BASE + PM8921_NR_GPIOS) |
| 26 | #define PM8921_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8921_MPP_BASE) |
| 27 | #define PM8921_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 28 | |
| 29 | extern struct pm8921_regulator_platform_data |
| 30 | msm_pm8921_regulator_pdata[] __devinitdata; |
| 31 | |
| 32 | extern int msm_pm8921_regulator_pdata_len __devinitdata; |
| 33 | |
| 34 | #define GPIO_VREG_ID_EXT_5V 0 |
| 35 | #define GPIO_VREG_ID_EXT_L2 1 |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 36 | #define GPIO_VREG_ID_EXT_3P3V 2 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | |
| 38 | extern struct gpio_regulator_platform_data |
| 39 | msm_gpio_regulator_pdata[] __devinitdata; |
| 40 | |
| 41 | extern struct regulator_init_data msm_saw_regulator_pdata_s5; |
| 42 | extern struct regulator_init_data msm_saw_regulator_pdata_s6; |
| 43 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 44 | extern struct rpm_regulator_platform_data msm_rpm_regulator_pdata __devinitdata; |
| 45 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 46 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
| 47 | enum { |
| 48 | GPIO_EXPANDER_IRQ_BASE = (PM8921_IRQ_BASE + PM8921_NR_IRQS), |
| 49 | GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS), |
| 50 | /* CAM Expander */ |
| 51 | GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE, |
| 52 | GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE, |
| 53 | GPIO_CAM_GP_AFBUSY, |
| 54 | GPIO_CAM_GP_STROBE_CE, |
| 55 | GPIO_CAM_GP_CAM1MP_XCLR, |
| 56 | GPIO_CAM_GP_CAMIF_RESET_N, |
| 57 | GPIO_CAM_GP_XMT_FLASH_INT, |
| 58 | GPIO_CAM_GP_LED_EN1, |
| 59 | GPIO_CAM_GP_LED_EN2, |
| 60 | |
| 61 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 62 | #endif |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 63 | |
| 64 | enum { |
| 65 | SX150X_CAM, |
| 66 | }; |
| 67 | |
| 68 | #endif |
| 69 | |
| 70 | extern struct sx150x_platform_data msm8960_sx150x_data[]; |
| 71 | void msm8960_init_cam(void); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 72 | void msm8960_init_fb(void); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 73 | void msm8960_init_pmic(void); |
Stepan Moskovchenko | 0c547bb | 2011-11-30 13:29:12 -0800 | [diff] [blame] | 74 | void msm8960_init_mmc(void); |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 75 | int msm8960_init_gpiomux(void); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 76 | void msm8960_allocate_fb_region(void); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 77 | void msm8960_pm8921_gpio_mpp_init(void); |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 78 | |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 79 | #define PLATFORM_IS_CHARM25() \ |
| 80 | (machine_is_msm8960_cdp() && \ |
| 81 | (socinfo_get_platform_subtype() == 1) \ |
| 82 | ) |
| 83 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 84 | #define MSM_8960_GSBI4_QUP_I2C_BUS_ID 4 |
| 85 | #define MSM_8960_GSBI3_QUP_I2C_BUS_ID 3 |
| 86 | #define MSM_8960_GSBI10_QUP_I2C_BUS_ID 10 |