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: 9869971 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 CC84A60382 for ; Sat, 29 Jul 2017 14:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0EF52869C for ; Sat, 29 Jul 2017 14:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5CB4286F7; Sat, 29 Jul 2017 14:19:12 +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.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 96E3C2869C for ; Sat, 29 Jul 2017 14:19:10 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=xq8D+mSt3jaOjQJ1/PYRzSzGOhadPJk35rv1trQlAUU=; b=X2DXjiW9bosN9GE5/J6M+1I+D/ sACCRjZ5o2cGJa2nb9R1DvKmXwL6OWsOvAQdVckYwEofnnjf5XRtz6u7S4Bs/52rvuNDkZGA+lrJV TewUMOzSoUxK06SuFAsssk1U532oShmqAkaoZKiVAOEEVVEK2qKezQQxizigR/ATW/V8aFtp9VeZg 7+v5WCM5QvHCG9VwKO9pjSHx19VV1XeN+xIxITyarKuUpnvwlHsyuTOOvfbu2APAsxg1AqG6E3Gfz N1MMGn+keeLBDhA0cLMkMzFOimW4q83/xdw1FY2tDMZnPLXfnBje8BbaOb8QgF7/c4v1MUgG6ANRN ijtBw+vA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dbSZo-0001Pq-OF; Sat, 29 Jul 2017 14:18:44 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dbSZQ-00015w-31 for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2017 14:18:22 +0000 Received: by mail-lf0-x243.google.com with SMTP id x16so11676386lfb.4 for ; Sat, 29 Jul 2017 07:17:58 -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=lW6rjxs1oWjRADwRkAgrkdgBDq0jV4m6XK5B/7FomtyeSOOAVlXr1hufi8/RkkWbfm 3rNb2PcuLvWvhf1EWi7BOcsHpsLOhM51/A6ia+GCRMwZw+oLGsbaTvCBpv5jT3rMEEpp Y5OTdNHFSHeTZ/6WSN/zgE7l9zgROpqhG8Vfqg4RPdhx9gyT6L0YyJAKCO2CFjzs7/DT f+IuumsGYuyz5xHvKsJlfqJGjmig+JiaDuiLT2P3GIMF7F8xZGqeB3des3/8QDgAk7A9 l7vAZSGV54OUPio6Oi2/aQxnkm5rnIShG3BfZHYzK5U20xjJVkx5lw/JU/CsHKZ0H1en bS2A== X-Gm-Message-State: AIVw113BL959tkaeGXQmo5NVUEQRqcha9if6kQkZxmMNmHcQy9J+5nei 7X3o3c/RTZb7PA== 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 Subject: [PATCH v3 01/12] ASoC: sun4i-i2s: Extend quirks scope 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170729_071820_322862_46905AA9 X-CRM114-Status: GOOD ( 14.64 ) 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: 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 MIME-Version: 1.0 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 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");