aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-11-13 14:53:39 -0500
committerDave Airlie <airlied@redhat.com>2017-11-13 14:53:39 -0500
commitfc150d6bba8f446f77732cf27b09a7e646c25771 (patch)
tree8673983d58196869d9063cd1ebedd1ead6dd4136
parentecc325bb76707370cfa6f34ef8574c7ee7577a23 (diff)
parentf674bd281460451e8784f3bc917a650e8937a8ed (diff)
Merge branch 'linus-4.14-rc4-acp-prereq' of git://people.freedesktop.org/~agd5f/linux into drm-next
This is a shared tree between drm and audio for some amd bits. * 'linus-4.14-rc4-acp-prereq' of git://people.freedesktop.org/~agd5f/linux: drm/amdgpu Moving amdgpu asic types to a separate file ASoC: AMD: Added asic_type as ACP DMA driver platform data drm/amd/amdgpu: Added asic_type as ACP DMA driver platform data
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c2
-rw-r--r--drivers/gpu/drm/amd/include/amd_shared.h29
-rw-r--r--include/drm/amd_asic_type.h52
-rw-r--r--sound/soc/amd/acp-pcm-dma.c8
-rw-r--r--sound/soc/amd/acp.h7
5 files changed, 65 insertions, 33 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index 023bfdb3e63f..c04f44a90392 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -382,6 +382,8 @@ static int acp_hw_init(void *handle)
382 adev->acp.acp_cell[0].name = "acp_audio_dma"; 382 adev->acp.acp_cell[0].name = "acp_audio_dma";
383 adev->acp.acp_cell[0].num_resources = 4; 383 adev->acp.acp_cell[0].num_resources = 4;
384 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0]; 384 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0];
385 adev->acp.acp_cell[0].platform_data = &adev->asic_type;
386 adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type);
385 387
386 adev->acp.acp_cell[1].name = "designware-i2s"; 388 adev->acp.acp_cell[1].name = "designware-i2s";
387 adev->acp.acp_cell[1].num_resources = 1; 389 adev->acp.acp_cell[1].num_resources = 1;
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index de6fc2731b98..b72f8a43d86b 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -23,36 +23,11 @@
23#ifndef __AMD_SHARED_H__ 23#ifndef __AMD_SHARED_H__
24#define __AMD_SHARED_H__ 24#define __AMD_SHARED_H__
25 25
26#define AMD_MAX_USEC_TIMEOUT 200000 /* 200 ms */ 26#include <drm/amd_asic_type.h>
27 27
28struct seq_file; 28struct seq_file;
29 29
30/* 30#define AMD_MAX_USEC_TIMEOUT 200000 /* 200 ms */
31 * Supported ASIC types
32 */
33enum amd_asic_type {
34 CHIP_TAHITI = 0,
35 CHIP_PITCAIRN,
36 CHIP_VERDE,
37 CHIP_OLAND,
38 CHIP_HAINAN,
39 CHIP_BONAIRE,
40 CHIP_KAVERI,
41 CHIP_KABINI,
42 CHIP_HAWAII,
43 CHIP_MULLINS,
44 CHIP_TOPAZ,
45 CHIP_TONGA,
46 CHIP_FIJI,
47 CHIP_CARRIZO,
48 CHIP_STONEY,
49 CHIP_POLARIS10,
50 CHIP_POLARIS11,
51 CHIP_POLARIS12,
52 CHIP_VEGA10,
53 CHIP_RAVEN,
54 CHIP_LAST,
55};
56 31
57/* 32/*
58 * Chip flags 33 * Chip flags
diff --git a/include/drm/amd_asic_type.h b/include/drm/amd_asic_type.h
new file mode 100644
index 000000000000..599028f66585
--- /dev/null
+++ b/include/drm/amd_asic_type.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2017 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __AMD_ASIC_TYPE_H__
24#define __AMD_ASIC_TYPE_H__
25/*
26 * Supported ASIC types
27 */
28enum amd_asic_type {
29 CHIP_TAHITI = 0,
30 CHIP_PITCAIRN,
31 CHIP_VERDE,
32 CHIP_OLAND,
33 CHIP_HAINAN,
34 CHIP_BONAIRE,
35 CHIP_KAVERI,
36 CHIP_KABINI,
37 CHIP_HAWAII,
38 CHIP_MULLINS,
39 CHIP_TOPAZ,
40 CHIP_TONGA,
41 CHIP_FIJI,
42 CHIP_CARRIZO,
43 CHIP_STONEY,
44 CHIP_POLARIS10,
45 CHIP_POLARIS11,
46 CHIP_POLARIS12,
47 CHIP_VEGA10,
48 CHIP_RAVEN,
49 CHIP_LAST,
50};
51
52#endif /*__AMD_ASIC_TYPE_H__ */
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 08b1399d1da2..dcbf9973884d 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 = {
73 .periods_max = CAPTURE_MAX_NUM_PERIODS, 73 .periods_max = CAPTURE_MAX_NUM_PERIODS,
74}; 74};
75 75
76struct audio_drv_data {
77 struct snd_pcm_substream *play_stream;
78 struct snd_pcm_substream *capture_stream;
79 void __iomem *acp_mmio;
80};
81
82static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg) 76static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg)
83{ 77{
84 return readl(acp_mmio + (reg * 4)); 78 return readl(acp_mmio + (reg * 4));
@@ -916,6 +910,7 @@ static int acp_audio_probe(struct platform_device *pdev)
916 int status; 910 int status;
917 struct audio_drv_data *audio_drv_data; 911 struct audio_drv_data *audio_drv_data;
918 struct resource *res; 912 struct resource *res;
913 const u32 *pdata = pdev->dev.platform_data;
919 914
920 audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data), 915 audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data),
921 GFP_KERNEL); 916 GFP_KERNEL);
@@ -932,6 +927,7 @@ static int acp_audio_probe(struct platform_device *pdev)
932 927
933 audio_drv_data->play_stream = NULL; 928 audio_drv_data->play_stream = NULL;
934 audio_drv_data->capture_stream = NULL; 929 audio_drv_data->capture_stream = NULL;
930 audio_drv_data->asic_type = *pdata;
935 931
936 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 932 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
937 if (!res) { 933 if (!res) {
diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h
index 330832ef4e5e..28cf9140f49c 100644
--- a/sound/soc/amd/acp.h
+++ b/sound/soc/amd/acp.h
@@ -84,6 +84,13 @@ struct audio_substream_data {
84 void __iomem *acp_mmio; 84 void __iomem *acp_mmio;
85}; 85};
86 86
87struct audio_drv_data {
88 struct snd_pcm_substream *play_stream;
89 struct snd_pcm_substream *capture_stream;
90 void __iomem *acp_mmio;
91 u32 asic_type;
92};
93
87enum { 94enum {
88 ACP_TILE_P1 = 0, 95 ACP_TILE_P1 = 0,
89 ACP_TILE_P2, 96 ACP_TILE_P2,