diff --git a/drivers/bus/mhi/common.h b/drivers/bus/mhi/common.h index f794b9c8049e..da2f1214f2eb 100644 --- a/drivers/bus/mhi/common.h +++ b/drivers/bus/mhi/common.h @@ -250,6 +250,7 @@ enum mhi_cmd_type { MHI_CMD_RESET_CHAN = 16, MHI_CMD_STOP_CHAN = 17, MHI_CMD_START_CHAN = 18, + MHI_CMD_SFR_CFG = 73, }; #define EV_CTX_RESERVED_MASK GENMASK(7, 0) diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c index 0dc847c18191..9e127a060dac 100644 --- a/drivers/bus/mhi/host/main.c +++ b/drivers/bus/mhi/host/main.c @@ -812,6 +812,12 @@ static void mhi_process_cmd_completion(struct mhi_controller *mhi_cntrl, cmd_pkt = mhi_to_virtual(mhi_ring, ptr); + if (MHI_TRE_GET_CMD_TYPE(cmd_pkt) == MHI_CMD_SFR_CFG) { + mhi_misc_cmd_completion(mhi_cntrl, MHI_CMD_SFR_CFG, + MHI_TRE_GET_EV_CODE(tre)); + return; + } + chan = MHI_TRE_GET_CMD_CHID(cmd_pkt); if (chan < mhi_cntrl->max_chan && @@ -1349,6 +1355,11 @@ int mhi_send_cmd(struct mhi_controller *mhi_cntrl, cmd_tre->dword[0] = MHI_TRE_CMD_START_DWORD0; cmd_tre->dword[1] = MHI_TRE_CMD_START_DWORD1(chan); break; + case MHI_CMD_SFR_CFG: + mhi_misc_cmd_configure(mhi_cntrl, MHI_CMD_SFR_CFG, + &cmd_tre->ptr, &cmd_tre->dword[0], + &cmd_tre->dword[1]); + break; default: dev_err(dev, "Command not supported\n"); break; diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 03c6a3529127..0121557f9855 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. * */ @@ -432,6 +432,7 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl) read_unlock_bh(&mhi_cntrl->pm_lock); + mhi_misc_mission_mode(mhi_cntrl); mhi_process_sleeping_events(mhi_cntrl); /* @@ -507,6 +508,7 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) /* Release lock and wait for all pending threads to complete */ mutex_unlock(&mhi_cntrl->pm_mutex); + mhi_misc_disable(mhi_cntrl); dev_dbg(dev, "Waiting for all pending threads to complete\n"); wake_up_all(&mhi_cntrl->state_event); @@ -643,6 +645,7 @@ static void mhi_pm_sys_error_transition(struct mhi_controller *mhi_cntrl) /* Release lock and wait for all pending threads to complete */ mutex_unlock(&mhi_cntrl->pm_mutex); + mhi_misc_disable(mhi_cntrl); dev_dbg(dev, "Waiting for all pending threads to complete\n"); wake_up_all(&mhi_cntrl->state_event);