Lines Matching +full:audio +full:- +full:hdmi
26 #include <linux/hdmi.h>
38 * HDMI color format
88 dev_err(rdev->dev, "Unknown bits per sample 0x%x, using 16\n", in r600_audio_status()
113 * update all hdmi interfaces with current audio parameters
124 if (rdev->audio.pin[0].channels != audio_status.channels || in r600_audio_update_hdmi()
125 rdev->audio.pin[0].rate != audio_status.rate || in r600_audio_update_hdmi()
126 rdev->audio.pin[0].bits_per_sample != audio_status.bits_per_sample || in r600_audio_update_hdmi()
127 rdev->audio.pin[0].status_bits != audio_status.status_bits || in r600_audio_update_hdmi()
128 rdev->audio.pin[0].category_code != audio_status.category_code) { in r600_audio_update_hdmi()
129 rdev->audio.pin[0] = audio_status; in r600_audio_update_hdmi()
133 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { in r600_audio_update_hdmi()
141 /* enable the audio stream */
174 /* only one pin on 6xx-NI */ in r600_audio_get_pin()
175 return &rdev->audio.pin[0]; in r600_audio_get_pin()
181 struct drm_device *dev = encoder->dev; in r600_hdmi_update_acr()
182 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_update_acr()
194 HDMI0_ACR_CTS_32(acr->cts_32khz), in r600_hdmi_update_acr()
197 HDMI0_ACR_N_32(acr->n_32khz), in r600_hdmi_update_acr()
201 HDMI0_ACR_CTS_44(acr->cts_44_1khz), in r600_hdmi_update_acr()
204 HDMI0_ACR_N_44(acr->n_44_1khz), in r600_hdmi_update_acr()
208 HDMI0_ACR_CTS_48(acr->cts_48khz), in r600_hdmi_update_acr()
211 HDMI0_ACR_N_48(acr->n_48khz), in r600_hdmi_update_acr()
216 * build a HDMI Video Info Frame
242 * build a Audio Info Frame
247 struct drm_device *dev = encoder->dev; in r600_hdmi_update_audio_infoframe()
248 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_update_audio_infoframe()
250 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_update_audio_infoframe()
251 uint32_t offset = dig->afmt->offset; in r600_hdmi_update_audio_infoframe()
261 * test if audio buffer is filled enough to start playing
265 struct drm_device *dev = encoder->dev; in r600_hdmi_is_audio_buffer_filled()
266 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_is_audio_buffer_filled()
268 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_is_audio_buffer_filled()
269 uint32_t offset = dig->afmt->offset; in r600_hdmi_is_audio_buffer_filled()
280 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_buffer_status_changed()
283 if (!dig->afmt || !dig->afmt->enabled) in r600_hdmi_buffer_status_changed()
287 result = dig->afmt->last_buffer_filled_status != status; in r600_hdmi_buffer_status_changed()
288 dig->afmt->last_buffer_filled_status = status; in r600_hdmi_buffer_status_changed()
294 * write the audio workaround status to the hardware
298 struct drm_device *dev = encoder->dev; in r600_hdmi_audio_workaround()
299 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_audio_workaround()
301 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_audio_workaround()
302 uint32_t offset = dig->afmt->offset; in r600_hdmi_audio_workaround()
324 radeon_encoder = to_radeon_encoder(crtc->encoder); in r600_hdmi_audio_set_dto()
325 dig = radeon_encoder->enc_priv; in r600_hdmi_audio_set_dto()
330 if (dig->dig_encoder == 0) { in r600_hdmi_audio_set_dto()
343 struct drm_device *dev = encoder->dev; in r600_set_vbi_packet()
344 struct radeon_device *rdev = dev->dev_private; in r600_set_vbi_packet()
354 struct drm_device *dev = encoder->dev; in r600_set_audio_packet()
355 struct radeon_device *rdev = dev->dev_private; in r600_set_audio_packet()
358 HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */ in r600_set_audio_packet()
359 HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */ in r600_set_audio_packet()
360 …HDMI0_AUDIO_PACKETS_PER_LINE(3) | /* should be suffient for all audio modes and small enough for a… in r600_set_audio_packet()
368 …HDMI0_AUDIO_INFO_SEND | /* enable audio info frames (frames won't be set until audio is enabled) … in r600_set_audio_packet()
369 HDMI0_AUDIO_INFO_UPDATE); /* required for audio info values to be updated */ in r600_set_audio_packet()
396 struct drm_device *dev = encoder->dev; in r600_set_mute()
397 struct radeon_device *rdev = dev->dev_private; in r600_set_mute()
406 * r600_hdmi_update_audio_settings - Update audio infoframe
410 * Gets info about current audio stream and updates audio infoframe.
414 struct drm_device *dev = encoder->dev; in r600_hdmi_update_audio_settings()
415 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_update_audio_settings()
417 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_update_audio_settings()
418 struct r600_audio_pin audio = r600_audio_status(rdev); in r600_hdmi_update_audio_settings() local
425 if (!dig->afmt || !dig->afmt->enabled) in r600_hdmi_update_audio_settings()
427 offset = dig->afmt->offset; in r600_hdmi_update_audio_settings()
431 audio.channels, audio.rate, audio.bits_per_sample); in r600_hdmi_update_audio_settings()
433 (int)audio.status_bits, (int)audio.category_code); in r600_hdmi_update_audio_settings()
437 DRM_ERROR("failed to setup audio infoframe\n"); in r600_hdmi_update_audio_settings()
441 frame.channels = audio.channels; in r600_hdmi_update_audio_settings()
445 DRM_ERROR("failed to pack audio infoframe\n"); in r600_hdmi_update_audio_settings()
468 * enable the HDMI engine
472 struct drm_device *dev = encoder->dev; in r600_hdmi_enable()
473 struct radeon_device *rdev = dev->dev_private; in r600_hdmi_enable()
475 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; in r600_hdmi_enable()
476 u32 hdmi = HDMI0_ERROR_ACK; in r600_hdmi_enable() local
478 if (!dig || !dig->afmt) in r600_hdmi_enable()
481 /* Older chipsets require setting HDMI and routing manually */ in r600_hdmi_enable()
484 hdmi |= HDMI0_ENABLE; in r600_hdmi_enable()
485 switch (radeon_encoder->encoder_id) { in r600_hdmi_enable()
489 hdmi |= HDMI0_STREAM(HDMI0_STREAM_TMDSA); in r600_hdmi_enable()
497 hdmi |= HDMI0_STREAM(HDMI0_STREAM_LVTMA); in r600_hdmi_enable()
505 hdmi |= HDMI0_STREAM(HDMI0_STREAM_DDIA); in r600_hdmi_enable()
512 hdmi |= HDMI0_STREAM(HDMI0_STREAM_DVOA); in r600_hdmi_enable()
515 dev_err(rdev->dev, "Invalid encoder for HDMI: 0x%X\n", in r600_hdmi_enable()
516 radeon_encoder->encoder_id); in r600_hdmi_enable()
519 WREG32(HDMI0_CONTROL + dig->afmt->offset, hdmi); in r600_hdmi_enable()
522 if (rdev->irq.installed) { in r600_hdmi_enable()
526 radeon_irq_kms_enable_afmt(rdev, dig->afmt->id); in r600_hdmi_enable()
528 radeon_irq_kms_disable_afmt(rdev, dig->afmt->id); in r600_hdmi_enable()
531 dig->afmt->enabled = enable; in r600_hdmi_enable()
533 DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n", in r600_hdmi_enable()
534 enable ? "En" : "Dis", dig->afmt->offset, radeon_encoder->encoder_id); in r600_hdmi_enable()