From cc2aada3780ff6a70f4fcaae812313adbf93095e Mon Sep 17 00:00:00 2001 From: Laxminath Kasam Date: Mon, 3 Feb 2020 12:47:48 +0530 Subject: [PATCH] asoc: wsa881x-analog: Disable MCLK if clk enabled state In WSA analog driver, disable MCLK only if clock enabled. Change-Id: I3a6aa42dc258e3c6ad1ceccdf74f0136338d79b2 Signed-off-by: Laxminath Kasam --- asoc/codecs/wsa881x-analog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/asoc/codecs/wsa881x-analog.c b/asoc/codecs/wsa881x-analog.c index d322f315b9..fe8a5b9c9d 100644 --- a/asoc/codecs/wsa881x-analog.c +++ b/asoc/codecs/wsa881x-analog.c @@ -1,9 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2015-2016, 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2016, 2018-2020, The Linux Foundation. All rights reserved. */ #include +#include #include #include #include @@ -1032,7 +1033,8 @@ static int wsa881x_shutdown(struct wsa881x_pdata *pdata) return ret; } - clk_disable_unprepare(pdata->wsa_mclk); + if (__clk_is_enabled(pdata->wsa_mclk)) + clk_disable_unprepare(pdata->wsa_mclk); ret = msm_cdc_pinctrl_select_sleep_state(pdata->wsa_clk_gpio_p); if (ret) {