bus: mhi: core: Use macros for execution environment features
Subsystems (2)
PATCH 1/1 bus: mhi: core: Use macros for execution environment features
From: Bhaumik Bhatt <[email protected]>
The implementation for execution environment specific functionality is spread out. Use macros that help determine the paths to be taken.
Signed-off-by Bhaumik Bhatt <[email protected]>
--- drivers/bus/mhi/core/boot.c | 2 +- drivers/bus/mhi/core/internal.h | 3 ++- drivers/bus/mhi/core/pm.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/bus/mhi/core/boot.c +1 -1
@@ -417,7 +417,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) }/* wait for ready on pass through or any other execution environment */ -if (mhi_cntrl->ee !=MHI_EE_EDL && mhi_cntrl->ee !=MHI_EE_PBL ) +if (!MHI_FW_LOAD_CAPABLE (mhi_cntrl->ee)) goto fw_load_ready_state; fw_name = (mhi_cntrl->ee == MHI_EE_EDL) ?
drivers/bus/mhi/core/internal.h +2 -1
@@ -390,7 +390,8 @@ extern const char * const mhi_ee_str[MHI_EE_MAX];#define MHI_IN_PBL (ee) (ee == MHI_EE_PBL || ee == MHI_EE_PTHRU || \ ee == MHI_EE_EDL) - +#define MHI_POWER_UP_CAPABLE (ee) (MHI_IN_PBL(ee) || ee == MHI_EE_AMSS) +#define MHI_FW_LOAD_CAPABLE (ee) (ee == MHI_EE_PBL || ee == MHI_EE_EDL)#define MHI_IN_MISSION_MODE (ee) (ee == MHI_EE_AMSS || ee == MHI_EE_WFW || \ ee == MHI_EE_FP)
drivers/bus/mhi/core/pm.c +1 -1
@@ -1068,7 +1068,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)write_unlock_irq (&mhi_cntrl->pm_lock);/* Confirm that the device is in valid exec env */ -if (!MHI_IN_PBL (current_ee) && current_ee !=MHI_EE_AMSS ) { +if (!MHI_POWER_UP_CAPABLE (current_ee)) {dev_err (dev,"%s is not a valid EE for power on\n" ,TO_MHI_EXEC_STR (current_ee)); ret = -EIO ;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 5 lines · Bhaumik Bhatt
From: Bhaumik Bhatt <[email protected]>
The implementation for execution environment specific functionality is spread out. Use macros that help determine the paths to be taken.
Reviewed-by Manivannan Sadhasivam <[email protected]>
Thanks,
Mani
Quoted 51 lines
Signed-off-by Bhaumik Bhatt <[email protected]>--- drivers/bus/mhi/core/boot.c | 2 +- drivers/bus/mhi/core/internal.h | 3 ++- drivers/bus/mhi/core/pm.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)drivers/bus/mhi/core/boot.c +1
-1@@ -417,7 +417,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) }/* wait for ready on pass through or any other execution environment */ -if (mhi_cntrl->ee !=MHI_EE_EDL && mhi_cntrl->ee !=MHI_EE_PBL ) +if (!MHI_FW_LOAD_CAPABLE (mhi_cntrl->ee)) goto fw_load_ready_state; fw_name = (mhi_cntrl->ee == MHI_EE_EDL) ?drivers/bus/mhi/core/internal.h +2
-1@@ -390,7 +390,8 @@ extern const char * const mhi_ee_str[MHI_EE_MAX];#define MHI_IN_PBL (ee) (ee == MHI_EE_PBL || ee == MHI_EE_PTHRU || \ ee == MHI_EE_EDL) - +#define MHI_POWER_UP_CAPABLE (ee) (MHI_IN_PBL(ee) || ee == MHI_EE_AMSS) +#define MHI_FW_LOAD_CAPABLE (ee) (ee == MHI_EE_PBL || ee == MHI_EE_EDL)#define MHI_IN_MISSION_MODE (ee) (ee == MHI_EE_AMSS || ee == MHI_EE_WFW || \ ee == MHI_EE_FP)drivers/bus/mhi/core/pm.c +1
-1@@ -1068,7 +1068,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)write_unlock_irq (&mhi_cntrl->pm_lock);/* Confirm that the device is in valid exec env */ -if (!MHI_IN_PBL (current_ee) && current_ee !=MHI_EE_AMSS ) { +if (!MHI_POWER_UP_CAPABLE (current_ee)) {dev_err (dev,"%s is not a valid EE for power on\n" ,TO_MHI_EXEC_STR (current_ee)); ret = -EIO ;Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Manivannan Sadhasivam
AppliedQuoted 6 lines · Bhaumik Bhatt
From: Bhaumik Bhatt <[email protected]>
The implementation for execution environment specific functionality is spread out. Use macros that help determine the paths to be taken.
Signed-off-by Bhaumik Bhatt <[email protected]>
Applied to mhi-next!
Thanks,
Mani
Quoted 50 lines
--- drivers/bus/mhi/core/boot.c | 2 +- drivers/bus/mhi/core/internal.h | 3 ++- drivers/bus/mhi/core/pm.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)drivers/bus/mhi/core/boot.c +1
-1@@ -417,7 +417,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) }/* wait for ready on pass through or any other execution environment */ -if (mhi_cntrl->ee !=MHI_EE_EDL && mhi_cntrl->ee !=MHI_EE_PBL ) +if (!MHI_FW_LOAD_CAPABLE (mhi_cntrl->ee)) goto fw_load_ready_state; fw_name = (mhi_cntrl->ee == MHI_EE_EDL) ?drivers/bus/mhi/core/internal.h +2
-1@@ -390,7 +390,8 @@ extern const char * const mhi_ee_str[MHI_EE_MAX];#define MHI_IN_PBL (ee) (ee == MHI_EE_PBL || ee == MHI_EE_PTHRU || \ ee == MHI_EE_EDL) - +#define MHI_POWER_UP_CAPABLE (ee) (MHI_IN_PBL(ee) || ee == MHI_EE_AMSS) +#define MHI_FW_LOAD_CAPABLE (ee) (ee == MHI_EE_PBL || ee == MHI_EE_EDL)#define MHI_IN_MISSION_MODE (ee) (ee == MHI_EE_AMSS || ee == MHI_EE_WFW || \ ee == MHI_EE_FP)drivers/bus/mhi/core/pm.c +1
-1@@ -1068,7 +1068,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)write_unlock_irq (&mhi_cntrl->pm_lock);/* Confirm that the device is in valid exec env */ -if (!MHI_IN_PBL (current_ee) && current_ee !=MHI_EE_AMSS ) { +if (!MHI_POWER_UP_CAPABLE (current_ee)) {dev_err (dev,"%s is not a valid EE for power on\n" ,TO_MHI_EXEC_STR (current_ee)); ret = -EIO ;Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project