Rework OMAP4+ HDMI audio support
Subsystems (7)
v3 cover Rework OMAP4+ HDMI audio support
Question to ASoC maintainers:
Do feel it is Ok to put ASoC code outside sound/soc the way I do in these patches (in patch 0006 particularly)?
The patches are based on:git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git for-next
The base, the patches, and couple of additional not-to-be-merged omap2plus_defconfig patches can be found here:
git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio
Changes since v2 version of the patches:
- Add "OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio too"
- Fix "OMAPDSS: hdmi: Make hdmi structure public". There was no need to make "core"-member a pointer.
- Make functional division between hdmi_audio.c and hdmi[45].c more clear. hdmi_audio.c does not touch anything but "audio"-member in omap_hdmi struct that is stored in drvdata.
The patch set fixes OMAP4+ HDMI audio. The structure of the implementation looks a bit different than before. Instead of creating a driver specific API for a separate ASoC component driver to connect to, this implementation integrates an the ASoC cpu-dai component driver into the HDMI driver. Also the other ASoC component drivers needed for operational audio are automatically registered by the HDMI driver. There is no need to add anything to the device tree as long as the nodes needed for HDMI video are there.
Big part of the HDMI audio code is still unchanged and there is a need for a cleanup there. Also there is still probably something wrong with speaker mapping of multi-channel streams. I will get back to cleaning up these issues later.
Best regards,
Jyri
Jyri Sarha (14):
ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio
too
OMAPDSS: hdmi_wp: Add function for getting audio dma address
OMAPDSS: hdmi: Make hdmi structure public
OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver
implementation
OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option
OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option
OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
OMAPDSS: Remove all references to obsolete HDMI audio callbacks
arch/arm/mach-omap2/devices.c | 28 -- .../fbdev/omap2/displays-new/connector-hdmi.c | 99 ------ .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 --- drivers/video/fbdev/omap2/dss/Kconfig | 29 +- drivers/video/fbdev/omap2/dss/Makefile | 1 + drivers/video/fbdev/omap2/dss/hdmi.h | 61 +++- drivers/video/fbdev/omap2/dss/hdmi4.c | 231 +++++-------- drivers/video/fbdev/omap2/dss/hdmi5.c | 213 +++++------- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 298 ++++++++++++++++ drivers/video/fbdev/omap2/dss/hdmi_common.c | 2 +- drivers/video/fbdev/omap2/dss/hdmi_wp.c | 6 + include/video/omapdss.h | 31 -- sound/soc/omap/Kconfig | 13 - sound/soc/omap/Makefile | 4 - sound/soc/omap/omap-hdmi-card.c | 87 ----- sound/soc/omap/omap-hdmi.c | 364 -------------------- sound/soc/omap/omap-hdmi.h | 38 -- 17 files changed, 567 insertions(+), 994 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c delete mode 100644 sound/soc/omap/omap-hdmi-card.c delete mode 100644 sound/soc/omap/omap-hdmi.c delete mode 100644 sound/soc/omap/omap-hdmi.h
Signature · 1 line
1.7.9.5
PATCH v3 1/14 ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
This code is not working currently and it can be removed. There is a conflict in sharing resources with the actual HDMI driver and with the ASoC HDMI audio DAI driver.
--- arch/arm/mach-omap2/devices.c | 28 ---------------------------- 1 file changed, 28 deletions(-)
arch/arm/mach-omap2/devices.c +0 -28
@@ -297,33 +297,6 @@ static void omap_init_audio(void)static inline void omap_init_audio (void ) {}#endif -#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI ) || \ - defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE ) - -static struct platform_device omap_hdmi_audio = { - .name ="omap-hdmi-audio" , - .id =-1 , -}; - -static void __init omap_init_hdmi_audio (void ) -{ -struct omap_hwmod *oh; -struct platform_device *pdev; - - oh =omap_hwmod_lookup ("dss_hdmi" ); -if (!oh) -return ; - - pdev =omap_device_build ("omap-hdmi-audio-dai" ,-1 , oh,NULL ,0 ); -WARN (IS_ERR (pdev), -"Can't build omap_device for omap-hdmi-audio-dai.\n" ); - -platform_device_register (&omap_hdmi_audio); -} -#else -static inline void omap_init_hdmi_audio (void ) {} -#endif -#if defined(CONFIG_SPI_OMAP24XX ) || defined(CONFIG_SPI_OMAP24XX_MODULE )#include <linux/platform_data/spi-omap2-mcspi.h>
@@ -459,7 +432,6 @@ static int __init omap2_init_devices(void)*/ omap_init_audio ();omap_init_camera (); -omap_init_hdmi_audio ();omap_init_mbox ();/* If dtb is there, the devices will be created dynamically */ if (!of_have_populated_dt ()) {
Signature · 1 line
1.7.9.5
PATCH v3 2/14 OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
In reply to Jyri SarhaThe OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in hdmi_core_audio_layout enum. I found the correct value from ti-linux 3.8 tree.
--- drivers/video/fbdev/omap2/dss/hdmi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/hdmi.h +2 -1
@@ -160,7 +160,8 @@ enum hdmi_audio_blk_strt_end_sig {enum hdmi_core_audio_layout {HDMI_AUDIO_LAYOUT_2CH =0 , -HDMI_AUDIO_LAYOUT_8CH =1 +HDMI_AUDIO_LAYOUT_8CH =1 , +HDMI_AUDIO_LAYOUT_6CH =2 };enum hdmi_core_cts_mode {
Signature · 1 line
1.7.9.5
PATCH v3 3/14 OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio too
In reply to Jyri Sarha--- drivers/video/fbdev/omap2/dss/hdmi_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/hdmi_common.c +1 -1
@@ -48,7 +48,7 @@ int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep,return 0 ; } -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO )int hdmi_compute_acr (u32 pclk,u32 sample_freq,u32 *n,u32 *cts) {u32 deep_color;
Signature · 1 line
1.7.9.5
PATCH v3 4/14 OMAPDSS: hdmi_wp: Add function for getting audio dma address
In reply to Jyri SarhaThe audio dma port is found in the hdmi_wp physical address space.
--- drivers/video/fbdev/omap2/dss/hdmi.h | 2 ++ drivers/video/fbdev/omap2/dss/hdmi_wp.c | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi.h +2 -0
@@ -250,6 +250,7 @@ struct hdmi_core_audio_config {struct hdmi_wp_data {void __iomem *base; +phys_addr_t phys_base; };struct hdmi_pll_data {
@@ -317,6 +318,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,void hdmi_wp_init_vid_fmt_timings (struct hdmi_video_format *video_fmt,struct omap_video_timings *timings,struct hdmi_config *param);int hdmi_wp_init (struct platform_device *pdev,struct hdmi_wp_data *wp); +phys_addr_t hdmi_wp_get_audio_dma_addr (struct hdmi_wp_data *wp);/* HDMI PLL funcs */ int hdmi_pll_enable (struct hdmi_pll_data *pll,struct hdmi_wp_data *wp);
drivers/video/fbdev/omap2/dss/hdmi_wp.c +6 -0
@@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)DSSERR ("can't get WP mem resource\n" );return -EINVAL ; } + wp->phys_base = res->start; wp->base =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (wp->base)) {
@@ -256,3 +257,8 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)return 0 ; } + +phys_addr_t hdmi_wp_get_audio_dma_addr (struct hdmi_wp_data *wp) +{ +return wp->phys_base +HDMI_WP_AUDIO_DATA ; +}
Signature · 1 line
1.7.9.5
PATCH v3 5/14 OMAPDSS: hdmi: Make hdmi structure public
In reply to Jyri SarhaUnify the private anonymous struct in hdmi4.c and hdmi5.c, name it as struct omap_hdmi, and make it public in hdmi.h.
--- drivers/video/fbdev/omap2/dss/hdmi.h | 21 +++++++++++++++++++++ drivers/video/fbdev/omap2/dss/hdmi4.c | 31 ++++++++----------------------- drivers/video/fbdev/omap2/dss/hdmi5.c | 20 ++------------------ 3 files changed, 31 insertions(+), 41 deletions(-)
drivers/video/fbdev/omap2/dss/hdmi.h +21 -0
@@ -349,5 +349,26 @@ static inline bool hdmi_mode_has_audio(int mode) {return mode ==HDMI_HDMI ? true : false; } + +/* HDMI DRV data */ +struct omap_hdmi { +struct mutex lock; +struct platform_device *pdev; + +struct hdmi_wp_data wp; +struct hdmi_pll_data pll; +struct hdmi_phy_data phy; +struct hdmi_core_data core; + +struct hdmi_config cfg; + +struct clk *sys_clk; +struct regulator *vdda_reg; + +bool core_enabled; + +struct omap_dss_device output; +}; +#endif #endif
drivers/video/fbdev/omap2/dss/hdmi4.c +8 -23
@@ -37,25 +37,9 @@#include "hdmi4_core.h" #include "dss.h" #include "dss_features.h" +#include "hdmi.h" -static struct { -struct mutex lock; -struct platform_device *pdev; - -struct hdmi_wp_data wp; -struct hdmi_pll_data pll; -struct hdmi_phy_data phy; -struct hdmi_core_data core; - -struct hdmi_config cfg; - -struct clk *sys_clk; -struct regulator *vdda_hdmi_dac_reg; - -bool core_enabled; - -struct omap_dss_device output; -} hdmi; +static struct omap_hdmi hdmi;static int hdmi_runtime_get (void ) {
@@ -117,7 +101,7 @@ static int hdmi_init_regulator(void)int r;struct regulator *reg; -if (hdmi.vdda_hdmi_dac_reg !=NULL ) +if (hdmi.vdda_reg !=NULL )return 0 ; reg =devm_regulator_get (&hdmi.pdev->dev,"vdda" );
@@ -137,7 +121,7 @@ static int hdmi_init_regulator(void) } } - hdmi.vdda_hdmi_dac_reg = reg; + hdmi.vdda_reg = reg;return 0 ; }
@@ -146,7 +130,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) {int r; - r =regulator_enable (hdmi.vdda_hdmi_dac_reg); + r =regulator_enable (hdmi.vdda_reg);if (r)return r;
@@ -162,7 +146,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)return 0 ; err_runtime_get: -regulator_disable (hdmi.vdda_hdmi_dac_reg); +regulator_disable (hdmi.vdda_reg);return r; }
@@ -172,7 +156,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) hdmi.core_enabled = false;hdmi_runtime_put (); -regulator_disable (hdmi.vdda_hdmi_dac_reg); +regulator_disable (hdmi.vdda_reg); }static int hdmi_power_on_full (struct omap_dss_device *dssdev)
@@ -678,6 +662,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)int irq; hdmi.pdev = pdev; +dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);
drivers/video/fbdev/omap2/dss/hdmi5.c +2 -18
@@ -43,24 +43,7 @@#include "dss.h" #include "dss_features.h" -static struct { -struct mutex lock; -struct platform_device *pdev; - -struct hdmi_wp_data wp; -struct hdmi_pll_data pll; -struct hdmi_phy_data phy; -struct hdmi_core_data core; - -struct hdmi_config cfg; - -struct clk *sys_clk; -struct regulator *vdda_reg; - -bool core_enabled; - -struct omap_dss_device output; -} hdmi; +static struct omap_hdmi hdmi;static int hdmi_runtime_get (void ) {
@@ -703,6 +686,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)int irq; hdmi.pdev = pdev; +dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);
Signature · 1 line
1.7.9.5
PATCH v3 6/14 OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
In reply to Jyri SarhaIntegrate ASoC DAI component driver in to the OMAP hdmi driver. The patch also updates the relevant entry in ti,omap5-dss DT binding document. The driver registers a dummy hdmi codec driver and a simple-card driver to produce a fully functional ALSA device. The DAI driver is implemented in hdmi_audio.c, but it still needs to be registered from hdmi4.c or hdmi5.c.
--- drivers/video/fbdev/omap2/dss/Kconfig | 3 + drivers/video/fbdev/omap2/dss/Makefile | 1 + drivers/video/fbdev/omap2/dss/hdmi.h | 37 +++- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 298 ++++++++++++++++++++++++++++ 4 files changed, 335 insertions(+), 4 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
drivers/video/fbdev/omap2/dss/Kconfig +3 -0
@@ -67,6 +67,9 @@ config OMAP2_DSS_VENC config OMAP2_DSS_HDMI_COMMON bool +config OMAP_DSS_HDMI_AUDIO + bool + config OMAP4_DSS_HDMI bool "HDMI support for OMAP4" default y
drivers/video/fbdev/omap2/dss/Makefile +1 -0
@@ -13,6 +13,7 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o +omapdss-$(CONFIG_OMAP_DSS_HDMI_AUDIO) += hdmi_audio.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
drivers/video/fbdev/omap2/dss/hdmi.h +33 -4
@@ -25,6 +25,9 @@#include <linux/hdmi.h> #include <video/omapdss.h> +#include <sound/dmaengine_pcm.h> +#include <uapi/sound/asound.h> +#include "dss.h" /* HDMI Wrapper */
@@ -337,7 +340,31 @@ int hdmi_phy_parse_lanes(struct hdmi_phy_data *phy, const u32 *lanes);int hdmi_parse_lanes_of (struct platform_device *pdev,struct device_node *ep,struct hdmi_phy_data *phy); -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO ) +struct omap_hdmi ; + +/* HDMI audio support */ +struct hdmi_audio_data { +/* These should be initialized when hdmi_audio_register() is called */ +struct snd_soc_dai_driver *hdmi_dai_drv; + +int (*mode_has_audio)(struct omap_hdmi *hd); +int (*audio_enable)(struct omap_hdmi *hd,bool enable); +int (*audio_start)(struct omap_hdmi *hd,bool enable); +int (*audio_config)(struct omap_hdmi *hd, +struct omap_dss_audio *dss_audio); + +/* These are for audio implementation's private use */ +struct snd_dmaengine_dai_dma_data dma_data; +struct omap_dss_audio dss_audio; +struct snd_aes_iec958 iec; +struct snd_cea_861_aud_if cea; +struct platform_device *codec_pdev; +struct platform_device *card_pdev; +}; + +int hdmi_audio_register (struct platform_device *pdev); +void hdmi_audio_unregister (struct platform_device *pdev); +int hdmi_compute_acr (u32 pclk,u32 sample_freq,u32 *n,u32 *cts);int hdmi_wp_audio_enable (struct hdmi_wp_data *wp,bool enable);int hdmi_wp_audio_core_req_enable (struct hdmi_wp_data *wp,bool enable);
@@ -345,13 +372,16 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp, struct hdmi_audio_format *aud_fmt);void hdmi_wp_audio_config_dma (struct hdmi_wp_data *wp,struct hdmi_audio_dma *aud_dma); -static inline bool hdmi_mode_has_audio (int mode) +static inline bool hdmi_mode_has_audio (struct hdmi_config *cfg) { -return mode ==HDMI_HDMI ? true : false; +return cfg->hdmi_dvi_mode ==HDMI_HDMI ? true : false; }/* HDMI DRV data */ struct omap_hdmi { +#if defined(CONFIG_OMAP_DSS_HDMI_AUDIO ) +struct hdmi_audio_data audio; +#endif struct mutex lock;struct platform_device *pdev;
@@ -371,4 +401,3 @@ struct omap_hdmi { };#endif -#endif
drivers/video/fbdev/omap2/dss/hdmi_audio.c new file +298 -0
298 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v3 7/14 OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option
In reply to Jyri SarhaAdd help section to OMAP4_DSS_HDMI_AUDIO with dependency to OMAP4_DSS_HDMI and select for newly created OMAP_DSS_HDMI_AUDIO. The OMAP_DSS_HDMI_AUDIO option is for common HDMI audio support and it is is dependent on SND_SOC.
Also selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for OMAP2_DSS if OMAP_DSS_HDMI_AUDIO is enabled.
--- drivers/video/fbdev/omap2/dss/Kconfig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/Kconfig +14 -1
@@ -6,6 +6,9 @@ menuconfig OMAP2_DSS select VIDEOMODE_HELPERS select OMAP2_DSS_INIT select HDMI + select SND_OMAP_SOC if OMAP_DSS_HDMI_AUDIO + select SND_SOC_HDMI_CODEC if OMAP_DSS_HDMI_AUDIO + select SND_SIMPLE_CARD if OMAP_DSS_HDMI_AUDIO help OMAP2+ Display Subsystem support.
@@ -78,7 +81,17 @@ config OMAP4_DSS_HDMI HDMI support for OMAP4 based SoCs. config OMAP4_DSS_HDMI_AUDIO - bool + bool "HDMI audio support for OMAP4" + depends on OMAP4_DSS_HDMI + depends on SND_SOC=y || OMAP2_DSS = SND_SOC + select OMAP_DSS_HDMI_AUDIO + default y + help + HDMI audio support for OMAP4 based SoCs. Adds integrated + ASoC Digital Audio Interface component driver into OMAPDSS + module. If enabled OMAP2_DSS selects SND_OMAP_SOC, + SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI + audio support. config OMAP5_DSS_HDMI bool "HDMI support for OMAP5"
Signature · 1 line
1.7.9.5
PATCH v3 8/14 OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
In reply to Jyri SarhaInitialize the callbacks in struct hdmi_audio_data and call register and unregister functions form hdmi_audio.c. Register function registers the integrated cpu dai, dummy HDMI codec, and simple-card machine driver for complete HDMI audio support.
--- drivers/video/fbdev/omap2/dss/hdmi4.c | 87 +++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi4.c +87 -0
@@ -34,6 +34,9 @@#include <linux/regulator/consumer.h> #include <video/omapdss.h> +#include <sound/soc.h> +#include <sound/soc-dai.h> +#include "hdmi4_core.h" #include "dss.h" #include "dss_features.h"
@@ -655,6 +658,73 @@ err:return r; } +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) +static int mode_has_audio (struct omap_hdmi *hd) +{ +int ret; + +mutex_lock (&hd->lock); + ret =hdmi_mode_has_audio (&hd->cfg); +mutex_unlock (&hd->lock); + +return ret; +} + +static int audio_enable (struct omap_hdmi *hd,bool enable) +{ +int ret; + +mutex_lock (&hd->lock); +if (!hdmi_mode_has_audio (&hd->cfg)) + ret = -EPERM ; +else + ret =hdmi_wp_audio_enable (&hd->wp, enable); +mutex_unlock (&hd->lock); + +return ret; +} + +static int audio_start (struct omap_hdmi *hd,bool enable) +{ +int ret =0 ; + +if (enable) + ret =hdmi4_audio_start (&hd->core, &hd->wp); +else +hdmi4_audio_stop (&hd->core, &hd->wp); + +return ret; +} + +static int audio_config (struct omap_hdmi *hd,struct omap_dss_audio *dss_audio) +{ +int ret; + +mutex_lock (&hd->lock); +if (!hdmi_mode_has_audio (&hd->cfg)) + ret = -EPERM ; +else + ret =hdmi4_audio_config (&hd->core, &hd->wp, dss_audio, + hd->cfg.timings.pixelclock); +mutex_unlock (&hd->lock); + +return ret; +} + +static struct snd_soc_dai_driver omap_hdmi_dai = { + .name ="omap4-hdmi-dai" , + .playback = { + .channels_min =2 , + .channels_max =8 , + .rates = (SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | +SNDRV_PCM_RATE_192000 ), + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE , + }, +}; +#endif +/* HDMI HW IP initialisation */ static int omapdss_hdmihw_probe (struct platform_device *pdev) {
@@ -712,6 +782,20 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)hdmi_init_output (pdev); +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) + hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai; + hdmi.audio.mode_has_audio = mode_has_audio; + hdmi.audio.audio_enable = audio_enable; + hdmi.audio.audio_start = audio_start; + hdmi.audio.audio_config = audio_config; + r =hdmi_audio_register (pdev); +if (r) { +DSSERR ("Registering HDMI audio failed\n" ); +hdmi_uninit_output (pdev); +pm_runtime_disable (&pdev->dev); +return r; + } +#endif dss_debugfs_create_file ("hdmi" , hdmi_dump_regs);return 0 ;
@@ -719,6 +803,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) { +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) +hdmi_audio_unregister (pdev); +#endif hdmi_uninit_output (pdev);pm_runtime_disable (&pdev->dev);
Signature · 1 line
1.7.9.5
PATCH v3 9/14 OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option
In reply to Jyri SarhaAdd help section to OMAP5_DSS_HDMI_AUDIO with dependency to OMAP5_DSS_HDMI and select for OMAP_DSS_HDMI_AUDIO.
--- drivers/video/fbdev/omap2/dss/Kconfig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/Kconfig +10 -1
@@ -103,8 +103,17 @@ config OMAP5_DSS_HDMI specification. config OMAP5_DSS_HDMI_AUDIO + bool "HDMI audio support for OMAP5" depends on OMAP5_DSS_HDMI - bool + depends on SND_SOC=y || OMAP2_DSS = SND_SOC + select OMAP_DSS_HDMI_AUDIO + default y + help + HDMI audio support for OMAP5 based SoCs. Adds integrated + ASoC Digital Audio Interface component driver into OMAPDSS + module. If enabled OMAP2_DSS selects SND_OMAP_SOC, + SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI + audio support. config OMAP2_DSS_SDI bool "SDI support"
Signature · 1 line
1.7.9.5
PATCH v3 10/14 OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
In reply to Jyri SarhaInitialize the callbacks in struct hdmi_audio_data and call register and unregister functions form hdmi_audio.c. Register function registers the integrated cpu dai, dummy HDMI codec, and simple-card machine driver for complete HDMI audio support.
--- drivers/video/fbdev/omap2/dss/hdmi5.c | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi5.c +80 -0
@@ -39,6 +39,9 @@#include <linux/regulator/consumer.h> #include <video/omapdss.h> +#include <sound/soc.h> +#include <sound/soc-dai.h> +#include "hdmi5_core.h" #include "dss.h" #include "dss_features.h"
@@ -679,6 +682,66 @@ err:return r; } +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO ) +static int mode_has_audio (struct omap_hdmi *hd) +{ +int ret; + +mutex_lock (&hd->lock); + ret =hdmi_mode_has_audio (&hd->cfg); +mutex_unlock (&hd->lock); + +return ret; +} + +static int audio_enable (struct omap_hdmi *hd,bool enable) +{ +int ret; + +mutex_lock (&hd->lock); +if (!hdmi_mode_has_audio (&hd->cfg)) + ret = -EPERM ; +else + ret =hdmi_wp_audio_enable (&hd->wp, enable); +mutex_unlock (&hd->lock); + +return ret; +} + +static int audio_start (struct omap_hdmi *hd,bool enable) +{ +return hdmi_wp_audio_core_req_enable (&hd->wp, enable); +} + +static int audio_config (struct omap_hdmi *hd,struct omap_dss_audio *dss_audio) +{ +int ret; + +mutex_lock (&hd->lock); +if (!hdmi_mode_has_audio (&hd->cfg)) + ret = -EPERM ; +else + ret =hdmi5_audio_config (&hd->core, &hd->wp, dss_audio, + hd->cfg.timings.pixelclock); +mutex_unlock (&hd->lock); + +return ret; +} + +static struct snd_soc_dai_driver omap_hdmi_dai = { + .name ="omap5-hdmi-dai" , + .playback = { + .channels_min =2 , + .channels_max =8 , + .rates = (SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | +SNDRV_PCM_RATE_192000 ), + .formats =SNDRV_PCM_FMTBIT_S16_LE , + }, +}; +#endif +/* HDMI HW IP initialisation */ static int omapdss_hdmihw_probe (struct platform_device *pdev) {
@@ -736,6 +799,20 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)hdmi_init_output (pdev); +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO ) + hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai; + hdmi.audio.mode_has_audio = mode_has_audio; + hdmi.audio.audio_enable = audio_enable; + hdmi.audio.audio_start = audio_start; + hdmi.audio.audio_config = audio_config; + r =hdmi_audio_register (pdev); +if (r) { +DSSERR ("Registering HDMI audio failed\n" ); +hdmi_uninit_output (pdev); +pm_runtime_disable (&pdev->dev); +return r; + } +#endif dss_debugfs_create_file ("hdmi" , hdmi_dump_regs);return 0 ;
@@ -743,6 +820,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) { +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO ) +hdmi_audio_unregister (pdev); +#endif hdmi_uninit_output (pdev);pm_runtime_disable (&pdev->dev);
Signature · 1 line
1.7.9.5
PATCH v3 11/14 ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
In reply to Jyri SarhaRemoves omap-hdmi DAI driver, omap-hdmi-card driver, the related Kconfig options, and Makefile entries. The HDMI DAI drivers has been integrated directly to OMAP4+ HDMI drivers and simple-card driver is used instead of omap-hdmi-card driver.
--- sound/soc/omap/Kconfig | 13 -- sound/soc/omap/Makefile | 4 - sound/soc/omap/omap-hdmi-card.c | 87 ---------- sound/soc/omap/omap-hdmi.c | 364 --------------------------------------- sound/soc/omap/omap-hdmi.h | 38 ---- 5 files changed, 506 deletions(-) delete mode 100644 sound/soc/omap/omap-hdmi-card.c delete mode 100644 sound/soc/omap/omap-hdmi.c delete mode 100644 sound/soc/omap/omap-hdmi.h
sound/soc/omap/Kconfig +0 -13
@@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSP config SND_OMAP_SOC_MCPDM tristate -config SND_OMAP_SOC_HDMI - tristate - config SND_OMAP_SOC_N810 tristate "SoC Audio support for Nokia N810" depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
@@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040 - PandaBoard (4430) - PandaBoardES (4460) -config SND_OMAP_SOC_OMAP_HDMI - tristate "SoC Audio support for Texas Instruments OMAP HDMI" - depends on SND_OMAP_SOC && OMAP4_DSS_HDMI && OMAP2_DSS - select SND_OMAP_SOC_HDMI - select SND_SOC_HDMI_CODEC - select OMAP4_DSS_HDMI_AUDIO - help - Say Y if you want to add support for SoC HDMI audio on Texas Instruments - OMAP4 chips - config SND_OMAP_SOC_OMAP3_PANDORA tristate "SoC Audio support for OMAP3 Pandora" depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
sound/soc/omap/Makefile +0 -4
@@ -3,13 +3,11 @@ snd-soc-omap-objs := omap-pcm.o snd-soc-omap-dmic-objs := omap-dmic.o snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o snd-soc-omap-mcpdm-objs := omap-mcpdm.o -snd-soc-omap-hdmi-objs := omap-hdmi.o obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o -obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o # OMAP Machine Support snd-soc-n810-objs := n810.o
@@ -20,7 +18,6 @@ snd-soc-am3517evm-objs := am3517evm.o snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o snd-soc-omap-twl4030-objs := omap-twl4030.o snd-soc-omap3pandora-objs := omap3pandora.o -snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
@@ -30,4 +27,3 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o -obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
sound/soc/omap/omap-hdmi-card.c deleted +0 -87
87 lines not on this page · raw message
sound/soc/omap/omap-hdmi.c deleted +0 -364
364 lines not on this page · raw message
sound/soc/omap/omap-hdmi.h deleted +0 -38
@@ -1,38 +0,0 @@ -/* -* omap-hdmi.h -* -* Definitions for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors. -* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ -* Authors: Jorge Candelaria <[email protected]> -* Ricardo Neri <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* version 2 as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA -* -*/ - -#ifndef __OMAP_HDMI_H__ -#define __OMAP_HDMI_H__ - -#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c - -#define OMAP_HDMI_RATES (SNDRV_PCM_RATE_32000 | \ - SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \ - SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \ - SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000) - -#define OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ - SNDRV_PCM_FMTBIT_S24_LE) - -#endif
Signature · 1 line
1.7.9.5
PATCH v3 12/14 OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
In reply to Jyri SarhaRemoves the OMAP4 HDMI audio callbacks for an external audio driver and the old external DAI driver does not work anymore after this patch.
--- drivers/video/fbdev/omap2/dss/hdmi4.c | 113 --------------------------------- 1 file changed, 113 deletions(-)
drivers/video/fbdev/omap2/dss/hdmi4.c +0 -113
@@ -471,112 +471,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,return r; } -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO ) -static int hdmi_audio_enable (struct omap_dss_device *dssdev) -{ -int r; - -mutex_lock (&hdmi.lock); - -if (!hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM ; - goto err; - } - - r =hdmi_wp_audio_enable (&hdmi.wp, true); -if (r) - goto err; - -mutex_unlock (&hdmi.lock); -return 0 ; - -err: -mutex_unlock (&hdmi.lock); -return r; -} - -static void hdmi_audio_disable (struct omap_dss_device *dssdev) -{ -hdmi_wp_audio_enable (&hdmi.wp, false); -} - -static int hdmi_audio_start (struct omap_dss_device *dssdev) -{ -return hdmi4_audio_start (&hdmi.core, &hdmi.wp); -} - -static void hdmi_audio_stop (struct omap_dss_device *dssdev) -{ -hdmi4_audio_stop (&hdmi.core, &hdmi.wp); -} - -static bool hdmi_audio_supported (struct omap_dss_device *dssdev) -{ -bool r; - -mutex_lock (&hdmi.lock); - - r =hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode); - -mutex_unlock (&hdmi.lock); -return r; -} - -static int hdmi_audio_config (struct omap_dss_device *dssdev, -struct omap_dss_audio *audio) -{ -int r; -u32 pclk = hdmi.cfg.timings.pixelclock; - -mutex_lock (&hdmi.lock); - -if (!hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM ; - goto err; - } - - r =hdmi4_audio_config (&hdmi.core, &hdmi.wp, audio, pclk); -if (r) - goto err; - -mutex_unlock (&hdmi.lock); -return 0 ; - -err: -mutex_unlock (&hdmi.lock); -return r; -} -#else -static int hdmi_audio_enable (struct omap_dss_device *dssdev) -{ -return -EPERM ; -} - -static void hdmi_audio_disable (struct omap_dss_device *dssdev) -{ -} - -static int hdmi_audio_start (struct omap_dss_device *dssdev) -{ -return -EPERM ; -} - -static void hdmi_audio_stop (struct omap_dss_device *dssdev) -{ -} - -static bool hdmi_audio_supported (struct omap_dss_device *dssdev) -{ -return false; -} - -static int hdmi_audio_config (struct omap_dss_device *dssdev, -struct omap_dss_audio *audio) -{ -return -EPERM ; -} -#endif -static int hdmi_set_infoframe (struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi) {
@@ -605,13 +499,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe, .set_hdmi_mode = hdmi_set_hdmi_mode, - - .audio_enable = hdmi_audio_enable, - .audio_disable = hdmi_audio_disable, - .audio_start = hdmi_audio_start, - .audio_stop = hdmi_audio_stop, - .audio_supported = hdmi_audio_supported, - .audio_config = hdmi_audio_config, };static void hdmi_init_output (struct platform_device *pdev)
Signature · 1 line
1.7.9.5
PATCH v3 13/14 OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
In reply to Jyri SarhaRemoves the OMAP5 HDMI audio callbacks for an external audio driver and the old external DAI driver does not work anymore after this patch.
--- drivers/video/fbdev/omap2/dss/hdmi5.c | 113 --------------------------------- 1 file changed, 113 deletions(-)
drivers/video/fbdev/omap2/dss/hdmi5.c +0 -113
@@ -495,112 +495,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,return r; } -#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO ) -static int hdmi_audio_enable (struct omap_dss_device *dssdev) -{ -int r; - -mutex_lock (&hdmi.lock); - -if (!hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM ; - goto err; - } - - r =hdmi_wp_audio_enable (&hdmi.wp, true); -if (r) - goto err; - -mutex_unlock (&hdmi.lock); -return 0 ; - -err: -mutex_unlock (&hdmi.lock); -return r; -} - -static void hdmi_audio_disable (struct omap_dss_device *dssdev) -{ -hdmi_wp_audio_enable (&hdmi.wp, false); -} - -static int hdmi_audio_start (struct omap_dss_device *dssdev) -{ -return hdmi_wp_audio_core_req_enable (&hdmi.wp, true); -} - -static void hdmi_audio_stop (struct omap_dss_device *dssdev) -{ -hdmi_wp_audio_core_req_enable (&hdmi.wp, false); -} - -static bool hdmi_audio_supported (struct omap_dss_device *dssdev) -{ -bool r; - -mutex_lock (&hdmi.lock); - - r =hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode); - -mutex_unlock (&hdmi.lock); -return r; -} - -static int hdmi_audio_config (struct omap_dss_device *dssdev, -struct omap_dss_audio *audio) -{ -int r; -u32 pclk = hdmi.cfg.timings.pixelclock; - -mutex_lock (&hdmi.lock); - -if (!hdmi_mode_has_audio (hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM ; - goto err; - } - - r =hdmi5_audio_config (&hdmi.core, &hdmi.wp, audio, pclk); -if (r) - goto err; - -mutex_unlock (&hdmi.lock); -return 0 ; - -err: -mutex_unlock (&hdmi.lock); -return r; -} -#else -static int hdmi_audio_enable (struct omap_dss_device *dssdev) -{ -return -EPERM ; -} - -static void hdmi_audio_disable (struct omap_dss_device *dssdev) -{ -} - -static int hdmi_audio_start (struct omap_dss_device *dssdev) -{ -return -EPERM ; -} - -static void hdmi_audio_stop (struct omap_dss_device *dssdev) -{ -} - -static bool hdmi_audio_supported (struct omap_dss_device *dssdev) -{ -return false; -} - -static int hdmi_audio_config (struct omap_dss_device *dssdev, -struct omap_dss_audio *audio) -{ -return -EPERM ; -} -#endif -static int hdmi_set_infoframe (struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi) {
@@ -629,13 +523,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe, .set_hdmi_mode = hdmi_set_hdmi_mode, - - .audio_enable = hdmi_audio_enable, - .audio_disable = hdmi_audio_disable, - .audio_start = hdmi_audio_start, - .audio_stop = hdmi_audio_stop, - .audio_supported = hdmi_audio_supported, - .audio_config = hdmi_audio_config, };static void hdmi_init_output (struct platform_device *pdev)
Signature · 1 line
1.7.9.5
PATCH v3 14/14 OMAPDSS: Remove all references to obsolete HDMI audio callbacks
In reply to Jyri SarhaIn new model these callbacks are obsolete since the ASoC component drivers are integrated into the HDMI drivers and no callbacks are needed anymore.
--- .../fbdev/omap2/displays-new/connector-hdmi.c | 99 -------------------- .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 ----------- include/video/omapdss.h | 31 ------ 3 files changed, 186 deletions(-)
drivers/video/fbdev/omap2/displays-new/connector-hdmi.c +0 -99
@@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)return in->ops.hdmi->detect (in); } -static int hdmic_audio_enable (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; -int r; - -/* enable audio only if the display is active */ -if (!omapdss_device_is_enabled (dssdev)) -return -EPERM ; - - r = in->ops.hdmi->audio_enable (in); -if (r) -return r; - - dssdev->audio_state =OMAP_DSS_AUDIO_ENABLED ; - -return 0 ; -} - -static void hdmic_audio_disable (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - - in->ops.hdmi->audio_disable (in); - - dssdev->audio_state =OMAP_DSS_AUDIO_DISABLED ; -} - -static int hdmic_audio_start (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; -int r; - -/* -* No need to check the panel state. It was checked when trasitioning -* to AUDIO_ENABLED. -*/ -if (dssdev->audio_state !=OMAP_DSS_AUDIO_ENABLED ) -return -EPERM ; - - r = in->ops.hdmi->audio_start (in); -if (r) -return r; - - dssdev->audio_state =OMAP_DSS_AUDIO_PLAYING ; - -return 0 ; -} - -static void hdmic_audio_stop (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - - in->ops.hdmi->audio_stop (in); - - dssdev->audio_state =OMAP_DSS_AUDIO_ENABLED ; -} - -static bool hdmic_audio_supported (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - -if (!omapdss_device_is_enabled (dssdev)) -return false; - -return in->ops.hdmi->audio_supported (in); -} - -static int hdmic_audio_config (struct omap_dss_device *dssdev, -struct omap_dss_audio *audio) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; -int r; - -/* config audio only if the display is active */ -if (!omapdss_device_is_enabled (dssdev)) -return -EPERM ; - - r = in->ops.hdmi->audio_config (in, audio); -if (r) -return r; - - dssdev->audio_state =OMAP_DSS_AUDIO_CONFIGURED ; - -return 0 ; -} -static int hdmic_set_hdmi_mode (struct omap_dss_device *dssdev,bool hdmi_mode) {struct panel_drv_data *ddata =to_panel_data (dssdev);
@@ -296,13 +204,6 @@ static struct omap_dss_driver hdmic_driver = { .detect = hdmic_detect, .set_hdmi_mode = hdmic_set_hdmi_mode, .set_hdmi_infoframe = hdmic_set_infoframe, - - .audio_enable = hdmic_audio_enable, - .audio_disable = hdmic_audio_disable, - .audio_start = hdmic_audio_start, - .audio_stop = hdmic_audio_stop, - .audio_supported = hdmic_audio_supported, - .audio_config = hdmic_audio_config, };static int hdmic_probe_pdata (struct platform_device *pdev)
drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c +0 -56
68 lines not on this page · raw message
include/video/omapdss.h +0 -31
@@ -635,19 +635,6 @@ struct omapdss_hdmi_ops {int (*set_hdmi_mode)(struct omap_dss_device *dssdev,bool hdmi_mode);int (*set_infoframe)(struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi); - -/* -* Note: These functions might sleep. Do not call while -* holding a spinlock/readlock. -*/ -int (*audio_enable)(struct omap_dss_device *dssdev); -void (*audio_disable)(struct omap_dss_device *dssdev); -bool (*audio_supported)(struct omap_dss_device *dssdev); -int (*audio_config)(struct omap_dss_device *dssdev, -struct omap_dss_audio *audio); -/* Note: These functions may not sleep */ -int (*audio_start)(struct omap_dss_device *dssdev); -void (*audio_stop)(struct omap_dss_device *dssdev); };struct omapdss_dsi_ops {
@@ -858,24 +845,6 @@ struct omap_dss_driver {int (*set_hdmi_mode)(struct omap_dss_device *dssdev,bool hdmi_mode);int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi); - -/* -* For display drivers that support audio. This encompasses -* HDMI and DisplayPort at the moment. -*/ -/* -* Note: These functions might sleep. Do not call while -* holding a spinlock/readlock. -*/ -int (*audio_enable)(struct omap_dss_device *dssdev); -void (*audio_disable)(struct omap_dss_device *dssdev); -bool (*audio_supported)(struct omap_dss_device *dssdev); -int (*audio_config)(struct omap_dss_device *dssdev, -struct omap_dss_audio *audio); -/* Note: These functions may not sleep */ -int (*audio_start)(struct omap_dss_device *dssdev); -void (*audio_stop)(struct omap_dss_device *dssdev); - };enum omapdss_version omapdss_get_version (void );
Signature · 1 line
1.7.9.5
Mark Brown
maintainerQuoted 3 lines · Jyri Sarha
Question to ASoC maintainers:
Do feel it is Ok to put ASoC code outsidesound/socthe way I do in these patches (in patch 0006 particularly)?
I'm not thrilled about the idea, it's going to result in breakage during API updates and more cross tree coordination needs.
Quoted 8 lines · Mark Brown
Quoted 3 lines · Jyri Sarha
Question to ASoC maintainers:
Do feel it is Ok to put ASoC code outsidesound/socthe way I do in these patches (in patch 0006 particularly)?I'm not thrilled about the idea, it's going to result in breakage during API updates and more cross tree coordination needs.
I guess then the least bad alternative would be cutting the cpu-dai driver away from drivers/video/fbdev/omap2/dss/hdmi_audio.c and placing it under sound/soc/omap and registering it from hdmi_audio.c the same way as hdmi-audio-codec and asoc-simple-card is now registered.
There would be two devices for a single ip, but at least the ASoC side driver would receive its resources directly from the HDMI video driver with necessary tools to synchronize the access.
This approach would work for other HDMI audio situation too, where there would usually (for tda998x and SiI9022 at least) be a need to register an i2s codec driver associated with the HDMI encoder. It would probably be possible to make a single codec driver to work with multiple HDMI encoders if the API between the codec and endcoder drivers is designed that in mind.
How does this sound?
Best regards,
Jyri
Mark Brown
maintainerQuoted 8 lines · Jyri Sarha
I guess then the least bad alternative would be cutting the cpu-dai driver away from
drivers/video/fbdev/omap2/dss/hdmi_audio.cand placing it undersound/soc/omapand registering it fromhdmi_audio.cthe same way as hdmi-audio-codec and asoc-simple-card is now registered.There would be two devices for a single ip, but at least the ASoC side driver would receive its resources directly from the HDMI video driver with necessary tools to synchronize the access.
Just a MFD really.
Quoted 7 lines
This approach would work for other HDMI audio situation too, where there would usually (for tda998x and SiI9022 at least) be a need to register an i2s codec driver associated with the HDMI encoder. It would probably be possible to make a single codec driver to work with multiple HDMI encoders if the API between the codec and endcoder drivers is designed that in mind.
How does this sound?
This sounds like a way forward, I definitely think it's a good idea to standardise the interfaces as much as we can.
Quoted 19 lines · Mark Brown
Quoted 8 lines · Jyri Sarha
I guess then the least bad alternative would be cutting the cpu-dai driver away from
drivers/video/fbdev/omap2/dss/hdmi_audio.cand placing it undersound/soc/omapand registering it fromhdmi_audio.cthe same way as hdmi-audio-codec and asoc-simple-card is now registered.There would be two devices for a single ip, but at least the ASoC side driver would receive its resources directly from the HDMI video driver with necessary tools to synchronize the access.
Just a MFD really.
Quoted 5 lines
This approach would work for other HDMI audio situation too, where there would usually (for tda998x and SiI9022 at least) be a need to register an i2s codec driver associated with the HDMI encoder. It would probably be possible to make a single codec driver to work with multiple HDMI encoders if the API between the codec and endcoder drivers is designed that in mind.
Quoted 5 lines
Quoted 1 line
How does this sound?
This sounds like a way forward, I definitely think it's a good idea to standardise the interfaces as much as we can.
After discussing with Peter and Tomi I decided to change the approach a bit. There should not be any new device registered, just ASoC components that are implemented under sound/soc as a library rather than a device driver.
The library would export a register and unregister functions to be called from video driver directory. The functions will then register the necessary ASoC components under the video device.
If there are no objections I'll go ahead implementing this approach, first for OMAP HDMI audio, and later for SiI9022 driver we are cooking.
Best regards,
Jyri
Mark Brown
maintainerQuoted 10 lines · Jyri Sarha
After discussing with Peter and Tomi I decided to change the approach a bit. There should not be any new device registered, just ASoC components that are implemented under
sound/socas a library rather than a device driver.The library would export a register and unregister functions to be called from video driver directory. The functions will then register the necessary ASoC components under the video device.
If there are no objections I'll go ahead implementing this approach, first for OMAP HDMI audio, and later for SiI9022 driver we are cooking.
That also sounds perfectly sensible.