8930: Use MPP line for USB ID detection
0n 8930 with PMIC 8917, USB ID line is not connected to PMIC instead it is routed using MPP line. This change adds support to configure MPP01 as input pin and uses IRQ line for MPP01 for USB ID detection. By default, this feature is disable as it is required to have rework (i.e. external 30k pullup on MPP01 line) with used hardware. To enable this feature: set usb_host_mode_pm8917=1 as boot param CRs-Fixed: 438131 Change-Id: I4a1530c4c0e18f530b89f2fc0bb5cc7462c144fd Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
086318c02f
commit
393baf6efa
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
|
||||
/* Copyright (c) 2011-2013, The Linux Foundation. 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
|
||||
@@ -180,6 +180,10 @@ static struct pm8xxx_gpio_init pm8917_gpios[] __initdata = {
|
||||
|
||||
/* Initial PM8917 MPP configurations */
|
||||
static struct pm8xxx_mpp_init pm8917_mpps[] __initdata = {
|
||||
PM8917_MPP_INIT(PM8XXX_AMUX_MPP_3, A_INPUT,
|
||||
PM8XXX_MPP_AIN_AMUX_CH8, DIN_TO_INT),
|
||||
/* Configure MPP01 for USB ID detection */
|
||||
PM8917_MPP_INIT(1, D_INPUT, PM8921_MPP_DIG_LEVEL_S4, DIN_TO_INT),
|
||||
};
|
||||
|
||||
void __init msm8930_pm8038_gpio_mpp_init(void)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2013, The Linux Foundation. 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
|
||||
@@ -1486,6 +1486,16 @@ static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
|
||||
#ifdef CONFIG_USB_MSM_OTG_72K
|
||||
static struct msm_otg_platform_data msm_otg_pdata;
|
||||
#else
|
||||
static int enable_usb_host_mode;
|
||||
static int __init usb_host_mode_with_pm8917(char *param)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = kstrtoint(param, 10, &enable_usb_host_mode);
|
||||
return ret;
|
||||
}
|
||||
early_param("usb_host_mode_pm8917", usb_host_mode_with_pm8917);
|
||||
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
/* Bandwidth requests (zero) if no vote placed */
|
||||
static struct msm_bus_vectors usb_init_vectors[] = {
|
||||
@@ -1539,7 +1549,6 @@ static struct msm_otg_platform_data msm_otg_pdata = {
|
||||
.mode = USB_OTG,
|
||||
.otg_control = OTG_PMIC_CONTROL,
|
||||
.phy_type = SNPS_28NM_INTEGRATED_PHY,
|
||||
.pmic_id_irq = PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE),
|
||||
.power_budget = 750,
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
.bus_scale_table = &usb_bus_scale_pdata,
|
||||
@@ -2830,6 +2839,27 @@ static void __init msm8930_cdp_init(void)
|
||||
msm_clock_init(&msm8930_pm8917_clock_init_data);
|
||||
else
|
||||
msm_clock_init(&msm8930_clock_init_data);
|
||||
|
||||
if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
|
||||
/*
|
||||
* By default, set USB mode as USB Peripheral only due to
|
||||
* hardware rework requirement for USB Host Mode.
|
||||
* Provide pmic_id_irq number only if host mode is enable
|
||||
* by user assuming that hardware rework is available.
|
||||
*/
|
||||
if (enable_usb_host_mode) {
|
||||
/* MPP01 IRQ number */
|
||||
msm_otg_pdata.pmic_id_irq =
|
||||
PM8921_MPP_IRQ(PM8917_IRQ_BASE, 1);
|
||||
} else {
|
||||
pr_err("Enabling USB Peripheral Only mode.\n");
|
||||
msm_otg_pdata.mode = USB_PERIPHERAL;
|
||||
}
|
||||
} else {
|
||||
msm_otg_pdata.pmic_id_irq =
|
||||
PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE);
|
||||
}
|
||||
|
||||
msm_otg_pdata.phy_init_seq = hsusb_phy_init_seq;
|
||||
msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
|
||||
android_usb_pdata.swfi_latency =
|
||||
|
||||
Reference in New Issue
Block a user