summaryrefslogtreecommitdiffstats
path: root/include/drm/i915_component.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-11-12 15:23:41 +0100
committerTakashi Iwai <tiwai@suse.de>2015-12-10 13:39:27 +0100
commitcae666ceb8c3f154351f7df29c522f7a7016bdc0 (patch)
treea05689bd2a327fa7cfb67c4e3ca4c0e141eda9c7 /include/drm/i915_component.h
parente876b41ab074561d65f213bf5e0fc68cf5bc7380 (diff)
downloadlinux-cae666ceb8c3f154351f7df29c522f7a7016bdc0.tar.gz
linux-cae666ceb8c3f154351f7df29c522f7a7016bdc0.tar.bz2
linux-cae666ceb8c3f154351f7df29c522f7a7016bdc0.zip
drm/i915: Add get_eld audio component
Implement a new i915_audio_component_ops, get_eld(). It's called by the audio driver to fetch the current audio status and ELD of the given HDMI/DP port. It returns the size of expected ELD bytes if it's valid, zero if no valid ELD is found, or a negative error code. The current state of audio on/off is stored in the given pointer, too. Note that the returned size isn't limited to the given max bytes. If the size is greater than the max bytes, it means that only a part of ELD has been copied back. For achieving this implementation, a new field audio_connector is added to struct intel_digital_port. It points to the connector assigned to the given digital port. It's set/reset at each audio enable/disable call in intel_audio.c, and protected with av_mutex. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/drm/i915_component.h')
-rw-r--r--include/drm/i915_component.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h
index fab13851f95a..b46fa0ef3005 100644
--- a/include/drm/i915_component.h
+++ b/include/drm/i915_component.h
@@ -65,6 +65,20 @@ struct i915_audio_component_ops {
* sample rate, it will call this function to set n/cts
*/
int (*sync_audio_rate)(struct device *, int port, int rate);
+ /**
+ * @get_eld: fill the audio state and ELD bytes for the given port
+ *
+ * Called from audio driver to get the HDMI/DP audio state of the given
+ * digital port, and also fetch ELD bytes to the given pointer.
+ *
+ * It returns the byte size of the original ELD (not the actually
+ * copied size), zero for an invalid ELD, or a negative error code.
+ *
+ * Note that the returned size may be over @max_bytes. Then it
+ * implies that only a part of ELD has been copied to the buffer.
+ */
+ int (*get_eld)(struct device *, int port, bool *enabled,
+ unsigned char *buf, int max_bytes);
};
/**