From patchwork Sat Jul 29 14:17:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 9869977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B4AA6038F for ; Sat, 29 Jul 2017 14:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35D41286F7 for ; Sat, 29 Jul 2017 14:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AACC2869C; Sat, 29 Jul 2017 14:19:13 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938782868B for ; Sat, 29 Jul 2017 14:19:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0DC53266E24; Sat, 29 Jul 2017 16:18:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 27F14266E13; Sat, 29 Jul 2017 16:18:01 +0200 (CEST) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by alsa0.perex.cz (Postfix) with ESMTP id C48B6266D9B for ; Sat, 29 Jul 2017 16:17:56 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id 65so7747885lfa.0 for ; Sat, 29 Jul 2017 07:17:56 -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; bh=4xeHrhWk5DMw1X40qVrL+WM/3f/NohpQtKHxCEObSLI=; b=dWfslYCj13+VKzlhR//JLhcPclx3cV0VHkzCkq70Oy7YfD3kZLic06njQvfHuCYyiN MGJWUo/l67Y33DxNMNZ39YKatBecbU2fWhaw7eBxDr9tWB9VlTF/slT2+1K4Uow1Koyy P/OGjBGYObEP1QVqZEeGo8p/D9yjwAoKQAUuKuOIX63Xs4JAYAYkJNi0pcN8yJ+oA2NY naM8Rrk/ca2VJp3aIiW0Jfp9yV89f5no+lNkYBtWCGaOxEctmaNE6lu0/qhp1d79FMTB Zye6NDGYNOIvacHyHoC+AmHxFjXhTWjIyEH8kLpgb1TJMLLGh/QAh3cmRLjuuXrolZOS cdPQ== 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; bh=4xeHrhWk5DMw1X40qVrL+WM/3f/NohpQtKHxCEObSLI=; b=H/JM1j0fLB+n+gHu+LfTxNZnKea+a5WQAKYBGj83AnuSvKHF4+Cq9SgSEtTXsxe1FZ 5jmt5MibIsZzJX3CyqvRWAEKc7G/1gDa5gsmvc/og8WmjRQ0KQ4UPYQuO5CCm3qN+qQQ k2Y2bnG96ii9QKL6xM5Guuif703lcYlJft2y02mGmdO3N+aeNg0xHpwjt3foxOcb9K0L Eh267VhtzU8bYkW1ARVD8fKFpYGsveVZ1dqe2OdU7SAW1VcqwW9fb2530hZjXp8VtMov wb1DIqBgPYogW9LlXfv6NBmkFTdMWX69iAofQz0gKIM6Rcq0mN+BCI5Y8Yamt6+1YE2x ksuQ== X-Gm-Message-State: AIVw110qYVamF0dDU3vvdvGkMVdxmaAxkFxhBZPEPaJQtiZRw90dOLCu sA+iMML2LB9T/A== X-Received: by 10.25.225.70 with SMTP id y67mr3842090lfg.34.1501337876517; Sat, 29 Jul 2017 07:17:56 -0700 (PDT) Received: from localhost.localdomain (c80-217-9-219.bredband.comhem.se. [80.217.9.219]) by smtp.gmail.com with ESMTPSA id s189sm4581958lja.77.2017.07.29.07.17.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2017 07:17:55 -0700 (PDT) From: codekipper@gmail.com To: maxime.ripard@free-electrons.com Date: Sat, 29 Jul 2017 16:17:42 +0200 Message-Id: <20170729141753.20174-2-codekipper@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170729141753.20174-1-codekipper@gmail.com> References: <20170729141753.20174-1-codekipper@gmail.com> Cc: alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, linux-sunxi@googlegroups.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v3 01/12] ASoC: sun4i-i2s: Extend quirks scope X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marcus Cooper In preparation for the changes required to support newer SoCs then quirks has been moved and also added to the device structure. Signed-off-by: Marcus Cooper Reviewed-by: Chen-Yu Tsai --- sound/soc/sunxi/sun4i-i2s.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 62b307b0c846..d7ee7a443e4e 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -90,6 +90,15 @@ #define SUN4I_I2S_RX_CHAN_SEL_REG 0x38 #define SUN4I_I2S_RX_CHAN_MAP_REG 0x3c +/** + * struct sun4i_i2s_quirks - Differences between SoC variants. + * + * @has_reset: SoC needs reset deasserted. + */ +struct sun4i_i2s_quirks { + bool has_reset; +}; + struct sun4i_i2s { struct clk *bus_clk; struct clk *mod_clk; @@ -100,6 +109,8 @@ struct sun4i_i2s { struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data; + + const struct sun4i_i2s_quirks *variant; }; struct sun4i_i2s_clk_div { @@ -654,10 +665,6 @@ static int sun4i_i2s_runtime_suspend(struct device *dev) return 0; } -struct sun4i_i2s_quirks { - bool has_reset; -}; - static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = { .has_reset = false, }; @@ -669,7 +676,6 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = { static int sun4i_i2s_probe(struct platform_device *pdev) { struct sun4i_i2s *i2s; - const struct sun4i_i2s_quirks *quirks; struct resource *res; void __iomem *regs; int irq, ret; @@ -690,8 +696,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev) return irq; } - quirks = of_device_get_match_data(&pdev->dev); - if (!quirks) { + i2s->variant = of_device_get_match_data(&pdev->dev); + if (!i2s->variant) { dev_err(&pdev->dev, "Failed to determine the quirks to use\n"); return -ENODEV; } @@ -715,7 +721,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev) return PTR_ERR(i2s->mod_clk); } - if (quirks->has_reset) { + if (i2s->variant->has_reset) { i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL); if (IS_ERR(i2s->rst)) { dev_err(&pdev->dev, "Failed to get reset control\n");