/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
- r600_audio_enable(rdev, dig->afmt->pin, 0);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0);
r600_audio_set_dto(encoder, mode->clock);
r600_hdmi_audio_workaround(encoder);
/* enable audio after to setting up hw */
- r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
}
return;
for (i = 0; i < rdev->audio.num_pins; i++)
- dce6_audio_enable(rdev, &rdev->audio.pin[i], false);
+ radeon_audio_enable(rdev, &rdev->audio.pin[i], false);
rdev->audio.enabled = false;
}
#include "atom.h"
/* enable the audio stream */
-static void dce4_audio_enable(struct radeon_device *rdev,
+void dce4_audio_enable(struct radeon_device *rdev,
struct r600_audio_pin *pin,
u8 enable_mask)
{
/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
- if (ASIC_IS_DCE6(rdev)) {
- dce6_audio_enable(rdev, dig->afmt->pin, 0);
- } else {
- dce4_audio_enable(rdev, dig->afmt->pin, 0);
- }
+ radeon_audio_enable(rdev, dig->afmt->pin, 0);
evergreen_audio_set_dto(encoder, mode->clock);
WREG32(AFMT_RAMP_CONTROL3 + offset, 0x00000001);
/* enable audio after to setting up hw */
- if (ASIC_IS_DCE6(rdev))
- dce6_audio_enable(rdev, dig->afmt->pin, 1);
- else
- dce4_audio_enable(rdev, dig->afmt->pin, 0xf);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
}
void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
return;
if (!enable && dig->afmt->pin) {
- if (ASIC_IS_DCE6(rdev))
- dce6_audio_enable(rdev, dig->afmt->pin, 0);
- else
- dce4_audio_enable(rdev, dig->afmt->pin, 0);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0);
dig->afmt->pin = NULL;
}
if (!rdev->audio.enabled)
return;
- r600_audio_enable(rdev, &rdev->audio.pin[0], 0);
-
+ radeon_audio_enable(rdev, &rdev->audio.pin[0], 0);
rdev->audio.enabled = false;
}
/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
- r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0);
r600_audio_set_dto(encoder, mode->clock);
WREG32(HDMI0_RAMP_CONTROL3 + offset, 0x00000001);
/* enable audio after to setting up hw */
- r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
}
/**
return;
if (!enable && dig->afmt->pin) {
- r600_audio_enable(rdev, dig->afmt->pin, 0);
+ radeon_audio_enable(rdev, dig->afmt->pin, 0);
dig->afmt->pin = NULL;
}
void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
+void dce4_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
+ u8 enable_mask);
void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
static struct radeon_audio_basic_funcs dce32_funcs = {
.endpoint_rreg = radeon_audio_rreg,
.endpoint_wreg = radeon_audio_wreg,
+ .enable = r600_audio_enable,
};
static struct radeon_audio_basic_funcs dce4_funcs = {
.endpoint_rreg = radeon_audio_rreg,
.endpoint_wreg = radeon_audio_wreg,
+ .enable = dce4_audio_enable,
};
static struct radeon_audio_basic_funcs dce6_funcs = {
.endpoint_rreg = dce6_endpoint_rreg,
.endpoint_wreg = dce6_endpoint_wreg,
+ .enable = dce6_audio_enable,
};
static struct radeon_audio_funcs dce32_hdmi_funcs = {
/* disable audio. it will be set up later */
for (i = 0; i < rdev->audio.num_pins; i++)
- if (ASIC_IS_DCE6(rdev))
- dce6_audio_enable(rdev, &rdev->audio.pin[i], false);
- else
- r600_audio_enable(rdev, &rdev->audio.pin[i], false);
+ radeon_audio_enable(rdev, &rdev->audio.pin[i], false);
return 0;
}
if (radeon_encoder->audio && radeon_encoder->audio->select_pin)
radeon_encoder->audio->select_pin(encoder);
}
+
+void radeon_audio_enable(struct radeon_device *rdev,
+ struct r600_audio_pin *pin, u8 enable_mask)
+{
+ if (rdev->audio.funcs->enable)
+ rdev->audio.funcs->enable(rdev, pin, enable_mask);
+}
u32 (*endpoint_rreg)(struct radeon_device *rdev, u32 offset, u32 reg);
void (*endpoint_wreg)(struct radeon_device *rdev,
u32 offset, u32 reg, u32 v);
+ void (*enable)(struct radeon_device *rdev,
+ struct r600_audio_pin *pin, u8 enable_mask);
};
struct radeon_audio_funcs
struct drm_display_mode *mode);
struct r600_audio_pin *radeon_audio_get_pin(struct drm_encoder *encoder);
void radeon_audio_select_pin(struct drm_encoder *encoder);
+void radeon_audio_enable(struct radeon_device *rdev,
+ struct r600_audio_pin *pin, u8 enable_mask);
#endif