From patchwork Wed Sep 13 17:57:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9951783 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 C7F1960360 for ; Wed, 13 Sep 2017 17:58:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B78DE28CD4 for ; Wed, 13 Sep 2017 17:58:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC4BA28CDA; Wed, 13 Sep 2017 17:58:28 +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=0.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB,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 D351E28CD4 for ; Wed, 13 Sep 2017 17:58:27 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 137E8266ED0; Wed, 13 Sep 2017 19:58:14 +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 9A4EA266ED0; Wed, 13 Sep 2017 19:58:12 +0200 (CEST) Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by alsa0.perex.cz (Postfix) with ESMTP id A3BCA266EBE for ; Wed, 13 Sep 2017 19:58:07 +0200 (CEST) Received: by mail-io0-f193.google.com with SMTP id j26so992294iod.0 for ; Wed, 13 Sep 2017 10:58:07 -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=wxxgAqmjdzxcBEnS3qaiAjN8ufrE4nl9f564ehFUi3E=; b=OIHCnr21l1XuxK3QLMHId4g+ey2e3pPBBFhEJGw4P5KuulQpjBMBaSHF7mD0IRfV0R Gi38HPZWNoeZ4z+vaIpHIIOEDYxofzXkJ9b1GJZgiHkZDiDZbArhh6j7Jn0reqjYWdSx JzY3hkCNBCdNMCsfNMLNrKmrRZ+JUqAuwVggktD+mxNZM3lnAxspcItf4XyiOS7OcJkN fF0OWHRioXUxkTv4jtL5og36DN/biJ4T4Fjk7J5WObMoq18hStWPdbhbMIdnCPvsch5x DoKoLoL8Y4VmyiD+o5Nchi5/qtLhoUqTdgUhnoOGd8Ti0saPn96/JIMAZEH7DvJcPtOK 332A== 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=wxxgAqmjdzxcBEnS3qaiAjN8ufrE4nl9f564ehFUi3E=; b=JZD/xlhd0zbqLhhIkiEmrowNplczPksYuSu9ZpUv/Dwkn8Hoqyq4XuFVKVE1ePhUuY LOz058DupUt/lgt9TAuU4LofQCc/hGkDKeLQE4qaa2DWlVYiRZyyYekxDMTWqHwJ+cxg fLCRz/rfHm/53uXG6EXE64dGOlvZDTN6mkl0gU5eFLFU+IG9M/Y0P9nptDHUnGz3NKWr EjvV2P0wQ1Qrju5/RoTxj32OW6d1gooHJdY1ON9oaSMIRHUHw/ZWrP2zySs/gl3TsNT7 csr6cqSJDjaQnsx0i3Wrmey4EVQYv6Wsg/O4T6vZK/KrYg964w5Z32AaNr5/C6TrvmRl 8qww== X-Gm-Message-State: AHPjjUiSh64IDyMsJEs1YUreyr0hp9yUpvDmNvuxAwII9NS2R2iYcvkK CTOeR5JtpJ78FS8e X-Google-Smtp-Source: AOwi7QCNCZT4XNIHfWJr+AxBQeQVDUExId2Y5ChT6EH1XM01Ut/jNJUXFfdq3bxM/NyxqITSPq2wRg== X-Received: by 10.107.158.213 with SMTP id h204mr5320088ioe.256.1505325486330; Wed, 13 Sep 2017 10:58:06 -0700 (PDT) Received: from cm.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id a189sm1119690itd.21.2017.09.13.10.58.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 10:58:05 -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: Wed, 13 Sep 2017 13:57:50 -0400 Message-Id: <1505325475-22602-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1505325475-22602-1-git-send-email-alexander.deucher@amd.com> References: <1505325475-22602-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,