Rev 1403 | Rev 2005 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1403 | Rev 1430 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | /* |
33 | /* |
34 | * check if the chipset is supported |
34 | * check if the chipset is supported |
35 | */ |
35 | */ |
36 | static int r600_audio_chipset_supported(struct radeon_device *rdev) |
36 | static int r600_audio_chipset_supported(struct radeon_device *rdev) |
37 | { |
37 | { |
38 | return (rdev->family >= CHIP_R600 && rdev->family < CHIP_RV710) |
38 | return rdev->family >= CHIP_R600 |
39 | || rdev->family == CHIP_RS600 |
39 | || rdev->family == CHIP_RS600 |
40 | || rdev->family == CHIP_RS690 |
40 | || rdev->family == CHIP_RS690 |
41 | || rdev->family == CHIP_RS740; |
41 | || rdev->family == CHIP_RS740; |
42 | } |
42 | } |
Line 145... | Line 145... | ||
145 | // mod_timer(&rdev->audio_timer, |
145 | // mod_timer(&rdev->audio_timer, |
146 | // jiffies + msecs_to_jiffies(AUDIO_TIMER_INTERVALL)); |
146 | // jiffies + msecs_to_jiffies(AUDIO_TIMER_INTERVALL)); |
147 | } |
147 | } |
Line 148... | Line 148... | ||
148 | 148 | ||
- | 149 | /* |
|
- | 150 | * turn on/off audio engine |
|
- | 151 | */ |
|
- | 152 | static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable) |
|
- | 153 | { |
|
- | 154 | DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling"); |
|
- | 155 | WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000); |
|
- | 156 | } |
|
- | 157 | ||
149 | /* |
158 | /* |
150 | * initialize the audio vars and register the update timer |
159 | * initialize the audio vars and register the update timer |
151 | */ |
160 | */ |
152 | int r600_audio_init(struct radeon_device *rdev) |
161 | int r600_audio_init(struct radeon_device *rdev) |
153 | { |
162 | { |
154 | if (!r600_audio_chipset_supported(rdev)) |
163 | if (!radeon_audio || !r600_audio_chipset_supported(rdev)) |
Line 155... | Line 164... | ||
155 | return 0; |
164 | return 0; |
156 | - | ||
Line 157... | Line 165... | ||
157 | DRM_INFO("%s audio support", radeon_audio ? "Enabling" : "Disabling"); |
165 | |
158 | WREG32_P(R600_AUDIO_ENABLE, radeon_audio ? 0x81000000 : 0x0, ~0x81000000); |
166 | r600_audio_engine_enable(rdev, true); |
159 | 167 | ||
160 | rdev->audio_channels = -1; |
168 | rdev->audio_channels = -1; |
Line 256... | Line 264... | ||
256 | * release the audio timer |
264 | * release the audio timer |
257 | * TODO: How to do this correctly on SMP systems? |
265 | * TODO: How to do this correctly on SMP systems? |
258 | */ |
266 | */ |
259 | void r600_audio_fini(struct radeon_device *rdev) |
267 | void r600_audio_fini(struct radeon_device *rdev) |
260 | { |
268 | { |
261 | if (!r600_audio_chipset_supported(rdev)) |
269 | if (!radeon_audio || !r600_audio_chipset_supported(rdev)) |
262 | return; |
270 | return; |
Line 263... | Line -... | ||
263 | - | ||
264 | WREG32_P(R600_AUDIO_ENABLE, 0x0, ~0x81000000); |
- | |
265 | 271 | ||
- | 272 | // del_timer(&rdev->audio_timer); |
|
- | 273 | ||
266 | // del_timer(&rdev->audio_timer); |
274 | r600_audio_engine_enable(rdev, false); |