From b68d1027647b95d50375f482ff27638405effc54 Mon Sep 17 00:00:00 2001 From: Aditya Bavanari Date: Mon, 8 Jan 2018 19:14:41 +0530 Subject: [PATCH] ASoC: sdm670: fix clock refcount for MI2S shutdown For MI2S shutdown, if clock disable is failed, do not bother to re-increment clock reference. Otherwise, next time when startup is called, clock enable will not be called again, so use case will not work. CRs-Fixed: 2166356 Change-Id: Ic7a93a5f20eaabed93d0cd94d76d09f0f1c869fd Signed-off-by: Aditya Bavanari --- asoc/sdm660-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/asoc/sdm660-common.c b/asoc/sdm660-common.c index 449664287303..ccfe528487dd 100644 --- a/asoc/sdm660-common.c +++ b/asoc/sdm660-common.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2783,11 +2783,10 @@ void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) pdata->mi2s_gpio_p[index]); ret = msm_mi2s_set_sclk(substream, false); - if (ret < 0) { + if (ret < 0) pr_err("%s:clock disable failed for MI2S (%d); ret=%d\n", __func__, index, ret); - mi2s_intf_conf[index].ref_cnt++; - } + if (mi2s_intf_conf[index].msm_is_ext_mclk) { mi2s_mclk[index].enable = 0; pr_debug("%s: Disabling mclk, clk_freq_in_hz = %u\n",