mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
tty: n_smux: Reset Power Collapse Enabled Flag
Reset the power-collapse-enabled flag to allow renegotiation when the remote modem restarts. Without this change, the external modem will boot assuming that power collapse is disabled, but the Apps will have the previous state cached and may not send the proper power-collapse-enabled handshaking. Change-Id: I58acbfa51b60fde23d328239fd6b330bf0bcc63f Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
This commit is contained in:
parent
9d5c6fa6ef
commit
729d851d88
1 changed files with 17 additions and 1 deletions
|
@ -3124,11 +3124,22 @@ static int ssr_notifier_cb(struct notifier_block *this,
|
|||
unsigned long flags;
|
||||
int power_off_uart = 0;
|
||||
|
||||
if (code != SUBSYS_AFTER_SHUTDOWN)
|
||||
if (code == SUBSYS_BEFORE_SHUTDOWN) {
|
||||
SMUX_DBG("%s: ssr - before shutdown\n", __func__);
|
||||
mutex_lock(&smux.mutex_lha0);
|
||||
smux.in_reset = 1;
|
||||
mutex_unlock(&smux.mutex_lha0);
|
||||
return NOTIFY_DONE;
|
||||
} else if (code != SUBSYS_AFTER_SHUTDOWN) {
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
SMUX_DBG("%s: ssr - after shutdown\n", __func__);
|
||||
|
||||
/* Cleanup channels */
|
||||
mutex_lock(&smux.mutex_lha0);
|
||||
smux_lch_purge();
|
||||
if (smux.tty)
|
||||
tty_driver_flush_buffer(smux.tty);
|
||||
|
||||
/* Power-down UART */
|
||||
spin_lock_irqsave(&smux.tx_lock_lha2, flags);
|
||||
|
@ -3137,11 +3148,15 @@ static int ssr_notifier_cb(struct notifier_block *this,
|
|||
smux.power_state = SMUX_PWR_OFF;
|
||||
power_off_uart = 1;
|
||||
}
|
||||
smux.powerdown_enabled = 0;
|
||||
spin_unlock_irqrestore(&smux.tx_lock_lha2, flags);
|
||||
|
||||
if (power_off_uart)
|
||||
smux_uart_power_off();
|
||||
|
||||
smux.in_reset = 0;
|
||||
mutex_unlock(&smux.mutex_lha0);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
|
@ -3245,6 +3260,7 @@ static void smuxld_close(struct tty_struct *tty)
|
|||
if (smux.power_state == SMUX_PWR_OFF)
|
||||
power_up_uart = 1;
|
||||
smux.power_state = SMUX_PWR_OFF;
|
||||
smux.powerdown_enabled = 0;
|
||||
spin_unlock_irqrestore(&smux.tx_lock_lha2, flags);
|
||||
|
||||
if (power_up_uart)
|
||||
|
|
Loading…
Reference in a new issue