From patchwork Tue Oct 27 18:31:41 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: 11861351 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 8EBF5C4363A for ; Tue, 27 Oct 2020 18:33:47 +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 C583120724 for ; Tue, 27 Oct 2020 18:33:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xrqKBfWg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cPyXQd8b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C583120724 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=vGgQ8bTx5Y94wAV19nCbCfaRiw8ILaQbb9FOL8Um45I=; b=xrqKBfWgGexo+nKayqmk09JpD +iQbGm2P3YKRQI8EQxhEEuG7J3NkCswzvnVap+jtkcdce/pY7f2VpQGKImGrMVPrMJ94B75oHFB0C 2PF7akE5hqfnEZaG9l9+q418KEXwTZ5qh/XvY2sj1AYb7uzwxDThamDnhjlp8jto/QyKDpMvmW0Cl tDBDv1DaHMZqV0jkCaGEHU0pTMLBFNbG8wUUIKRL8waRW3aWZt27dIUNXpk0GXllM2G9ciJxQkNKe JkwyNmGD7G/Hl0VPE6tXRnK7iTd0TzqccNIXMzGLf3MRfKEU3A74ZrhXupwlIM3tDMXj8gkpkiWDR sIpGoaX4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTmE-0002np-DD; Tue, 27 Oct 2020 18:32:59 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTlI-0002R9-4D for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 18:32:04 +0000 Received: by mail-wm1-x343.google.com with SMTP id d3so2470104wma.4 for ; Tue, 27 Oct 2020 11:31:59 -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=EO+XgfqYhS1hWPZ5l+hsM+hp/BUXxbM/bDwLpUj+eH0=; b=cPyXQd8bpobuaTcZbflF+9ISJGHRfsusHYPfQhnJAlbApOn2LHLwmI/KUP8W41pMEH YhVaLV6hJL8RVHkO8xjOAEUDCMUg3XwW4FZfJaNDh/g56geus/uLQMfuXbWacVu7l58k Yp1DRySxAHwMS2ziQKrB5PiFluap3kCoSezNPsT4INGW8y8YAJ1Gd0B7+c+3ubZRLv+u Y50S9wzPWKWHEZbfl/trFf5287+SEMFkxNL9rRfsWgDzfC2VvX0AHsaOiM8SO4AIRVkr Xukph5Fl/ewvLAni+mLc3HTH1+1a9owNE8MJLDT9wZKijF7KhvyVycUQYIcHg9zjS+HF TxZg== 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=EO+XgfqYhS1hWPZ5l+hsM+hp/BUXxbM/bDwLpUj+eH0=; b=hU9DhEDGC+nR916akugSzy+Yw3rxrtnPeCnhR7fa62AeWWrPnpHdnDszg1KKHNrkGr 9H99wgEVC4DNOIhqYgbWcls6gbc5WrCO/TD+hHMU+mKvlthhDzxWl3t5F+HDw2WyWADQ 3NI/gQjnrmxawWwMk3hK4Qh/qJpQuEGFhAwbI5OTXxzsi/KOwYyt3Htr+9cH3B6aM1NO gRBacqpupczt8srgnu/nrVlLJq1NlXAPlYzpyCHKiyg07EECElJJea5mgaj58uKeBpLT kxOYLfKvXpoeTTBK1UoYb8YxnNJfJ0C/LFUS0Uh5YiTu183F+dhQbuE2996K0tNYC9Bc X24w== X-Gm-Message-State: AOAM532BDCsu1d80xRyj7pSHLTp6ZArOVm/lLBc2nWo+/JJJCY5FTQIC J4huXuWnhs7r/K0pkQUOoME= X-Google-Smtp-Source: ABdhPJz51xl2Ade7TO2COWem4gvbYEgstwB3/gSBh+1t+c45C6pZQU7QwS2H6fG7zZ5N/uwbbZayEw== X-Received: by 2002:a7b:c387:: with SMTP id s7mr4042645wmj.52.1603823519008; Tue, 27 Oct 2020 11:31:59 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:31:58 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Subject: [PATCH v9 06/14] ASoC: sun4i-i2s: Fix sun8i volatile regs Date: Tue, 27 Oct 2020 19:31:41 +0100 Message-Id: <20201027183149.145165-7-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_143200_272757_128E0E83 X-CRM114-Status: GOOD ( 15.24 ) 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, 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 The FIFO TX reg is volatile and sun8i i2s register mapping is different from sun4i. Even if in this case it's doesn't create an issue, Avoid setting some regs that are undefined in sun8i. Acked-by: Maxime Ripard Reviewed-by: Chen-Yu Tsai Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 39b56d0de1fd..83537538f8ee 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -1162,12 +1162,19 @@ static bool sun8i_i2s_rd_reg(struct device *dev, unsigned int reg) static bool sun8i_i2s_volatile_reg(struct device *dev, unsigned int reg) { - if (reg == SUN8I_I2S_INT_STA_REG) + switch (reg) { + case SUN4I_I2S_FIFO_CTRL_REG: + case SUN4I_I2S_FIFO_RX_REG: + case SUN4I_I2S_FIFO_STA_REG: + case SUN4I_I2S_RX_CNT_REG: + case SUN4I_I2S_TX_CNT_REG: + case SUN8I_I2S_FIFO_TX_REG: + case SUN8I_I2S_INT_STA_REG: return true; - if (reg == SUN8I_I2S_FIFO_TX_REG) - return false; - return sun4i_i2s_volatile_reg(dev, reg); + default: + return false; + } } static const struct reg_default sun4i_i2s_reg_defaults[] = {