From patchwork Wed Nov 18 13:29:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7649151 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7467F9F1D3 for ; Wed, 18 Nov 2015 13:30:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E23520499 for ; Wed, 18 Nov 2015 13:30:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7BF2A2062A for ; Wed, 18 Nov 2015 13:30:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B77CD26586A; Wed, 18 Nov 2015 14:30:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BA05B265473; Wed, 18 Nov 2015 14:30:19 +0100 (CET) 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 55DD12654B0; Wed, 18 Nov 2015 14:30:18 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by alsa0.perex.cz (Postfix) with ESMTP id 4A595260A5D for ; Wed, 18 Nov 2015 14:30:11 +0100 (CET) Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0M4muv-1aI3Wf1XQL-00yuoA; Wed, 18 Nov 2015 14:30:00 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Date: Wed, 18 Nov 2015 14:29:55 +0100 Message-ID: <5998295.uG2eFL3eef@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <4029229.ZxVVfeA0q2@wuerfel> References: <6346833.MfUC71I3uD@wuerfel> <4020501.kQLt6nnIEv@wuerfel> <4029229.ZxVVfeA0q2@wuerfel> MIME-Version: 1.0 X-Provags-ID: V03:K0:9JHam2Nx4NfqS8R3HJ6okKYf363PO+X7GOn/N4sa2/9Yvkcskn/ GMuVpiwEP5H8+CjB+AeX5gnI7Sc+Ko9EuhQ4TAbKAay2MT5C6TttIDt3PX6nvf05FmlELcH 6xHB4roRRPFebgI5yNXaM4gm8Cv3LCcCD2ywpILGWn0F8qMY01wSRBKO7F4zr1u8ADqBYUy j1QrHOR4AFtekRQTAzdnQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:9I+y3bSldHE=:54t+QAEpB7sv7TjP1fdrYt 7Vue+w78qpjBUjz/jq1+f5A1T3D78GX7j+DFtcGIWVc//wYTT3ebDlcKcjcSCllKwQJfHPuwq SJfu+LrxWch82f+NE/ehuAn/mj4liPrDfRBbVVYS5vjNK2+WVDD5aY1Hsiau5c+tievcsAGjW XWojBN80iVB6rAAm+YgX/QmSmaEaU9qd22T0zREc5jfYVCFZevMxLQZD+XDBypPnc7rmUZ1yt PLK3vPQhiUSMf9VGoFZEjRh26CE9g1K/ix53XulN53wCca5ehDDVNgYCVgg+rsDJUyxvkGp0H v5MuxKaeSEzjO1zQn1Swxhq6a9VGjvjibZFayywuEwtaTpStLBDgVofx+ESxhLcaSVDohnN/N B5VIrujBqwtK04G7rAwF/AS06NIFi/KF8tNFbtZT41ESAFZpnkOiJJ6CSSxwWlKiRagHHYYYo j/Jm9UKjffwJyr3oKQ0m9lBchhz3d0GxAS7JCvEVvI0Gvdk7IWaaWvj7uhNB95jBygtGyOVHG szYrpu8K/rsqO0Z2nYeBgFLzDScHWSBvWoy8mmZ9XiQYANKgOd3Fmzjur24Ao1+ymd6i+tUeA 8AQylgk0H0dD3zctxZXJqniK6Zw7QhpjW/2UGXP9zq2y+rtPbLJHepNY90j0yJznzwOcfu0F9 hcBMm0XAWkmf//2m6sOTopLKL73rMJXBk5xl43nz1GewLzRtI7U0z7ZtCFNLEw1elJIPE5RW8 Dk1Ho5q9JAhkeJZa Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Heiko Stuebner , Liam Girdwood , Sangbeom Kim , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Vinod Koul , Mark Brown , Kukjin Kim Subject: [alsa-devel] [PATCH v3 2/3] ASoC: s3c24xx-i2s: pass DMA channels as platform data 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This is a minor cleanup to make the s3c2412-i2s and s3c24xx-i2s drivers independent of the mach/dma.h header file and to allow removing the dependency on the specific dmaengine driver in the next patch. As a side not, only the s3c24xx-i2s driver seems to still be used, while the definition of the s3c2412-i2s platform device was removed in commit 6d259a25b56d ("ARM: SAMSUNG: use static declaration when it is not used in other files") after it had never been referenced since its introduction in f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support"). Apparently it should have been used by mach-jive.c, but that never happened. My patch at this point leaves the current state unchanged, we can decide whether to fix or delete the jive driver and s3c2412-i2s another time. Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski --- v3: fix typo in s3c24xx-i2s.c v2: check for NULL pdata diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 9c03b0e83bd5..1c2582f4b587 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -571,6 +571,11 @@ static struct resource s3c_iis_resource[] = { [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS), }; +static struct s3c_audio_pdata s3c_iis_platdata = { + .dma_playback = (void *)DMACH_I2S_OUT, + .dma_capture = (void *)DMACH_I2S_IN, +}; + struct platform_device s3c_device_iis = { .name = "s3c24xx-iis", .id = -1, @@ -579,6 +584,7 @@ struct platform_device s3c_device_iis = { .dev = { .dma_mask = &samsung_device_dma_mask, .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &s3c_iis_platdata, } }; #endif /* CONFIG_PLAT_S3C24XX */ diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 77d27c85a32a..105317f523f2 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -33,14 +33,14 @@ #include "regs-i2s-v2.h" #include "s3c2412-i2s.h" +#include + static struct s3c_dma_params s3c2412_i2s_pcm_stereo_out = { - .slave = (void *)(uintptr_t)DMACH_I2S_OUT, .ch_name = "tx", .dma_size = 4, }; static struct s3c_dma_params s3c2412_i2s_pcm_stereo_in = { - .slave = (void *)(uintptr_t)DMACH_I2S_IN, .ch_name = "rx", .dma_size = 4, }; @@ -152,6 +152,12 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev) { int ret = 0; struct resource *res; + struct s3c_audio_pdata *pdata = dev_get_platdata(&pdev->dev); + + if (!pdata) { + dev_err(&pdev->dev, "missing platform data"); + return -ENXIO; + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); s3c2412_i2s.regs = devm_ioremap_resource(&pdev->dev, res); @@ -159,7 +165,9 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev) return PTR_ERR(s3c2412_i2s.regs); s3c2412_i2s_pcm_stereo_out.dma_addr = res->start + S3C2412_IISTXD; + s3c2412_i2s_pcm_stereo_out.slave = pdata->dma_playback; s3c2412_i2s_pcm_stereo_in.dma_addr = res->start + S3C2412_IISRXD; + s3c2412_i2s_pcm_stereo_in.slave = pdata->dma_capture; ret = s3c_i2sv2_register_component(&pdev->dev, -1, &s3c2412_i2s_component, diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 9da3a77ea2c7..9e6a5bc012e3 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -31,14 +31,14 @@ #include "dma.h" #include "s3c24xx-i2s.h" +#include + static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_out = { - .slave = (void *)(uintptr_t)DMACH_I2S_OUT, .ch_name = "tx", .dma_size = 2, }; static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_in = { - .slave = (void *)(uintptr_t)DMACH_I2S_IN, .ch_name = "rx", .dma_size = 2, }; @@ -454,6 +454,12 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) { int ret = 0; struct resource *res; + struct s3c_audio_pdata *pdata = dev_get_platdata(&pdev->dev); + + if (!pdata) { + dev_err(&pdev->dev, "missing platform data"); + return -ENXIO; + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -465,7 +471,9 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) return PTR_ERR(s3c24xx_i2s.regs); s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO; + s3c24xx_i2s_pcm_stereo_out.slave = pdata->dma_playback; s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO; + s3c24xx_i2s_pcm_stereo_in.slave = pdata->dma_capture; ret = devm_snd_soc_register_component(&pdev->dev, &s3c24xx_i2s_component, &s3c24xx_i2s_dai, 1);