Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1835536pxb; Mon, 13 Sep 2021 06:36:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0UfgLYGoootvL+ZV+6IC8F5bEhi4Oy5m7z+6jc4Sz7WdirK6H9Ot3hD9ve9e74CM39NGg X-Received: by 2002:a17:906:d0cd:: with SMTP id bq13mr13081510ejb.66.1631540185583; Mon, 13 Sep 2021 06:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540185; cv=none; d=google.com; s=arc-20160816; b=Ln+pudjkFQUDW78XLs1ei20V6RdGHa+7DkTUEpjbaekAqfjWMKfk5cfnI29E1Unx0R mNRWVF2E/T4e46Di0fsZDQDqR/797RgpGmyFFgb67Fz+LSeyODMfOyQOk/oI3R3VtGg4 ATPWNeXBvG66mjXqnn89jWekGwYmSodeGf4RLz8IGoQXGUDd2IoJmmmtS2oYP2qoADQ7 9onAk9lDvffC6DJkVAfV2JadQwrzvxvsICbVvyonBx/GDkXzNz4Q4Prblq4QBMT7Rl0m chFYVEuuDfVcSh33q6SzMbK4O6tEyExOgq58MRIEzcouhbkPkd/xjjARMRyjXsMJqTWJ cekA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=53W4/1orqtIzgVPcXR9WVZIwGBp9WJkwbfjePbGZExo=; b=j6E0yDS5248GOW9uggXtGxm3tj061YXNFB3MxNSkGH1Q/JZHMfubW2sMkfTR9jAapM jwNk+qu7joYipp1NSHM8by05utFQgkT/C2tEGEHj4rl+bqZULbvE140ViCa78Llo+vFM PqPbYgG2Dc3Oc60lDrv8lk0WyXh4U4qeXK/Ph2N/i/fFBpDK/sn9LjIDfdaluSu45uoH AI1nP7kAfwmzzqsPEcH3p0ZGsw7uvTzfhKoDpt0zyanvw5EdEfplFr3FreOwjLLOwpQw peYj0X5jRmMx5MCvhE1n3hS/Dy6+Rbl7XNqSBeVPBVeilu+jDR+oaKnRkzpZLwvjRbjD vMsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wHFo698e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si7711368ejc.571.2021.09.13.06.35.58; Mon, 13 Sep 2021 06:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wHFo698e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242025AbhIMNdQ (ORCPT + 99 others); Mon, 13 Sep 2021 09:33:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:34848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241355AbhIMNX4 (ORCPT ); Mon, 13 Sep 2021 09:23:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B5B99610F9; Mon, 13 Sep 2021 13:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539301; bh=bOvRzoq8iYuF1+SrAaotocRKtSikggHxC12v29IJ35k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wHFo698ef0OMbTkW62q5ZEqk5WZX81UnAjjI96MXwAjdkJylBnZXjRUwtWsAKo7Vv gIrDH0KNaGq8Rs50IffjZtGls3XP/U09UiyspKfzOYdmUpaw1tIYi3q89xXnyqGZYG CyhAlADSCno4zlYraUlsimKQuWQNn1rIdfAdAV78= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Mark Brown , Sasha Levin Subject: [PATCH 5.4 117/144] ASoC: wcd9335: Disable irq on slave ports in the remove function Date: Mon, 13 Sep 2021 15:14:58 +0200 Message-Id: <20210913131051.842348284@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit d3efd26af2e044ff2b48d38bb871630282d77e60 ] The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave ports. This must be undone in the remove function. Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()' function, and call it from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wcd9335.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 5ec63217ad02..016aff97e2fb 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -4076,6 +4076,16 @@ static int wcd9335_setup_irqs(struct wcd9335_codec *wcd) return ret; } +static void wcd9335_teardown_irqs(struct wcd9335_codec *wcd) +{ + int i; + + /* disable interrupts on all slave ports */ + for (i = 0; i < WCD9335_SLIM_NUM_PORT_REG; i++) + regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i, + 0x00); +} + static void wcd9335_cdc_sido_ccl_enable(struct wcd9335_codec *wcd, bool ccl_flag) { @@ -4878,6 +4888,7 @@ static void wcd9335_codec_remove(struct snd_soc_component *comp) struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); wcd_clsh_ctrl_free(wcd->clsh_ctrl); + wcd9335_teardown_irqs(wcd); } static int wcd9335_codec_set_sysclk(struct snd_soc_component *comp, -- 2.30.2