From patchwork Thu Jun 26 19:20:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 4431631 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCD05BEEAA for ; Thu, 26 Jun 2014 19:26:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB27E20270 for ; Thu, 26 Jun 2014 19:26:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8A88E2018E for ; Thu, 26 Jun 2014 19:26:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 93AB22655B0; Thu, 26 Jun 2014 21:26:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DF19E265211; Thu, 26 Jun 2014 21:21:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 16A302650D7; Thu, 26 Jun 2014 21:21:55 +0200 (CEST) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by alsa0.perex.cz (Postfix) with ESMTP id 2351E26500B for ; Thu, 26 Jun 2014 21:21:24 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5QJLOpY019123; Thu, 26 Jun 2014 14:21:24 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5QJLOp0001146; Thu, 26 Jun 2014 14:21:24 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Thu, 26 Jun 2014 14:21:23 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5QJLNCU014578; Thu, 26 Jun 2014 14:21:23 -0500 From: Jyri Sarha To: , , Date: Thu, 26 Jun 2014 22:20:59 +0300 Message-ID: <4bc595e2f43e56e88e7bfc82d4ca2a639cc452df.1403807781.git.jsarha@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Cc: liam.r.girdwood@linux.intel.com, detheridge@ti.com, broonie@kernel.org, Jyri Sarha , peter.ujfalusi@ti.com, tomi.valkeinen@ti.com, jyri.sarha@iki.fi Subject: [alsa-devel] [PATCH 08/12] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add audio datamember to hdmi struct 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. Signed-off-by: Jyri Sarha --- drivers/video/fbdev/omap2/dss/hdmi5.c | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c index 713e35a..b49b33b 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5.c @@ -43,6 +43,11 @@ #include "dss.h" #include "dss_features.h" +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) +#include +#include +#endif + static struct { struct mutex lock; struct platform_device *pdev; @@ -57,6 +62,9 @@ static struct { struct clk *sys_clk; struct regulator *vdda_reg; +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) + struct hdmi_audio_data audio; +#endif bool core_enabled; struct omap_dss_device output; @@ -696,6 +704,33 @@ err: return r; } +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) +static int audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp) +{ + hdmi_wp_audio_core_req_enable(wp, true); + + return 0; +} + +static void audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp) +{ + hdmi_wp_audio_core_req_enable(wp, false); +} + +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) { @@ -752,6 +787,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi_init_output(pdev); +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) + /* drvdata is only used by HDMI audio */ + hdmi.audio.hdmi_lock = &hdmi.lock; + hdmi.audio.wp = &hdmi.wp; + hdmi.audio.core = &hdmi.core; + hdmi.audio.cfg = &hdmi.cfg; + hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai; + hdmi.audio.audio_start = audio_start; + hdmi.audio.audio_stop = audio_stop; + hdmi.audio.audio_config = hdmi5_audio_config; + dev_set_drvdata(&pdev->dev, &hdmi.audio); + 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; @@ -759,6 +813,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);