/* * Copyright (C) 2011 LAPIS Semiconductor Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include static struct snd_soc_dai_link ioh_i2s_dai = { .name = "I2S", .stream_name = "I2S HiFi", .cpu_dai_name = "ml7213ioh-i2s", .codec_dai_name = "ml7213ioh-hifi", .platform_name = "ml7213ioh-pcm-audio", .codec_name = "ml26124-codec", }; static struct snd_soc_card ioh_i2s_card = { .name = "ml7213ioh i2s", .dai_link = &ioh_i2s_dai, .num_links = 1, }; static struct platform_device *soc_pdev; static int __init ioh_i2s_probe(struct platform_device *pdev) { int ret; soc_pdev = platform_device_alloc("soc-audio", -1); if (!soc_pdev) return -ENOMEM; platform_set_drvdata(soc_pdev, &ioh_i2s_card); ret = platform_device_add(soc_pdev); if (ret) { platform_device_put(soc_pdev); return ret; } return 0; } static int __exit ioh_i2s_remove(struct platform_device *pdev) { platform_device_unregister(soc_pdev); return 0; } static struct platform_driver ioh_i2s_driver = { .remove = ioh_i2s_remove, .driver = { .name = "ml7213ioh-machine", .owner = THIS_MODULE, }, }; static int __init ioh_i2s_init(void) { return platform_driver_probe(&ioh_i2s_driver, ioh_i2s_probe); } static void __exit ioh_i2s_exit(void) { platform_driver_unregister(&ioh_i2s_driver); } module_init(ioh_i2s_init); module_exit(ioh_i2s_exit); MODULE_AUTHOR("Tomoya MORINAGA "); MODULE_DESCRIPTION("LAPIS Semiconductor ML7213 IOH ALSA SoC machine driver"); MODULE_LICENSE("GPL");