Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4214179ybi; Mon, 27 May 2019 13:31:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwY+mhZpPiddN5Ph5xXencTAumuP+gvqzUHmKZjSTqTBIn+befiMRFEBcCiRnU4RfuADN8p X-Received: by 2002:a62:585:: with SMTP id 127mr116999580pff.231.1558989085850; Mon, 27 May 2019 13:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558989085; cv=none; d=google.com; s=arc-20160816; b=ceS4PA/P89GlLMT19WSK8rlFQMGRv7pPLLr7wQA805e/sK0phmIHvM3HQEVi/JDbqd oE77zswsMaada+me4GujK1fi/x5gYY2NYaCGu0IY4kJIxugHuwV1l5bhavRAAFcJErJt /2rhBpXwVrdpwGX2mpNs2EqMfUt7nT09pzFOzq5PWUplui6whCrZwPjo/NfwyZdeSlKs BF2gfIWuuFIzQDx5lSicw4KG74FUu6LCfdc+avEfvLpcUfGtEBtlhoV0MpXIdeCGkoHI jg4SR0FWmkl7QEk1Fvy9sBG6PZj+MBu46DUU9TQD65kNhIqp1Gk783q065rUjP5RikEa D3UA== 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=k+c7EUbgBQhlzZ37NOreDYMAwd8bxw3irPCzpd3kWrE=; b=Moc94coQIBXtZCr8N9H9GnWgt1vzwGLyobOdSjw98r0912q4inT7uiv89ssRUaVyxi jBFe+79RToTr/zYJJeKbF/JoOhe5+3OqOAJKZuQjiZuNuU5jje2Lk6KKP6eGKZwnWeU5 ypggMqY3oVo0bGoIKd54US0/5k/Y43IT9RN3TvqqEUq2W724IzH4ienRAnskfqdzhVhU y12sGdiA8qr5UIrArekXfoIDZdieLlvFk6SDj0btfvOHc7zJkFTa7qv76W+T+r057Dld 2VA+MC34OMF6xdaFqz4sXX5DVbF7seVaQgmITBBL6Bnt8Jr1anacWoxLhiMFKPwSgAFK oujA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gbyFYMES; 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 z25si18849918pgv.418.2019.05.27.13.31.10; Mon, 27 May 2019 13:31:25 -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=gbyFYMES; 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 S1727314AbfE0UKY (ORCPT + 99 others); Mon, 27 May 2019 16:10:24 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40447 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfE0UKT (ORCPT ); Mon, 27 May 2019 16:10:19 -0400 Received: by mail-wm1-f68.google.com with SMTP id 15so517758wmg.5; Mon, 27 May 2019 13:10:18 -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=k+c7EUbgBQhlzZ37NOreDYMAwd8bxw3irPCzpd3kWrE=; b=gbyFYMESgLGOeRm9ME4IdNBI0YZ6YdBSJXE5ykZmP6QQOKtNBykYFL/TeH6nOX4ri/ Uz0Q3jJQta0zUKjvSyF2lNxeL0X9oSahiY2dNOFQrRyAWqhtMl+izapHKYdsSNiRELAV NRL6k9eCnfks+xQfkBtino4GQqq8IPYHSQWWERBX1DhZgaLXYCKHSc9wihGoDfRZ5o+0 mt99CI2qM/8kEn0y/CqkVoGpOOpqtOj1FbR380vVKTpk83ujGaK/ZkXL1+sHO41PI+En vUBzcF1h9fVTLpVAQV9n8/s1U4aSVd92wspN+HW2fS1I5bWGhduT0VVhoCCWB7Zx/HyH eT/Q== 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=k+c7EUbgBQhlzZ37NOreDYMAwd8bxw3irPCzpd3kWrE=; b=kPfIJ6vDBEzejVTib55mqmrSWj6Qvik/CaMQRHreWBz3UCUzWYoWAY6DuEOhjOO0uT 7+U9aZNJo7uyvqOkx2Znr/i3hJZKu5/RI5QkE+6+eMl0pkfNpC8BWqDd3RnKOFhGlkKU bhsz6imv/QXelO6OlqRyDE31Uu97VPiXJ8jxGjhbEaMeO7WXr9qKL61OgNQhpSfeZ6bW fwImFF+N6fUyZEWMB5EI5oejoQDqMnjFY1DF85rjouWZkTE0lXxNNfL0aX1ijWZXuVg5 ii++CY/IXJ3rjahsTmCCRvmU+230QsUEsIlQO/hQsqE39b74rrhNg3NOvMxpmXy8XENY a5PA== X-Gm-Message-State: APjAAAXido5VQ6l/Teb43/00KITcn4rUShZ7t6zQwtXC0N4y2ReFHLjS aqpaqwtVcwlwqVZwAKmgOCo= X-Received: by 2002:a7b:ca43:: with SMTP id m3mr488971wml.45.1558987817783; Mon, 27 May 2019 13:10:17 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::4e2b:d7ca]) by smtp.gmail.com with ESMTPSA id s127sm308523wmf.48.2019.05.27.13.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 13:10:16 -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, linux-sunxi@googlegroups.com, =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Subject: [PATCH v4 4/7] ASoC: sun4i-spdif: Add support for H6 SoC Date: Mon, 27 May 2019 22:06:24 +0200 Message-Id: <20190527200627.8635-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527200627.8635-1-peron.clem@gmail.com> References: <20190527200627.8635-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 045d0cc4b62a..54c09346d298 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, + .val_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