From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2A99C433FF for ; Wed, 14 Aug 2019 11:31:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8C5D205F4 for ; Wed, 14 Aug 2019 11:31:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Bz9eQnQ2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8C5D205F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MXGfOod5slTFTu0OS7qA/1LlMf78LpJ3zYZUW0JPLDU=; b=Bz9eQnQ2D3n8R3 EFyyK29kunD3kF3HGHB1AA4jcgaRxtdrqwk+Bxd6O8Jrf8XGZViGQIq7810f0ITMcttvNSpq9TnXD C4leQKt+1yvkzjeAsxzlUp0ysiwbX0Oi4vYAjxazBaudTzkANLPGyDcNjpaR47E5nPv9SBKXuHyih Enkmx2QZno8ep/NbEq5CthnQP6KE3/AimYrnOA6QolvQ5HGNUfVl581n705VCP9HifAi2aMLKicT7 L8eEr7kOCLG46bwSRfD1u6dqf97jLs1D4ggbVz5mgtsUGaMT2ui7SShSb1Slj3W4nkJQ1nHoccjIQ l1FzUrYYqCdLFNV9ThDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxrVL-0001sG-C8; Wed, 14 Aug 2019 11:31:47 +0000 Received: from mail-ed1-f66.google.com ([209.85.208.66]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxrVG-0001rf-GS for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2019 11:31:45 +0000 Received: by mail-ed1-f66.google.com with SMTP id m44so6762803edd.9 for ; Wed, 14 Aug 2019 04:31:42 -0700 (PDT) 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=jnH5gEWlUPqTFMc04DMHRK5rlUo9OFLR8LpIJiKaA88=; b=g6Ck11nsav/mLAThkQP8xObrmmD+jiwDzO4gq0OVBxotaklVJYrJ5yqaZx32+oM66x A/BVKPIpTrjawxKkihk0Hp4Q3e5Uun/80AASINrAs8XYTZFKmj163wt3+uh2DsYSVcha xXTd2Cx0U4viJIGztuTDYJM+WPL0p83uyjN5L5PiIE1qU0Q/tqycZpSB24ZNzoflRlXw CJJIMsMMphRTlxezWfBbdT2/mroKux7fSh63egkFwwBQ2LeZGEg9xtpBTYTsXwkXY5Vn ibJ7S9DSY0R2taLol0JJlR6EPcbqDZeHnhWVbrnNzVeKdkf+EzRL0y155RNco2S+SJkk nPrA== X-Gm-Message-State: APjAAAXsXyTUZxDGtB41OCV6iSJG2MU/dJkn4S9u8t0P4dUcPShuaDPI 7w8E6zWwR9q+qVy1ShmGmvzcdudFjT4= X-Google-Smtp-Source: APXvYqzL6DwSbAmxbAWDitYMFxoiT2Ky7/TFF+kxXEeNPkqsL9Zvi46Qh/ZmTXZWoSG83pnAxWJGDw== X-Received: by 2002:aa7:c68f:: with SMTP id n15mr18075971edq.43.1565782300186; Wed, 14 Aug 2019 04:31:40 -0700 (PDT) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id j30sm25258930edb.8.2019.08.14.04.31.39 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 14 Aug 2019 04:31:39 -0700 (PDT) Received: by mail-wm1-f42.google.com with SMTP id l2so4148915wmg.0 for ; Wed, 14 Aug 2019 04:31:39 -0700 (PDT) X-Received: by 2002:a1c:4c06:: with SMTP id z6mr7844443wmf.47.1565782298812; Wed, 14 Aug 2019 04:31:38 -0700 (PDT) MIME-Version: 1.0 References: <20190814060854.26345-1-codekipper@gmail.com> <20190814060854.26345-16-codekipper@gmail.com> In-Reply-To: <20190814060854.26345-16-codekipper@gmail.com> From: Chen-Yu Tsai Date: Wed, 14 Aug 2019 19:31:27 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 15/15] ASoC: sun4i-i2s: Adjust regmap settings To: Code Kipper X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190814_043142_543235_69EE3587 X-CRM114-Status: GOOD ( 18.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA , linux-kernel , Liam Girdwood , "Andrea Venturi \(pers\)" , linux-sunxi , Mark Brown , Maxime Ripard , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 14, 2019 at 2:09 PM wrote: > > From: Marcus Cooper > > Bypass the regmap cache when flushing the i2s FIFOs and modify the tables > to reflect this. > > Signed-off-by: Marcus Cooper > --- > sound/soc/sunxi/sun4i-i2s.c | 31 ++++++++++--------------------- > 1 file changed, 10 insertions(+), 21 deletions(-) > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > index d3c8789f70bb..ecfc1ed79379 100644 > --- a/sound/soc/sunxi/sun4i-i2s.c > +++ b/sound/soc/sunxi/sun4i-i2s.c > @@ -876,9 +876,11 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) > static void sun4i_i2s_start_capture(struct sun4i_i2s *i2s) > { > /* Flush RX FIFO */ > + regcache_cache_bypass(i2s->regmap, true); > regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG, > SUN4I_I2S_FIFO_CTRL_FLUSH_RX, > SUN4I_I2S_FIFO_CTRL_FLUSH_RX); > + regcache_cache_bypass(i2s->regmap, false); > > /* Clear RX counter */ > regmap_write(i2s->regmap, SUN4I_I2S_RX_CNT_REG, 0); > @@ -897,9 +899,11 @@ static void sun4i_i2s_start_capture(struct sun4i_i2s *i2s) > static void sun4i_i2s_start_playback(struct sun4i_i2s *i2s) > { > /* Flush TX FIFO */ > + regcache_cache_bypass(i2s->regmap, true); > regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG, > SUN4I_I2S_FIFO_CTRL_FLUSH_TX, > SUN4I_I2S_FIFO_CTRL_FLUSH_TX); > + regcache_cache_bypass(i2s->regmap, false); > > /* Clear TX counter */ > regmap_write(i2s->regmap, SUN4I_I2S_TX_CNT_REG, 0); > @@ -1053,13 +1057,7 @@ static const struct snd_soc_component_driver sun4i_i2s_component = { > > static bool sun4i_i2s_rd_reg(struct device *dev, unsigned int reg) > { > - switch (reg) { > - case SUN4I_I2S_FIFO_TX_REG: > - return false; > - > - default: > - return true; > - } > + return true; The commit log needs to explain why this is relevant. And I'm not sure why one would read back the TX FIFO. Also, if it's always true, just drop the callback. ChenYu > } > > static bool sun4i_i2s_wr_reg(struct device *dev, unsigned int reg) > @@ -1078,6 +1076,8 @@ static bool sun4i_i2s_volatile_reg(struct device *dev, unsigned int reg) > { > switch (reg) { > case SUN4I_I2S_FIFO_RX_REG: > + case SUN4I_I2S_FIFO_TX_REG: > + case SUN4I_I2S_FIFO_STA_REG: > case SUN4I_I2S_INT_STA_REG: > case SUN4I_I2S_RX_CNT_REG: > case SUN4I_I2S_TX_CNT_REG: > @@ -1088,23 +1088,12 @@ static bool sun4i_i2s_volatile_reg(struct device *dev, unsigned int reg) > } > } > > -static bool sun8i_i2s_rd_reg(struct device *dev, unsigned int reg) > -{ > - switch (reg) { > - case SUN8I_I2S_FIFO_TX_REG: > - return false; > - > - default: > - return true; > - } > -} > - > static bool sun8i_i2s_volatile_reg(struct device *dev, unsigned int reg) > { > if (reg == SUN8I_I2S_INT_STA_REG) > return true; > if (reg == SUN8I_I2S_FIFO_TX_REG) > - return false; > + return true; > > return sun4i_i2s_volatile_reg(dev, reg); > } > @@ -1175,7 +1164,7 @@ static const struct regmap_config sun8i_i2s_regmap_config = { > .reg_defaults = sun8i_i2s_reg_defaults, > .num_reg_defaults = ARRAY_SIZE(sun8i_i2s_reg_defaults), > .writeable_reg = sun4i_i2s_wr_reg, > - .readable_reg = sun8i_i2s_rd_reg, > + .readable_reg = sun4i_i2s_rd_reg, > .volatile_reg = sun8i_i2s_volatile_reg, > }; > > @@ -1188,7 +1177,7 @@ static const struct regmap_config sun50i_i2s_regmap_config = { > .reg_defaults = sun50i_i2s_reg_defaults, > .num_reg_defaults = ARRAY_SIZE(sun50i_i2s_reg_defaults), > .writeable_reg = sun4i_i2s_wr_reg, > - .readable_reg = sun8i_i2s_rd_reg, > + .readable_reg = sun4i_i2s_rd_reg, > .volatile_reg = sun8i_i2s_volatile_reg, > }; > > -- > 2.22.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel