From 09819e980c3f7df188fb8ae7730386cf43428027 Mon Sep 17 00:00:00 2001 From: Laxminath Kasam Date: Mon, 18 Nov 2019 14:38:11 +0530 Subject: [PATCH] soc: soundwire: Update comp status check for SWR version 1.6 Check comp status based on active and inactive request and return once status met. Change-Id: I75669558875d8ab6fc23a02c888e6083e15aee08 Signed-off-by: Laxminath Kasam --- soc/swr-mstr-ctrl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index c90e6b491b..2ab70f3e02 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -500,12 +500,15 @@ static bool swrm_check_link_status(struct swr_mstr_ctrl *swrm, bool active) int retry = SWRM_LINK_STATUS_RETRY_CNT; int ret = false; int status = active ? 0x1 : 0x0; + int comp_sts = 0x0; if ((swrm->version <= SWRM_VERSION_1_5_1)) return true; do { - if (swr_master_read(swrm, SWRM_COMP_STATUS) & status) { + comp_sts = swr_master_read(swrm, SWRM_COMP_STATUS) & 0x01; + /* check comp status and status requested met */ + if ((comp_sts && status) || (!comp_sts && !status)) { ret = true; break; }