From patchwork Fri Jul 28 19:31:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9869303 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 0BC5F60382 for ; Fri, 28 Jul 2017 19:32:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0176A288E5 for ; Fri, 28 Jul 2017 19:32:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA866288F4; Fri, 28 Jul 2017 19:32:38 +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 2C9A9288E5 for ; Fri, 28 Jul 2017 19:32:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 096B6266C52; Fri, 28 Jul 2017 21:31:57 +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 99403266C42; Fri, 28 Jul 2017 21:31:55 +0200 (CEST) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by alsa0.perex.cz (Postfix) with ESMTP id 772B02669CD for ; Fri, 28 Jul 2017 21:31:49 +0200 (CEST) Received: by mail-qt0-f196.google.com with SMTP id d10so12318835qtb.4 for ; Fri, 28 Jul 2017 12:31:48 -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=2RcRIPDv6ZZb2OM0LPNjCQK80/NXaiRdmYMtXrluGkY=; b=jwwlDkmptY/bFpouZ5TsBb1vzo4C0GiWHeH7HGf7FBIGvXlzwmSNnvax8JfFmQYF9v T5XBIjMCm4r6jF2xHeFwC3/7BssMUW2HXbYaOzRVkN3yLemDlGCp4t3IfsUf7uos6NLJ 3VWnkTSCp9wp/NHMvtk17B4vVXBT5SmsNuCNecvmTQg7GnMD5mw4nk/Hyg/YgVvARvXH 05Uf8q5adoN/iqtDx8DjAhVe5QSlo8Z/0yIJ0M3rbdDgZliYDyo//nunqDxAeSEXYryN 88FJL+M5tGzLktfx9WbO2ywP2BK0+Dt+8JPSeBDvAc3qTbeoUCNkZsG9VQJWehbj6rKs 2pag== 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=2RcRIPDv6ZZb2OM0LPNjCQK80/NXaiRdmYMtXrluGkY=; b=YaBWRe1CNVrFUzDUAVi2XD2PbBizB77lB+1LTmkrhi23XI8hkh0qMa0YQcCHG9DxtQ YaQl7BUSLO5Ra5czDA9h6dQpHu+hi8J5nBAWWgRksbisDTKQ+t341WDMEm4CJCRK0Ng1 3G6Z6FzXIFqBnSEXSMbYBCNvsTn+Zbn6wkzqSfM8Px+kfE4/JDZZZHGck9Mbjlgt6eO1 SV5g0EpqS+SFtUJSQ+PUCUQPFv5d8R7o6C9C057d/NgRX0/jF/lZQJwU3Ueey6BtIWj2 DmEHNocc9NUP5tEEld+s9FZLGtUx3r8fYui5yhrCuZFjXZKkOhJQPR9+Vunhg9hNkk5G D5ew== X-Gm-Message-State: AIVw113joffQNOXiNwkgjHz5y7Q6JGvuTq8OKSfDMjxYYhbslHRe+ZxM CcvzimCQwf/CkA== X-Received: by 10.200.12.3 with SMTP id k3mr11596092qti.13.1501270308326; Fri, 28 Jul 2017 12:31:48 -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 j21sm16189153qtc.17.2017.07.28.12.31.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 12:31:47 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, airlied@gmail.com, broonie@kernel.org, Vijendar.Mukunda@amd.com, rajeevkumar.linux@gmail.com, perex@perex.cz Date: Fri, 28 Jul 2017 15:31:27 -0400 Message-Id: <1501270294-31153-3-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1501270294-31153-1-git-send-email-alexander.deucher@amd.com> References: <1501270294-31153-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Alex Deucher , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 2/9 v2] 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. Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher Reviewed-by: Alex Deucher --- v2:Removed asic_type local variable and directly passing asic_type instance to ACP DMA driver as platform data. 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 06879d1..0fa8122 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -355,6 +355,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,