From patchwork Fri Jun 23 16:34:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9806913 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 5243260349 for ; Fri, 23 Jun 2017 16:35:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4141928524 for ; Fri, 23 Jun 2017 16:35:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3590328794; Fri, 23 Jun 2017 16:35:42 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 93D4228524 for ; Fri, 23 Jun 2017 16:35:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 12FAE26750E; Fri, 23 Jun 2017 18:35:23 +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 B5ACE267502; Fri, 23 Jun 2017 18:35:18 +0200 (CEST) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by alsa0.perex.cz (Postfix) with ESMTP id 8E86B267501 for ; Fri, 23 Jun 2017 18:35:16 +0200 (CEST) Received: by mail-qk0-f195.google.com with SMTP id p21so6870327qke.0 for ; Fri, 23 Jun 2017 09:35:16 -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=zmD6KCdfKpqBnlTc+KG+sBCJNgu/NpKuiqbPZtM46r0=; b=ipHpLXyKEJVq9bAjD8QowOvu+7T2CPuAtLjL6LcDBE6qnURoRfzlNDEVnZ/L5lqCFg DItHZZfjAcsbPCgKXWPNKd712Oju1v8CukoPnvF/kiKjqdk9MOLJBktOjfyYMc/pXVOx OZn7V+RmMlLw4VfrQySY7uvOsD1cG6xvzxRt5OS6feOfaP3A6WN/Vm4uDLagbdSaTZ1K OZGVPvv26BKivQxKIiCgflN+5wroHAoFCsWVkpotHMr89SYgb2baIvkoGVuCyYsYBgbg +ZCMp/crQA9bIJZjlKoRba8EGE9D+UtT52UIWyqN59lHeyKwPVq7ifkhQgYO+A4wkLq1 Qs0A== 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=zmD6KCdfKpqBnlTc+KG+sBCJNgu/NpKuiqbPZtM46r0=; b=dJLU4ozZgHxl+H4CYTXmqiUYTCexdlZLX8vHOdrLy/ClOlDyazJuf7jz3oC77Jj6Ub x0PBSs5lIsN2wlEz7GbElGkE2pZKswQ39fnBjOHq+S9PYi0EfJ+oirgg1BOgN9q5c1DH udCQTh/YPnhaq9WjiNWspqE8Yr8poIURqv3UTNKxmf89/obmgv38Sar5SbbzndqtY7o0 OUZYZLgbhPxOmlxSpRbSINUkKIYYF0ehW16WXFz0LOPbOCd5sGpKP6H0wPIyt1nnfsos eySdnSyUP3w/Bkn8JtcYU4zIIDzx0bXNgEHNoDx94hdbTmqDWz/Ea4PMmjfIZRShMm1S NFXQ== X-Gm-Message-State: AKS2vOxhDUN2EnexMfTtl9xMQ8068n/d8n4ooQxRD4u+MVvhalZJ91yw fX74Bfsa1tApmg== X-Received: by 10.55.141.67 with SMTP id p64mr10960203qkd.164.1498235715366; Fri, 23 Jun 2017 09:35:15 -0700 (PDT) Received: from cm.localdomain (va-67-76-166-195.sta.embarqhsd.net. [67.76.166.195]) by smtp.gmail.com with ESMTPSA id 5sm3793284qkr.27.2017.06.23.09.35.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 09:35:14 -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 Date: Fri, 23 Jun 2017 12:34:59 -0400 Message-Id: <1498235706-31111-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1498235706-31111-1-git-send-email-alexander.deucher@amd.com> References: <1498235706-31111-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Alex Deucher , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 1/8] 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. We need this to determine whether the asic is Carrizo (CZ) or Stoney (ST) in the acp sound driver. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 ++++ sound/soc/amd/acp-pcm-dma.c | 8 ++------ sound/soc/amd/acp.h | 7 +++++++ 3 files changed, 13 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..7a2a765 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -262,6 +262,7 @@ static int acp_hw_init(void *handle) uint64_t acp_base; struct device *dev; struct i2s_platform_data *i2s_pdata; + u32 asic_type; struct amdgpu_device *adev = (struct amdgpu_device *)handle; @@ -271,6 +272,7 @@ static int acp_hw_init(void *handle) if (!ip_block) return -EINVAL; + asic_type = adev->asic_type; r = amd_acp_hw_init(adev->acp.cgs_device, ip_block->version->major, ip_block->version->minor); /* -ENODEV means board uses AZ rather than ACP */ @@ -355,6 +357,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 = &asic_type; + adev->acp.acp_cell[0].pdata_size = sizeof(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,