diff options
author | Slava Grigorev <slava.grigorev@amd.com> | 2014-12-22 17:26:51 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-01-22 10:38:59 -0500 |
commit | bfc1f97d8ac5d3dc6f7ded64ba9adbac371e912c (patch) | |
tree | a7d965803e57ca2736d37bbc1b6605fcb0d66f19 /drivers/gpu/drm/radeon | |
parent | 49ead33b9f0e0ba0b528951a05986486196848ef (diff) |
radeon/audio: consolidate audio_init() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/dce6_afmt.c | 54 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/ni.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_audio.c | 90 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_audio.h | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs690.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 3 |
14 files changed, 138 insertions, 105 deletions
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile index c58cfd3c3917..f9dab1cb85ba 100644 --- a/drivers/gpu/drm/radeon/Makefile +++ b/drivers/gpu/drm/radeon/Makefile | |||
@@ -81,7 +81,7 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ | |||
81 | rv770_smc.o cypress_dpm.o btc_dpm.o sumo_dpm.o sumo_smc.o trinity_dpm.o \ | 81 | rv770_smc.o cypress_dpm.o btc_dpm.o sumo_dpm.o sumo_smc.o trinity_dpm.o \ |
82 | trinity_smc.o ni_dpm.o si_smc.o si_dpm.o kv_smc.o kv_dpm.o ci_smc.o \ | 82 | trinity_smc.o ni_dpm.o si_smc.o si_dpm.o kv_smc.o kv_dpm.o ci_smc.o \ |
83 | ci_dpm.o dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.o radeon_mn.o \ | 83 | ci_dpm.o dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.o radeon_mn.o \ |
84 | radeon_sync.o | 84 | radeon_sync.o radeon_audio.o |
85 | 85 | ||
86 | # add async DMA block | 86 | # add async DMA block |
87 | radeon-y += \ | 87 | radeon-y += \ |
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index ed336fbfab7c..efbcd23e9c51 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "drmP.h" | 27 | #include "drmP.h" |
28 | #include "radeon.h" | 28 | #include "radeon.h" |
29 | #include "radeon_asic.h" | 29 | #include "radeon_asic.h" |
30 | #include "radeon_audio.h" | ||
30 | #include "cikd.h" | 31 | #include "cikd.h" |
31 | #include "atom.h" | 32 | #include "atom.h" |
32 | #include "cik_blit_shaders.h" | 33 | #include "cik_blit_shaders.h" |
@@ -8517,7 +8518,7 @@ static int cik_startup(struct radeon_device *rdev) | |||
8517 | return r; | 8518 | return r; |
8518 | } | 8519 | } |
8519 | 8520 | ||
8520 | r = dce6_audio_init(rdev); | 8521 | r = radeon_audio_init(rdev); |
8521 | if (r) | 8522 | if (r) |
8522 | return r; | 8523 | return r; |
8523 | 8524 | ||
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c index f312edf4d50e..a97fb22ed06a 100644 --- a/drivers/gpu/drm/radeon/dce6_afmt.c +++ b/drivers/gpu/drm/radeon/dce6_afmt.c | |||
@@ -277,11 +277,6 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder) | |||
277 | kfree(sads); | 277 | kfree(sads); |
278 | } | 278 | } |
279 | 279 | ||
280 | static int dce6_audio_chipset_supported(struct radeon_device *rdev) | ||
281 | { | ||
282 | return !ASIC_IS_NODCE(rdev); | ||
283 | } | ||
284 | |||
285 | void dce6_audio_enable(struct radeon_device *rdev, | 280 | void dce6_audio_enable(struct radeon_device *rdev, |
286 | struct r600_audio_pin *pin, | 281 | struct r600_audio_pin *pin, |
287 | u8 enable_mask) | 282 | u8 enable_mask) |
@@ -293,55 +288,6 @@ void dce6_audio_enable(struct radeon_device *rdev, | |||
293 | enable_mask ? AUDIO_ENABLED : 0); | 288 | enable_mask ? AUDIO_ENABLED : 0); |
294 | } | 289 | } |
295 | 290 | ||
296 | static const u32 pin_offsets[7] = | ||
297 | { | ||
298 | (0x5e00 - 0x5e00), | ||
299 | (0x5e18 - 0x5e00), | ||
300 | (0x5e30 - 0x5e00), | ||
301 | (0x5e48 - 0x5e00), | ||
302 | (0x5e60 - 0x5e00), | ||
303 | (0x5e78 - 0x5e00), | ||
304 | (0x5e90 - 0x5e00), | ||
305 | }; | ||
306 | |||
307 | int dce6_audio_init(struct radeon_device *rdev) | ||
308 | { | ||
309 | int i; | ||
310 | |||
311 | if (!radeon_audio || !dce6_audio_chipset_supported(rdev)) | ||
312 | return 0; | ||
313 | |||
314 | rdev->audio.enabled = true; | ||
315 | |||
316 | if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */ | ||
317 | rdev->audio.num_pins = 7; | ||
318 | else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */ | ||
319 | rdev->audio.num_pins = 3; | ||
320 | else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */ | ||
321 | rdev->audio.num_pins = 7; | ||
322 | else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */ | ||
323 | rdev->audio.num_pins = 6; | ||
324 | else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */ | ||
325 | rdev->audio.num_pins = 2; | ||
326 | else /* SI: 6 streams, 6 endpoints */ | ||
327 | rdev->audio.num_pins = 6; | ||
328 | |||
329 | for (i = 0; i < rdev->audio.num_pins; i++) { | ||
330 | rdev->audio.pin[i].channels = -1; | ||
331 | rdev->audio.pin[i].rate = -1; | ||
332 | rdev->audio.pin[i].bits_per_sample = -1; | ||
333 | rdev->audio.pin[i].status_bits = 0; | ||
334 | rdev->audio.pin[i].category_code = 0; | ||
335 | rdev->audio.pin[i].connected = false; | ||
336 | rdev->audio.pin[i].offset = pin_offsets[i]; | ||
337 | rdev->audio.pin[i].id = i; | ||
338 | /* disable audio. it will be set up later */ | ||
339 | dce6_audio_enable(rdev, &rdev->audio.pin[i], false); | ||
340 | } | ||
341 | |||
342 | return 0; | ||
343 | } | ||
344 | |||
345 | void dce6_audio_fini(struct radeon_device *rdev) | 291 | void dce6_audio_fini(struct radeon_device *rdev) |
346 | { | 292 | { |
347 | int i; | 293 | int i; |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 85995b4e3338..406ea8ee0852 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <drm/drmP.h> | 26 | #include <drm/drmP.h> |
27 | #include "radeon.h" | 27 | #include "radeon.h" |
28 | #include "radeon_asic.h" | 28 | #include "radeon_asic.h" |
29 | #include "radeon_audio.h" | ||
29 | #include <drm/radeon_drm.h> | 30 | #include <drm/radeon_drm.h> |
30 | #include "evergreend.h" | 31 | #include "evergreend.h" |
31 | #include "atom.h" | 32 | #include "atom.h" |
@@ -5286,7 +5287,7 @@ static int evergreen_startup(struct radeon_device *rdev) | |||
5286 | return r; | 5287 | return r; |
5287 | } | 5288 | } |
5288 | 5289 | ||
5289 | r = r600_audio_init(rdev); | 5290 | r = radeon_audio_init(rdev); |
5290 | if (r) { | 5291 | if (r) { |
5291 | DRM_ERROR("radeon: audio init failed\n"); | 5292 | DRM_ERROR("radeon: audio init failed\n"); |
5292 | return r; | 5293 | return r; |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index aea48c89b241..d2f10408c560 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <drm/drmP.h> | 27 | #include <drm/drmP.h> |
28 | #include "radeon.h" | 28 | #include "radeon.h" |
29 | #include "radeon_asic.h" | 29 | #include "radeon_asic.h" |
30 | #include "radeon_audio.h" | ||
30 | #include <drm/radeon_drm.h> | 31 | #include <drm/radeon_drm.h> |
31 | #include "nid.h" | 32 | #include "nid.h" |
32 | #include "atom.h" | 33 | #include "atom.h" |
@@ -2097,15 +2098,9 @@ static int cayman_startup(struct radeon_device *rdev) | |||
2097 | return r; | 2098 | return r; |
2098 | } | 2099 | } |
2099 | 2100 | ||
2100 | if (ASIC_IS_DCE6(rdev)) { | 2101 | r = radeon_audio_init(rdev); |
2101 | r = dce6_audio_init(rdev); | 2102 | if (r) |
2102 | if (r) | 2103 | return r; |
2103 | return r; | ||
2104 | } else { | ||
2105 | r = r600_audio_init(rdev); | ||
2106 | if (r) | ||
2107 | return r; | ||
2108 | } | ||
2109 | 2104 | ||
2110 | return 0; | 2105 | return 0; |
2111 | } | 2106 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index ef5d6066fa5b..de7878aef65c 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <drm/radeon_drm.h> | 33 | #include <drm/radeon_drm.h> |
34 | #include "radeon.h" | 34 | #include "radeon.h" |
35 | #include "radeon_asic.h" | 35 | #include "radeon_asic.h" |
36 | #include "radeon_audio.h" | ||
36 | #include "radeon_mode.h" | 37 | #include "radeon_mode.h" |
37 | #include "r600d.h" | 38 | #include "r600d.h" |
38 | #include "atom.h" | 39 | #include "atom.h" |
@@ -3054,7 +3055,7 @@ static int r600_startup(struct radeon_device *rdev) | |||
3054 | return r; | 3055 | return r; |
3055 | } | 3056 | } |
3056 | 3057 | ||
3057 | r = r600_audio_init(rdev); | 3058 | r = radeon_audio_init(rdev); |
3058 | if (r) { | 3059 | if (r) { |
3059 | DRM_ERROR("radeon: audio init failed\n"); | 3060 | DRM_ERROR("radeon: audio init failed\n"); |
3060 | return r; | 3061 | return r; |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index b90dc0eb08e6..96a26b0c435b 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -70,15 +70,6 @@ static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = { | |||
70 | { 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */ | 70 | { 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */ |
71 | }; | 71 | }; |
72 | 72 | ||
73 | |||
74 | /* | ||
75 | * check if the chipset is supported | ||
76 | */ | ||
77 | static int r600_audio_chipset_supported(struct radeon_device *rdev) | ||
78 | { | ||
79 | return ASIC_IS_DCE2(rdev) && !ASIC_IS_NODCE(rdev); | ||
80 | } | ||
81 | |||
82 | static struct r600_audio_pin r600_audio_status(struct radeon_device *rdev) | 73 | static struct r600_audio_pin r600_audio_status(struct radeon_device *rdev) |
83 | { | 74 | { |
84 | struct r600_audio_pin status; | 75 | struct r600_audio_pin status; |
@@ -192,29 +183,6 @@ void r600_audio_enable(struct radeon_device *rdev, | |||
192 | } | 183 | } |
193 | 184 | ||
194 | /* | 185 | /* |
195 | * initialize the audio vars | ||
196 | */ | ||
197 | int r600_audio_init(struct radeon_device *rdev) | ||
198 | { | ||
199 | if (!radeon_audio || !r600_audio_chipset_supported(rdev)) | ||
200 | return 0; | ||
201 | |||
202 | rdev->audio.enabled = true; | ||
203 | |||
204 | rdev->audio.num_pins = 1; | ||
205 | rdev->audio.pin[0].channels = -1; | ||
206 | rdev->audio.pin[0].rate = -1; | ||
207 | rdev->audio.pin[0].bits_per_sample = -1; | ||
208 | rdev->audio.pin[0].status_bits = 0; | ||
209 | rdev->audio.pin[0].category_code = 0; | ||
210 | rdev->audio.pin[0].id = 0; | ||
211 | /* disable audio. it will be set up later */ | ||
212 | r600_audio_enable(rdev, &rdev->audio.pin[0], 0); | ||
213 | |||
214 | return 0; | ||
215 | } | ||
216 | |||
217 | /* | ||
218 | * release the audio timer | 186 | * release the audio timer |
219 | * TODO: How to do this correctly on SMP systems? | 187 | * TODO: How to do this correctly on SMP systems? |
220 | */ | 188 | */ |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 5142bc97f6b6..6eacf410a45f 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -390,7 +390,6 @@ void r600_irq_suspend(struct radeon_device *rdev); | |||
390 | void r600_disable_interrupts(struct radeon_device *rdev); | 390 | void r600_disable_interrupts(struct radeon_device *rdev); |
391 | void r600_rlc_stop(struct radeon_device *rdev); | 391 | void r600_rlc_stop(struct radeon_device *rdev); |
392 | /* r600 audio */ | 392 | /* r600 audio */ |
393 | int r600_audio_init(struct radeon_device *rdev); | ||
394 | void r600_audio_fini(struct radeon_device *rdev); | 393 | void r600_audio_fini(struct radeon_device *rdev); |
395 | void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock); | 394 | void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock); |
396 | void r600_hdmi_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, | 395 | void r600_hdmi_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, |
@@ -680,7 +679,6 @@ void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable); | |||
680 | 679 | ||
681 | /* DCE6 - SI */ | 680 | /* DCE6 - SI */ |
682 | void dce6_bandwidth_update(struct radeon_device *rdev); | 681 | void dce6_bandwidth_update(struct radeon_device *rdev); |
683 | int dce6_audio_init(struct radeon_device *rdev); | ||
684 | void dce6_audio_fini(struct radeon_device *rdev); | 682 | void dce6_audio_fini(struct radeon_device *rdev); |
685 | 683 | ||
686 | /* | 684 | /* |
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c new file mode 100644 index 000000000000..cc835e2e0de5 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_audio.c | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * Copyright 2014 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 | * Authors: Slava Grigorev <slava.grigorev@amd.com> | ||
23 | */ | ||
24 | |||
25 | #include <drm/drmP.h> | ||
26 | #include "radeon.h" | ||
27 | |||
28 | void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin, | ||
29 | u8 enable_mask); | ||
30 | void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin, | ||
31 | u8 enable_mask); | ||
32 | |||
33 | static const u32 pin_offsets[7] = | ||
34 | { | ||
35 | (0x5e00 - 0x5e00), | ||
36 | (0x5e18 - 0x5e00), | ||
37 | (0x5e30 - 0x5e00), | ||
38 | (0x5e48 - 0x5e00), | ||
39 | (0x5e60 - 0x5e00), | ||
40 | (0x5e78 - 0x5e00), | ||
41 | (0x5e90 - 0x5e00), | ||
42 | }; | ||
43 | |||
44 | static int radeon_audio_chipset_supported(struct radeon_device *rdev) | ||
45 | { | ||
46 | return ASIC_IS_DCE2(rdev) && !ASIC_IS_NODCE(rdev); | ||
47 | } | ||
48 | |||
49 | int radeon_audio_init(struct radeon_device *rdev) | ||
50 | { | ||
51 | int i; | ||
52 | |||
53 | if (!radeon_audio || !radeon_audio_chipset_supported(rdev)) | ||
54 | return 0; | ||
55 | |||
56 | rdev->audio.enabled = true; | ||
57 | |||
58 | if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */ | ||
59 | rdev->audio.num_pins = 3; | ||
60 | else if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */ | ||
61 | rdev->audio.num_pins = 7; | ||
62 | else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */ | ||
63 | rdev->audio.num_pins = 7; | ||
64 | else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */ | ||
65 | rdev->audio.num_pins = 2; | ||
66 | else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */ | ||
67 | rdev->audio.num_pins = 6; | ||
68 | else if (ASIC_IS_DCE6(rdev)) /* SI: 6 streams, 6 endpoints */ | ||
69 | rdev->audio.num_pins = 6; | ||
70 | else | ||
71 | rdev->audio.num_pins = 1; | ||
72 | |||
73 | for (i = 0; i < rdev->audio.num_pins; i++) { | ||
74 | rdev->audio.pin[i].channels = -1; | ||
75 | rdev->audio.pin[i].rate = -1; | ||
76 | rdev->audio.pin[i].bits_per_sample = -1; | ||
77 | rdev->audio.pin[i].status_bits = 0; | ||
78 | rdev->audio.pin[i].category_code = 0; | ||
79 | rdev->audio.pin[i].connected = false; | ||
80 | rdev->audio.pin[i].offset = pin_offsets[i]; | ||
81 | rdev->audio.pin[i].id = i; | ||
82 | /* disable audio. it will be set up later */ | ||
83 | if (ASIC_IS_DCE6(rdev)) | ||
84 | dce6_audio_enable(rdev, &rdev->audio.pin[i], false); | ||
85 | else | ||
86 | r600_audio_enable(rdev, &rdev->audio.pin[i], false); | ||
87 | } | ||
88 | |||
89 | return 0; | ||
90 | } | ||
diff --git a/drivers/gpu/drm/radeon/radeon_audio.h b/drivers/gpu/drm/radeon/radeon_audio.h new file mode 100644 index 000000000000..8455fbdf97e4 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_audio.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2014 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 | * Authors: Slava Grigorev <slava.grigorev@amd.com> | ||
23 | */ | ||
24 | #ifndef __RADEON_AUDIO_H__ | ||
25 | #define __RADEON_AUDIO_H__ | ||
26 | |||
27 | int radeon_audio_init(struct radeon_device *rdev); | ||
28 | |||
29 | #endif | ||
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 9acb1c3c005b..c26f96093a10 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <drm/drmP.h> | 38 | #include <drm/drmP.h> |
39 | #include "radeon.h" | 39 | #include "radeon.h" |
40 | #include "radeon_asic.h" | 40 | #include "radeon_asic.h" |
41 | #include "radeon_audio.h" | ||
41 | #include "atom.h" | 42 | #include "atom.h" |
42 | #include "rs600d.h" | 43 | #include "rs600d.h" |
43 | 44 | ||
@@ -1012,7 +1013,7 @@ static int rs600_startup(struct radeon_device *rdev) | |||
1012 | return r; | 1013 | return r; |
1013 | } | 1014 | } |
1014 | 1015 | ||
1015 | r = r600_audio_init(rdev); | 1016 | r = radeon_audio_init(rdev); |
1016 | if (r) { | 1017 | if (r) { |
1017 | dev_err(rdev->dev, "failed initializing audio\n"); | 1018 | dev_err(rdev->dev, "failed initializing audio\n"); |
1018 | return r; | 1019 | return r; |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 0a2d36e81108..0fc559221933 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <drm/drmP.h> | 28 | #include <drm/drmP.h> |
29 | #include "radeon.h" | 29 | #include "radeon.h" |
30 | #include "radeon_asic.h" | 30 | #include "radeon_asic.h" |
31 | #include "radeon_audio.h" | ||
31 | #include "atom.h" | 32 | #include "atom.h" |
32 | #include "rs690d.h" | 33 | #include "rs690d.h" |
33 | 34 | ||
@@ -729,7 +730,7 @@ static int rs690_startup(struct radeon_device *rdev) | |||
729 | return r; | 730 | return r; |
730 | } | 731 | } |
731 | 732 | ||
732 | r = r600_audio_init(rdev); | 733 | r = radeon_audio_init(rdev); |
733 | if (r) { | 734 | if (r) { |
734 | dev_err(rdev->dev, "failed initializing audio\n"); | 735 | dev_err(rdev->dev, "failed initializing audio\n"); |
735 | return r; | 736 | return r; |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 372016e266d0..9bdeb4edb722 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <drm/drmP.h> | 30 | #include <drm/drmP.h> |
31 | #include "radeon.h" | 31 | #include "radeon.h" |
32 | #include "radeon_asic.h" | 32 | #include "radeon_asic.h" |
33 | #include "radeon_audio.h" | ||
33 | #include <drm/radeon_drm.h> | 34 | #include <drm/radeon_drm.h> |
34 | #include "rv770d.h" | 35 | #include "rv770d.h" |
35 | #include "atom.h" | 36 | #include "atom.h" |
@@ -1788,7 +1789,7 @@ static int rv770_startup(struct radeon_device *rdev) | |||
1788 | return r; | 1789 | return r; |
1789 | } | 1790 | } |
1790 | 1791 | ||
1791 | r = r600_audio_init(rdev); | 1792 | r = radeon_audio_init(rdev); |
1792 | if (r) { | 1793 | if (r) { |
1793 | DRM_ERROR("radeon: audio init failed\n"); | 1794 | DRM_ERROR("radeon: audio init failed\n"); |
1794 | return r; | 1795 | return r; |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 5d89b874a1a2..86cdc6798240 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <drm/drmP.h> | 27 | #include <drm/drmP.h> |
28 | #include "radeon.h" | 28 | #include "radeon.h" |
29 | #include "radeon_asic.h" | 29 | #include "radeon_asic.h" |
30 | #include "radeon_audio.h" | ||
30 | #include <drm/radeon_drm.h> | 31 | #include <drm/radeon_drm.h> |
31 | #include "sid.h" | 32 | #include "sid.h" |
32 | #include "atom.h" | 33 | #include "atom.h" |
@@ -6869,7 +6870,7 @@ static int si_startup(struct radeon_device *rdev) | |||
6869 | return r; | 6870 | return r; |
6870 | } | 6871 | } |
6871 | 6872 | ||
6872 | r = dce6_audio_init(rdev); | 6873 | r = radeon_audio_init(rdev); |
6873 | if (r) | 6874 | if (r) |
6874 | return r; | 6875 | return r; |
6875 | 6876 | ||