From patchwork Sat May 25 16:23:20 2019 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: 10960901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21DAB933 for ; Sat, 25 May 2019 16:24:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EE85283C5 for ; Sat, 25 May 2019 16:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00B7528A85; Sat, 25 May 2019 16:24:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A2D31283C5 for ; Sat, 25 May 2019 16:24:25 +0000 (UTC) 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: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=pQbzqnG6Sbj/Sb5NV0YPAXuJSj9/a4Vs4udWdpDMs+4=; b=az2cfi7OJBuCtL dkbEBt3eTYmrigc7tNgCb6dMkD4NZn51+5eqQ5pgYI9zrjvudokjddtiT5OhY1OLvaq6pkWWYseXN 0xpmj3rONMSoMX/uiuTWsY2HCifvk+hb8aWxDmKzqmxbTeDtFmG29TZC9icauB0L9RKG+UmnZkdhd vtr4/arMKkHPhIB3vovdLcIlwfKIP+rvAo+YVTCoYhDdqNd5Aj587PXwcT0Kf+nyPyXyLlMyixYyU lagc3x8uwTeBbwFMzkcsp9HC1ny5FxLbSEwKIxc9S6X9I4FZjPXlWb4/0rbdFB5NMs1J2f4HbTSHq W3YYAgLgLRRfnW3JT52g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUZT1-0006o4-F6; Sat, 25 May 2019 16:24:19 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUZSL-0005uY-Hb for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2019 16:23:40 +0000 Received: by mail-wr1-x443.google.com with SMTP id m3so12812445wrv.2 for ; Sat, 25 May 2019 09:23:37 -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=5uUaYKFKqVciIG3lVseFyzbyz6GKlPhTPtvbtba51oA=; b=bHLkAWb9RfaNiXMj3sBfSi6dpURjsbFlzSAaDE8K334xT29EiBpmbLYA0Gk6IdaNIb 2mZY4BDMqGmHswFGwX20J00imoNKgA8vT1DSgaJR437fnNk6ylUGk6Zm7+Yp2ih11lDm vbHzXF7kJFN6bEXymy0y1E3n/OU+uW9HJTHTFeahfVhQeYY5QVo4o9+M6yY0n71WdKfV b9BtKnuVccwPam5ipRCVE7iP0vV8f/cOEGMjjNVIOH5/FckfXzpBxNcPKNV/MBHWOs6K ZBxdukjjSbTsNYLW5IDaUvM1BDTjNL8l9/QPT3cg8xtaUpQxOPG7zjKdk7GIeW6Mf7hj /FPw== 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=5uUaYKFKqVciIG3lVseFyzbyz6GKlPhTPtvbtba51oA=; b=fursKaT3JnKCw1xVrJmbU4d+vjcFfQxTAcHwWN8cLmXdV+j4OBKIMvkqf6JA+apJsL ygqtQKpliJnWl+LhyJmfriexN1BQDvosp6Cw2yLH6WbI+Ydudkjzn7NmQPx2kCkcOF1i PhqF0dKHBQ0u18EJ69k7v+FUKYgVFPAKQxMR3Fzf/bKns+2dhIy3IymIiaUxowrYaNBO TL+/ECJcWEMum7acuI3FjKvl5zpya+Lhv3fqew1UcIQ6UnsznCTSTVYwZFv1FunlM+Th aO2f1mrEuym8XJ9feDqyqcQNNIFA8f9YyVuRiGlEnQknB6pBtG5jwlwZxwpWy+7HiDV1 szAg== X-Gm-Message-State: APjAAAU6+Vd9ENixJCQUwgQ1/0/cvP+ZYps9bqwb6/C5xuib4eewChnE H77mXrQ+AHvDexYJP/OVYF4= X-Google-Smtp-Source: APXvYqwkPqO3mn4ga/iil/wlxyKMkJ5pDpNfzOJHHLu+QPgmwmExfzMvPXSHTN8LXOo1cqiuCvs5UA== X-Received: by 2002:a05:6000:1c6:: with SMTP id t6mr18063975wrx.236.1558801415765; Sat, 25 May 2019 09:23:35 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::4e2b:d7ca]) by smtp.gmail.com with ESMTPSA id k184sm13194409wmk.0.2019.05.25.09.23.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 25 May 2019 09:23:35 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jagan Teki Subject: [PATCH v3 4/7] ASoC: sun4i-spdif: Add support for H6 SoC Date: Sat, 25 May 2019 18:23:20 +0200 Message-Id: <20190525162323.20216-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190525162323.20216-1-peron.clem@gmail.com> References: <20190525162323.20216-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-20190525_092337_799053_DE3C1A30 X-CRM114-Status: GOOD ( 13.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, =?utf-8?b?Q2w=?= =?utf-8?b?w6ltZW50IFDDqXJvbg==?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Allwinner H6 has a different mapping for the fifo register controller. Actually only the fifo TX bit is used in the drivers. Use the freshly introduced quirks to make this drivers compatible with the Allwinner H6. Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-spdif.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index 8317bbee0712..86bf6a99703f 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -75,6 +75,18 @@ #define SUN4I_SPDIF_FCTL_RXOM(v) ((v) << 0) #define SUN4I_SPDIF_FCTL_RXOM_MASK GENMASK(1, 0) +#define SUN50I_H6_SPDIF_FCTL (0x14) + #define SUN50I_H6_SPDIF_FCTL_HUB_EN BIT(31) + #define SUN50I_H6_SPDIF_FCTL_FTX BIT(30) + #define SUN50I_H6_SPDIF_FCTL_FRX BIT(29) + #define SUN50I_H6_SPDIF_FCTL_TXTL(v) ((v) << 12) + #define SUN50I_H6_SPDIF_FCTL_TXTL_MASK GENMASK(19, 12) + #define SUN50I_H6_SPDIF_FCTL_RXTL(v) ((v) << 4) + #define SUN50I_H6_SPDIF_FCTL_RXTL_MASK GENMASK(10, 4) + #define SUN50I_H6_SPDIF_FCTL_TXIM BIT(2) + #define SUN50I_H6_SPDIF_FCTL_RXOM(v) ((v) << 0) + #define SUN50I_H6_SPDIF_FCTL_RXOM_MASK GENMASK(1, 0) + #define SUN4I_SPDIF_FSTA (0x18) #define SUN4I_SPDIF_FSTA_TXE BIT(14) #define SUN4I_SPDIF_FSTA_TXECNTSHT (8) @@ -438,6 +450,12 @@ static const struct sun4i_spdif_quirks sun8i_h3_spdif_quirks = { .has_reset = true, }; +static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = { + .reg_dac_txdata = SUN8I_SPDIF_TXFIFO, + .reg_fctl_ftx = SUN50I_H6_SPDIF_FCTL_FTX, + .has_reset = true, +}; + static const struct of_device_id sun4i_spdif_of_match[] = { { .compatible = "allwinner,sun4i-a10-spdif", @@ -451,6 +469,10 @@ static const struct of_device_id sun4i_spdif_of_match[] = { .compatible = "allwinner,sun8i-h3-spdif", .data = &sun8i_h3_spdif_quirks, }, + { + .compatible = "allwinner,sun50i-h6-spdif", + .data = &sun50i_h6_spdif_quirks, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);