Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5695836pxv; Wed, 7 Jul 2021 09:36:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1c5RAz12H1cbyjRGsXiLMBpa4W2Al0US+gZV6Hmf6JsZyWaAOLbir9TyLu1k7vtVBmqVc X-Received: by 2002:a92:d58b:: with SMTP id a11mr19110632iln.305.1625675813801; Wed, 07 Jul 2021 09:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625675813; cv=none; d=google.com; s=arc-20160816; b=sPVnHRJU98ehQrAgr3sab2/N5kcdgjDg+1vVKUhyTjGik+KTqf6IeqWRxuM7g+0hOO PnyVVdbHk+ogHIZkk7n3OT54yULEuxeq411MbE6RXw63CzbTE11O32ueytUPaFiBBLK8 h1r6/7gzITxmpr9VSz0cr8KaA5Pb9gbQFqjr5mcEH2wqw0lV8W/Dum5fEcgia/3alLxI mE0lM7fib381lVx3MOa6WKGCvZ15eq7L7mnCXqa+uWRXpvYTkQzAuWT2SdqLlzIm43xW wjtwKSxmJXNV2Ww4pUbtlvslyeiUhMxB5UtSsbwfk1KgQjD8bKbjathkJCI3zOBljmZQ B85Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=8RVUzhcv7PqrvmtNN08wEgQz+zAhs/gjOL7m2wvs8CU=; b=jF432hBU+WFEsxnhgFokQ5wnkjr2SDNQV0IA0HNXyRN5hDz0Xzeg8awH1aSL0t67ix YLls52swD+sXN8n+QHMeyHmvSjxXlQMYaE8KOMN/m7a5frT4FP62aA/JBGhslekbDPiJ bohyk1dhvmOo2L3Zd1jOemCYOChBSW2edlX04kBdVX0D8xMMYiG1hHaRoJ3UGFsi0XQB xCCengcSfb4XYE96QBV7a//zCxY3e14NLFLoC9RvsnLI5d7I/pCsvkkBcJmPyv+79vGR yFX3iyLtmsE1hDyPsdS7zp5TIn/ow3JrkRKhqjfhK9SZeXoE4zCq9Wja+tvt92085f/g dprg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si24654145ilm.156.2021.07.07.09.36.42; Wed, 07 Jul 2021 09:36:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbhGGQi2 (ORCPT + 99 others); Wed, 7 Jul 2021 12:38:28 -0400 Received: from mga17.intel.com ([192.55.52.151]:55266 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbhGGQi2 (ORCPT ); Wed, 7 Jul 2021 12:38:28 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="189718237" X-IronPort-AV: E=Sophos;i="5.84,220,1620716400"; d="scan'208";a="189718237" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 09:35:32 -0700 X-IronPort-AV: E=Sophos;i="5.84,220,1620716400"; d="scan'208";a="645442779" Received: from cmcarran-mobl.amr.corp.intel.com (HELO [10.213.189.140]) ([10.213.189.140]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 09:35:31 -0700 Subject: Re: [PATCH 06/12] ASoC: amd: irq handler changes for ACP5x PCM dma driver To: Vijendar Mukunda , broonie@kernel.org, alsa-devel@alsa-project.org Cc: Sunil-kumar.Dommati@amd.com, Liam Girdwood , open list , Takashi Iwai , Alexander.Deucher@amd.com References: <20210707055623.27371-1-vijendar.mukunda@amd.com> <20210707055623.27371-7-vijendar.mukunda@amd.com> From: Pierre-Louis Bossart Message-ID: <6ae6e658-692e-70f2-6bda-ce139168aae3@linux.intel.com> Date: Wed, 7 Jul 2021 11:20:31 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210707055623.27371-7-vijendar.mukunda@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static irqreturn_t i2s_irq_handler(int irq, void *dev_id) > +{ > + struct i2s_dev_data *vg_i2s_data; > + u16 play_flag, cap_flag; > + u32 val; > + > + vg_i2s_data = dev_id; > + if (!vg_i2s_data) > + return IRQ_NONE; > + > + play_flag = 0; > + cap_flag = 0; > + val = acp_readl(vg_i2s_data->acp5x_base + ACP_EXTERNAL_INTR_STAT); > + if ((val & BIT(HS_TX_THRESHOLD)) && vg_i2s_data->play_stream) { > + acp_writel(BIT(HS_TX_THRESHOLD), vg_i2s_data->acp5x_base + > + ACP_EXTERNAL_INTR_STAT); > + snd_pcm_period_elapsed(vg_i2s_data->play_stream); > + play_flag = 1; > + } > + if ((val & BIT(I2S_TX_THRESHOLD)) && > + vg_i2s_data->i2ssp_play_stream) { > + acp_writel(BIT(I2S_TX_THRESHOLD), > + vg_i2s_data->acp5x_base + ACP_EXTERNAL_INTR_STAT); > + snd_pcm_period_elapsed(vg_i2s_data->i2ssp_play_stream); > + play_flag = 1; > + } > + > + if ((val & BIT(HS_RX_THRESHOLD)) && vg_i2s_data->capture_stream) { > + acp_writel(BIT(HS_RX_THRESHOLD), vg_i2s_data->acp5x_base + > + ACP_EXTERNAL_INTR_STAT); > + snd_pcm_period_elapsed(vg_i2s_data->capture_stream); > + cap_flag = 1; > + } > + if ((val & BIT(I2S_RX_THRESHOLD)) && > + vg_i2s_data->i2ssp_capture_stream) { > + acp_writel(BIT(I2S_RX_THRESHOLD), > + vg_i2s_data->acp5x_base + ACP_EXTERNAL_INTR_STAT); > + snd_pcm_period_elapsed(vg_i2s_data->i2ssp_capture_stream); > + cap_flag = 1; > + } > + > + if (play_flag | cap_flag) it doesn't seem terribly useful to use two variables if you can use one? > + return IRQ_HANDLED; > + else > + return IRQ_NONE; > +} > +