diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 08:38:23 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 08:38:23 -0400 |
| commit | 037983e61b61e82fa28fea38d02e354d74c66bab (patch) | |
| tree | 8d502829f3b27b5d8b587fb965919260d832497a | |
| parent | 38137c8f0ce8dfaea467884cb2eb45de8df1bdfc (diff) | |
| parent | f3a97491f2c54e5239663f8f147b34c280cf7db5 (diff) | |
Merge branch 'omapdss-hdmi-audio'
Merge OMAP DSS HDMI audio patches from Ricardo Neri
| -rw-r--r-- | Documentation/arm/OMAP/DSS | 45 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss.h | 8 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 8 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 359 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/hdmi_panel.c | 236 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/ti_hdmi.h | 32 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 316 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 104 | ||||
| -rw-r--r-- | include/video/omapdss.h | 34 |
10 files changed, 710 insertions, 436 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/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig index 9aaf3246f821..43324e5ed25f 100644 --- a/drivers/video/omap2/dss/Kconfig +++ b/drivers/video/omap2/dss/Kconfig | |||
| @@ -68,6 +68,10 @@ config OMAP4_DSS_HDMI | |||
| 68 | HDMI Interface. This adds the High Definition Multimedia Interface. | 68 | HDMI Interface. This adds the High Definition Multimedia Interface. |
| 69 | See http://www.hdmi.org/ for HDMI specification. | 69 | See http://www.hdmi.org/ for HDMI specification. |
| 70 | 70 | ||
| 71 | config OMAP4_DSS_HDMI_AUDIO | ||
| 72 | bool | ||
| 73 | depends on OMAP4_DSS_HDMI | ||
| 74 | |||
| 71 | config OMAP2_DSS_SDI | 75 | config OMAP2_DSS_SDI |
| 72 | bool "SDI support" | 76 | bool "SDI support" |
| 73 | depends on ARCH_OMAP3 | 77 | depends on ARCH_OMAP3 |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index d5cb19fe7e8b..4aa9529a4768 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
| @@ -464,6 +464,14 @@ int omapdss_hdmi_read_edid(u8 *buf, int len); | |||
| 464 | bool omapdss_hdmi_detect(void); | 464 | bool omapdss_hdmi_detect(void); |
| 465 | int hdmi_panel_init(void); | 465 | int hdmi_panel_init(void); |
| 466 | void hdmi_panel_exit(void); | 466 | void hdmi_panel_exit(void); |
| 467 | #ifdef CONFIG_OMAP4_DSS_HDMI_AUDIO | ||
| 468 | int hdmi_audio_enable(void); | ||
| 469 | void hdmi_audio_disable(void); | ||
| 470 | int hdmi_audio_start(void); | ||
| 471 | void hdmi_audio_stop(void); | ||
| 472 | bool hdmi_mode_has_audio(void); | ||
| 473 | int hdmi_audio_config(struct omap_dss_audio *audio); | ||
| 474 | #endif | ||
| 467 | 475 | ||
| 468 | /* RFBI */ | 476 | /* RFBI */ |
| 469 | int rfbi_init_platform_driver(void) __init; | 477 | int rfbi_init_platform_driver(void) __init; |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 1d10a014bc55..2627441731b1 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
| @@ -568,13 +568,17 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = { | |||
| 568 | .pll_enable = ti_hdmi_4xxx_pll_enable, | 568 | .pll_enable = ti_hdmi_4xxx_pll_enable, |
| 569 | .pll_disable = ti_hdmi_4xxx_pll_disable, | 569 | .pll_disable = ti_hdmi_4xxx_pll_disable, |
| 570 | .video_enable = ti_hdmi_4xxx_wp_video_start, | 570 | .video_enable = ti_hdmi_4xxx_wp_video_start, |
| 571 | .video_disable = ti_hdmi_4xxx_wp_video_stop, | ||
| 571 | .dump_wrapper = ti_hdmi_4xxx_wp_dump, | 572 | .dump_wrapper = ti_hdmi_4xxx_wp_dump, |
| 572 | .dump_core = ti_hdmi_4xxx_core_dump, | 573 | .dump_core = ti_hdmi_4xxx_core_dump, |
| 573 | .dump_pll = ti_hdmi_4xxx_pll_dump, | 574 | .dump_pll = ti_hdmi_4xxx_pll_dump, |
| 574 | .dump_phy = ti_hdmi_4xxx_phy_dump, | 575 | .dump_phy = ti_hdmi_4xxx_phy_dump, |
| 575 | #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ | 576 | #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) |
| 576 | defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) | ||
| 577 | .audio_enable = ti_hdmi_4xxx_wp_audio_enable, | 577 | .audio_enable = ti_hdmi_4xxx_wp_audio_enable, |
| 578 | .audio_disable = ti_hdmi_4xxx_wp_audio_disable, | ||
| 579 | .audio_start = ti_hdmi_4xxx_audio_start, | ||
| 580 | .audio_stop = ti_hdmi_4xxx_audio_stop, | ||
| 581 | .audio_config = ti_hdmi_4xxx_audio_config, | ||
| 578 | #endif | 582 | #endif |
| 579 | 583 | ||
| 580 | }; | 584 | }; |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 5f2e2f677bef..8195c7166d20 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
| @@ -33,12 +33,6 @@ | |||
| 33 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
| 34 | #include <linux/clk.h> | 34 | #include <linux/clk.h> |
| 35 | #include <video/omapdss.h> | 35 | #include <video/omapdss.h> |
| 36 | #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ | ||
| 37 | defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) | ||
| 38 | #include <sound/soc.h> | ||
| 39 | #include <sound/pcm_params.h> | ||
| 40 | #include "ti_hdmi_4xxx_ip.h" | ||
| 41 | #endif | ||
| 42 | 36 | ||
| 43 | #include "ti_hdmi.h" | 37 | #include "ti_hdmi.h" |
| 44 | #include "dss.h" | 38 | #include "dss.h" |
| @@ -324,7 +318,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
| 324 | 318 | ||
| 325 | hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); | 319 | hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); |
| 326 | 320 | ||
| 327 | hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0); | 321 | hdmi.ip_data.ops->video_disable(&hdmi.ip_data); |
| 328 | 322 | ||
| 329 | /* config the PLL and PHY hdmi_set_pll_pwrfirst */ | 323 | /* config the PLL and PHY hdmi_set_pll_pwrfirst */ |
| 330 | r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data); | 324 | r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data); |
| @@ -358,7 +352,9 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
| 358 | /* tv size */ | 352 | /* tv size */ |
| 359 | dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings); | 353 | dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings); |
| 360 | 354 | ||
| 361 | hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1); | 355 | r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data); |
| 356 | if (r) | ||
| 357 | goto err_vid_enable; | ||
| 362 | 358 | ||
| 363 | r = dss_mgr_enable(dssdev->manager); | 359 | r = dss_mgr_enable(dssdev->manager); |
| 364 | if (r) | 360 | if (r) |
| @@ -367,7 +363,8 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
| 367 | return 0; | 363 | return 0; |
| 368 | 364 | ||
| 369 | err_mgr_enable: | 365 | err_mgr_enable: |
| 370 | hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0); | 366 | hdmi.ip_data.ops->video_disable(&hdmi.ip_data); |
| 367 | err_vid_enable: | ||
| 371 | hdmi.ip_data.ops->phy_disable(&hdmi.ip_data); | 368 | hdmi.ip_data.ops->phy_disable(&hdmi.ip_data); |
| 372 | hdmi.ip_data.ops->pll_disable(&hdmi.ip_data); | 369 | hdmi.ip_data.ops->pll_disable(&hdmi.ip_data); |
| 373 | err: | 370 | err: |
