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: 9806897 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 164C660349 for ; Fri, 23 Jun 2017 16:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 056FC28524 for ; Fri, 23 Jun 2017 16:35:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE3CF28794; Fri, 23 Jun 2017 16:35:22 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 81F7728524 for ; Fri, 23 Jun 2017 16:35:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 034A16E11C; Fri, 23 Jun 2017 16:35:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5EF8D6E0EF; Fri, 23 Jun 2017 16:35:16 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id 16so6867264qkg.2; 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=DX+CbljbvjBqlRl6geKJJtP2OyIuaBsU8XOOcUGbYKpRAoLWfwr31rh5/kmGakpyDz hJPwBlSD97BTCA8K7XXq7/5GSWF9fgHH0FrdHrbQy+xmmpfAlSVLSu/f6HLUzJcwo8Ga WBpeax48nyDbUK9vKexLc4P/rHWGZAH0grFSm6dCPKJCTDPmaG8cFtOXEh0x0n7XO0xE knxltE+HrLWPPScQsr5xVBGmJ+G2JU89B9RnkLVi9Eqj9IXY52Kio/47FImAwp5lpb9c AgQdXaHBbMQoWdU/X965i0Lri2RDXXacVCP+e6r28gWSdSdLGiXTxaFZuuW9CIiC7XVg mr5Q== X-Gm-Message-State: AKS2vOzdAIA1DWuoIV7nUyIfbr1A+kf6HSUTm/JMQ7efgk9CCUt6/Cqe jNK2dUd/FaEujLNK 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 Subject: [PATCH 1/8] drm/amd/amdgpu: Added asic_type as ACP DMA driver platform data 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: Alex Deucher , lgirdwood@gmail.com, perex@perex.cz X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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,