mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 03:43:03 +00:00
usb: msm_otg: Allow delayed LPM upon cable disconnect
This change introduces a new module parameter, which allows to use 1 second delay before entering Low Power Mode, after USB cable is disconnected. This change is needed, since for some platforms, there are external HW blocks (e.g., A2) that interact with USB shortly after USB cable is disconnected, and require USB clocks to be enabled. Change-Id: Ia63839e84ec1c7ab8816ad1b035f1026acaa1e66 Signed-off-by: Amit Blay <ablay@codeaurora.org>
This commit is contained in:
parent
213f65697f
commit
423f803f58
|
@ -762,6 +762,7 @@ static struct msm_otg_platform_data msm_otg_pdata = {
|
|||
.disable_reset_on_disconnect = true,
|
||||
.enable_lpm_on_dev_suspend = true,
|
||||
.core_clk_always_on_workaround = true,
|
||||
.delay_lpm_on_disconnect = true,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -82,6 +82,11 @@ module_param(override_phy_init, charp, S_IRUGO|S_IWUSR);
|
|||
MODULE_PARM_DESC(override_phy_init,
|
||||
"Override HSUSB PHY Init Settings");
|
||||
|
||||
unsigned int lpm_disconnect_thresh = 1000;
|
||||
module_param(lpm_disconnect_thresh , uint, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(lpm_disconnect_thresh,
|
||||
"Delay before entering LPM on USB disconnect");
|
||||
|
||||
static DECLARE_COMPLETION(pmic_vbus_init);
|
||||
static struct msm_otg *the_msm_otg;
|
||||
static bool debug_aca_enabled;
|
||||
|
@ -2449,7 +2454,12 @@ static void msm_otg_sm_work(struct work_struct *w)
|
|||
msm_otg_notify_charger(motg, 0);
|
||||
msm_otg_reset(otg->phy);
|
||||
pm_runtime_put_noidle(otg->phy->dev);
|
||||
pm_runtime_suspend(otg->phy->dev);
|
||||
/*
|
||||
* Only if autosuspend was enabled in probe, it will be
|
||||
* used here. Otherwise, no delay will be used.
|
||||
*/
|
||||
pm_runtime_mark_last_busy(otg->phy->dev);
|
||||
pm_runtime_autosuspend(otg->phy->dev);
|
||||
}
|
||||
break;
|
||||
case OTG_STATE_B_SRP_INIT:
|
||||
|
@ -3998,6 +4008,12 @@ static int __init msm_otg_probe(struct platform_device *pdev)
|
|||
pm_runtime_set_active(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
if (motg->pdata->delay_lpm_on_disconnect) {
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev,
|
||||
lpm_disconnect_thresh);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
}
|
||||
|
||||
if (motg->pdata->bus_scale_table) {
|
||||
motg->bus_perf_client =
|
||||
msm_bus_scale_register_client(motg->pdata->bus_scale_table);
|
||||
|
|
|
@ -199,6 +199,8 @@ enum usb_vdd_value {
|
|||
* is connected.
|
||||
* @core_clk_always_on_workaround: Don't disable core_clk when
|
||||
* USB enters LPM.
|
||||
* @delay_lpm_on_disconnect: Use a delay before entering LPM
|
||||
* upon USB cable disconnection.
|
||||
* @bus_scale_table: parameters for bus bandwidth requirements
|
||||
* @mhl_dev_name: MHL device name used to register with MHL driver.
|
||||
*/
|
||||
|
@ -218,6 +220,7 @@ struct msm_otg_platform_data {
|
|||
bool pnoc_errata_fix;
|
||||
bool enable_lpm_on_dev_suspend;
|
||||
bool core_clk_always_on_workaround;
|
||||
bool delay_lpm_on_disconnect;
|
||||
struct msm_bus_scale_pdata *bus_scale_table;
|
||||
const char *mhl_dev_name;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue