From patchwork Tue Oct 27 18:31:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11861377 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=-12.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 94B53C388F9 for ; Tue, 27 Oct 2020 18:35:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 32E8520724 for ; Tue, 27 Oct 2020 18:35:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WGDoM6HS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qq7QZoCm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32E8520724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y/xL20mooL8vlIccQgAHxTHKEUJj5A398NsaDuSSGHA=; b=WGDoM6HSRU8a79tJX4Rb+9Mee ucTSq+hJZFtO3U48JLzlwwtAiS5pD69XRYUfGd1xJljfDiIDRLcd1Faxd7WFstBeSuX6xpp0RBmCp xioLNJQGIj6Lt9xvZcqm16KV+XKSXYNXRulvsV0IZYYbkjTz78aBHm3MqCzQ06oGNC1M9V51IQdId ltWXVRe4atyDJ+urYrS46pbIyrV3QebL9v8BmcaEV1rekeofRGNJf5N9ZV+HzzfK6NNyrBCcj7S1f B1h5Z7vg6AAS9ihi2CFN81QAvi82iJRTswlLXL2rN7CFVtsnf4qlMMu1rpbsu7BdPfMbjmHRGuOLf TUakCSmHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTmk-0002yj-Rw; Tue, 27 Oct 2020 18:33:31 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTlJ-0002Ra-G3 for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 18:32:04 +0000 Received: by mail-wr1-x442.google.com with SMTP id s9so3031554wro.8 for ; Tue, 27 Oct 2020 11:32:00 -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=/c21paZsZJba8DF8tLoBjklcU/pJ5XW5IJeLsS+Kt2k=; b=Qq7QZoCmy3TG4ygb3zE5N9P9WwwrdWRvnwyFqTugFRCwtD8y0B79yV80bbWFTHlS3B laFP7MJZXthqxDAyFScKHBXrLD0CNzRem3b+BB8IlbWO0eZHx1RvmnmHdeBM4GsI3r7T 7/5/LfySsMy0D43qEsW1hGFYZZc5E2bTDlLZbOBahwdNUPEriU3TZSCy3HU050xKmv8o Ln/dkQiVXEKmpUIOjB3BdZ5DJRN5FFan/AbEdGRzd8NsC1zX2L7l2z/3ZiSBwNMr4oNO T1Rj7RTK/ja2Rk+ajzINEpm0aI4tJRGELYqL2YY1PXuzfmsZc05K9yaIgaIG8rEQsFzz 8tCA== 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=/c21paZsZJba8DF8tLoBjklcU/pJ5XW5IJeLsS+Kt2k=; b=Lm6AzoEIFRQ9HIGbVaIecJ1VkU5glQZvcm4prlR6ykJOj9sNKxhxJHyPqCXxPT6s5Z 6sJR+h6e4NANw18mQJnD3EQ7Y4eav5ss90pCWnFTQCdTjyk2v+NiYr4GjQCGH+7vriBf jsyPiKlktJthWVDQoK+1eeBrnLMKzKQi0ykhzzoiTrzrsozzmi1HdhElvr6oDy3KZsDi 5xaDyC/DPaK8fQ33fg/CBB+0VN/UgcoUSndRKsZBgGBKusf3GLXIXFcEclmIyRuFB1Ev +uhLQoERR7iKZSxWUkoi3Euj0HsUjBABTanPZAG9dD/UEqE0p/iZPqU6hvOT6S/tD8ua dOyw== X-Gm-Message-State: AOAM530/eiwGTY2DPaUmaGN6Hucd2HqNKmuuXkYuMdmBFuwYgW/nCfKx BH7ctzaHwreQqfcSIBr2Vq8= X-Google-Smtp-Source: ABdhPJybTKURTTgkaIrteg61pZdd9OQfEw3Zti19H4IKrVduAttOy9laYU4qyz5dK9TRTLYbl8fiGQ== X-Received: by 2002:adf:fe4b:: with SMTP id m11mr4110664wrs.98.1603823520009; Tue, 27 Oct 2020 11:32:00 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:31:59 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Subject: [PATCH v9 07/14] ASoC: sun4i-i2s: Fix setting of FIFO modes Date: Tue, 27 Oct 2020 19:31:42 +0100 Message-Id: <20201027183149.145165-8-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_143201_659166_17E805FE X-CRM114-Status: GOOD ( 15.00 ) 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: devicetree@vger.kernel.org, Jernej Skrabec , alsa-devel@alsa-project.org, Samuel Holland , linux-kernel@vger.kernel.org, Takashi Iwai , Jaroslav Kysela , Marcus Cooper , linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Chen-Yu Tsai Acked-by: Maxime Ripard 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 83537538f8ee..6a3207245ae2 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -596,6 +596,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; @@ -924,13 +931,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;