2011-06-02 15:44:46 -05:00
/*
2012-05-18 01:42:42 -05:00
* omap - hdmi - card . c
2011-06-02 15:44:46 -05:00
*
2012-05-18 01:42:42 -05:00
* OMAP ALSA SoC machine driver for TI OMAP HDMI
2011-06-02 15:44:46 -05:00
* Copyright ( C ) 2011 Texas Instruments Incorporated - http : //www.ti.com/
* Author : Ricardo Neri < ricardo . neri @ ti . com >
*
* 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
*
*/
2011-07-15 12:38:28 -04:00
# include <linux/module.h>
2011-06-02 15:44:46 -05:00
# include <sound/pcm.h>
# include <sound/soc.h>
# include <asm/mach-types.h>
# include <video/omapdss.h>
2012-05-18 01:42:34 -05:00
# define DRV_NAME "omap-hdmi-audio"
2011-06-02 15:44:46 -05:00
2012-05-18 01:42:42 -05:00
static struct snd_soc_dai_link omap_hdmi_dai = {
2011-06-02 15:44:46 -05:00
. name = " HDMI " ,
. stream_name = " HDMI " ,
2012-05-18 01:42:34 -05:00
. cpu_dai_name = " omap-hdmi-audio-dai " ,
2011-06-02 15:44:46 -05:00
. platform_name = " omap-pcm-audio " ,
2012-05-18 01:42:34 -05:00
. codec_name = " hdmi-audio-codec " ,
. codec_dai_name = " omap-hdmi-hifi " ,
2011-06-02 15:44:46 -05:00
} ;
2012-05-18 01:42:42 -05:00
static struct snd_soc_card snd_soc_omap_hdmi = {
. name = " OMAPHDMI " ,
2011-12-22 11:08:59 +08:00
. owner = THIS_MODULE ,
2012-05-18 01:42:42 -05:00
. dai_link = & omap_hdmi_dai ,
2011-06-02 15:44:46 -05:00
. num_links = 1 ,
} ;
2012-12-07 09:26:29 -05:00
static int omap_hdmi_probe ( struct platform_device * pdev )
2011-06-02 15:44:46 -05:00
{
2012-05-18 01:42:42 -05:00
struct snd_soc_card * card = & snd_soc_omap_hdmi ;
2011-06-02 15:44:46 -05:00
int ret ;
card - > dev = & pdev - > dev ;
ret = snd_soc_register_card ( card ) ;
if ( ret ) {
dev_err ( & pdev - > dev , " snd_soc_register_card failed (%d) \n " , ret ) ;
card - > dev = NULL ;
return ret ;
}
return 0 ;
}
2012-12-07 09:26:29 -05:00
static int omap_hdmi_remove ( struct platform_device * pdev )
2011-06-02 15:44:46 -05:00
{
struct snd_soc_card * card = platform_get_drvdata ( pdev ) ;
snd_soc_unregister_card ( card ) ;
card - > dev = NULL ;
return 0 ;
}
2012-05-18 01:42:42 -05:00
static struct platform_driver omap_hdmi_driver = {
2011-06-02 15:44:46 -05:00
. driver = {
2012-05-18 01:42:34 -05:00
. name = DRV_NAME ,
2011-06-02 15:44:46 -05:00
. owner = THIS_MODULE ,
} ,
2012-05-18 01:42:42 -05:00
. probe = omap_hdmi_probe ,
2012-12-07 09:26:29 -05:00
. remove = omap_hdmi_remove ,
2011-06-02 15:44:46 -05:00
} ;
2012-05-18 01:42:42 -05:00
module_platform_driver ( omap_hdmi_driver ) ;
2011-06-02 15:44:46 -05:00
MODULE_AUTHOR ( " Ricardo Neri <ricardo.neri@ti.com> " ) ;
2012-05-18 01:42:42 -05:00
MODULE_DESCRIPTION ( " OMAP HDMI machine ASoC driver " ) ;
2011-06-02 15:44:46 -05:00
MODULE_LICENSE ( " GPL " ) ;
MODULE_ALIAS ( " platform: " DRV_NAME ) ;