Received: by 10.192.165.148 with SMTP id m20csp3121674imm; Sun, 29 Apr 2018 14:43:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqXOgmjzxupApR15CQ1krNVB2QFPwHBcQuxsNwR1kraMUnKjstxmwbUNR7swIJZzjpWyFwr X-Received: by 10.98.219.5 with SMTP id f5mr9821281pfg.137.1525038191395; Sun, 29 Apr 2018 14:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525038191; cv=none; d=google.com; s=arc-20160816; b=R7+LhVFTFmQjvKjIIcv6b8o9ZXXr8C9KRx6W5QcczGyh5OeqHPCoZ6vQ7L1Y557ySw aphOhzYBIvTRj0eGnRjveE40HDo9I8kDGG1hD0Vm9zK9YV92ddkN+5y991KwVxJm3WI4 kNv1C6HFXnjp7MpYH0BgczSZ3QqXsBXqVWSjaWvWz6fH53cxhs9WJ46ohWeJ5wNQC9nx rQxK3JTOQ42R8d3RTUd5cK7xRXiohGk4oigFzmqp2HSEuIt+iQeObYs7GlT5d1zUb7X5 eA+9L82CYsUUodgiej9I4veRqoNSZPQJ3mfmDYRgkFIMG6ngHTIyV92S4wbItKUNVM4r 6GuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=CVuroqaiFi/nJ+AkLvfittsBicxeaPCduLCJ03ILoPs=; b=Z2F5PYBDZgqIz1YN2KRX2fNDeclqpAumDSL9XsRtlOITajQRlAKYVQJYqthvvGtflX zsDGvA+ywoGjj776lY8cAxDrenq0aSM1N010PykYHCFewjdQK7hKs4ovtH0+mztkISD4 L2RCWpdLEpUEMeMjXmGi2iDyUOXDuaNpx1FfzAzUH61lfOaw9C5F/8rSBPnUgt/jG8hh P+5DYb7NIUxhazk3qQgo+LsktKgNd2AhCjTSfYyE8Qwcz676Z6E8CLi8lFLxEJpuu6sr SucqLEoX9uMfBjDY1BOPDVGSxGNymcNDT01lUYmuS/L7e/t08s/dci2YF3vJnDLE2E3G DZoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OptYQtoN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si6048757plo.476.2018.04.29.14.42.57; Sun, 29 Apr 2018 14:43:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OptYQtoN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754363AbeD2Vls (ORCPT + 99 others); Sun, 29 Apr 2018 17:41:48 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:39846 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbeD2Vlp (ORCPT ); Sun, 29 Apr 2018 17:41:45 -0400 Received: by mail-ua0-f193.google.com with SMTP id g10so4335195ual.6 for ; Sun, 29 Apr 2018 14:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CVuroqaiFi/nJ+AkLvfittsBicxeaPCduLCJ03ILoPs=; b=OptYQtoNWu/xQWHNrt2Rur1DeKiD/QpPwYUYzfq7MMP7NMm/MRSudzh0OPSji0Hcio Uyld1GbKdUWPedjZQWBDkmFxldRkykOJA9T/JubOJVIiDPtg9aONbHyEMPOLgkPA1r7C Un0m0cX0W8J80EBeT6EAJaM538etYn0OM/MZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CVuroqaiFi/nJ+AkLvfittsBicxeaPCduLCJ03ILoPs=; b=kwk6OfVYaAL/N/LhDLAHISoEu06LK7OusPF9C7RB40svfsmFnmDLWWDtHBbP/TYOt2 5ENafcAd11Bc/aDADmBb8mkvz2OgVjSuo95VcBsv7kojkUxGMkdigf2UjMYTjKiMKNjE tpd9UJGkSQcB4rxRM/oywFRelTZK2yKp+8Eht23ZvNUm1Kz9DQo+clluk9eHBChkljvk KQQeu5WnrsYc2+W6Uo6ftDXjxp08LTvZUyhE6tZojHng7SKKj49LXom1hR4b3avuTBDU h66TXGiH8PZ13HDHZiPdBk+gUPg5BmOMdcoF0UKirI64Wl0rzRXx4E/mrQ6xXZUqzUhF km3g== X-Gm-Message-State: ALQs6tDpJhJA5WVytwBmnwnD5jIb+5aQHZpCLPZiLaeMnY3t39WNpulR m46gPPn7Efib+51I7Qu6cLSlrJPiFbohDHc6PBulyw== X-Received: by 10.159.51.108 with SMTP id a44mr7292216uac.38.1525038103969; Sun, 29 Apr 2018 14:41:43 -0700 (PDT) MIME-Version: 1.0 References: <1524741374-13523-1-git-send-email-Vijendar.Mukunda@amd.com> <1524741374-13523-4-git-send-email-Vijendar.Mukunda@amd.com> In-Reply-To: <1524741374-13523-4-git-send-email-Vijendar.Mukunda@amd.com> From: Daniel Kurtz Date: Sun, 29 Apr 2018 21:41:33 +0000 Message-ID: Subject: Re: [PATCH 04/11] ASoC: amd: removed separate byte count variables for playback and capture To: Vijendar.Mukunda@amd.com Cc: Liam Girdwood , Mark Brown , perex@perex.cz, tiwai@suse.com, alexander.deucher@amd.com, jclinton@chromium.org, Akshu Agrawal , Guenter Roeck , pombredanne@nexb.com, kstewart@linuxfoundation.org, Greg Kroah-Hartman , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vijendar, On Thu, Apr 26, 2018 at 5:15 AM Vijendar Mukunda wrote: > Removed separate byte count variables for playback and capture. > Signed-off-by: Vijendar Mukunda Reviewed-by: Daniel Kurtz > --- > sound/soc/amd/acp-pcm-dma.c | 19 +++++-------------- > sound/soc/amd/acp.h | 3 +-- > 2 files changed, 6 insertions(+), 16 deletions(-) > diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c > index 019f696..5f34be1 100644 > --- a/sound/soc/amd/acp-pcm-dma.c > +++ b/sound/soc/amd/acp-pcm-dma.c > @@ -866,13 +866,8 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) > buffersize = frames_to_bytes(runtime, runtime->buffer_size); > bytescount = acp_get_byte_count(rtd); > - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { > - if (bytescount > rtd->i2ssp_renderbytescount) > - bytescount = bytescount - rtd->i2ssp_renderbytescount; > - } else { > - if (bytescount > rtd->i2ssp_capturebytescount) > - bytescount = bytescount - rtd->i2ssp_capturebytescount; > - } > + if (bytescount > rtd->bytescount) > + bytescount = bytescount - rtd->bytescount; nit, this could be: bytescount -= rtd->bytescount; > pos = do_div(bytescount, buffersize); > return bytes_to_frames(runtime, pos); > } > @@ -921,9 +916,9 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) > case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: > case SNDRV_PCM_TRIGGER_RESUME: > bytescount = acp_get_byte_count(rtd); > + if (rtd->bytescount == 0) > + rtd->bytescount = bytescount; > if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { > - if (rtd->i2ssp_renderbytescount == 0) > - rtd->i2ssp_renderbytescount = bytescount; > acp_dma_start(rtd->acp_mmio, rtd->ch1, false); > while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & > BIT(rtd->ch1)) { > @@ -934,9 +929,6 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) > } > cpu_relax(); > } > - } else { > - if (rtd->i2ssp_capturebytescount == 0) > - rtd->i2ssp_capturebytescount = bytescount; > } > acp_dma_start(rtd->acp_mmio, rtd->ch2, true); > ret = 0; > @@ -947,12 +939,11 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) > if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { > acp_dma_stop(rtd->acp_mmio, rtd->ch1); > ret = acp_dma_stop(rtd->acp_mmio, rtd->ch2); > - rtd->i2ssp_renderbytescount = 0; > } else { > acp_dma_stop(rtd->acp_mmio, rtd->ch2); > ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1); > - rtd->i2ssp_capturebytescount = 0; > } > + rtd->bytescount = 0; > break; > default: > ret = -EINVAL; > diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h > index 3b076c6..82470bc 100644 > --- a/sound/soc/amd/acp.h > +++ b/sound/soc/amd/acp.h > @@ -93,8 +93,7 @@ struct audio_substream_data { > u32 byte_cnt_high_reg_offset; > u32 byte_cnt_low_reg_offset; > uint64_t size; > - u64 i2ssp_renderbytescount; > - u64 i2ssp_capturebytescount; > + u64 bytescount; > void __iomem *acp_mmio; > }; > -- > 2.7.4