/arch/arm/mach-msm/board-qrdc.c
https://bitbucket.org/sammyz/iscream_thunderc-2.6.35-rebase · C · 4213 lines · 3554 code · 458 blank · 201 comment · 246 complexity · 89f1b7783fc1bdce4c6c17cc22a92312 MD5 · raw file
Large files are truncated click here to view the full file
- /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
- #include <linux/kernel.h>
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
- #include <linux/irq.h>
- #include <linux/io.h>
- #include <linux/mfd/pmic8058.h>
- #include <linux/mfd/bahama.h>
- #include <linux/input/pmic8058-keypad.h>
- #include <linux/pmic8058-pwrkey.h>
- #include <linux/pmic8058-vibrator.h>
- #include <linux/leds.h>
- #include <linux/pmic8058-othc.h>
- #include <linux/mfd/pmic8901.h>
- #include <linux/regulator/pmic8901-regulator.h>
- #include <linux/bootmem.h>
- #include <linux/pwm.h>
- #include <linux/pmic8058-pwm.h>
- #include <linux/leds-pmic8058.h>
- #include <linux/mfd/marimba.h>
- #include <linux/i2c.h>
- #include <linux/i2c/sx150x.h>
- #include <linux/smsc911x.h>
- #include <linux/spi/spi.h>
- #include <linux/input/tdisc_shinetsu.h>
- #include <linux/input/cy8c_ts.h>
- #include <linux/input/qci_kbd.h>
- #include <linux/mfd/wm8994/core.h>
- #include <linux/mfd/wm8994/pdata.h>
- #ifdef CONFIG_ANDROID_PMEM
- #include <linux/android_pmem.h>
- #endif
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
- #include <asm/setup.h>
- #include <mach/mpp.h>
- #include <mach/board.h>
- #include <mach/irqs.h>
- #include <mach/msm_spi.h>
- #include <mach/msm_serial_hs.h>
- #include <mach/msm_iomap.h>
- #include <asm/mach/mmc.h>
- #include <mach/msm_battery.h>
- #include <mach/msm_hsusb.h>
- #include <mach/msm_xo.h>
- #include <mach/msm_bus_board.h>
- #include <mach/tpm_st_i2c.h>
- #include <mach/socinfo.h>
- #ifdef CONFIG_USB_ANDROID
- #include <linux/usb/android_composite.h>
- #endif
- #include <linux/regulator/consumer.h>
- #include <linux/regulator/machine.h>
- #include "devices.h"
- #include "devices-msm8x60.h"
- #include "cpuidle.h"
- #include "pm.h"
- #include "rpm.h"
- #include "mpm.h"
- #include "spm.h"
- #include "rpm_log.h"
- #include "timer.h"
- #include "saw-regulator.h"
- #include "rpm-regulator.h"
- #include "gpiomux.h"
- #include "gpiomux-8x60.h"
- #define MSM_SHARED_RAM_PHYS 0x40000000
- /* Macros assume PMIC GPIOs start at 0 */
- #define PM8058_GPIO_BASE NR_MSM_GPIOS
- #define PM8058_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_GPIO_BASE)
- #define PM8058_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_GPIO_BASE)
- #define PM8058_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
- #define PM8901_GPIO_BASE (PM8058_GPIO_BASE + \
- PM8058_GPIOS + PM8058_MPPS)
- #define PM8901_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + PM8901_GPIO_BASE)
- #define PM8901_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - PM901_GPIO_BASE)
- #define PM8901_IRQ_BASE (PM8058_IRQ_BASE + \
- NR_PMIC8058_IRQS)
- #define GPIO_EXPANDER_GPIO_BASE \
- (PM8901_GPIO_BASE + PM8901_MPPS)
- #define GPIO_EXPANDER_IRQ_BASE (PM8901_IRQ_BASE + NR_PMIC8901_IRQS)
- /*
- * The UI_INTx_N lines are pmic gpio lines which connect i2c
- * gpio expanders to the pm8058.
- */
- #define UI_INT1_N 25
- #define UI_INT2_N 34
- #define UI_INT3_N 14
- static struct msm_spm_platform_data msm_spm_data[] __initdata = {
- [0] = {
- .reg_base_addr = MSM_SAW0_BASE,
- .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x0F,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x01,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00,
- .awake_vlevel = 0x9C,
- .retention_vlevel = 0x81,
- .collapse_vlevel = 0x20,
- .retention_mid_vlevel = 0x94,
- .collapse_mid_vlevel = 0x8C,
- .vctl_timeout_us = 50,
- },
- [1] = {
- .reg_base_addr = MSM_SAW1_BASE,
- .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x0F,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x13,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01,
- .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00,
- .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00,
- .awake_vlevel = 0x9C,
- .retention_vlevel = 0x81,
- .collapse_vlevel = 0x20,
- .retention_mid_vlevel = 0x94,
- .collapse_mid_vlevel = 0x8C,
- .vctl_timeout_us = 50,
- },
- };
- static struct msm_acpu_clock_platform_data msm8x60_acpu_clock_data = {
- };
- static struct regulator_consumer_supply saw_s0_supply =
- REGULATOR_SUPPLY("8901_s0", NULL);
- static struct regulator_consumer_supply saw_s1_supply =
- REGULATOR_SUPPLY("8901_s1", NULL);
- static struct regulator_init_data saw_s0_init_data = {
- .constraints = {
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
- .min_uV = 840000,
- .max_uV = 1200000,
- },
- .num_consumer_supplies = 1,
- .consumer_supplies = &saw_s0_supply,
- };
- static struct regulator_init_data saw_s1_init_data = {
- .constraints = {
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
- .min_uV = 840000,
- .max_uV = 1200000,
- },
- .num_consumer_supplies = 1,
- .consumer_supplies = &saw_s1_supply,
- };
- static struct platform_device msm_device_saw_s0 = {
- .name = "saw-regulator",
- .id = SAW_VREG_ID_S0,
- .dev = {
- .platform_data = &saw_s0_init_data,
- },
- };
- static struct platform_device msm_device_saw_s1 = {
- .name = "saw-regulator",
- .id = SAW_VREG_ID_S1,
- .dev = {
- .platform_data = &saw_s1_init_data,
- },
- };
- static struct resource smsc911x_resources[] = {
- [0] = {
- .flags = IORESOURCE_MEM,
- .start = 0x1b800000,
- .end = 0x1b8000ff
- },
- [1] = {
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
- };
- static struct smsc911x_platform_config smsc911x_config = {
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
- .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
- .flags = SMSC911X_USE_16BIT
- };
- static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = 0,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config
- }
- };
- static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
- [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
- .supported = 1,
- .suspend_enabled = 0,
- .idle_enabled = 0,
- .latency = 4000,
- .residency = 13000,
- },
- [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
- .supported = 1,
- .suspend_enabled = 0,
- .idle_enabled = 0,
- .latency = 500,
- .residency = 6000,
- },
- [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
- .supported = 1,
- .suspend_enabled = 1,
- .idle_enabled = 1,
- .latency = 2,
- .residency = 0,
- },
- [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
- .supported = 1,
- .suspend_enabled = 0,
- .idle_enabled = 0,
- .latency = 600,
- .residency = 7200,
- },
- [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
- .supported = 1,
- .suspend_enabled = 0,
- .idle_enabled = 0,
- .latency = 500,
- .residency = 6000,
- },
- [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
- .supported = 1,
- .suspend_enabled = 1,
- .idle_enabled = 1,
- .latency = 2,
- .residency = 0,
- },
- };
- static struct msm_cpuidle_state msm_cstates[] __initdata = {
- {0, 0, "C0", "WFI",
- MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
- {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
- MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
- {0, 2, "C2", "POWER_COLLAPSE",
- MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
- {1, 0, "C0", "WFI",
- MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
- {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
- MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
- };
- #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM)
- static struct regulator *ldo6_3p3;
- static struct regulator *ldo7_1p8;
- static struct regulator *vdd_cx;
- static int msm_hsusb_ldo_init(int init)
- {
- if (init) {
- ldo6_3p3 = regulator_get(NULL, "8058_l6");
- if (IS_ERR(ldo6_3p3))
- return PTR_ERR(ldo6_3p3);
- ldo7_1p8 = regulator_get(NULL, "8058_l7");
- if (IS_ERR(ldo7_1p8)) {
- regulator_put(ldo6_3p3);
- return PTR_ERR(ldo7_1p8);
- }
- /*digital core voltage for usb phy*/
- vdd_cx = regulator_get(NULL, "8058_s1");
- if (IS_ERR(vdd_cx)) {
- regulator_put(ldo6_3p3);
- regulator_put(ldo7_1p8);
- return PTR_ERR(vdd_cx);
- }
- regulator_set_voltage(vdd_cx, 1000000, 1200000);
- regulator_set_voltage(ldo7_1p8, 1800000, 1800000);
- regulator_set_voltage(ldo6_3p3, 3050000, 3050000);
- } else {
- regulator_put(ldo6_3p3);
- regulator_put(ldo7_1p8);
- regulator_put(vdd_cx);
- }
- return 0;
- }
- static int msm_hsusb_ldo_enable(int on)
- {
- static int ldo_status;
- int ret = 0;
- if (!ldo7_1p8 || IS_ERR(ldo7_1p8)) {
- pr_err("%s: ldo7_1p8 is not initialized\n", __func__);
- return -ENODEV;
- }
- if (!ldo6_3p3 || IS_ERR(ldo6_3p3)) {
- pr_err("%s: ldo6_3p3 is not initialized\n", __func__);
- return -ENODEV;
- }
- if (!vdd_cx || IS_ERR(vdd_cx)) {
- pr_err("%s: vdd_cx is not initialized\n", __func__);
- return -ENODEV;
- }
- if (ldo_status == on)
- return 0;
- ldo_status = on;
- if (on) {
- ret = regulator_enable(ldo7_1p8);
- if (ret) {
- pr_err("%s: Unable to enable the regulator:"
- "ldo7_1p8\n", __func__);
- ldo_status = !on;
- return ret;
- }
- ret = regulator_enable(ldo6_3p3);
- if (ret) {
- pr_err("%s: Unable to enable the regulator:"
- "ldo6_3p3\n", __func__);
- regulator_disable(ldo7_1p8);
- ldo_status = !on;
- return ret;
- }
- ret = regulator_enable(vdd_cx);
- if (ret) {
- pr_err("%s: Unable to enable VDDCX digital core:"
- " vdd_dig\n", __func__);
- regulator_disable(ldo6_3p3);
- regulator_disable(ldo7_1p8);
- ldo_status = !on;
- return ret;
- }
- } else {
- /* calling regulator_disable when its already disabled might
- * * print WARN_ON. Trying to avoid it by regulator_is_enable
- * * */
- if (regulator_is_enabled(ldo6_3p3)) {
- ret = regulator_disable(ldo6_3p3);
- if (ret) {
- pr_err("%s: Unable to disable the regulator:"
- "ldo6_3p3\n", __func__);
- ldo_status = !on;
- return ret;
- }
- }
- if (regulator_is_enabled(ldo7_1p8)) {
- ret = regulator_disable(ldo7_1p8);
- if (ret) {
- pr_err("%s: Unable to enable the regulator:"
- " ldo7_1p8\n", __func__);
- ldo_status = !on;
- return ret;
- }
- }
- if (regulator_is_enabled(vdd_cx)) {
- ret = regulator_disable(vdd_cx);
- if (ret) {
- pr_err("%s: Unable to enable the regulator:"
- "vdd_cx\n", __func__);
- ldo_status = !on;
- return ret;
- }
- }
- }
- pr_debug("reg (%s)\n", on ? "ENABLED" : "DISABLED");
- return 0;
- }
- #endif
- #ifdef CONFIG_USB_EHCI_MSM
- static void msm_hsusb_vbus_power(unsigned phy_info, int on)
- {
- static struct regulator *votg_5v_switch;
- static struct regulator *ext_5v_reg;
- static int vbus_is_on;
- /* If VBUS is already on (or off), do nothing. */
- if (on == vbus_is_on)
- return;
- if (!votg_5v_switch) {
- votg_5v_switch = regulator_get(NULL, "8901_usb_otg");
- if (IS_ERR(votg_5v_switch)) {
- pr_err("%s: unable to get votg_5v_switch\n", __func__);
- return;
- }
- }
- if (!ext_5v_reg) {
- ext_5v_reg = regulator_get(NULL, "8901_mpp0");
- if (IS_ERR(ext_5v_reg)) {
- pr_err("%s: unable to get ext_5v_reg\n", __func__);
- return;
- }
- }
- if (on) {
- if (regulator_enable(ext_5v_reg)) {
- pr_err("%s: Unable to enable the regulator:"
- " ext_5v_reg\n", __func__);
- return;
- }
- if (regulator_enable(votg_5v_switch)) {
- pr_err("%s: Unable to enable the regulator:"
- " votg_5v_switch\n", __func__);
- return;
- }
- } else {
- if (regulator_disable(votg_5v_switch))
- pr_err("%s: Unable to enable the regulator:"
- " votg_5v_switch\n", __func__);
- if (regulator_disable(ext_5v_reg))
- pr_err("%s: Unable to enable the regulator:"
- " ext_5v_reg\n", __func__);
- }
- vbus_is_on = on;
- }
- static struct msm_usb_host_platform_data msm_usb_host_pdata = {
- .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM),
- .power_budget = 390,
- };
- #endif
- #if defined(CONFIG_BATTERY_MSM8X60) && !defined(CONFIG_USB_EHCI_MSM)
- static int msm_hsusb_pmic_vbus_notif_init(void (*callback)(int online),
- int init)
- {
- if (init) {
- /* TBD: right API will get filled here as a part of
- * PMIC chanrger patch and removes thsi comments.*/
- } else {
- /* TBD: right API will get filled here as a part of
- * PMIC chanrger patch and removes thsi comments.*/
- }
- return 0;
- }
- #endif
- #define USB_SWITCH_EN_GPIO 132 /* !CS of analog switch */
- #define USB_SWITCH_CNTL_GPIO 131 /* 0: Host, 1: Peripheral */
- #define USB_HUB_RESET_GPIO 34 /* 0: HUB is RESET */
- static int msm_otg_init_analog_switch_gpio(int on)
- {
- int rc = 0;
- if (on) {
- /* USB SWITCH ENABLE*/
- rc = gpio_request(USB_SWITCH_EN_GPIO, "USB_SWITCH_ENABLE");
- if (rc) {
- pr_err("%s: SW_EN gpio %d request failed\n", __func__,
- USB_SWITCH_EN_GPIO);
- return rc;
- }
- /* USB SWITCH CONTROL */
- rc = gpio_request(USB_SWITCH_CNTL_GPIO, "USB_SWITCH_CONTROL");
- if (rc) {
- pr_err("%s: SW_CNTL gpio %d request failed\n", __func__,
- USB_SWITCH_CNTL_GPIO);
- goto fail_gpio_usb_switch_en;
- }
- /* USB HUB RESET */
- rc = gpio_request(USB_HUB_RESET_GPIO, "USB_HUB_RESET");
- if (rc) {
- pr_err("%s: HUB_RESET gpio %d request failed\n",
- __func__, USB_HUB_RESET_GPIO);
- goto fail_gpio_usb_switch_cntl;
- }
- /* Set direction of USB SWITCH ENABLE gpio */
- rc = gpio_direction_output(USB_SWITCH_EN_GPIO, 0);
- if (rc) {
- pr_err("%s: gpio_direction_output failed for %d\n",
- __func__, USB_SWITCH_EN_GPIO);
- goto fail_gpio_usb_hub_reset;
- }
- /* Set direction of USB SWITCH CONTROL gpio */
- rc = gpio_direction_output(USB_SWITCH_CNTL_GPIO, 0);
- if (rc) {
- pr_err("%s: gpio_direction_output failed for %d\n",
- __func__, USB_SWITCH_CNTL_GPIO);
- goto fail_gpio_usb_hub_reset;
- }
- /* Set direction of USB HUB RESET gpio */
- rc = gpio_direction_output(USB_HUB_RESET_GPIO, 0);
- if (rc) {
- pr_err("%s: gpio_direction_output failed for %d\n",
- __func__, USB_HUB_RESET_GPIO);
- goto fail_gpio_usb_hub_reset;
- }
- return rc;
- }
- fail_gpio_usb_hub_reset:
- gpio_free(USB_HUB_RESET_GPIO);
- fail_gpio_usb_switch_cntl:
- gpio_free(USB_SWITCH_CNTL_GPIO);
- fail_gpio_usb_switch_en:
- gpio_free(USB_SWITCH_EN_GPIO);
- return rc;
- }
- static void msm_otg_setup_analog_switch_gpio(enum usb_switch_control mode)
- {
- switch (mode) {
- case USB_SWITCH_HOST:
- /* Configure analog switch as USB host. */
- gpio_set_value(USB_SWITCH_EN_GPIO, 0);
- gpio_set_value(USB_SWITCH_CNTL_GPIO, 0);
- /* Bring HUB out of RESET */
- gpio_set_value(USB_HUB_RESET_GPIO, 1);
- break;
- case USB_SWITCH_PERIPHERAL:
- /* Configure analog switch as USB peripheral. */
- gpio_set_value(USB_SWITCH_EN_GPIO, 0);
- gpio_set_value(USB_SWITCH_CNTL_GPIO, 1);
- gpio_set_value(USB_HUB_RESET_GPIO, 0);
- break;
- case USB_SWITCH_DISABLE:
- default:
- /* Disable Switch */
- gpio_set_value(USB_SWITCH_EN_GPIO, 1);
- gpio_set_value(USB_HUB_RESET_GPIO, 0);
- }
- }
- #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM)
- static struct msm_otg_platform_data msm_otg_pdata = {
- /* if usb link is in sps there is no need for
- * usb pclk as dayatona fabric clock will be
- * used instead
- */
- .usb_in_sps = 1,
- .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT,
- .cdr_autoreset = CDR_AUTO_RESET_DISABLE,
- .se1_gating = SE1_GATING_DISABLE,
- .init_gpio = msm_otg_init_analog_switch_gpio,
- .setup_gpio = msm_otg_setup_analog_switch_gpio,
- #ifdef CONFIG_USB_EHCI_MSM
- .vbus_power = msm_hsusb_vbus_power,
- #endif
- #if defined(CONFIG_BATTERY_MSM8X60) && !defined(CONFIG_USB_EHCI_MSM)
- .pmic_vbus_notif_init = msm_hsusb_pmic_vbus_notif_init,
- #endif
- .otg_mode = OTG_USER_CONTROL,
- .usb_mode = USB_HOST_MODE,
- .ldo_init = msm_hsusb_ldo_init,
- .ldo_enable = msm_hsusb_ldo_enable,
- };
- #endif
- #ifdef CONFIG_USB_ANDROID
- static char *usb_functions_default[] = {
- "diag",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
- };
- static char *usb_functions_default_adb[] = {
- "diag",
- "adb",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
- };
- static char *usb_functions_rndis[] = {
- "rndis",
- };
- static char *usb_functions_rndis_adb[] = {
- "rndis",
- "adb",
- };
- static char *usb_functions_all[] = {
- #ifdef CONFIG_USB_ANDROID_RNDIS
- "rndis",
- #endif
- #ifdef CONFIG_USB_ANDROID_DIAG
- "diag",
- #endif
- "adb",
- #ifdef CONFIG_USB_F_SERIAL
- "modem",
- "nmea",
- #endif
- #ifdef CONFIG_USB_ANDROID_RMNET
- "rmnet",
- #endif
- "usb_mass_storage",
- #ifdef CONFIG_USB_ANDROID_ACM
- "acm",
- #endif
- };
- static struct android_usb_product usb_products[] = {
- {
- .product_id = 0x9026,
- .num_functions = ARRAY_SIZE(usb_functions_default),
- .functions = usb_functions_default,
- },
- {
- .product_id = 0x9025,
- .num_functions = ARRAY_SIZE(usb_functions_default_adb),
- .functions = usb_functions_default_adb,
- },
- {
- .product_id = 0xf00e,
- .num_functions = ARRAY_SIZE(usb_functions_rndis),
- .functions = usb_functions_rndis,
- },
- {
- .product_id = 0x9024,
- .num_functions = ARRAY_SIZE(usb_functions_rndis_adb),
- .functions = usb_functions_rndis_adb,
- },
- };
- static struct usb_mass_storage_platform_data mass_storage_pdata = {
- .nluns = 1,
- .vendor = "Qualcomm Incorporated",
- .product = "Mass storage",
- };
- static struct platform_device usb_mass_storage_device = {
- .name = "usb_mass_storage",
- .id = -1,
- .dev = {
- .platform_data = &mass_storage_pdata,
- },
- };
- static struct usb_ether_platform_data rndis_pdata = {
- /* ethaddr is filled by board_serialno_setup */
- .vendorID = 0x05C6,
- .vendorDescr = "Qualcomm Incorporated",
- };
- static struct platform_device rndis_device = {
- .name = "rndis",
- .id = -1,
- .dev = {
- .platform_data = &rndis_pdata,
- },
- };
- static struct android_usb_platform_data android_usb_pdata = {
- .vendor_id = 0x05C6,
- .product_id = 0x9026,
- .version = 0x0100,
- .product_name = "Qualcomm HSUSB Device",
- .manufacturer_name = "Qualcomm Incorporated",
- .num_products = ARRAY_SIZE(usb_products),
- .products = usb_products,
- .num_functions = ARRAY_SIZE(usb_functions_all),
- .functions = usb_functions_all,
- .serial_number = "1234567890ABCDEF",
- };
- static struct platform_device android_usb_device = {
- .name = "android_usb",
- .id = -1,
- .dev = {
- .platform_data = &android_usb_pdata,
- },
- };
- static int __init board_serialno_setup(char *serialno)
- {
- int i;
- char *src = serialno;
- /* create a fake MAC address from our serial number.
- * first byte is 0x02 to signify locally administered.
- */
- rndis_pdata.ethaddr[0] = 0x02;
- for (i = 0; *src; i++) {
- /* XOR the USB serial across the remaining bytes */
- rndis_pdata.ethaddr[i % (ETH_ALEN - 1) + 1] ^= *src++;
- }
- android_usb_pdata.serial_number = serialno;
- return 1;
- }
- __setup("androidboot.serialno=", board_serialno_setup);
- #endif
- #ifdef CONFIG_MSM_VPE
- static struct resource msm_vpe_resources[] = {
- {
- .start = 0x05300000,
- .end = 0x05300000 + SZ_1M - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_VPE,
- .end = INT_VPE,
- .flags = IORESOURCE_IRQ,
- },
- };
- static struct platform_device msm_vpe_device = {
- .name = "msm_vpe",
- .id = 0,
- .num_resources = ARRAY_SIZE(msm_vpe_resources),
- .resource = msm_vpe_resources,
- };
- #endif
- #ifdef CONFIG_MSM_GEMINI
- static struct resource msm_gemini_resources[] = {
- {
- .start = 0x04600000,
- .end = 0x04600000 + SZ_1M - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_JPEG,
- .end = INT_JPEG,
- .flags = IORESOURCE_IRQ,
- },
- };
- static struct platform_device msm_gemini_device = {
- .name = "msm_gemini",
- .resource = msm_gemini_resources,
- .num_resources = ARRAY_SIZE(msm_gemini_resources),
- };
- #endif
- #ifdef CONFIG_I2C_QUP
- static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
- {
- }
- static struct msm_i2c_platform_data msm_gsbi3_qup_i2c_pdata = {
- .clk_freq = 100000,
- .src_clk_rate = 24000000,
- .clk = "gsbi_qup_clk",
- .pclk = "gsbi_pclk",
- .use_gsbi_shared_mode = 1,
- .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
- };
- static struct msm_i2c_platform_data msm_gsbi4_qup_i2c_pdata = {
- .clk_freq = 100000,
- .src_clk_rate = 24000000,
- .clk = "gsbi_qup_clk",
- .pclk = "gsbi_pclk",
- .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
- };
- static struct msm_i2c_platform_data msm_gsbi7_qup_i2c_pdata = {
- .clk_freq = 100000,
- .src_clk_rate = 24000000,
- .clk = "gsbi_qup_clk",
- .pclk = "gsbi_pclk",
- .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
- };
- static struct msm_i2c_platform_data msm_gsbi8_qup_i2c_pdata = {
- .clk_freq = 100000,
- .src_clk_rate = 24000000,
- .clk = "gsbi_qup_clk",
- .pclk = "gsbi_pclk",
- .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
- };
- static struct msm_i2c_platform_data msm_gsbi9_qup_i2c_pdata = {
- .clk_freq = 100000,
- .src_clk_rate = 24000000,
- .clk = "gsbi_qup_clk",
- .pclk = "gsbi_pclk",
- .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
- };
- #endif
- #if defined(CONFIG_SPI_QUP) || defined(CONFIG_SPI_QUP_MODULE)
- static struct msm_spi_platform_data msm_gsbi1_qup_spi_pdata = {
- .max_clock_speed = 24000000,
- .clk_name = "gsbi_qup_clk",
- .pclk_name = "gsbi_pclk",
- };
- #endif
- #ifdef CONFIG_I2C_SSBI
- /* PMIC SSBI */
- static struct msm_ssbi_platform_data msm_ssbi1_pdata = {
- .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
- };
- /* PMIC SSBI */
- static struct msm_ssbi_platform_data msm_ssbi2_pdata = {
- .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
- };
- /* CODEC/TSSC SSBI */
- static struct msm_ssbi_platform_data msm_ssbi3_pdata = {
- .controller_type = MSM_SBI_CTRL_SSBI,
- };
- #endif
- #ifdef CONFIG_BATTERY_MSM
- /* Use basic value for fake MSM battery */
- static struct msm_psy_batt_pdata msm_psy_batt_data = {
- .avail_chg_sources = AC_CHG,
- };
- static struct platform_device msm_batt_device = {
- .name = "msm-battery",
- .id = -1,
- .dev.platform_data = &msm_psy_batt_data,
- };
- #endif
- #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
- /* prim = 1366 (rounds up to 1376) x 768 x 4(bpp) x 2(pages)
- * hdmi = 1920 x 1080 x 2(bpp) x 1(page)
- * Note: must be multiple of 4096 */
- #define MSM_FB_SIZE 0xC08000
- #else /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
- #define MSM_FB_SIZE 0x811000
- #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
- #define MSM_PMEM_SF_SIZE 0x1700000
- #define MSM_PMEM_KERNEL_EBI1_SIZE 0x600000
- #define MSM_PMEM_ADSP_SIZE 0x2000000
- #define MSM_SMI_BASE 0x38000000
- /* Kernel SMI PMEM Region for video core, used for Firmware */
- /* and encoder,decoder scratch buffers */
- /* Kernel SMI PMEM Region Should always precede the user space */
- /* SMI PMEM Region, as the video core will use offset address */
- /* from the Firmware base */
- #define PMEM_KERNEL_SMI_BASE (MSM_SMI_BASE)
- #define PMEM_KERNEL_SMI_SIZE 0x1000000
- /* User space SMI PMEM Region for video core*/
- /* used for encoder, decoder input & output buffers */
- #define MSM_PMEM_SMIPOOL_BASE (PMEM_KERNEL_SMI_BASE + PMEM_KERNEL_SMI_SIZE)
- #define MSM_PMEM_SMIPOOL_SIZE 0x2800000
- static unsigned fb_size = MSM_FB_SIZE;
- static int __init fb_size_setup(char *p)
- {
- fb_size = memparse(p, NULL);
- return 0;
- }
- early_param("fb_size", fb_size_setup);
- #ifdef CONFIG_KERNEL_PMEM_EBI_REGION
- static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
- static int __init pmem_kernel_ebi1_size_setup(char *p)
- {
- pmem_kernel_ebi1_size = memparse(p, NULL);
- return 0;
- }
- early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
- #endif
- #ifdef CONFIG_ANDROID_PMEM
- static unsigned pmem_sf_size = MSM_PMEM_SF_SIZE;
- static int __init pmem_sf_size_setup(char *p)
- {
- pmem_sf_size = memparse(p, NULL);
- return 0;
- }
- early_param("pmem_sf_size", pmem_sf_size_setup);
- static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
- static int __init pmem_adsp_size_setup(char *p)
- {
- pmem_adsp_size = memparse(p, NULL);
- return 0;
- }
- early_param("pmem_adsp_size", pmem_adsp_size_setup);
- #endif
- static struct resource msm_fb_resources[] = {
- {
- .flags = IORESOURCE_DMA,
- }
- };
- static int msm_fb_detect_panel(const char *name)
- {
- #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
- if (!strcmp(name, "hdmi_msm"))
- return 0;
- #endif
- if (!strcmp(name, "lcdc_qrdc"))
- return 0;
- pr_warning("%s: not supported '%s'", __func__, name);
- return -ENODEV;
- }
- static void lcd_panel_power(int on);
- static int msm_fb_lcdc_gpio_config(int on);
- static int vga_enabled;
- static int vga_enable(int select_vga)
- {
- int rc = 0;
- vga_enabled = select_vga;
- rc = msm_fb_lcdc_gpio_config(1);
- if (rc)
- return rc;
- lcd_panel_power(1);
- return 0;
- }
- static struct msm_panel_common_pdata lcdc_qrdc_panel_data = {
- .vga_switch = vga_enable,
- };
- static struct platform_device lcdc_qrdc_panel_device = {
- .name = "lcdc_qrdc",
- .id = 0,
- .dev = {
- .platform_data = &lcdc_qrdc_panel_data,
- }
- };
- static struct msm_fb_platform_data msm_fb_pdata = {
- .detect_client = msm_fb_detect_panel,
- };
- static struct platform_device msm_fb_device = {
- .name = "msm_fb",
- .id = 0,
- .num_resources = ARRAY_SIZE(msm_fb_resources),
- .resource = msm_fb_resources,
- .dev = {
- .platform_data = &msm_fb_pdata,
- }
- };
- #ifdef CONFIG_KERNEL_PMEM_EBI_REGION
- static struct android_pmem_platform_data android_pmem_kernel_ebi1_pdata = {
- .name = PMEM_KERNEL_EBI1_DATA_NAME,
- .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
- .cached = 0,
- };
- static struct platform_device android_pmem_kernel_ebi1_device = {
- .name = "android_pmem",
- .id = 1,
- .dev = { .platform_data = &android_pmem_kernel_ebi1_pdata },
- };
- #endif
- #ifdef CONFIG_KERNEL_PMEM_SMI_REGION
- static struct android_pmem_platform_data android_pmem_kernel_smi_pdata = {
- .name = PMEM_KERNEL_SMI_DATA_NAME,
- /* defaults to bitmap don't edit */
- .cached = 0,
- };
- static struct platform_device android_pmem_kernel_smi_device = {
- .name = "android_pmem",
- .id = 6,
- .dev = { .platform_data = &android_pmem_kernel_smi_pdata },
- };
- #endif
- #ifdef CONFIG_ANDROID_PMEM
- static struct android_pmem_platform_data android_pmem_pdata = {
- .name = "pmem",
- .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
- .cached = 0,
- };
- static struct platform_device android_pmem_device = {
- .name = "android_pmem",
- .id = 0,
- .dev = {.platform_data = &android_pmem_pdata},
- };
- static struct android_pmem_platform_data android_pmem_adsp_pdata = {
- .name = "pmem_adsp",
- .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
- .cached = 0,
- };
- static struct platform_device android_pmem_adsp_device = {
- .name = "android_pmem",
- .id = 2,
- .dev = { .platform_data = &android_pmem_adsp_pdata },
- };
- static struct android_pmem_platform_data android_pmem_smipool_pdata = {
- .name = "pmem_smipool",
- .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
- .cached = 0,
- };
- static struct platform_device android_pmem_smipool_device = {
- .name = "android_pmem",
- .id = 7,
- .dev = { .platform_data = &android_pmem_smipool_pdata },
- };
- #endif
- #define GPIO_BACKLIGHT_PWM0 0
- #define GPIO_BACKLIGHT_PWM1 1
- static int pmic_backlight_gpio[2]
- = { GPIO_BACKLIGHT_PWM0, GPIO_BACKLIGHT_PWM1 };
- static struct msm_panel_common_pdata lcdc_samsung_panel_data = {
- .gpio_num = pmic_backlight_gpio, /* two LPG CHANNELS for backlight */
- };
- static struct platform_device lcdc_samsung_panel_device = {
- .name = "lcdc_samsung_wsvga",
- .id = 0,
- .dev = {
- .platform_data = &lcdc_samsung_panel_data,
- }
- };
- #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
- static struct resource hdmi_msm_resources[] = {
- {
- .name = "hdmi_msm_qfprom_addr",
- .start = 0x00700000,
- .end = 0x007060FF,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "hdmi_msm_hdmi_addr",
- .start = 0x04A00000,
- .end = 0x04A00FFF,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "hdmi_msm_irq",
- .start = HDMI_IRQ,
- .end = HDMI_IRQ,
- .flags = IORESOURCE_IRQ,
- },
- };
- static int hdmi_enable_5v(int on);
- static int hdmi_core_power(int on, int show);
- static int hdmi_cec_power(int on);
- static struct msm_hdmi_platform_data hdmi_msm_data = {
- .irq = HDMI_IRQ,
- .enable_5v = hdmi_enable_5v,
- .core_power = hdmi_core_power,
- .cec_power = hdmi_cec_power,
- };
- static struct platform_device hdmi_msm_device = {
- .name = "hdmi_msm",
- .id = 0,
- .num_resources = ARRAY_SIZE(hdmi_msm_resources),
- .resource = hdmi_msm_resources,
- .dev.platform_data = &hdmi_msm_data,
- };
- #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
- static struct platform_device mipi_dsi_video_toshiba_wvga_panel_device = {
- .name = "dsi_video_toshiba_wvga",
- .id = 0,
- };
- static void __init msm8x60_allocate_memory_regions(void)
- {
- void *addr;
- unsigned long size;
- size = MSM_FB_SIZE;
- addr = alloc_bootmem(size);
- msm_fb_resources[0].start = __pa(addr);
- msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
- pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
- size, addr, __pa(addr));
- #ifdef CONFIG_KERNEL_PMEM_EBI_REGION
- size = pmem_kernel_ebi1_size;
- if (size) {
- addr = alloc_bootmem_aligned(size, 0x100000);
- android_pmem_kernel_ebi1_pdata.start = __pa(addr);
- android_pmem_kernel_ebi1_pdata.size = size;
- pr_info("allocating %lu bytes at %p (%lx physical) for kernel"
- " ebi1 pmem arena\n", size, addr, __pa(addr));
- }
- #endif
- #ifdef CONFIG_KERNEL_PMEM_SMI_REGION
- size = PMEM_KERNEL_SMI_SIZE;
- if (size) {
- android_pmem_kernel_smi_pdata.start = PMEM_KERNEL_SMI_BASE;
- android_pmem_kernel_smi_pdata.size = size;
- pr_info("allocating %lu bytes at %lx physical for kernel"
- " smi pmem arena\n", size,
- (unsigned long) PMEM_KERNEL_SMI_BASE);
- }
- #endif
- #ifdef CONFIG_ANDROID_PMEM
- size = pmem_adsp_size;
- if (size) {
- addr = alloc_bootmem(size);
- android_pmem_adsp_pdata.start = __pa(addr);
- android_pmem_adsp_pdata.size = size;
- pr_info("allocating %lu bytes at %p (%lx physical) for adsp "
- "pmem arena\n", size, addr, __pa(addr));
- }
- size = MSM_PMEM_SMIPOOL_SIZE;
- if (size) {
- android_pmem_smipool_pdata.start = MSM_PMEM_SMIPOOL_BASE;
- android_pmem_smipool_pdata.size = size;
- pr_info("allocating %lu bytes at %lx physical for user"
- " smi pmem arena\n", size,
- (unsigned long) MSM_PMEM_SMIPOOL_BASE);
- }
- size = pmem_sf_size;
- if (size) {
- addr = alloc_bootmem(size);
- android_pmem_pdata.start = __pa(addr);
- android_pmem_pdata.size = size;
- pr_info("allocating %lu bytes at %p (%lx physical) for sf "
- "pmem arena\n", size, addr, __pa(addr));
- }
- #endif
- }
- #ifdef CONFIG_SERIAL_MSM_HS
- static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = {
- .inject_rx_on_wakeup = 1,
- .rx_to_inject = 0xFD,
- };
- #endif
- #if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE)
- static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
- .phys_addr_base = 0x00106000,
- .reg_offsets = {
- [MSM_RPM_LOG_PAGE_INDICES] = 0x00000C80,
- [MSM_RPM_LOG_PAGE_BUFFER] = 0x00000CA0,
- },
- .phys_size = SZ_8K,
- .log_len = 4096, /* log's buffer length in bytes */
- .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
- };
- static struct platform_device msm_rpm_log_device = {
- .name = "msm_rpm_log",
- .id = -1,
- .dev = {
- .platform_data = &msm_rpm_log_pdata,
- },
- };
- #endif
- static struct regulator_consumer_supply rpm_vreg_supply[RPM_VREG_ID_MAX] = {
- [RPM_VREG_ID_PM8058_L0] = REGULATOR_SUPPLY("8058_l0", NULL),
- [RPM_VREG_ID_PM8058_L1] = REGULATOR_SUPPLY("8058_l1", NULL),
- [RPM_VREG_ID_PM8058_L2] = REGULATOR_SUPPLY("8058_l2", NULL),
- [RPM_VREG_ID_PM8058_L3] = REGULATOR_SUPPLY("8058_l3", NULL),
- [RPM_VREG_ID_PM8058_L4] = REGULATOR_SUPPLY("8058_l4", NULL),
- [RPM_VREG_ID_PM8058_L5] = REGULATOR_SUPPLY("8058_l5", NULL),
- [RPM_VREG_ID_PM8058_L6] = REGULATOR_SUPPLY("8058_l6", NULL),
- [RPM_VREG_ID_PM8058_L7] = REGULATOR_SUPPLY("8058_l7", NULL),
- [RPM_VREG_ID_PM8058_L8] = REGULATOR_SUPPLY("8058_l8", NULL),
- [RPM_VREG_ID_PM8058_L9] = REGULATOR_SUPPLY("8058_l9", NULL),
- [RPM_VREG_ID_PM8058_L10] = REGULATOR_SUPPLY("8058_l10", NULL),
- [RPM_VREG_ID_PM8058_L11] = REGULATOR_SUPPLY("8058_l11", NULL),
- [RPM_VREG_ID_PM8058_L12] = REGULATOR_SUPPLY("8058_l12", NULL),
- [RPM_VREG_ID_PM8058_L13] = REGULATOR_SUPPLY("8058_l13", NULL),
- [RPM_VREG_ID_PM8058_L14] = REGULATOR_SUPPLY("8058_l14", NULL),
- [RPM_VREG_ID_PM8058_L15] = REGULATOR_SUPPLY("8058_l15", NULL),
- [RPM_VREG_ID_PM8058_L16] = REGULATOR_SUPPLY("8058_l16", NULL),
- [RPM_VREG_ID_PM8058_L17] = REGULATOR_SUPPLY("8058_l17", NULL),
- [RPM_VREG_ID_PM8058_L18] = REGULATOR_SUPPLY("8058_l18", NULL),
- [RPM_VREG_ID_PM8058_L19] = REGULATOR_SUPPLY("8058_l19", NULL),
- [RPM_VREG_ID_PM8058_L20] = REGULATOR_SUPPLY("8058_l20", NULL),
- [RPM_VREG_ID_PM8058_L21] = REGULATOR_SUPPLY("8058_l21", NULL),
- [RPM_VREG_ID_PM8058_L22] = REGULATOR_SUPPLY("8058_l22", NULL),
- [RPM_VREG_ID_PM8058_L23] = REGULATOR_SUPPLY("8058_l23", NULL),
- [RPM_VREG_ID_PM8058_L24] = REGULATOR_SUPPLY("8058_l24", NULL),
- [RPM_VREG_ID_PM8058_L25] = REGULATOR_SUPPLY("8058_l25", NULL),
- [RPM_VREG_ID_PM8058_S0] = REGULATOR_SUPPLY("8058_s0", NULL),
- [RPM_VREG_ID_PM8058_S1] = REGULATOR_SUPPLY("8058_s1", NULL),
- [RPM_VREG_ID_PM8058_S2] = REGULATOR_SUPPLY("8058_s2", NULL),
- [RPM_VREG_ID_PM8058_S3] = REGULATOR_SUPPLY("8058_s3", NULL),
- [RPM_VREG_ID_PM8058_S4] = REGULATOR_SUPPLY("8058_s4", NULL),
- [RPM_VREG_ID_PM8058_LVS0] = REGULATOR_SUPPLY("8058_lvs0", NULL),
- [RPM_VREG_ID_PM8058_LVS1] = REGULATOR_SUPPLY("8058_lvs1", NULL),
- [RPM_VREG_ID_PM8058_NCP] = REGULATOR_SUPPLY("8058_ncp", NULL),
- [RPM_VREG_ID_PM8901_L0] = REGULATOR_SUPPLY("8901_l0", NULL),
- [RPM_VREG_ID_PM8901_L1] = REGULATOR_SUPPLY("8901_l1", NULL),
- [RPM_VREG_ID_PM8901_L2] = REGULATOR_SUPPLY("8901_l2", NULL),
- [RPM_VREG_ID_PM8901_L3] = REGULATOR_SUPPLY("8901_l3", NULL),
- [RPM_VREG_ID_PM8901_L4] = REGULATOR_SUPPLY("8901_l4", NULL),
- [RPM_VREG_ID_PM8901_L5] = REGULATOR_SUPPLY("8901_l5", NULL),
- [RPM_VREG_ID_PM8901_L6] = REGULATOR_SUPPLY("8901_l6", NULL),
- [RPM_VREG_ID_PM8901_S2] = REGULATOR_SUPPLY("8901_s2", NULL),
- [RPM_VREG_ID_PM8901_S3] = REGULATOR_SUPPLY("8901_s3", NULL),
- [RPM_VREG_ID_PM8901_S4] = REGULATOR_SUPPLY("8901_s4", NULL),
- [RPM_VREG_ID_PM8901_LVS0] = REGULATOR_SUPPLY("8901_lvs0", NULL),
- [RPM_VREG_ID_PM8901_LVS1] = REGULATOR_SUPPLY("8901_lvs1", NULL),
- [RPM_VREG_ID_PM8901_LVS2] = REGULATOR_SUPPLY("8901_lvs2", NULL),
- [RPM_VREG_ID_PM8901_LVS3] = REGULATOR_SUPPLY("8901_lvs3", NULL),
- [RPM_VREG_ID_PM8901_MVS0] = REGULATOR_SUPPLY("8901_mvs0", NULL),
- };
- #define RPM_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \
- _default_uV, _peak_uA, _avg_uA, _pull_down, _pin_ctrl, \
- _freq, _pin_fn, _rpm_mode, _state, _sleep_selectable, \
- _always_on) \
- [RPM_VREG_ID_##_id] = { \
- .init_data = { \
- .constraints = { \
- .valid_modes_mask = _modes, \
- .valid_ops_mask = _ops, \
- .min_uV = _min_uV, \
- .max_uV = _max_uV, \
- .input_uV = _min_uV, \
- .apply_uV = _apply_uV, \
- .always_on = _always_on, \
- }, \
- .num_consumer_supplies = 1, \
- .consumer_supplies = \
- &rpm_vreg_supply[RPM_VREG_ID_##_id], \
- }, \
- .default_uV = _default_uV, \
- .peak_uA = _peak_uA, \
- .avg_uA = _avg_uA, \
- .pull_down_enable = _pull_down, \
- .pin_ctrl = _pin_ctrl, \
- .freq = _freq, \
- .pin_fn = _pin_fn, \
- .mode = _rpm_mode, \
- .state = _state, \
- .sleep_selectable = _sleep_selectable, \
- }
- /*
- * The default LPM/HPM state of an RPM controlled regulator can be controlled
- * via the peak_uA value specified in the table below. If the value is less
- * than the low power threshold for the regulator, then the regulator will be
- * set to LPM. Otherwise, it will be set to HPM.
- *
- * This value can be further overridden by specifying an initial mode via
- * .init_data.constraints.initial_mode.
- */
- #define RPM_VREG_INIT_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, \
- _max_uV, _init_peak_uA, _pin_ctrl) \
- RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \
- REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \
- REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \
- REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
- REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \
- _init_peak_uA, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \
- RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \
- RPM_VREG_STATE_OFF, _sleep_selectable, _always_on)
- #define RPM_VREG_INIT_LDO_PF(_id, _always_on, _pd, _sleep_selectable, _min_uV, \
- _max_uV, _init_peak_uA, _pin_ctrl, _pin_fn) \
- RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \
- REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \
- REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \
- REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
- REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \
- _init_peak_uA, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \
- _pin_fn, RPM_VREG_MODE_NONE, RPM_VREG_STATE_OFF, \
- _sleep_selectable, _always_on)
- #define RPM_VREG_INIT_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, \
- _max_uV, _init_peak_uA, _pin_ctrl, _freq) \
- RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \
- REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \
- REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \
- REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \
- REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \
- _init_peak_uA, _pd, _pin_ctrl, _freq, \
- RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \
- RPM_VREG_STATE_OFF, _sleep_selectable, _always_on)
- #define RPM_VREG_INIT_VS(_id, _always_on, _pd, _sleep_selectable, _pin_ctrl) \
- RPM_VREG_INIT(_id, 0, 0, REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, \
- REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE, 0, 0, \
- 1000, 1000, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \
- RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \
- RPM_VREG_STATE_OFF, _sleep_selectable, _always_on)
- #define RPM_VREG_INIT_NCP(_id, _always_on, _pd, _sleep_selectable, _min_uV, \
- _max_uV, _pin_ctrl) \
- RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \
- REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, \
- _min_uV, 1000, 1000, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \
- RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \
- RPM_VREG_STATE_OFF, _sleep_selectable, _always_on)
- #define LDO50HMIN RPM_VREG_LDO_50_HPM_MIN_LOAD
- #define LDO150HMIN RPM_VREG_LDO_150_HPM_MIN_LOAD
- #define LDO300HMIN RPM_VREG_LDO_300_HPM_MIN_LOAD
- #define SMPS_HMIN RPM_VREG_SMPS_HPM_MIN_LOAD
- #define FTS_HMIN RPM_VREG_FTSMPS_HPM_MIN_LOAD
- static struct rpm_vreg_pdata rpm_vreg_init_pdata[RPM_VREG_ID_MAX] = {
- RPM_VREG_INIT_LDO_PF(PM8058_L0, 0, 1, 0, 1200000, 1200000, LDO150HMIN,
- RPM_VREG_PIN_CTRL_NONE, RPM_VREG_PIN_FN_SLEEP_B),
- RPM_VREG_INIT_LDO(PM8058_L1, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L2, 0, 1, 0, 1800000, 2600000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L3, 0, 1, 0, 1800000, 1800000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L4, 0, 1, 0, 2850000, 2850000, LDO50HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L5, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L6, 0, 1, 0, 3000000, 3600000, LDO50HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L7, 0, 1, 0, 1800000, 1800000, LDO50HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L8, 0, 1, 0, 2900000, 3050000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L9, 0, 1, 0, 1800000, 1800000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L10, 0, 1, 0, 2600000, 2600000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L11, 0, 1, 0, 1500000, 1500000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L12, 0, 1, 0, 2900000, 2900000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L13, 0, 1, 0, 2050000, 2050000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L14, 0, 0, 0, 2850000, 2850000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L15, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L16, 1, 1, 1, 1800000, 1800000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L17, 0, 1, 0, 2600000, 2600000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L18, 0, 1, 1, 2200000, 2200000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L19, 0, 1, 0, 2500000, 2500000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L20, 0, 1, 0, 1800000, 1800000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO_PF(PM8058_L21, 1, 1, 0, 1200000, 1200000, LDO150HMIN,
- RPM_VREG_PIN_CTRL_NONE, RPM_VREG_PIN_FN_SLEEP_B),
- RPM_VREG_INIT_LDO(PM8058_L22, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L23, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L24, 0, 1, 0, 1200000, 1200000, LDO150HMIN, 0),
- RPM_VREG_INIT_LDO(PM8058_L25, 0, 1, 0, 1200000, 1200000, LDO150HMIN, 0),
- RPM_VREG_INIT_SMPS(PM8058_S0, 0, 1, 1, 500000, 1200000, SMPS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8058_S1, 0, 1, 1, 500000, 1200000, SMPS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8058_S2, 0, 1, 0, 1200000, 1400000, SMPS_HMIN,
- RPM_VREG_PIN_CTRL_A0, RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8058_S3, 1, 1, 0, 1800000, 1800000, SMPS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8058_S4, 1, 1, 0, 2200000, 2200000, SMPS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_VS(PM8058_LVS0, 0, 1, 0, 0),
- RPM_VREG_INIT_VS(PM8058_LVS1, 0, 1, 0, 0),
- RPM_VREG_INIT_NCP(PM8058_NCP, 0, 1, 0, 1800000, 1800000, 0),
- RPM_VREG_INIT_LDO(PM8901_L0, 0, 1, 0, 1200000, 1200000, LDO300HMIN,
- RPM_VREG_PIN_CTRL_A0),
- RPM_VREG_INIT_LDO(PM8901_L1, 0, 1, 0, 3300000, 3300000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8901_L2, 0, 1, 0, 2850000, 3300000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8901_L3, 0, 1, 0, 3300000, 3300000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8901_L4, 0, 1, 0, 2600000, 2600000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8901_L5, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0),
- RPM_VREG_INIT_LDO(PM8901_L6, 0, 1, 0, 2200000, 2200000, LDO300HMIN, 0),
- RPM_VREG_INIT_SMPS(PM8901_S2, 0, 1, 0, 1300000, 1300000, FTS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8901_S3, 0, 1, 0, 1100000, 1100000, FTS_HMIN, 0,
- RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_SMPS(PM8901_S4, 0, 1, 0, 1225000, 1225000, FTS_HMIN,
- RPM_VREG_PIN_CTRL_A0, RPM_VREG_FREQ_1p75),
- RPM_VREG_INIT_VS(PM8901_LVS0, 1, 1, 0, 0),
- RPM_VREG_INIT_VS(PM8901_LVS1, 0, 1, 0, 0),
- RPM_VREG_INIT_VS(PM8901_LVS2, 0, 1, 0, 0),
- RPM_VREG_INIT_VS(PM8901_LVS3, 0, 1, 0, 0),
- RPM_VREG_INIT_VS(PM8901_MVS0, 0, 1, 0, 0),
- };
- #define RPM_VREG(_id) \
- [_id] = { \
- .name = "rpm-regulator", \
- .id = _id, \
- .dev = { \
- .platform_data = &rpm_vreg_init_pdata[_id], \
- }, \
- }
- static struct platform_device rpm_vreg_device[RPM_VREG_ID_MAX] = {
- RPM_VREG(RPM_VREG_ID_PM8058_L0),
- RPM_VREG(RPM_VREG_ID_PM8058_L1),
- RPM_VREG(RPM_VREG_ID_PM8058_L2),
- RPM_VREG(RPM_VREG_ID_PM8058_L3),
- RPM_VREG(RPM_VREG_ID_PM8058_L4),
- RPM_VREG(RPM_VREG_ID_PM8058_L5),
- RPM_VREG(RPM_VREG_ID_PM8058_L6),
- RPM_VREG(RPM_VREG_ID_PM8058_L7),
- RPM_VREG(RPM_VREG_ID_PM8058_L8),
- RPM_VREG(RPM_VREG_ID_PM8058_L9),
- RPM_VREG(RPM_VREG_ID_PM8058_L10),
- RPM_VREG(RPM_VREG_ID_PM8058_L11),
- RPM_VREG(RPM_VREG_ID_PM8058_L12),
- RPM_VREG(RPM_VREG_ID_PM8058_L13),
- RPM_VREG(RPM_VREG_ID_PM8058_L14),
- RPM_VREG(RPM_VREG_ID_PM8058_L15),
- RPM_VREG(RPM_VREG_ID_PM8058_L16),
- RPM_VREG(RPM_VREG_ID_PM8058_L17),
- RPM_VREG(RPM_VREG_ID_PM8058_L18),
- RPM_VREG(RPM_VREG_ID_PM8058_L19),
- RPM_VREG(RPM_VREG_ID_PM8058_L20),
- RPM_VREG(RPM_VREG_ID_PM8058_L21),
- RPM_VREG(RPM_VREG_ID_PM8058_L22),
- RPM_VREG(RPM_VREG_ID_PM8058_L23),
- RPM_VREG(RPM_VREG_ID_PM8058_L24),
- RPM_VREG(RPM_VREG_ID_PM8058_L25),
- RPM_VREG(RPM_VREG_ID_PM8058_S0),
- RPM_VREG(RPM_VREG_ID_PM8058_S1),
- RPM_VREG(RPM_VREG_ID_PM8058_S2),
- RPM_VREG(RPM_VREG_ID_PM8058_S3),
- RPM_VREG(RPM_VREG_ID_PM8058_S4),
- RPM_VREG(RPM_VREG_ID_PM8058_LVS0),
- RPM_VREG(RPM_VREG_ID_PM8058_LVS1),
- RPM_VREG(RPM_VREG_ID_PM8058_NCP),
- RPM_VREG(RPM_VREG_ID_PM8901_L0),
- RPM_VREG(RPM_VREG_ID_PM8901_L1),
- RPM_VREG(RPM_VREG_ID_PM8901_L2),
- RPM_VREG(RPM_VREG_ID_PM8901_L3),
- RPM_VREG(RPM_VREG_ID_PM8901_L4),
- RPM_VREG(RPM_VREG_ID_PM8901_L5),
- RPM_VREG(RPM_VREG_ID_PM8901_L6),
- RPM_VREG(RPM_VREG_ID_PM8901_S2),
- RPM_VREG(RPM_VREG_ID_PM8901_S3),
- RPM_VREG(RPM_VREG_ID_PM8901_S4),
- RPM_VREG(RPM_VREG_ID_PM8901_LVS0),
- RPM_VREG(RPM_VREG_ID_PM8901_LVS1),
- RPM_VREG(RPM_VREG_ID_PM8901_LVS2),
- RPM_VREG(RPM_VREG_ID_PM8901_LVS3),
- RPM_VREG(RPM_VREG_ID_PM8901_MVS0),
- };
- static struct platform_device *early_regulators[] __initdata = {
- &msm_device_saw_s0,
- &msm_device_saw_s1,
- #ifdef CONFIG_PMIC8058
- &rpm_vreg_device[RPM_VREG_ID_PM8058_S0],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_S1],
- #endif
- };
- static struct platform_device *early_devices[] __initdata = {
- #ifdef CONFIG_MSM_BUS_SCALING
- &msm_bus_apps_fabric,
- &msm_bus_sys_fabric,
- &msm_bus_mm_fabric,
- &msm_bus_sys_fpb,
- &msm_bus_cpss_fpb,
- #endif
- };
- static struct resource msm_aux_pcm_resources[] = {
- {
- .name = "aux_pcm_dout",
- .start = 111,
- .end = 111,
- .flags = IORESOURCE_IO,
- },
- {
- .name = "aux_pcm_din",
- .start = 112,
- .end = 112,
- .flags = IORESOURCE_IO,
- },
- {
- .name = "aux_pcm_syncout",
- .start = 113,
- .end = 113,
- .flags = IORESOURCE_IO,
- },
- {
- .name = "aux_pcm_clkin_a",
- .start = 114,
- .end = 114,
- .flags = IORESOURCE_IO,
- },
- };
- static struct platform_device msm_aux_pcm_device = {
- .name = "msm_aux_pcm",
- .id = 0,
- .num_resources = ARRAY_SIZE(msm_aux_pcm_resources),
- .resource = msm_aux_pcm_resources,
- };
- static struct platform_device *qrdc_devices[] __initdata = {
- &msm_device_smd,
- &smsc911x_device,
- &msm_device_uart_dm3,
- #ifdef CONFIG_I2C_QUP
- &msm_gsbi3_qup_i2c_device,
- &msm_gsbi4_qup_i2c_device,
- &msm_gsbi7_qup_i2c_device,
- &msm_gsbi8_qup_i2c_device,
- &msm_gsbi9_qup_i2c_device,
- #endif
- #if defined(CONFIG_SPI_QUP) || defined(CONFIG_SPI_QUP_MODULE)
- &msm_gsbi1_qup_spi_device,
- #endif
- #ifdef CONFIG_SERIAL_MSM_HS
- &msm_device_uart_dm1,
- #endif
- #ifdef CONFIG_I2C_SSBI
- &msm_device_ssbi1,
- &msm_device_ssbi2,
- &msm_device_ssbi3,
- #endif
- #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_HCD)
- &msm_device_otg,
- #endif
- #ifdef CONFIG_USB_GADGET_MSM_72K
- &msm_device_gadget_peripheral,
- #endif
- #ifdef CONFIG_USB_ANDROID
- &usb_mass_storage_device,
- &rndis_device,
- &android_usb_device,
- #endif
- #ifdef CONFIG_BATTERY_MSM
- &msm_batt_device,
- #endif
- #ifdef CONFIG_KERNEL_PMEM_EBI_REGION
- &android_pmem_kernel_ebi1_device,
- #endif
- #ifdef CONFIG_KERNEL_PMEM_SMI_REGION
- &android_pmem_kernel_smi_device,
- #endif
- #ifdef CONFIG_ANDROID_PMEM
- &android_pmem_device,
- &android_pmem_adsp_device,
- &android_pmem_smipool_device,
- #endif
- #ifdef CONFIG_MSM_ROTATOR
- &msm_rotator_device,
- #endif
- &msm_fb_device,
- &lcdc_qrdc_panel_device,
- &msm_device_kgsl,
- &lcdc_samsung_panel_device,
- #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
- &hdmi_msm_device,
- #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */
- &mipi_dsi_video_toshiba_wvga_panel_device,
- #ifdef CONFIG_MSM_GEMINI
- &msm_gemini_device,
- #endif
- #ifdef CONFIG_MSM_VPE
- &msm_vpe_device,
- #endif
- #if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE)
- &msm_rpm_log_device,
- #endif
- &msm_device_vidc,
- &msm_aux_pcm_device,
- #ifdef CONFIG_PMIC8058
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L0],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L1],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L2],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L3],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L4],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L5],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L6],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L7],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L8],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L9],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L10],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L11],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L12],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L13],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L14],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L15],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L16],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L17],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L18],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L19],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L20],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L21],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L22],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L23],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L24],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_L25],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_S2],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_S3],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_S4],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_LVS0],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_LVS1],
- &rpm_vreg_device[RPM_VREG_ID_PM8058_NCP],
- #endif
- #ifdef CONFIG_PMIC8901
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L0],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L1],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L2],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L3],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L4],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L5],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_L6],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_S2],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_S3],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_S4],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS0],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS1],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS2],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS3],
- &rpm_vreg_device[RPM_VREG_ID_PM8901_MVS0],
- #endif
- };
- #ifdef CONFIG_PMIC8058
- #define PMIC_GPIO_SDC3_DET 22
- #define PMIC_GPIO_EXT_POWER 1
- static int pm8058_gpios_init(void)
- {
- int i;
- int rc;
- struct pm8058_gpio_cfg {
- int gpio;
- struct pm8058_gpio cfg;
- };
- struct pm8058_gpio_cfg gpio_cfgs[] = {
- { /* External power enable */
- PMIC_GPIO_EXT_POWER - 1,
- {
- .direction = PM_GPIO_DIR_OUT,
- .output_value = 1,
- .pull = PM_GPIO_PULL_UP_30,
- .vin_sel = 2,
- .function = PM_GPIO_FUNC_NORMAL,
- .inv_int_pol = 0,
- },
- },
- { /* FFA ethernet */
- 6,
- {
- .direction = PM_GPIO_DIR_IN,
- .pull = PM_GPIO_PULL_DN,
- .vin_sel = 2,
- .function = PM_GPIO_FUNC_NORMAL,
- .inv_int_pol = 0,
- },
- },
- #ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION…