From patchwork Thu Oct 8 16:12:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 7354041 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A108BEEA4 for ; Thu, 8 Oct 2015 16:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C193207E7 for ; Thu, 8 Oct 2015 16:14:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 18EA8207E1 for ; Thu, 8 Oct 2015 16:14:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id EAEC3266881; Thu, 8 Oct 2015 18:14:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1F702264F34; Thu, 8 Oct 2015 18:13:08 +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 872A02667D0; Thu, 8 Oct 2015 18:13:07 +0200 (CEST) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.53]) by alsa0.perex.cz (Postfix) with ESMTP id 387DD264F31 for ; Thu, 8 Oct 2015 18:12:55 +0200 (CEST) Received: by qgez77 with SMTP id z77so46245570qge.1 for ; Thu, 08 Oct 2015 09:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r/UlSpuBnU/QffHipdYd+Xzxj9htYzJaMEP1lLs51RA=; b=HbesnkcbUeJcoBlgPumT6e1gQI/mgZwLUp6S2z5zgorlIX3LWOn8ZNzvQBvseAZikN kdf/WJ0Uwe38zA3HTKWnpLrTMo+ZELYKoXaqhJXBcjdD2asowgUd9oSWWSdB2cMDUjrQ hdi4qMqAidOI1oS+qoFygShZcghfjquiSWmSjFA5cRERjK2SZ8Ynvk2iseh/HWVlgw6P mRbUAA807BD4Pu64bYHRnucyVXToJpdOUEHIGnVcSycv+AOk3GZL8KS3StMc/hxl+rcf 1LDrs9+7JYPcJDj+fcD5c+9/tnnHtml1zk1u6KrkPkbcuDJphS6ndTtthKX3csrFBlOf cO6Q== X-Received: by 10.140.148.204 with SMTP id 195mr9789162qhu.6.1444320774467; Thu, 08 Oct 2015 09:12:54 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id s52sm18960467qge.19.2015.10.08.09.12.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2015 09:12:54 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: broonie@kernel.org, airlied@gmail.com, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org, maruthi.bayyavarapu@amd.com, rajeevkumar.linux@gmail.com Date: Thu, 8 Oct 2015 12:12:36 -0400 Message-Id: <1444320760-21936-4-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1444320760-21936-1-git-send-email-alexander.deucher@amd.com> References: <1444320760-21936-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Maruthi Srinivas Bayyavarapu , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 3/8] ASoC : dwc : add quirk for dwc controller instances 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: Maruthi Srinivas Bayyavarapu Added a qurik to assign different base addresses for different dwc controllers present on platform for playback and capture. Signed-off-by: Maruthi Bayyavarapu --- include/sound/designware_i2s.h | 3 +++ sound/soc/dwc/designware_i2s.c | 26 +++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h index 8966ba7..48c8210 100644 --- a/include/sound/designware_i2s.h +++ b/include/sound/designware_i2s.h @@ -45,6 +45,9 @@ struct i2s_platform_data { u32 snd_fmts; u32 snd_rates; + #define DW_I2S_QUIRK_MULTI_DWC (1 << 0) + unsigned int quirks; + void *play_dma_data; void *capture_dma_data; bool (*filter)(struct dma_chan *chan, void *slave); diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 374a83e..fd18a0e 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -94,6 +94,7 @@ struct dw_i2s_dev { struct clk *clk; int active; unsigned int capability; + unsigned int quirks; struct device *dev; /* data related to DMA transfers b/w i2s and DMAC */ @@ -176,9 +177,20 @@ static void i2s_stop(struct dw_i2s_dev *dev, } } - if (!dev->active) { - i2s_write_reg(dev->i2s_pbase, CER, 0); - i2s_write_reg(dev->i2s_pbase, IER, 0); + if (dev->quirks & DW_I2S_QUIRK_MULTI_DWC) { + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + i2s_write_reg(dev->i2s_pbase, CER, 0); + i2s_write_reg(dev->i2s_pbase, IER, 0); + } else { + i2s_write_reg(dev->i2s_cbase, CER, 0); + i2s_write_reg(dev->i2s_cbase, IER, 0); + } + + } else { + if (!dev->active) { + i2s_write_reg(dev->i2s_pbase, CER, 0); + i2s_write_reg(dev->i2s_pbase, IER, 0); + } } } @@ -599,6 +611,7 @@ static int dw_i2s_probe(struct platform_device *pdev) if (pdata) { dev->capability = pdata->cap; + dev->quirks = pdata->quirks; clk_id = NULL; ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); } else { @@ -608,6 +621,13 @@ static int dw_i2s_probe(struct platform_device *pdev) if (ret < 0) return ret; + if (dev->quirks & DW_I2S_QUIRK_MULTI_DWC) { + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); + dev->i2s_cbase = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(dev->i2s_cbase)) + return PTR_ERR(dev->i2s_cbase); + } + if (dev->capability & DW_I2S_MASTER) { if (pdata) { dev->i2s_clk_cfg = pdata->i2s_clk_cfg;