Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1807067ybi; Sat, 25 May 2019 09:25:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAKOLdlc6Rx7ptQ47939oMg24SrOxtL+NPdZYDo3omlpYnLxfedUxUpgW0VefhXjrcUuPy X-Received: by 2002:a63:534f:: with SMTP id t15mr114460745pgl.445.1558801536634; Sat, 25 May 2019 09:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558801536; cv=none; d=google.com; s=arc-20160816; b=iJlPhv/gqJYU/Cws8OPG5izHxjUjJGxPvlmoypzhLNs8xEO/tQZ4rNnoBKDxpbPl2u Ufh42hjNfV9pBWIc5B0J7kw4RXthVJxuufq2myahEdDvXzthFt7+Wcp2u48jQzzMSOI9 EhXGZ8Pg9Eibn7DbbgTXnKHQ/0zXcXxTqi9VESKS2KkIxFOP3nHvrVOngDPfRAEdA7TJ e039VoZtV+OKAE0BvnySU+4LBBlIXQO21TYwz1w+ezoSTQ11lH9eKDJqPhQPnXIhYOLK mBRqMvmf8XUh7XosOePkw1ROfBpLAFoFnN8JgbTpi0wvj1Gyg8YE54MHaFMPhcPkHtXk aiog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5uUaYKFKqVciIG3lVseFyzbyz6GKlPhTPtvbtba51oA=; b=z0iGb6ob/TTEsftul3OYPpEQbwWb5LpbYQjvH9KX1z5fKBjg7zpRtJHm1jrU2vc9tl GoQnPCnt5jKSA7zr4EC7ufkQ8SgWGvMjo0aL3e48I1w8eh8VlXYdTWY7XXoilIM4w72z ib1TVGCF2Gcu0LKqOeCzU/N09vARNhge3OeY5005tITqmKc/MvYg/CVxkZlI8qYCQ8Fi JFeyzHgDdSkuUelymxMyFFZ2H/3jOjq/na7S7peKxz28rji74vaw/HIYD+NS4s0d/ZPE lFkUkRRIx/bOGpFdT2hMkjWCwdGEkiM/Y188zEz6pY2BLannqs2kxSOwhtBQ3hjPiRfU juIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bHLkAWb9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 186si8859069pfc.247.2019.05.25.09.25.21; Sat, 25 May 2019 09:25:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bHLkAWb9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727225AbfEYQXm (ORCPT + 99 others); Sat, 25 May 2019 12:23:42 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34328 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbfEYQXh (ORCPT ); Sat, 25 May 2019 12:23:37 -0400 Received: by mail-wr1-f66.google.com with SMTP id f8so12827877wrt.1; Sat, 25 May 2019 09:23:36 -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=k82GuDoBqnEJleXaZJZG9u4BUmQbGFG4f/+HMhdiuAO5gOZJOo///0QXEGrzGo51cF n+UnBRmpLt9g1J0Uroy6xh4gEVP5zseqxwqK8wOPFk/G6i4K3E6eLt3x8wGun7AVOctI K3D9YBfpbal3Yf1aaUP48V+R8AOZpsWxpPSI8C9kq1QrlaIWhMiSp3I6HPoU4zbTVHkD ASGVuS1uxhFLy5QKvUjmWUNE/4GxN6ctMZQiCTj+appsgO9Hpu3Qff4XvS9ecxn8mF9E sXL9OsfXFTcPHmSPRyjXsis4xwnU7HflXbH0kaB9uE4qzoMhj+/vNgUzUKkNZ4aySsTU jLYQ== X-Gm-Message-State: APjAAAVR8esFGD1BSB5dydQEWAoWPUlr3nhcH/f3+znmCEsBvD4eLhBP J5vXaTxuEstjnved9PwQJ9g= 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?q?Cl=C3=A9ment=20P=C3=A9ron?= To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jagan Teki Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.20.1