From patchwork Fri Aug 18 18:10:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9909715 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 F2B8F60385 for ; Fri, 18 Aug 2017 18:11:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAB2028D38 for ; Fri, 18 Aug 2017 18:11:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFDEA28D3A; Fri, 18 Aug 2017 18:11:03 +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 1FB9728D39 for ; Fri, 18 Aug 2017 18:11:03 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9BEF1267834; Fri, 18 Aug 2017 20:10:45 +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 066C5267833; Fri, 18 Aug 2017 20:10:44 +0200 (CEST) Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by alsa0.perex.cz (Postfix) with ESMTP id CF6E2266C2E for ; Fri, 18 Aug 2017 20:10:40 +0200 (CEST) Received: by mail-qt0-f195.google.com with SMTP id v49so2772118qtc.4 for ; Fri, 18 Aug 2017 11:10:40 -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=P5fzMZZKzSgLCHHeReh72jm7LpaxdUK3F0L6iVspGco=; b=H3UmarBApUwIvR6GE2YtsgOA2h4tVRLhESmgA5wcEev+uX+ploYTCFF1cXPSEB2xst 0qG5RTzoTRBLTOYuwG1uBf9w3RwaQUtLAhsSiN2vULZPh4ttrg4CvznSc6MpCQoRFq/h 0bWwyDEy9HA5GU9iIH/TibVmg5LTqnGxBY7nFdR4rnE5piEafQrCOAlNL7R3f29GGnZg GVir5pr7GZLbG0rBieXJNTeFJsa7sK7vv+uaHzXxITMUMIBMH+TDuoLqE8SXL9FYHetc 2X3wA37MCQ/dtWJGa+vku0L/+hbxEauhUdQCv3zyPrbdbz4N7AH1MGr9pR9iS4bm/o0p iHUw== 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=P5fzMZZKzSgLCHHeReh72jm7LpaxdUK3F0L6iVspGco=; b=MM1kIvpiyO3KcqwdVsqXwew1NzV5CRbatJPkM1GT3alWqsR8GhY4Tj2kWUa+YyRNGE GBBfygIqsPeWK3dZoOJRZd2gXKtlXSXXB5t8oWJCCzAZV8C1GpNe38+hAEulOmz0P4/Y FeKAfpewyUHhQoJhQuXlNTzCniiGtnIeOC1TFdA6hQXG6ShD9/HrsAaY4FR3G9A25oOe Tk8LWr0TzYkpnn7CZ9wZLV5Rbkd9OCMFna+ZmQ9mpOcDki3NTQU8RBpt4Oi3o6RBljIh 2CHyrutGwfX/aUkhZv8aHpCyeoH6lVKNd/Gq/vrr6CLfDbJ/zdnlEby4prIsHgwwr18y ytTQ== X-Gm-Message-State: AHYfb5hgYW/UkNj/S0XNFPRH2FkoPee658H+HuDMvn992ash0ZE9vfqK MdHJTQgMsvv27A== X-Received: by 10.237.34.204 with SMTP id q12mr13081053qtc.292.1503079839395; Fri, 18 Aug 2017 11:10:39 -0700 (PDT) Received: from cm.localdomain (va-67-233-122-109.dhcp.embarqhsd.net. [67.233.122.109]) by smtp.gmail.com with ESMTPSA id h5sm4343562qth.19.2017.08.18.11.10.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Aug 2017 11:10:38 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, airlied@gmail.com, alsa-devel@alsa-project.org, broonie@kernel.org, Vijendar.Mukunda@amd.com, rajeevkumar.linux@gmail.com, perex@perex.cz Date: Fri, 18 Aug 2017 14:10:25 -0400 Message-Id: <1503079830-16072-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1503079830-16072-1-git-send-email-alexander.deucher@amd.com> References: <1503079830-16072-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Alex Deucher , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 1/6 v3] drm/amd/amdgpu: Added asic_type as ACP DMA driver 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: , 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: Vijendar Mukunda asic_type information is passed to ACP DMA Driver as platform data. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- v2: Removed asic_type local variable and directly passing asic_type instance to ACP DMA driver as platform data. v3: Add R-b, resend. drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 ++ sound/soc/amd/acp-pcm-dma.c | 8 ++------ sound/soc/amd/acp.h | 7 +++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index a52795d..ebca223 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -371,6 +371,8 @@ static int acp_hw_init(void *handle) adev->acp.acp_cell[0].name = "acp_audio_dma"; adev->acp.acp_cell[0].num_resources = 4; adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0]; + adev->acp.acp_cell[0].platform_data = &adev->asic_type; + adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type); adev->acp.acp_cell[1].name = "designware-i2s"; adev->acp.acp_cell[1].num_resources = 1; diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 08b1399..dcbf997 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -73,12 +73,6 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = { .periods_max = CAPTURE_MAX_NUM_PERIODS, }; -struct audio_drv_data { - struct snd_pcm_substream *play_stream; - struct snd_pcm_substream *capture_stream; - void __iomem *acp_mmio; -}; - static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg) { return readl(acp_mmio + (reg * 4)); @@ -916,6 +910,7 @@ static int acp_audio_probe(struct platform_device *pdev) int status; struct audio_drv_data *audio_drv_data; struct resource *res; + const u32 *pdata = pdev->dev.platform_data; audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data), GFP_KERNEL); @@ -932,6 +927,7 @@ static int acp_audio_probe(struct platform_device *pdev) audio_drv_data->play_stream = NULL; audio_drv_data->capture_stream = NULL; + audio_drv_data->asic_type = *pdata; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index 330832e..28cf914 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -84,6 +84,13 @@ struct audio_substream_data { void __iomem *acp_mmio; }; +struct audio_drv_data { + struct snd_pcm_substream *play_stream; + struct snd_pcm_substream *capture_stream; + void __iomem *acp_mmio; + u32 asic_type; +}; + enum { ACP_TILE_P1 = 0, ACP_TILE_P2,