diff options
-rw-r--r-- | Documentation/arm/OMAP/DSS | 45 | ||||
-rw-r--r-- | include/video/omapdss.h | 34 |
2 files changed, 79 insertions, 0 deletions
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS index d0aea9192204..a564ceea9e98 100644 --- a/Documentation/arm/OMAP/DSS +++ b/Documentation/arm/OMAP/DSS | |||
@@ -47,6 +47,51 @@ flexible way to enable non-common multi-display configuration. In addition to | |||
47 | modelling the hardware overlays, omapdss supports virtual overlays and overlay | 47 | modelling the hardware overlays, omapdss supports virtual overlays and overlay |
48 | managers. These can be used when updating a display with CPU or system DMA. | 48 | managers. These can be used when updating a display with CPU or system DMA. |
49 | 49 | ||
50 | omapdss driver support for audio | ||
51 | -------------------------------- | ||
52 | There exist several display technologies and standards that support audio as | ||
53 | well. Hence, it is relevant to update the DSS device driver to provide an audio | ||
54 | interface that may be used by an audio driver or any other driver interested in | ||
55 | the functionality. | ||
56 | |||
57 | The audio_enable function is intended to prepare the relevant | ||
58 | IP for playback (e.g., enabling an audio FIFO, taking in/out of reset | ||
59 | some IP, enabling companion chips, etc). It is intended to be called before | ||
60 | audio_start. The audio_disable function performs the reverse operation and is | ||
61 | intended to be called after audio_stop. | ||
62 | |||
63 | While a given DSS device driver may support audio, it is possible that for | ||
64 | certain configurations audio is not supported (e.g., an HDMI display using a | ||
65 | VESA video timing). The audio_supported function is intended to query whether | ||
66 | the current configuration of the display supports audio. | ||
67 | |||
68 | The audio_config function is intended to configure all the relevant audio | ||
69 | parameters of the display. In order to make the function independent of any | ||
70 | specific DSS device driver, a struct omap_dss_audio is defined. Its purpose | ||
71 | is to contain all the required parameters for audio configuration. At the | ||
72 | moment, such structure contains pointers to IEC-60958 channel status word | ||
73 | and CEA-861 audio infoframe structures. This should be enough to support | ||
74 | HDMI and DisplayPort, as both are based on CEA-861 and IEC-60958. | ||
75 | |||
76 | The audio_enable/disable, audio_config and audio_supported functions could be | ||
77 | implemented as functions that may sleep. Hence, they should not be called | ||
78 | while holding a spinlock or a readlock. | ||
79 | |||
80 | The audio_start/audio_stop function is intended to effectively start/stop audio | ||
81 | playback after the configuration has taken place. These functions are designed | ||
82 | to be used in an atomic context. Hence, audio_start should return quickly and be | ||
83 | called only after all the needed resources for audio playback (audio FIFOs, | ||
84 | DMA channels, companion chips, etc) have been enabled to begin data transfers. | ||
85 | audio_stop is designed to only stop the audio transfers. The resources used | ||
86 | for playback are released using audio_disable. | ||
87 | |||
88 | The enum omap_dss_audio_state may be used to help the implementations of | ||
89 | the interface to keep track of the audio state. The initial state is _DISABLED; | ||
90 | then, the state transitions to _CONFIGURED, and then, when it is ready to | ||
91 | play audio, to _ENABLED. The state _PLAYING is used when the audio is being | ||
92 | rendered. | ||
93 | |||
94 | |||
50 | Panel and controller drivers | 95 | Panel and controller drivers |
51 | ---------------------------- | 96 | ---------------------------- |
52 | 97 | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 1217df40cb7e..bb30242eeea1 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -51,6 +51,8 @@ | |||
51 | 51 | ||
52 | struct omap_dss_device; | 52 | struct omap_dss_device; |
53 | struct omap_overlay_manager; | 53 | struct omap_overlay_manager; |
54 | struct snd_aes_iec958; | ||
55 | struct snd_cea_861_aud_if; | ||
54 | 56 | ||
55 | enum omap_display_type { | 57 | enum omap_display_type { |
56 | OMAP_DISPLAY_TYPE_NONE = 0, | 58 | OMAP_DISPLAY_TYPE_NONE = 0, |
@@ -158,6 +160,13 @@ enum omap_dss_display_state { | |||
158 | OMAP_DSS_DISPLAY_SUSPENDED, | 160 | OMAP_DSS_DISPLAY_SUSPENDED, |
159 | }; | 161 | }; |
160 | 162 | ||
163 | enum omap_dss_audio_state { | ||
164 | OMAP_DSS_AUDIO_DISABLED = 0, | ||
165 | OMAP_DSS_AUDIO_ENABLED, | ||
166 | OMAP_DSS_AUDIO_CONFIGURED, | ||
167 | OMAP_DSS_AUDIO_PLAYING, | ||
168 | }; | ||
169 | |||
161 | /* XXX perhaps this should be removed */ | 170 | /* XXX perhaps this should be removed */ |
162 | enum omap_dss_overlay_managers { | 171 | enum omap_dss_overlay_managers { |
163 | OMAP_DSS_OVL_MGR_LCD, | 172 | OMAP_DSS_OVL_MGR_LCD, |
@@ -583,6 +592,8 @@ struct omap_dss_device { | |||
583 | 592 | ||
584 | enum omap_dss_display_state state; | 593 | enum omap_dss_display_state state; |
585 | 594 | ||
595 | enum omap_dss_audio_state audio_state; | ||
596 | |||
586 | /* platform specific */ | 597 | /* platform specific */ |
587 | int (*platform_enable)(struct omap_dss_device *dssdev); | 598 | int (*platform_enable)(struct omap_dss_device *dssdev); |
588 | void (*platform_disable)(struct omap_dss_device *dssdev); | 599 | void (*platform_disable)(struct omap_dss_device *dssdev); |
@@ -595,6 +606,11 @@ struct omap_dss_hdmi_data | |||
595 | int hpd_gpio; | 606 | int hpd_gpio; |
596 | }; | 607 | }; |
597 | 608 | ||
609 | struct omap_dss_audio { | ||
610 | struct snd_aes_iec958 *iec; | ||
611 | struct snd_cea_861_aud_if *cea; | ||
612 | }; | ||
613 | |||
598 | struct omap_dss_driver { | 614 | struct omap_dss_driver { |
599 | struct device_driver driver; | 615 | struct device_driver driver; |
600 | 616 | ||
@@ -642,6 +658,24 @@ struct omap_dss_driver { | |||
642 | 658 | ||
643 | int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); | 659 | int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); |
644 | bool (*detect)(struct omap_dss_device *dssdev); | 660 | bool (*detect)(struct omap_dss_device *dssdev); |
661 | |||
662 | /* | ||
663 | * For display drivers that support audio. This encompasses | ||
664 | * HDMI and DisplayPort at the moment. | ||
665 | */ | ||
666 | /* | ||
667 | * Note: These functions might sleep. Do not call while | ||
668 | * holding a spinlock/readlock. | ||
669 | */ | ||
670 | int (*audio_enable)(struct omap_dss_device *dssdev); | ||
671 | void (*audio_disable)(struct omap_dss_device *dssdev); | ||
672 | bool (*audio_supported)(struct omap_dss_device *dssdev); | ||
673 | int (*audio_config)(struct omap_dss_device *dssdev, | ||
674 | struct omap_dss_audio *audio); | ||
675 | /* Note: These functions may not sleep */ | ||
676 | int (*audio_start)(struct omap_dss_device *dssdev); | ||
677 | void (*audio_stop)(struct omap_dss_device *dssdev); | ||
678 | |||
645 | }; | 679 | }; |
646 | 680 | ||
647 | int omap_dss_register_driver(struct omap_dss_driver *); | 681 | int omap_dss_register_driver(struct omap_dss_driver *); |