Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2564587pxk; Sun, 27 Sep 2020 12:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMAKl3ON8kEnIGTIqTMy4/pYVXeOdmqjmHySd7HkPkFCxU1lXTmEN2HHY8MpEqZf67hkzS X-Received: by 2002:a17:907:20d9:: with SMTP id qq25mr11904938ejb.382.1601235134958; Sun, 27 Sep 2020 12:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601235134; cv=none; d=google.com; s=arc-20160816; b=iHDDfJJeoWwxxpUR48nGlJqP6pOJ4O6anHdSFJVrY9Ktq+xJouyagxPBuyOtJPQ63P bgvCBnXbW7+43E50nwF2Dyfve+OtHU2ji63v8lZuxYvg6/zQrnfxNfgJ5ft+yO3VmI32 xXLVKLcqbY3kf8ppbqkK7VxpKL3PEEgOn2Wo/vZaSruGrECD9rVOhyFzK0m8+fwAaN76 cQwdj0hSu0//tWFa/2DB0UmwuzDeW+owrVWxjYqJXC6XcR/HHSXvpr8wTAh9D4eQPFMA Ot+ij4jGCz4aOA45Lsex0SOPZsNZxI8jU/nX0u965fjlucsX/dFB0xWSqkpFBLKRnlkT b8sQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yae7P0Q6083dv69O1TuhnVIjdtmUZr4BtGd67cLDrDw=; b=xqBGnd81y8hPz9kG1MpnQdNc0fNL0dY8nh3kHFfnnvfG3nmDFM9r3djSyjSdvUGiaz 6rMGWvRNxsykOkPtT5aMRsY8NvATRq9Hz/USIWAguLbEsy6inYJU6Dn/EOOiBiNa0gOZ gCzWFYjd0veoJ38BOfBw+Q6Ba3qp72FIg/Dqcg7OP2eKoKPttsUCPOj0Hid2EnvA8p/7 Lm4MInC4YtYV/bWgplFbyoBMfnl/tuCd0XtvMHriV/nmmWfF51Jv5blKyiyVbDKrxB4X m4AhqjHB8GAOtiD/2UeXv8cWZoA2hJXhZtng1c7TN90T+NgXjlHBwyRqbOFwEVgRmllW uK/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OAwisc7a; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si6643667eda.92.2020.09.27.12.31.52; Sun, 27 Sep 2020 12:32:14 -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=@gmail.com header.s=20161025 header.b=OAwisc7a; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbgI0TaR (ORCPT + 99 others); Sun, 27 Sep 2020 15:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726551AbgI0T32 (ORCPT ); Sun, 27 Sep 2020 15:29:28 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71297C0613CE; Sun, 27 Sep 2020 12:29:28 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id y15so4630239wmi.0; Sun, 27 Sep 2020 12:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yae7P0Q6083dv69O1TuhnVIjdtmUZr4BtGd67cLDrDw=; b=OAwisc7aL0o8lIuJum3WM3sV9ofN665KoKM9NtgnT/G8zNo9Q9fgkMTuJqx1czeNc6 t1lx9xyjNwWHn8T8dqJm7/uG89/1NEjyVHD9C0S3HrqsKi5L5zwlxwMACbPvSgp6iWTd Dy0/3YjquAtjsMFUxepIlSBFuo+pWSSG5Rh7fyL016BPO28nT1wjpu5yHxRPxz8md0tG YT1lo3v6o7OkhuMsva3JMXgsP8srntNNyEWGRcq0GK6BaA9Q1dA9XquEzK6VS0a/uoI9 M6QVFWhXRstuXj6maGreKLFXuCV7/3Xm2rPglp5ST/wqN/EtFpRsYi/EqTbHR86zAeA2 /p4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yae7P0Q6083dv69O1TuhnVIjdtmUZr4BtGd67cLDrDw=; b=Jzq9i/4zXDNlbX9WFzpkHB4REAeSLpqHhfWna+fWK458Vl3AlZQuOznEWHuoXEovFn /j2cu7rb7bFskpF5XKsV+1azdj7TYRzB0CezDtaTvn1iZyvpovopnfADxIAn3/duUd8h jKJt8vtiEdO+2iNFXyjm8w3S29rs+KMGVv5W3K8LmLybmdEa0UYiRUyLCqoCC2UFgsg7 bBrQ8PBEqHCv6mJxm5OAUoxrEbl6wrvC7R1bllp6niNBbwLBuczvdFMQbIecIXpWEkiW svcV+kw1/sNGUXWqSrb1UBf/SuD5s3+NMoMNOk6UkxwUOLVNM4ioui0k3ayzYfb0kmf8 LHEw== X-Gm-Message-State: AOAM532cgFiFcGudsgwxJLH0TQ6V/ZzLaukHQfUr4Cuv2HdPIYvD6pyW BaU6X/3tPkNRCB/i2rrjwvQ= X-Received: by 2002:a1c:f008:: with SMTP id a8mr8404691wmb.155.1601234967071; Sun, 27 Sep 2020 12:29:27 -0700 (PDT) Received: from clement-Latitude-7490.numericable.fr (213-245-241-245.rev.numericable.fr. [213.245.241.245]) by smtp.gmail.com with ESMTPSA id n21sm6149609wmi.21.2020.09.27.12.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 12:29:26 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland , =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Subject: [PATCH v5 08/20] ASoC: sun4i-i2s: Fix setting of FIFO modes Date: Sun, 27 Sep 2020 21:29:00 +0200 Message-Id: <20200927192912.46323-9-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200927192912.46323-1-peron.clem@gmail.com> References: <20200927192912.46323-1-peron.clem@gmail.com> 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: Samuel Holland Because SUN4I_I2S_FIFO_CTRL_REG is volatile, writes done while the regmap is cache-only are ignored. To work around this, move the configuration to a callback that runs while the ASoC core has a runtime PM reference to the device. Signed-off-by: Samuel Holland Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 3f9110d70941..9cd6cd1cd284 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -586,6 +586,13 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, return ret; } + /* Set significant bits in our FIFOs */ + regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG, + SUN4I_I2S_FIFO_CTRL_TX_MODE_MASK | + SUN4I_I2S_FIFO_CTRL_RX_MODE_MASK, + SUN4I_I2S_FIFO_CTRL_TX_MODE(1) | + SUN4I_I2S_FIFO_CTRL_RX_MODE(1)); + switch (params_physical_width(params)) { case 16: width = DMA_SLAVE_BUSWIDTH_2_BYTES; @@ -914,13 +921,6 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) return ret; } - /* Set significant bits in our FIFOs */ - regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG, - SUN4I_I2S_FIFO_CTRL_TX_MODE_MASK | - SUN4I_I2S_FIFO_CTRL_RX_MODE_MASK, - SUN4I_I2S_FIFO_CTRL_TX_MODE(1) | - SUN4I_I2S_FIFO_CTRL_RX_MODE(1)); - i2s->format = fmt; return 0; -- 2.25.1