Merge "defconfig: msm8960: Enable isl9519q charger" into msm-3.0
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index 75ea97d..3636963 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -173,6 +173,7 @@
PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */
PM8XXX_GPIO_INPUT(26, PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
PM8XXX_GPIO_OUTPUT(43, PM_GPIO_PULL_UP_30), /* DISP_RESET_N */
+ PM8XXX_GPIO_OUTPUT(42, 0), /* USB 5V reg enable */
};
/* Initial PM8921 MPP configurations */
@@ -3065,15 +3066,6 @@
int rc;
static bool vbus_is_on;
static struct regulator *mvs_otg_switch;
- struct pm_gpio param = {
- .direction = PM_GPIO_DIR_OUT,
- .output_buffer = PM_GPIO_OUT_BUF_CMOS,
- .output_value = 1,
- .pull = PM_GPIO_PULL_NO,
- .vin_sel = PM_GPIO_VIN_S4,
- .out_strength = PM_GPIO_STRENGTH_MED,
- .function = PM_GPIO_FUNC_NORMAL,
- };
if (vbus_is_on == on)
return;
@@ -3093,27 +3085,29 @@
goto put_mvs_otg;
}
- if (regulator_enable(mvs_otg_switch)) {
- pr_err("unable to enable mvs_otg_switch\n");
+ rc = gpio_direction_output(PM8921_GPIO_PM_TO_SYS(USB_5V_EN), 1);
+ if (rc) {
+ pr_err("%s: unable to set_direction for gpio [%d]\n",
+ __func__, PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
goto free_usb_5v_en;
}
- rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(USB_5V_EN),
- ¶m);
- if (rc < 0) {
- pr_err("failed to configure usb_5v_en gpio\n");
- goto disable_mvs_otg;
+ if (regulator_enable(mvs_otg_switch)) {
+ pr_err("unable to enable mvs_otg_switch\n");
+ goto err_ldo_gpio_set_dir;
}
+
vbus_is_on = true;
return;
}
-disable_mvs_otg:
- regulator_disable(mvs_otg_switch);
+ regulator_disable(mvs_otg_switch);
+err_ldo_gpio_set_dir:
+ gpio_set_value(PM8921_GPIO_PM_TO_SYS(USB_5V_EN), 0);
free_usb_5v_en:
- gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
+ gpio_free(PM8921_GPIO_PM_TO_SYS(USB_5V_EN));
put_mvs_otg:
- regulator_put(mvs_otg_switch);
- vbus_is_on = false;
+ regulator_put(mvs_otg_switch);
+ vbus_is_on = false;
}
static struct msm_otg_platform_data msm_otg_pdata = {
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index b394710..b217b41 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -993,7 +993,6 @@
static struct regulator *ldo7_1p8;
static struct regulator *vdd_cx;
#define PMICID_INT PM8058_GPIO_IRQ(PM8058_IRQ_BASE, 36)
-#define PMIC_ID_GPIO 36
notify_vbus_state notify_vbus_state_func_ptr;
static int usb_phy_susp_dig_vol = 750000;
static int pmic_id_notif_supported;
@@ -1032,42 +1031,10 @@
return IRQ_HANDLED;
}
-static int msm_hsusb_phy_id_setup_init(int init)
-{
- unsigned ret;
-
- if (init) {
- ret = pm8901_mpp_config_digital_out(1,
- PM8901_MPP_DIG_LEVEL_L5, 1);
- if (ret < 0)
- pr_err("%s:MPP2 configuration failed\n", __func__);
- } else {
- ret = pm8901_mpp_config_digital_out(1,
- PM8901_MPP_DIG_LEVEL_L5, 0);
- if (ret < 0)
- pr_err("%s:MPP2 un config failed\n", __func__);
- }
- return ret;
-}
-
static int msm_hsusb_pmic_id_notif_init(void (*callback)(int online), int init)
{
unsigned ret = -ENODEV;
- struct pm8058_gpio pmic_id_cfg = {
- .direction = PM_GPIO_DIR_IN,
- .pull = PM_GPIO_PULL_UP_1P5,
- .function = PM_GPIO_FUNC_NORMAL,
- .vin_sel = 2,
- .inv_int_pol = 0,
- };
- struct pm8058_gpio pmic_id_uncfg = {
- .direction = PM_GPIO_DIR_IN,
- .pull = PM_GPIO_PULL_NO,
- .function = PM_GPIO_FUNC_NORMAL,
- .vin_sel = 2,
- .inv_int_pol = 0,
- };
if (!callback)
return -EINVAL;
@@ -1091,34 +1058,37 @@
if (init) {
notify_vbus_state_func_ptr = callback;
- INIT_DELAYED_WORK(&pmic_id_det, pmic_id_detect);
- ret = pm8058_gpio_config(PMIC_ID_GPIO, &pmic_id_cfg);
+ ret = pm8901_mpp_config_digital_out(1,
+ PM8901_MPP_DIG_LEVEL_L5, 1);
if (ret) {
- pr_err("%s:return val of pm8058_gpio_config: %d\n",
- __func__, ret);
- return ret;
+ pr_err("%s: MPP2 configuration failed\n", __func__);
+ return -ENODEV;
}
+ INIT_DELAYED_WORK(&pmic_id_det, pmic_id_detect);
ret = request_threaded_irq(PMICID_INT, NULL, pmic_id_on_irq,
(IRQF_TRIGGER_RISING|IRQF_TRIGGER_FALLING),
"msm_otg_id", NULL);
if (ret) {
+ pm8901_mpp_config_digital_out(1,
+ PM8901_MPP_DIG_LEVEL_L5, 0);
pr_err("%s:pmic_usb_id interrupt registration failed",
__func__);
return ret;
}
+ /* Notify the initial Id status */
+ pmic_id_detect(&pmic_id_det.work);
msm_otg_pdata.pmic_id_irq = PMICID_INT;
} else {
- usb_phy_susp_dig_vol = 750000;
free_irq(PMICID_INT, 0);
- ret = pm8058_gpio_config(PMIC_ID_GPIO, &pmic_id_uncfg);
- if (ret) {
- pr_err("%s: return val of pm8058_gpio_config: %d\n",
- __func__, ret);
- return ret;
- }
msm_otg_pdata.pmic_id_irq = 0;
cancel_delayed_work_sync(&pmic_id_det);
notify_vbus_state_func_ptr = NULL;
+ ret = pm8901_mpp_config_digital_out(1,
+ PM8901_MPP_DIG_LEVEL_L5, 0);
+ if (ret) {
+ pr_err("%s:MPP2 configuration failed\n", __func__);
+ return -ENODEV;
+ }
}
return 0;
}
@@ -1423,7 +1393,6 @@
.bam_disable = 1,
#ifdef CONFIG_USB_EHCI_MSM_72K
.pmic_id_notif_init = msm_hsusb_pmic_id_notif_init,
- .phy_id_setup_init = msm_hsusb_phy_id_setup_init,
#endif
#ifdef CONFIG_USB_EHCI_MSM_72K
.vbus_power = msm_hsusb_vbus_power,
@@ -5460,7 +5429,7 @@
36,
{
.direction = PM_GPIO_DIR_IN,
- .pull = PM_GPIO_PULL_NO,
+ .pull = PM_GPIO_PULL_UP_1P5,
.function = PM_GPIO_FUNC_NORMAL,
.vin_sel = 2,
.inv_int_pol = 0,
diff --git a/arch/arm/mach-msm/board-qrd7627a.c b/arch/arm/mach-msm/board-qrd7627a.c
index e46da5b..dbceae8 100644
--- a/arch/arm/mach-msm/board-qrd7627a.c
+++ b/arch/arm/mach-msm/board-qrd7627a.c
@@ -2382,6 +2382,14 @@
if (rc < 0)
return rc;
+ rc = gpio_tlmm_config(GPIO_CFG(GPIO_BACKLIGHT_EN, 0,
+ GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
+ GPIO_CFG_ENABLE);
+ if (rc < 0) {
+ pr_err("failed GPIO_BACKLIGHT_EN tlmm config\n");
+ return rc;
+ }
+
rc = gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
if (rc < 0) {
pr_err("failed to enable backlight\n");
diff --git a/arch/arm/mach-msm/clock-7x30.c b/arch/arm/mach-msm/clock-7x30.c
index 9fa13e5..a478b6f 100644
--- a/arch/arm/mach-msm/clock-7x30.c
+++ b/arch/arm/mach-msm/clock-7x30.c
@@ -2205,6 +2205,7 @@
static struct clk_freq_tbl clk_tbl_spi[] = {
F_MND8( 0, 0, 0, gnd, 1, 0, 0),
F_MND8( 9963243, 19, 12, pll3, 4, 2, 37),
+ F_MND8(24576000, 19, 12, lpxo, 1, 0, 0),
F_MND8(26331429, 19, 12, pll3, 4, 1, 7),
F_END,
};
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 6521537..60ddc52 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -4638,6 +4638,8 @@
static DEFINE_CLK_VOTER(dfab_dsps_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_usb_hs_clk, &dfab_clk.c);
+static DEFINE_CLK_VOTER(dfab_usb_hs3_clk, &dfab_clk.c);
+static DEFINE_CLK_VOTER(dfab_usb_hs4_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_sdc1_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_sdc2_clk, &dfab_clk.c);
static DEFINE_CLK_VOTER(dfab_sdc3_clk, &dfab_clk.c);
@@ -5092,8 +5094,8 @@
CLK_LOOKUP("ref_clk", tsif_ref_clk.c, NULL),
CLK_LOOKUP("core_clk", tssc_clk.c, NULL),
CLK_LOOKUP("usb_hs_clk", usb_hs1_xcvr_clk.c, NULL),
- CLK_LOOKUP("core_clk", usb_hs3_xcvr_clk.c, NULL),
- CLK_LOOKUP("core_clk", usb_hs4_xcvr_clk.c, NULL),
+ CLK_LOOKUP("core_clk", usb_hs3_xcvr_clk.c, "msm_ehci_host.0"),
+ CLK_LOOKUP("core_clk", usb_hs4_xcvr_clk.c, "msm_ehci_host.1"),
CLK_LOOKUP("usb_fs_src_clk", usb_fs1_src_clk.c, NULL),
CLK_LOOKUP("usb_fs_clk", usb_fs1_xcvr_clk.c, NULL),
CLK_LOOKUP("usb_fs_sys_clk", usb_fs1_sys_clk.c, NULL),
@@ -5112,8 +5114,8 @@
CLK_LOOKUP("iface_clk", tsif_p_clk.c, NULL),
CLK_LOOKUP("usb_fs_pclk", usb_fs1_p_clk.c, NULL),
CLK_LOOKUP("usb_hs_pclk", usb_hs1_p_clk.c, NULL),
- CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, NULL),
- CLK_LOOKUP("iface_clk", usb_hs4_p_clk.c, NULL),
+ CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, "msm_ehci_host.0"),
+ CLK_LOOKUP("iface_clk", usb_hs4_p_clk.c, "msm_ehci_host.1"),
CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"),
CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"),
CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"),
@@ -5249,6 +5251,8 @@
CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, NULL),
CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
CLK_DUMMY("dfab_usb_hs_clk", DFAB_USB_HS_CLK, NULL, 0),
+ CLK_DUMMY("bus_clk", DFAB_USB_HS3_CLK, "msm_ehci_host.0", 0),
+ CLK_DUMMY("bus_clk", DFAB_USB_HS4_CLK, "msm_ehci_host.1", 0),
CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, NULL, 0),
CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, NULL, 0),
CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, NULL, 0),
diff --git a/arch/arm/mach-msm/devices-8960.c b/arch/arm/mach-msm/devices-8960.c
index b737b116..5d0a13c 100644
--- a/arch/arm/mach-msm/devices-8960.c
+++ b/arch/arm/mach-msm/devices-8960.c
@@ -537,7 +537,12 @@
#ifdef CONFIG_MSM_BUS_SCALING
.vidc_bus_client_pdata = &vidc_bus_client_data,
#endif
- .memtype = MEMTYPE_EBI1
+ .memtype = MEMTYPE_EBI1,
+#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
+ .enable_ion = 1,
+#else
+ .enable_ion = 0,
+#endif
};
struct platform_device msm_device_vidc = {
diff --git a/arch/arm/mach-msm/devices-9615.c b/arch/arm/mach-msm/devices-9615.c
index 60fa257..e5a3f20 100644
--- a/arch/arm/mach-msm/devices-9615.c
+++ b/arch/arm/mach-msm/devices-9615.c
@@ -789,20 +789,32 @@
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
- 1, 8000, 100000, 1,
+ 100, 8000, 100000, 1,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
- 1500, 5000, 60100000, 3000,
+ 2000, 5000, 60100000, 3000,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
false,
- 2800, 5000, 60350000, 3500,
+ 6300, 5000, 60350000, 3500,
+ },
+ {
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
+ MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
+ false,
+ 13300, 2000, 71850000, 6800,
+ },
+ {
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
+ MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
+ false,
+ 28300, 0, 76350000, 9800,
},
};
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index b76a844..2a39e3c 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -789,7 +789,8 @@
};
struct msm_vidc_platform_data vidc_platform_data = {
- .memtype = MEMTYPE_EBI0
+ .memtype = MEMTYPE_EBI0,
+ .enable_ion = 0
};
struct platform_device msm_device_vidc_720p = {
diff --git a/arch/arm/mach-msm/devices-msm8x60.c b/arch/arm/mach-msm/devices-msm8x60.c
index 4458adf..52c62fd 100644
--- a/arch/arm/mach-msm/devices-msm8x60.c
+++ b/arch/arm/mach-msm/devices-msm8x60.c
@@ -2150,7 +2150,12 @@
#ifdef CONFIG_MSM_BUS_SCALING
.vidc_bus_client_pdata = &vidc_bus_client_data,
#endif
- .memtype = MEMTYPE_SMI_KERNEL
+ .memtype = MEMTYPE_SMI_KERNEL,
+#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
+ .enable_ion = 1,
+#else
+ .enable_ion = 0,
+#endif
};
struct platform_device msm_device_vidc = {
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
index e7f156e..2116ee7 100644
--- a/arch/arm/mach-msm/include/mach/board.h
+++ b/arch/arm/mach-msm/include/mach/board.h
@@ -404,6 +404,7 @@
struct msm_vidc_platform_data {
int memtype;
+ u32 enable_ion;
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *vidc_bus_client_pdata;
#endif
diff --git a/arch/arm/mach-msm/include/mach/diag_bridge.h b/arch/arm/mach-msm/include/mach/diag_bridge.h
index 92eb1b9..281a1a6 100644
--- a/arch/arm/mach-msm/include/mach/diag_bridge.h
+++ b/arch/arm/mach-msm/include/mach/diag_bridge.h
@@ -1,4 +1,3 @@
-
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -11,7 +10,6 @@
* GNU General Public License for more details.
*/
-
#ifndef __LINUX_USB_DIAG_BRIDGE_H__
#define __LINUX_USB_DIAG_BRIDGE_H__
@@ -23,9 +21,33 @@
size_t buf_size, size_t actual);
};
-extern int diag_read(char *data, size_t size);
-extern int diag_write(char *data, size_t size);
-extern int diag_open(struct diag_bridge_ops *ops);
-extern void diag_close(void);
+#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE) \
+ || defined(CONFIG_USB_QCOM_DIAG_BRIDGE_MODULE)
+
+extern int diag_bridge_read(char *data, size_t size);
+extern int diag_bridge_write(char *data, size_t size);
+extern int diag_bridge_open(struct diag_bridge_ops *ops);
+extern void diag_bridge_close(void);
+
+#else
+
+static int __maybe_unused diag_bridge_read(char *data, size_t size)
+{
+ return -ENODEV;
+}
+
+static int __maybe_unused diag_bridge_write(char *data, size_t size)
+{
+ return -ENODEV;
+}
+
+static int __maybe_unused diag_bridge_open(struct diag_bridge_ops *ops)
+{
+ return -ENODEV;
+}
+
+static void __maybe_unused diag_bridge_close(void) { }
+
+#endif
#endif
diff --git a/arch/arm/mach-msm/include/mach/iommu_domains.h b/arch/arm/mach-msm/include/mach/iommu_domains.h
index 28e98de..48eae0c 100644
--- a/arch/arm/mach-msm/include/mach/iommu_domains.h
+++ b/arch/arm/mach-msm/include/mach/iommu_domains.h
@@ -44,6 +44,12 @@
extern unsigned long msm_subsystem_get_partition_no(int subsys_id);
extern int msm_use_iommu(void);
+
+extern int msm_iommu_map_extra(struct iommu_domain *domain,
+ unsigned long start_iova,
+ unsigned long size,
+ int cached);
+
#else
static inline struct iommu_domain
*msm_get_iommu_domain(int subsys_id) { return NULL; }
@@ -74,6 +80,14 @@
{
return 0;
}
+
+static inline int msm_iommu_map_extra(struct iommu_domain *domain,
+ unsigned long start_iova,
+ unsigned long size,
+ int cached)
+{
+ return -ENODEV;
+}
#endif
#endif
diff --git a/arch/arm/mach-msm/include/mach/msm72k_otg.h b/arch/arm/mach-msm/include/mach/msm72k_otg.h
index 4509dad..43f487a 100644
--- a/arch/arm/mach-msm/include/mach/msm72k_otg.h
+++ b/arch/arm/mach-msm/include/mach/msm72k_otg.h
@@ -25,7 +25,6 @@
#define OTGSC_BSVIE (1 << 27)
#define OTGSC_IDIE (1 << 24)
-#define OTGSC_IDPU (1 << 5)
#define OTGSC_BSVIS (1 << 19)
#define OTGSC_ID (1 << 8)
#define OTGSC_IDIS (1 << 16)
@@ -149,6 +148,7 @@
struct wake_lock wlock;
unsigned long b_last_se0_sess; /* SRP initial condition check */
unsigned long inputs;
+ int pmic_id_status;
unsigned long tmouts;
u8 active_tmout;
struct hrtimer timer;
diff --git a/arch/arm/mach-msm/include/mach/msm_bus_board.h b/arch/arm/mach-msm/include/mach/msm_bus_board.h
index 2eb504a..b0d69c7 100644
--- a/arch/arm/mach-msm/include/mach/msm_bus_board.h
+++ b/arch/arm/mach-msm/include/mach/msm_bus_board.h
@@ -70,6 +70,8 @@
extern struct msm_bus_fabric_registration msm_bus_8064_sys_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_cpss_fpb_pdata;
+extern struct msm_bus_fabric_registration msm_bus_9615_sys_fabric_pdata;
+extern struct msm_bus_fabric_registration msm_bus_9615_def_fab_pdata;
void msm_bus_rpm_set_mt_mask(void);
int msm_bus_board_rpm_get_il_ids(uint16_t *id);
int msm_bus_board_get_iid(int id);
diff --git a/arch/arm/mach-msm/include/mach/msm_hsusb.h b/arch/arm/mach-msm/include/mach/msm_hsusb.h
index 3e8ab55..26f1cdd 100644
--- a/arch/arm/mach-msm/include/mach/msm_hsusb.h
+++ b/arch/arm/mach-msm/include/mach/msm_hsusb.h
@@ -158,7 +158,6 @@
/* pmic notfications apis */
int (*pmic_vbus_notif_init) (void (*callback)(int online), int init);
int (*pmic_id_notif_init) (void (*callback)(int online), int init);
- int (*phy_id_setup_init) (int init);
int (*pmic_register_vbus_sn) (void (*callback)(int online));
void (*pmic_unregister_vbus_sn) (void (*callback)(int online));
int (*pmic_enable_ldo) (int);
diff --git a/arch/arm/mach-msm/include/mach/msm_subsystem_map.h b/arch/arm/mach-msm/include/mach/msm_subsystem_map.h
index 0e74235..ebb2327 100644
--- a/arch/arm/mach-msm/include/mach/msm_subsystem_map.h
+++ b/arch/arm/mach-msm/include/mach/msm_subsystem_map.h
@@ -25,6 +25,11 @@
/* ioremaps in the kernel address space are uncached */
#define MSM_SUBSYSTEM_MAP_UNCACHED 0x8
/*
+ * Will map 2x the length requested.
+ */
+#define MSM_SUBSYSTEM_MAP_IOMMU_2X 0x10
+
+/*
* Shortcut flags for alignment.
* The flag must be equal to the alignment requested.
* e.g. for 8k alignment the flags must be (0x2000 | other flags)
diff --git a/arch/arm/mach-msm/iommu_domains.c b/arch/arm/mach-msm/iommu_domains.c
index e849cdb..600a2e9 100644
--- a/arch/arm/mach-msm/iommu_domains.c
+++ b/arch/arm/mach-msm/iommu_domains.c
@@ -20,6 +20,9 @@
#include <mach/iommu_domains.h>
#include <mach/socinfo.h>
+/* dummy 4k for overmapping */
+char iommu_dummy[2*PAGE_SIZE-4];
+
struct msm_iommu_domain {
/* iommu domain to map in */
struct iommu_domain *domain;
@@ -159,6 +162,41 @@
}
};
+int msm_iommu_map_extra(struct iommu_domain *domain,
+ unsigned long start_iova,
+ unsigned long size,
+ int cached)
+{
+ int i, ret;
+ unsigned long temp_iova;
+
+ for (i = size, temp_iova = start_iova; i > 0; i -= SZ_4K,
+ temp_iova += SZ_4K) {
+ ret = iommu_map(domain, temp_iova,
+ PFN_ALIGN(virt_to_phys(iommu_dummy)),
+ get_order(SZ_4K),
+ 0);
+
+ if (ret) {
+ pr_err("%s: could not map %lx to dummy page in domain"
+ " %p\n",
+ __func__, temp_iova, domain);
+ goto out;
+ }
+ }
+
+ return 0;
+
+out:
+
+ for ( ; i < size; i += SZ_4K, temp_iova -= SZ_4K)
+ iommu_unmap(domain, temp_iova, get_order(SZ_4K));
+
+ return -EINVAL;
+
+}
+
+
struct iommu_domain *msm_get_iommu_domain(int domain_num)
{
if (domain_num >= 0 && domain_num < MAX_DOMAINS)
diff --git a/arch/arm/mach-msm/msm_bus/Makefile b/arch/arm/mach-msm/msm_bus/Makefile
index c8600d5..c1155c9 100644
--- a/arch/arm/mach-msm/msm_bus/Makefile
+++ b/arch/arm/mach-msm/msm_bus/Makefile
@@ -4,4 +4,5 @@
obj-y += msm_bus_core.o msm_bus_fabric.o msm_bus_config.o msm_bus_arb.o msm_bus_rpm.o
obj-$(CONFIG_ARCH_MSM8X60) += msm_bus_board_8660.o
obj-$(CONFIG_ARCH_MSM8960) += msm_bus_board_8960.o
+obj-$(CONFIG_ARCH_MSM9615) += msm_bus_board_9615.o
obj-$(CONFIG_DEBUG_FS) += msm_bus_dbg.o
diff --git a/arch/arm/mach-msm/msm_bus/msm_bus_board_9615.c b/arch/arm/mach-msm/msm_bus/msm_bus_board_9615.c
new file mode 100644
index 0000000..a941a89
--- /dev/null
+++ b/arch/arm/mach-msm/msm_bus/msm_bus_board_9615.c
@@ -0,0 +1,311 @@
+/* Copyright (c) 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <mach/msm_bus.h>
+#include <mach/msm_bus_board.h>
+#include <mach/board.h>
+#include <mach/rpm.h>
+#include "msm_bus_core.h"
+
+#define NMASTERS 14
+#define NSLAVES 12
+#define NFAB_9615 2
+
+enum msm_bus_fabric_tiered_slave_type {
+ MSM_BUS_TIERED_SLAVE_EBI1_CH0 = 1,
+};
+
+enum msm_bus_9615_master_ports_type {
+ MSM_BUS_MASTER_PORT_SPS = 0,
+ MSM_BUS_MASTER_PORT_APSS_PROC,
+ MSM_BUS_MASTER_PORT_ADM_PORT0,
+ MSM_BUS_MASTER_PORT_ADM_PORT1,
+ MSM_BUS_MASTER_PORT_LPASS_PROC,
+ MSM_BUS_MASTER_PORT_MSS,
+ MSM_BUS_MASTER_PORT_MSS_SW_PROC,
+ MSM_BUS_MASTER_PORT_MSS_FW_PROC,
+ MSM_BUS_MASTER_PORT_LPASS,
+ MSM_BUS_SYSTEM_MASTER_PORT_CPSS_FPB,
+ MSM_BUS_SYSTEM_MASTER_PORT_SYSTEM_FPB,
+ MSM_BUS_SYSTEM_MASTER_PORT_ADM_AHB_CI,
+};
+
+enum msm_bus_9615_slave_ports_type {
+ MSM_BUS_SLAVE_PORT_SPS = 0,
+ MSM_BUS_SLAVE_PORT_EBI1_CH0,
+ MSM_BUS_SLAVE_PORT_APSS_L2,
+ MSM_BUS_SLAVE_PORT_SYSTEM_IMEM,
+ MSM_BUS_SLAVE_PORT_CORESIGHT,
+ MSM_BUS_SLAVE_PORT_APSS,
+ MSM_BUS_SLAVE_PORT_MSS,
+ MSM_BUS_SLAVE_PORT_LPASS,
+ MSM_BUS_SYSTEM_SLAVE_PORT_CPSS_FPB,
+ MSM_BUS_SYSTEM_SLAVE_PORT_SYSTEM_FPB,
+};
+
+static int tier2[] = {MSM_BUS_BW_TIER2,};
+static uint32_t master_iids[NMASTERS];
+static uint32_t slave_iids[NSLAVES];
+
+static int sport_ebi1_ch0[] = {MSM_BUS_SLAVE_PORT_EBI1_CH0,};
+static int sport_apss_l2[] = {MSM_BUS_SLAVE_PORT_APSS_L2,};
+
+static int tiered_slave_ebi1_ch0[] = {MSM_BUS_TIERED_SLAVE_EBI1_CH0,};
+
+static int mport_sps[] = {MSM_BUS_MASTER_PORT_SPS,};
+static int mport_apss_proc[] = {MSM_BUS_MASTER_PORT_APSS_PROC,};
+static int mport_adm_port0[] = {MSM_BUS_MASTER_PORT_ADM_PORT0,};
+static int mport_adm_port1[] = {MSM_BUS_MASTER_PORT_ADM_PORT1,};
+static int mport_mss[] = {MSM_BUS_MASTER_PORT_MSS,};
+static int mport_lpass_proc[] = {MSM_BUS_MASTER_PORT_LPASS_PROC,};
+static int mport_mss_sw_proc[] = {MSM_BUS_MASTER_PORT_MSS_SW_PROC,};
+static int mport_mss_fw_proc[] = {MSM_BUS_MASTER_PORT_MSS_FW_PROC,};
+static int mport_lpass[] = {MSM_BUS_MASTER_PORT_LPASS,};
+static int system_mport_adm_ahb_ci[] = {MSM_BUS_SYSTEM_MASTER_PORT_ADM_AHB_CI,};
+static int mport_system_fpb[] = {MSM_BUS_SYSTEM_MASTER_PORT_SYSTEM_FPB,};
+static int system_mport_cpss_fpb[] = {MSM_BUS_SYSTEM_MASTER_PORT_CPSS_FPB,};
+
+static int system_sport_system_fpb[] = {MSM_BUS_SYSTEM_SLAVE_PORT_SYSTEM_FPB,};
+static int system_sport_cpss_fpb[] = {MSM_BUS_SYSTEM_SLAVE_PORT_CPSS_FPB,};
+static int sport_sps[] = {MSM_BUS_SLAVE_PORT_SPS,};
+static int sport_system_imem[] = {MSM_BUS_SLAVE_PORT_SYSTEM_IMEM,};
+static int sport_coresight[] = {MSM_BUS_SLAVE_PORT_CORESIGHT,};
+static int sport_apss[] = {MSM_BUS_SLAVE_PORT_APSS,};
+static int sport_mss[] = {MSM_BUS_SLAVE_PORT_MSS,};
+static int sport_lpass[] = {MSM_BUS_SLAVE_PORT_LPASS,};
+
+static struct msm_bus_node_info system_fabric_info[] = {
+ {
+ .id = MSM_BUS_MASTER_SPS,
+ .masterp = mport_sps,
+ .num_mports = ARRAY_SIZE(mport_sps),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_ADM_PORT0,
+ .masterp = mport_adm_port0,
+ .num_mports = ARRAY_SIZE(mport_adm_port0),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_ADM_PORT1,
+ .masterp = mport_adm_port1,
+ .num_mports = ARRAY_SIZE(mport_adm_port1),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_LPASS_PROC,
+ .masterp = mport_lpass_proc,
+ .num_mports = ARRAY_SIZE(mport_lpass_proc),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_MSS,
+ .masterp = mport_mss,
+ .num_mports = ARRAY_SIZE(mport_mss),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_AMPSS_M0,
+ .masterp = mport_apss_proc,
+ .num_mports = ARRAY_SIZE(mport_apss_proc),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_MSS_SW_PROC,
+ .masterp = mport_mss_sw_proc,
+ .num_mports = ARRAY_SIZE(mport_mss_sw_proc),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_MSS_FW_PROC,
+ .masterp = mport_mss_fw_proc,
+ .num_mports = ARRAY_SIZE(mport_mss_fw_proc),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_LPASS,
+ .masterp = mport_lpass,
+ .num_mports = ARRAY_SIZE(mport_lpass),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_MASTER_ADM0_CI,
+ .masterp = system_mport_adm_ahb_ci,
+ .num_mports = ARRAY_SIZE(system_mport_adm_ahb_ci),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ },
+ {
+ .id = MSM_BUS_FAB_SYSTEM_FPB,
+ .gateway = 1,
+ .slavep = system_sport_system_fpb,
+ .num_sports = ARRAY_SIZE(system_sport_system_fpb),
+ .masterp = mport_system_fpb,
+ .num_mports = ARRAY_SIZE(mport_system_fpb),
+ .buswidth = 4,
+ },
+ {
+ .id = MSM_BUS_FAB_CPSS_FPB,
+ .gateway = 1,
+ .slavep = system_sport_cpss_fpb,
+ .num_sports = ARRAY_SIZE(system_sport_cpss_fpb),
+ .masterp = system_mport_cpss_fpb,
+ .num_mports = ARRAY_SIZE(system_mport_cpss_fpb),
+ .buswidth = 4,
+ },
+ {
+ .id = MSM_BUS_SLAVE_SPS,
+ .slavep = sport_sps,
+ .num_sports = ARRAY_SIZE(sport_sps),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_EBI_CH0,
+ .slavep = sport_ebi1_ch0,
+ .num_sports = ARRAY_SIZE(sport_ebi1_ch0),
+ .tier = tiered_slave_ebi1_ch0,
+ .num_tiers = ARRAY_SIZE(tiered_slave_ebi1_ch0),
+ .buswidth = 8,
+ .slaveclk[DUAL_CTX] = "ebi1_msmbus_clk",
+ .slaveclk[ACTIVE_CTX] = "ebi1_a_clk",
+ },
+ {
+ .id = MSM_BUS_SLAVE_SYSTEM_IMEM,
+ .slavep = sport_system_imem,
+ .num_sports = ARRAY_SIZE(sport_system_imem),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_CORESIGHT,
+ .slavep = sport_coresight,
+ .num_sports = ARRAY_SIZE(sport_coresight),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_AMPSS,
+ .slavep = sport_apss,
+ .num_sports = ARRAY_SIZE(sport_apss),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_AMPSS_L2,
+ .slavep = sport_apss_l2,
+ .num_sports = ARRAY_SIZE(sport_apss_l2),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_MSS,
+ .slavep = sport_mss,
+ .num_sports = ARRAY_SIZE(sport_mss),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+ {
+ .id = MSM_BUS_SLAVE_LPASS,
+ .slavep = sport_lpass,
+ .num_sports = ARRAY_SIZE(sport_lpass),
+ .tier = tier2,
+ .num_tiers = ARRAY_SIZE(tier2),
+ .buswidth = 8,
+ },
+};
+
+static void msm_bus_board_assign_iids(struct msm_bus_fabric_registration
+ *fabreg, int fabid)
+{
+ int i;
+ for (i = 0; i < fabreg->len; i++) {
+ if (!fabreg->info[i].gateway) {
+ fabreg->info[i].priv_id = fabid + fabreg->info[i].id;
+ if (fabreg->info[i].id < SLAVE_ID_KEY)
+ master_iids[fabreg->info[i].id] =
+ fabreg->info[i].priv_id;
+ else
+ slave_iids[fabreg->info[i].id - (SLAVE_ID_KEY)]
+ = fabreg->info[i].priv_id;
+ } else
+ fabreg->info[i].priv_id = fabreg->info[i].id;
+ }
+}
+
+static int msm_bus_board_9615_get_iid(int id)
+{
+ if ((id < SLAVE_ID_KEY && id >= NMASTERS) ||
+ id >= (SLAVE_ID_KEY + NSLAVES)) {
+ MSM_BUS_ERR("Cannot get iid. Invalid id %d passed\n", id);
+ return -EINVAL;
+ }
+
+ return ((id < SLAVE_ID_KEY) ? master_iids[id] : slave_iids[id -
+ SLAVE_ID_KEY]);
+}
+
+static struct msm_bus_board_algorithm msm_bus_board_algo = {
+ .board_nfab = NFAB_9615,
+ .get_iid = msm_bus_board_9615_get_iid,
+ .assign_iids = msm_bus_board_assign_iids,
+};
+
+struct msm_bus_fabric_registration msm_bus_9615_sys_fabric_pdata = {
+ .id = MSM_BUS_FAB_SYSTEM,
+ .name = "msm_sys_fab",
+ system_fabric_info,
+ ARRAY_SIZE(system_fabric_info),
+ .ahb = 0,
+ .fabclk[DUAL_CTX] = "sfab_clk",
+ .fabclk[ACTIVE_CTX] = "sfab_a_clk",
+ .haltid = MSM_RPM_ID_SYS_FABRIC_CFG_HALT_0,
+ .offset = MSM_RPM_ID_SYSTEM_FABRIC_ARB_0,
+ .nmasters = 12,
+ .nslaves = 10,
+ .ntieredslaves = 1,
+ .board_algo = &msm_bus_board_algo,
+};
+
+struct msm_bus_fabric_registration msm_bus_9615_def_fab_pdata = {
+ .id = MSM_BUS_FAB_DEFAULT,
+ .name = "msm_def_fab",
+ .ahb = 1,
+ .nmasters = 0,
+ .nslaves = 0,
+ .ntieredslaves = 0,
+ .board_algo = &msm_bus_board_algo,
+};
+
+int msm_bus_board_rpm_get_il_ids(uint16_t id[])
+{
+ return -ENXIO;
+}
diff --git a/arch/arm/mach-msm/subsystem_map.c b/arch/arm/mach-msm/subsystem_map.c
index 11fe26c..db9ab30 100644
--- a/arch/arm/mach-msm/subsystem_map.c
+++ b/arch/arm/mach-msm/subsystem_map.c
@@ -236,6 +236,7 @@
int i = 0, j = 0, ret;
unsigned long iova_start = 0, temp_phys, temp_va = 0;
struct iommu_domain *d = NULL;
+ int map_size = length;
if (!((flags & MSM_SUBSYSTEM_MAP_KADDR) ||
(flags & MSM_SUBSYSTEM_MAP_IOVA))) {
@@ -302,6 +303,11 @@
length = round_up(length, SZ_4K);
+ if (flags & MSM_SUBSYSTEM_MAP_IOMMU_2X)
+ map_size = 2 * length;
+ else
+ map_size = length;
+
buf->iova = kzalloc(sizeof(unsigned long)*nsubsys, GFP_ATOMIC);
if (!buf->iova) {
err = ERR_PTR(-ENOMEM);
@@ -337,7 +343,7 @@
iova_start = msm_allocate_iova_address(domain_no,
partition_no,
- length,
+ map_size,
max(min_align, SZ_4K));
if (!iova_start) {
@@ -363,13 +369,17 @@
}
}
buf->iova[i] = iova_start;
+
+ if (flags & MSM_SUBSYSTEM_MAP_IOMMU_2X)
+ msm_iommu_map_extra
+ (d, temp_va, length, 0);
}
}
node->buf = buf;
node->subsystems = subsys_ids;
- node->length = length;
+ node->length = map_size;
node->nsubsys = nsubsys;
if (add_buffer(node)) {
diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c
index 0ae987a..cac5c81 100644
--- a/drivers/char/diag/diagfwd.c
+++ b/drivers/char/diag/diagfwd.c
@@ -826,8 +826,8 @@
return 0;
}
/* Check for download command */
- else if ((cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_msm8930())
- && (*buf == 0x3A)) {
+ else if ((cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_msm8930()
+ || cpu_is_msm9615()) && (*buf == 0x3A)) {
/* send response back */
driver->apps_rsp_buf[0] = *buf;
ENCODE_RSP_AND_SEND(0);
diff --git a/drivers/mfd/pm8xxx-misc.c b/drivers/mfd/pm8xxx-misc.c
index 7367e66..439cefe 100644
--- a/drivers/mfd/pm8xxx-misc.c
+++ b/drivers/mfd/pm8xxx-misc.c
@@ -32,9 +32,48 @@
#define PON_CTRL_1_WD_EN_RESET 0x08
#define PON_CTRL_1_WD_EN_PWR_OFF 0x00
-/* Regulator L22 control register */
+/* Regulator master enable addresses */
+#define REG_PM8058_VREG_EN_MSM 0x018
+#define REG_PM8058_VREG_EN_GRP_5_4 0x1C8
+
+/* Regulator control registers for shutdown/reset */
+#define REG_PM8058_S0_CTRL 0x004
+#define REG_PM8058_S1_CTRL 0x005
+#define REG_PM8058_S3_CTRL 0x111
+#define REG_PM8058_L21_CTRL 0x120
#define REG_PM8058_L22_CTRL 0x121
+#define PM8058_REGULATOR_ENABLE_MASK 0x80
+#define PM8058_REGULATOR_ENABLE 0x80
+#define PM8058_REGULATOR_DISABLE 0x00
+#define PM8058_REGULATOR_PULL_DOWN_MASK 0x40
+#define PM8058_REGULATOR_PULL_DOWN_EN 0x40
+
+/* Buck CTRL register */
+#define PM8058_SMPS_LEGACY_VREF_SEL 0x20
+#define PM8058_SMPS_LEGACY_VPROG_MASK 0x1F
+#define PM8058_SMPS_ADVANCED_BAND_MASK 0xC0
+#define PM8058_SMPS_ADVANCED_BAND_SHIFT 6
+#define PM8058_SMPS_ADVANCED_VPROG_MASK 0x3F
+
+/* Buck TEST2 registers for shutdown/reset */
+#define REG_PM8058_S0_TEST2 0x084
+#define REG_PM8058_S1_TEST2 0x085
+#define REG_PM8058_S3_TEST2 0x11A
+
+#define PM8058_REGULATOR_BANK_WRITE 0x80
+#define PM8058_REGULATOR_BANK_MASK 0x70
+#define PM8058_REGULATOR_BANK_SHIFT 4
+#define PM8058_REGULATOR_BANK_SEL(n) ((n) << PM8058_REGULATOR_BANK_SHIFT)
+
+/* Buck TEST2 register bank 1 */
+#define PM8058_SMPS_LEGACY_VLOW_SEL 0x01
+
+/* Buck TEST2 register bank 7 */
+#define PM8058_SMPS_ADVANCED_MODE_MASK 0x02
+#define PM8058_SMPS_ADVANCED_MODE 0x02
+#define PM8058_SMPS_LEGACY_MODE 0x00
+
/* SLEEP CTRL register */
#define REG_PM8058_SLEEP_CTRL 0x02B
#define REG_PM8921_SLEEP_CTRL 0x10A
@@ -89,6 +128,154 @@
return rc;
}
+/*
+ * Set an SMPS regulator to be disabled in its CTRL register, but enabled
+ * in the master enable register. Also set it's pull down enable bit.
+ * Take care to make sure that the output voltage doesn't change if switching
+ * from advanced mode to legacy mode.
+ */
+static int
+__pm8058_disable_smps_locally_set_pull_down(struct pm8xxx_misc_chip *chip,
+ u16 ctrl_addr, u16 test2_addr, u16 master_enable_addr,
+ u8 master_enable_bit)
+{
+ int rc = 0;
+ u8 vref_sel, vlow_sel, band, vprog, bank, reg;
+
+ bank = PM8058_REGULATOR_BANK_SEL(7);
+ rc = pm8xxx_writeb(chip->dev->parent, test2_addr, bank);
+ if (rc) {
+ pr_err("%s: pm8xxx_writeb(0x%03X) failed: rc=%d\n", __func__,
+ test2_addr, rc);
+ goto done;
+ }
+
+ rc = pm8xxx_readb(chip->dev->parent, test2_addr, ®);
+ if (rc) {
+ pr_err("%s: FAIL pm8xxx_readb(0x%03X): rc=%d\n",
+ __func__, test2_addr, rc);
+ goto done;
+ }
+
+ /* Check if in advanced mode. */
+ if ((reg & PM8058_SMPS_ADVANCED_MODE_MASK) ==
+ PM8058_SMPS_ADVANCED_MODE) {
+ /* Determine current output voltage. */
+ rc = pm8xxx_readb(chip->dev->parent, ctrl_addr, ®);
+ if (rc) {
+ pr_err("%s: FAIL pm8xxx_readb(0x%03X): rc=%d\n",
+ __func__, ctrl_addr, rc);
+ goto done;
+ }
+
+ band = (reg & PM8058_SMPS_ADVANCED_BAND_MASK)
+ >> PM8058_SMPS_ADVANCED_BAND_SHIFT;
+ switch (band) {
+ case 3:
+ vref_sel = 0;
+ vlow_sel = 0;
+ break;
+ case 2:
+ vref_sel = PM8058_SMPS_LEGACY_VREF_SEL;
+ vlow_sel = 0;
+ break;
+ case 1:
+ vref_sel = PM8058_SMPS_LEGACY_VREF_SEL;
+ vlow_sel = PM8058_SMPS_LEGACY_VLOW_SEL;
+ break;
+ default:
+ pr_err("%s: regulator already disabled\n", __func__);
+ return -EPERM;
+ }
+ vprog = (reg & PM8058_SMPS_ADVANCED_VPROG_MASK);
+ /* Round up if fine step is in use. */
+ vprog = (vprog + 1) >> 1;
+ if (vprog > PM8058_SMPS_LEGACY_VPROG_MASK)
+ vprog = PM8058_SMPS_LEGACY_VPROG_MASK;
+
+ /* Set VLOW_SEL bit. */
+ bank = PM8058_REGULATOR_BANK_SEL(1);
+ rc = pm8xxx_writeb(chip->dev->parent, test2_addr, bank);
+ if (rc) {
+ pr_err("%s: FAIL pm8xxx_writeb(0x%03X): rc=%d\n",
+ __func__, test2_addr, rc);
+ goto done;
+ }
+
+ rc = pm8xxx_misc_masked_write(chip, test2_addr,
+ PM8058_REGULATOR_BANK_WRITE | PM8058_REGULATOR_BANK_MASK
+ | PM8058_SMPS_LEGACY_VLOW_SEL,
+ PM8058_REGULATOR_BANK_WRITE |
+ PM8058_REGULATOR_BANK_SEL(1) | vlow_sel);
+ if (rc)
+ goto done;
+
+ /* Switch to legacy mode */
+ bank = PM8058_REGULATOR_BANK_SEL(7);
+ rc = pm8xxx_writeb(chip->dev->parent, test2_addr, bank);
+ if (rc) {
+ pr_err("%s: FAIL pm8xxx_writeb(0x%03X): rc=%d\n",
+ __func__, test2_addr, rc);
+ goto done;
+ }
+ rc = pm8xxx_misc_masked_write(chip, test2_addr,
+ PM8058_REGULATOR_BANK_WRITE |
+ PM8058_REGULATOR_BANK_MASK |
+ PM8058_SMPS_ADVANCED_MODE_MASK,
+ PM8058_REGULATOR_BANK_WRITE |
+ PM8058_REGULATOR_BANK_SEL(7) |
+ PM8058_SMPS_LEGACY_MODE);
+ if (rc)
+ goto done;
+
+ /* Enable locally, enable pull down, keep voltage the same. */
+ rc = pm8xxx_misc_masked_write(chip, ctrl_addr,
+ PM8058_REGULATOR_ENABLE_MASK |
+ PM8058_REGULATOR_PULL_DOWN_MASK |
+ PM8058_SMPS_LEGACY_VREF_SEL |
+ PM8058_SMPS_LEGACY_VPROG_MASK,
+ PM8058_REGULATOR_ENABLE | PM8058_REGULATOR_PULL_DOWN_EN
+ | vref_sel | vprog);
+ if (rc)
+ goto done;
+ }
+
+ /* Enable in master control register. */
+ rc = pm8xxx_misc_masked_write(chip, master_enable_addr,
+ master_enable_bit, master_enable_bit);
+ if (rc)
+ goto done;
+
+ /* Disable locally and enable pull down. */
+ rc = pm8xxx_misc_masked_write(chip, ctrl_addr,
+ PM8058_REGULATOR_ENABLE_MASK | PM8058_REGULATOR_PULL_DOWN_MASK,
+ PM8058_REGULATOR_DISABLE | PM8058_REGULATOR_PULL_DOWN_EN);
+
+done:
+ return rc;
+}
+
+static int
+__pm8058_disable_ldo_locally_set_pull_down(struct pm8xxx_misc_chip *chip,
+ u16 ctrl_addr, u16 master_enable_addr, u8 master_enable_bit)
+{
+ int rc;
+
+ /* Enable LDO in master control register. */
+ rc = pm8xxx_misc_masked_write(chip, master_enable_addr,
+ master_enable_bit, master_enable_bit);
+ if (rc)
+ goto done;
+
+ /* Disable LDO in CTRL register and set pull down */
+ rc = pm8xxx_misc_masked_write(chip, ctrl_addr,
+ PM8058_REGULATOR_ENABLE_MASK | PM8058_REGULATOR_PULL_DOWN_MASK,
+ PM8058_REGULATOR_DISABLE | PM8058_REGULATOR_PULL_DOWN_EN);
+
+done:
+ return rc;
+}
+
static int __pm8018_reset_pwr_off(struct pm8xxx_misc_chip *chip, int reset)
{
int rc;
@@ -122,6 +309,24 @@
{
int rc;
+ /* When shutting down, enable active pulldowns on important rails. */
+ if (!reset) {
+ /* Disable SMPS's 0,1,3 locally and set pulldown enable bits. */
+ __pm8058_disable_smps_locally_set_pull_down(chip,
+ REG_PM8058_S0_CTRL, REG_PM8058_S0_TEST2,
+ REG_PM8058_VREG_EN_MSM, BIT(7));
+ __pm8058_disable_smps_locally_set_pull_down(chip,
+ REG_PM8058_S1_CTRL, REG_PM8058_S1_TEST2,
+ REG_PM8058_VREG_EN_MSM, BIT(6));
+ __pm8058_disable_smps_locally_set_pull_down(chip,
+ REG_PM8058_S3_CTRL, REG_PM8058_S3_TEST2,
+ REG_PM8058_VREG_EN_GRP_5_4, BIT(7) | BIT(4));
+ /* Disable LDO 21 locally and set pulldown enable bit. */
+ __pm8058_disable_ldo_locally_set_pull_down(chip,
+ REG_PM8058_L21_CTRL, REG_PM8058_VREG_EN_GRP_5_4,
+ BIT(1));
+ }
+
/*
* Fix-up: Set regulator LDO22 to 1.225 V in high power mode. Leave its
* pull-down state intact. This ensures a safe shutdown.
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index 98e57d5..c5dcdbf 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -259,27 +259,29 @@
To compile this driver as a module, choose M here: the
module will be called yurex.
-config USB_QCOM_DIAG
- tristate "USB Qualcomm diag port driver"
- depends on USB && !USB_SERIAL_QUALCOMM
- default n
+config USB_QCOM_DIAG_BRIDGE
+ tristate "USB Qualcomm diagnostic bridge driver"
+ depends on USB
help
- Say Y here if you want to use the diag ports provided
- by many Qualcomm chipsets.
+ Say Y here if you have a Qualcomm modem device connected via USB that
+ will be bridged in kernel space. This driver communicates with the
+ diagnostic interface and allows for bridging with the diag forwarding
+ driver.
To compile this driver as a module, choose M here: the
- module will be called qcaux. If unsure, choose N.
+ module will be called diag_bridge. If unsure, choose N.
-config USB_QCOM_DIAG_TEST
- tristate "USB Qualcomm diag port unit test driver"
- depends on USB && USB_QCOM_DIAG
- default n
+config USB_QCOM_DIAG_BRIDGE_TEST
+ tristate "USB Qualcomm diagnostic bridge driver test"
+ depends on USB && USB_QCOM_DIAG_BRIDGE
help
- Say Y here if you want to use unit test diag port provided
- by many Qualcomm chipsets.
+ Say Y here if you want to enable the test hook for the
+ Qualcomm diag bridge driver. When enabled, this will create
+ a debugfs file entry named "diag_bridge_test" which can be used
+ to send a ping command to the diag port of the modem over USB.
To compile this driver as a module, choose M here: the
- module will be called qcaux. If unsure, choose N.
+ module will be called diag_bridge_test. If unsure, choose N.
config USB_QCOM_DUN_BRIDGE
tristate "USB Qualcomm modem DUN bridge driver"
diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
index 03568bc..bb69a02 100644
--- a/drivers/usb/misc/Makefile
+++ b/drivers/usb/misc/Makefile
@@ -29,7 +29,7 @@
obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/
-obj-$(CONFIG_USB_QCOM_DIAG) += diag_usb.o
-obj-$(CONFIG_USB_QCOM_DIAG_TEST) += diag_bridge_test.o
+obj-$(CONFIG_USB_QCOM_DIAG_BRIDGE) += diag_bridge.o
+obj-$(CONFIG_USB_QCOM_DIAG_BRIDGE_TEST) += diag_bridge_test.o
obj-$(CONFIG_USB_QCOM_DUN_BRIDGE) += dun_bridge.o
obj-$(CONFIG_USB_QCOM_DUN_BRIDGE_TEST) += dun_bridge_test.o
diff --git a/drivers/usb/misc/diag_usb.c b/drivers/usb/misc/diag_bridge.c
similarity index 79%
rename from drivers/usb/misc/diag_usb.c
rename to drivers/usb/misc/diag_bridge.c
index b3419f4..11f9ef6 100644
--- a/drivers/usb/misc/diag_usb.c
+++ b/drivers/usb/misc/diag_bridge.c
@@ -23,7 +23,7 @@
#include <mach/diag_bridge.h>
#define DRIVER_DESC "USB host diag bridge driver"
-#define DRIVER_VERSION "0.1"
+#define DRIVER_VERSION "1.0"
struct diag_bridge {
struct usb_device *udev;
@@ -37,7 +37,7 @@
};
struct diag_bridge *__dev;
-int diag_open(struct diag_bridge_ops *ops)
+int diag_bridge_open(struct diag_bridge_ops *ops)
{
struct diag_bridge *dev = __dev;
@@ -50,9 +50,9 @@
return 0;
}
-EXPORT_SYMBOL(diag_open);
+EXPORT_SYMBOL(diag_bridge_open);
-void diag_close(void)
+void diag_bridge_close(void)
{
struct diag_bridge *dev = __dev;
@@ -62,25 +62,23 @@
dev->ops = 0;
}
-EXPORT_SYMBOL(diag_close);
+EXPORT_SYMBOL(diag_bridge_close);
-static void diag_read_cb(struct urb *urb)
+static void diag_bridge_read_cb(struct urb *urb)
{
struct diag_bridge *dev = urb->context;
struct diag_bridge_ops *cbs = dev->ops;
dev_dbg(&dev->udev->dev, "%s: status:%d actual:%d\n", __func__,
urb->status, urb->actual_length);
- if (urb->status)
- urb->actual_length = urb->status;
cbs->read_complete_cb(cbs->ctxt,
urb->transfer_buffer,
urb->transfer_buffer_length,
- urb->actual_length);
+ urb->status < 0 ? urb->status : urb->actual_length);
}
-int diag_read(char *data, size_t size)
+int diag_bridge_read(char *data, size_t size)
{
struct urb *urb = NULL;
unsigned int pipe;
@@ -107,7 +105,7 @@
pipe = usb_rcvbulkpipe(dev->udev, dev->in_epAddr);
usb_fill_bulk_urb(urb, dev->udev, pipe, data, size,
- diag_read_cb, dev);
+ diag_bridge_read_cb, dev);
usb_anchor_urb(urb, &dev->submitted);
ret = usb_submit_urb(urb, GFP_KERNEL);
@@ -122,25 +120,22 @@
return 0;
}
-EXPORT_SYMBOL(diag_read);
+EXPORT_SYMBOL(diag_bridge_read);
-static void diag_write_cb(struct urb *urb)
+static void diag_bridge_write_cb(struct urb *urb)
{
struct diag_bridge *dev = urb->context;
struct diag_bridge_ops *cbs = dev->ops;
dev_dbg(&dev->udev->dev, "%s:\n", __func__);
- if (urb->status)
- urb->actual_length = urb->status;
-
cbs->write_complete_cb(cbs->ctxt,
urb->transfer_buffer,
urb->transfer_buffer_length,
- urb->actual_length);
+ urb->status < 0 ? urb->status : urb->actual_length);
}
-int diag_write(char *data, size_t size)
+int diag_bridge_write(char *data, size_t size)
{
struct urb *urb = NULL;
unsigned int pipe;
@@ -167,7 +162,7 @@
pipe = usb_sndbulkpipe(dev->udev, dev->out_epAddr);
usb_fill_bulk_urb(urb, dev->udev, pipe, data, size,
- diag_write_cb, dev);
+ diag_bridge_write_cb, dev);
usb_anchor_urb(urb, &dev->submitted);
ret = usb_submit_urb(urb, GFP_KERNEL);
@@ -182,9 +177,9 @@
return 0;
}
-EXPORT_SYMBOL(diag_write);
+EXPORT_SYMBOL(diag_bridge_write);
-static void diag_delete(struct kref *kref)
+static void diag_bridge_delete(struct kref *kref)
{
struct diag_bridge *dev =
container_of(kref, struct diag_bridge, kref);
@@ -195,7 +190,7 @@
}
static int
-diag_probe(struct usb_interface *ifc, const struct usb_device_id *id)
+diag_bridge_probe(struct usb_interface *ifc, const struct usb_device_id *id)
{
struct diag_bridge *dev;
struct usb_host_interface *ifc_desc;
@@ -257,44 +252,44 @@
error:
if (dev)
- kref_put(&dev->kref, diag_delete);
+ kref_put(&dev->kref, diag_bridge_delete);
return ret;
}
-static void diag_disconnect(struct usb_interface *ifc)
+static void diag_bridge_disconnect(struct usb_interface *ifc)
{
struct diag_bridge *dev = usb_get_intfdata(ifc);
dev_dbg(&dev->udev->dev, "%s:\n", __func__);
platform_device_del(dev->pdev);
- kref_put(&dev->kref, diag_delete);
+ kref_put(&dev->kref, diag_bridge_delete);
usb_set_intfdata(ifc, NULL);
}
#define VALID_INTERFACE_NUM 0
-static const struct usb_device_id diag_ids[] = {
+static const struct usb_device_id diag_bridge_ids[] = {
{ USB_DEVICE(0x5c6, 0x9001),
.driver_info = VALID_INTERFACE_NUM, },
{} /* terminating entry */
};
-MODULE_DEVICE_TABLE(usb, diag_ids);
+MODULE_DEVICE_TABLE(usb, diag_bridge_ids);
-static struct usb_driver diag_driver = {
- .name = "diag_qc",
- .probe = diag_probe,
- .disconnect = diag_disconnect,
- .id_table = diag_ids,
+static struct usb_driver diag_bridge_driver = {
+ .name = "diag_bridge",
+ .probe = diag_bridge_probe,
+ .disconnect = diag_bridge_disconnect,
+ .id_table = diag_bridge_ids,
};
-static int __init diag_init(void)
+static int __init diag_bridge_init(void)
{
int ret;
- ret = usb_register(&diag_driver);
+ ret = usb_register(&diag_bridge_driver);
if (ret) {
err("%s: unable to register diag driver",
__func__);
@@ -304,13 +299,14 @@
return 0;
}
-static void __exit diag_exit(void)
+static void __exit diag_bridge_exit(void)
{
- usb_deregister(&diag_driver);
+ usb_deregister(&diag_bridge_driver);
}
-module_init(diag_init);
-module_exit(diag_exit);
+module_init(diag_bridge_init);
+module_exit(diag_bridge_exit);
MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL V2");
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/usb/misc/diag_bridge_test.c b/drivers/usb/misc/diag_bridge_test.c
index 234aa72..5bc0828 100644
--- a/drivers/usb/misc/diag_bridge_test.c
+++ b/drivers/usb/misc/diag_bridge_test.c
@@ -19,10 +19,12 @@
#include <linux/crc-ccitt.h>
#include <mach/diag_bridge.h>
+#define DRIVER_DESC "USB host diag bridge driver test"
+#define DRIVER_VERSION "1.0"
+
#define RD_BUF_SIZE 2048
#define DIAG_TEST_CONNECTED 0
-
struct diag_test_dev {
char *read_buf;
struct work_struct read_w;
@@ -49,7 +51,7 @@
container_of(w, struct diag_test_dev, read_w);
memset(dev->read_buf, 0, RD_BUF_SIZE);
- diag_read(dev->read_buf, RD_BUF_SIZE);
+ diag_bridge_read(dev->read_buf, RD_BUF_SIZE);
}
static void
@@ -86,7 +88,7 @@
buf[2] = 0x3A;
buf[3] = 0x7E;
- diag_write(buf, temp);
+ diag_bridge_write(buf, temp);
return count;
}
@@ -114,7 +116,7 @@
static int diag_test_remove(struct platform_device *pdev)
{
- diag_close();
+ diag_bridge_close();
if (dent) {
debugfs_remove_recursive(dent);
@@ -131,7 +133,7 @@
pr_info("%s:\n", __func__);
- ret = diag_open(&dev->ops);
+ ret = diag_bridge_open(&dev->ops);
if (ret)
pr_err("diag open failed: %d", ret);
@@ -190,7 +192,7 @@
pr_info("%s:\n", __func__);
if (test_bit(DIAG_TEST_CONNECTED, &dev->flags))
- diag_close();
+ diag_bridge_close();
kfree(dev->read_buf);
kfree(dev);
@@ -201,4 +203,5 @@
module_exit(diag_test_exit);
MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL V2");
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/usb/otg/msm72k_otg.c b/drivers/usb/otg/msm72k_otg.c
index 7067662..fccd357 100644
--- a/drivers/usb/otg/msm72k_otg.c
+++ b/drivers/usb/otg/msm72k_otg.c
@@ -37,13 +37,7 @@
#define DRIVER_NAME "msm_otg"
static void otg_reset(struct otg_transceiver *xceiv, int phy_reset);
static void msm_otg_set_vbus_state(int online);
-#ifdef CONFIG_USB_EHCI_MSM_72K
-static void msm_otg_set_id_state(int id);
-#else
-static void msm_otg_set_id_state(int id)
-{
-}
-#endif
+static void msm_otg_set_id_state(int online);
struct msm_otg *the_msm_otg;
@@ -51,7 +45,9 @@
{
struct msm_otg *dev = the_msm_otg;
- if (dev->pdata->otg_mode == OTG_ID)
+ if (dev->pmic_id_notif_supp)
+ return dev->pmic_id_status ? 0 : 1;
+ else if (dev->pdata->otg_mode == OTG_ID)
return (OTGSC_ID & readl(USB_OTGSC)) ? 0 : 1;
else
return !test_bit(ID, &dev->inputs);
@@ -139,38 +135,24 @@
#ifdef CONFIG_USB_EHCI_MSM_72K
static void enable_idgnd(struct msm_otg *dev)
{
- unsigned temp;
-
/* Do nothing if instead of ID pin, USER controls mode switch */
if (dev->pdata->otg_mode == OTG_USER_CONTROL)
return;
ulpi_write(dev, (1<<4), 0x0E);
ulpi_write(dev, (1<<4), 0x11);
- ulpi_write(dev, (1<<0), 0x0B);
- temp = OTGSC_IDIE | OTGSC_IDPU;
- writel_relaxed(readl_relaxed(USB_OTGSC) | temp, USB_OTGSC);
+ writel_relaxed(readl_relaxed(USB_OTGSC) | OTGSC_IDIE, USB_OTGSC);
}
static void disable_idgnd(struct msm_otg *dev)
{
- unsigned temp;
-
/* Do nothing if instead of ID pin, USER controls mode switch */
if (dev->pdata->otg_mode == OTG_USER_CONTROL)
return;
- temp = OTGSC_IDIE | OTGSC_IDPU;
- writel_relaxed(readl_relaxed(USB_OTGSC) & ~temp, USB_OTGSC);
+
ulpi_write(dev, (1<<4), 0x0F);
ulpi_write(dev, (1<<4), 0x12);
- ulpi_write(dev, (1<<0), 0x0C);
-}
-#else
-static void enable_idgnd(struct msm_otg *dev)
-{
-}
-static void disable_idgnd(struct msm_otg *dev)
-{
+ writel_relaxed(readl_relaxed(USB_OTGSC) & ~OTGSC_IDIE, USB_OTGSC);
}
#endif
@@ -242,9 +224,6 @@
#define get_aca_bmaxpower(dev) (dev->b_max_power)
#define set_aca_bmaxpower(dev, power) (dev->b_max_power = power)
#else
-static void set_aca_id_inputs(struct msm_otg *dev)
-{
-}
#define get_aca_bmaxpower(dev) 0
#define set_aca_bmaxpower(dev, power)
#endif
@@ -713,31 +692,6 @@
* 4. peripheral is supported, but, vbus is not routed to pmic
*/
host_bus_suspend = dev->otg.host && is_host();
-
- /*
- * Configure the PMIC ID only in case of cable disconnect.
- * PMIC doesn't generate interrupt for ID_GND to ID_A
- * transistion. hence use the PHY ID cricuit.
- */
- if (dev->pdata->pmic_id_notif_init && !host_bus_suspend &&
- !test_bit(ID_A, &dev->inputs)) {
- disable_idgnd(dev);
- ret = dev->pdata->pmic_id_notif_init(
- &msm_otg_set_id_state, 1);
- if (!ret) {
- dev->pmic_id_notif_supp = 1;
- if (dev->pdata->pmic_id_irq)
- dev->id_irq = dev->pdata->pmic_id_irq;
- } else if (ret == -ENOTSUPP) {
- pr_debug("%s:USB ID is not routed to pmic",
- __func__);
- enable_idgnd(dev);
- } else {
- pr_err("%s: pmic_id_ notif_init failed err:%d",
- __func__, ret);
- }
- }
-
if ((dev->otg.gadget && chg_type == USB_CHG_TYPE__WALLCHARGER) ||
host_bus_suspend ||
(dev->otg.host && !dev->pmic_id_notif_supp) ||
@@ -806,8 +760,7 @@
* that there is no harm with this. Till hw folks confirms this
* put regulators in lpm.
*/
- if (!host_bus_suspend && dev->pmic_vbus_notif_supp &&
- !test_bit(ID_A, &dev->inputs)) {
+ if (!host_bus_suspend && dev->pmic_vbus_notif_supp) {
pr_debug("phy can power collapse: (%d)\n",
can_phy_power_collapse(dev));
if (can_phy_power_collapse(dev) && dev->pdata->ldo_enable) {
@@ -928,23 +881,9 @@
}
phy_resumed:
- if (dev->pmic_id_notif_supp) {
- dev->pdata->pmic_id_notif_init(&msm_otg_set_id_state, 0);
- dev->pmic_id_notif_supp = 0;
- enable_idgnd(dev);
- }
-
/* Enable Idabc interrupts as these were disabled before entering LPM */
enable_idabc(dev);
- /*
- * There is corner case where host won't be resumed
- * while transitioning from ID_GND to ID_A. In that
- * IDGND might have cleared and ID_A might not have updated
- * yet. Hence update the ACA states explicitly.
- */
- set_aca_id_inputs(dev);
-
/* If resume signalling finishes before lpm exit, PCD is not set in
* USBSTS register. Drive resume signal to the downstream device now
* so that host driver can process the upcoming port change interrupt.*/
@@ -1057,12 +996,6 @@
}
udelay(10);
}
- if (dev->pmic_id_notif_supp) {
- dev->pdata->pmic_id_notif_init(
- &msm_otg_set_id_state, 0);
- dev->pmic_id_notif_supp = 0;
- enable_idgnd(dev);
- }
out:
enable_idabc(dev);
enable_irq(dev->irq);
@@ -1186,20 +1119,23 @@
#endif
return 0;
}
+#endif
-static void msm_otg_set_id_state(int id)
+void msm_otg_set_id_state(int id)
{
struct msm_otg *dev = the_msm_otg;
unsigned long flags;
- if (!atomic_read(&dev->in_lpm))
+ if (id == dev->pmic_id_status)
return;
if (id) {
set_bit(ID, &dev->inputs);
+ dev->pmic_id_status = 1;
} else {
clear_bit(ID, &dev->inputs);
set_bit(A_BUS_REQ, &dev->inputs);
+ dev->pmic_id_status = 0;
}
spin_lock_irqsave(&dev->lock, flags);
if (dev->otg.state != OTG_STATE_UNDEFINED) {
@@ -1208,7 +1144,6 @@
}
spin_unlock_irqrestore(&dev->lock, flags);
}
-#endif
void msm_otg_set_vbus_state(int online)
{
@@ -2038,7 +1973,6 @@
} else if (test_bit(ID_A, &dev->inputs)) {
dev->pdata->vbus_power(USB_PHY_INTEGRATED, 0);
} else if (!test_bit(ID, &dev->inputs)) {
- msm_otg_set_power(&dev->otg, 0);
dev->pdata->vbus_power(USB_PHY_INTEGRATED, 1);
}
break;
@@ -2753,10 +2687,12 @@
}
}
- if (dev->pdata->phy_id_setup_init) {
- ret = dev->pdata->phy_id_setup_init(1);
- if (ret) {
- pr_err("%s: phy_id_setup_init failed err:%d",
+ if (dev->pdata->pmic_id_notif_init) {
+ ret = dev->pdata->pmic_id_notif_init(&msm_otg_set_id_state, 1);
+ if (!ret) {
+ dev->pmic_id_notif_supp = 1;
+ } else if (ret != -ENOTSUPP) {
+ pr_err("%s: pmic_id_ notif_init failed err:%d",
__func__, ret);
goto free_pmic_vbus_notif;
}
@@ -2764,6 +2700,8 @@
if (dev->pdata->pmic_vbus_irq)
dev->vbus_on_irq = dev->pdata->pmic_vbus_irq;
+ if (dev->pdata->pmic_id_irq)
+ dev->id_irq = dev->pdata->pmic_id_irq;
/* vote for vddcx, as PHY cannot tolerate vddcx below 1.0V */
if (dev->pdata->init_vddcx) {
@@ -2771,7 +2709,7 @@
if (ret) {
pr_err("%s: unable to enable vddcx digital core:%d\n",
__func__, ret);
- goto free_phy_id_setup;
+ goto free_pmic_id_notif;
}
}
@@ -2881,9 +2819,9 @@
free_config_vddcx:
if (dev->pdata->init_vddcx)
dev->pdata->init_vddcx(0);
-free_phy_id_setup:
- if (dev->pdata->phy_id_setup_init)
- dev->pdata->phy_id_setup_init(0);
+free_pmic_id_notif:
+ if (dev->pdata->pmic_id_notif_init && dev->pmic_id_notif_supp)
+ dev->pdata->pmic_id_notif_init(&msm_otg_set_id_state, 0);
free_pmic_vbus_notif:
if (dev->pdata->pmic_vbus_notif_init && dev->pmic_vbus_notif_supp)
dev->pdata->pmic_vbus_notif_init(&msm_otg_set_vbus_state, 0);
@@ -2952,9 +2890,6 @@
if (dev->pmic_vbus_notif_supp)
dev->pdata->pmic_vbus_notif_init(&msm_otg_set_vbus_state, 0);
- if (dev->pdata->phy_id_setup_init)
- dev->pdata->phy_id_setup_init(0);
-
if (dev->pmic_id_notif_supp)
dev->pdata->pmic_id_notif_init(&msm_otg_set_id_state, 0);