Path: blob/master/sound/soc/txx9/txx9aclc-generic.c
10817 views
/*1* Generic TXx9 ACLC machine driver2*3* Copyright (C) 2009 Atsushi Nemoto4*5* Based on RBTX49xx patch from CELF patch archive.6* (C) Copyright TOSHIBA CORPORATION 2004-20067*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License version 2 as10* published by the Free Software Foundation.11*12* This is a very generic AC97 sound machine driver for boards which13* have (AC97) audio at ACLC (e.g. RBTX49XX boards).14*/1516#include <linux/module.h>17#include <linux/platform_device.h>18#include <sound/core.h>19#include <sound/pcm.h>20#include <sound/soc.h>21#include "txx9aclc.h"2223static struct snd_soc_dai_link txx9aclc_generic_dai = {24.name = "AC97",25.stream_name = "AC97 HiFi",26.cpu_dai_name = "txx9aclc-ac97",27.codec_dai_name = "ac97-hifi",28.platform_name = "txx9aclc-pcm-audio",29.codec_name = "ac97-codec",30};3132static struct snd_soc_card txx9aclc_generic_card = {33.name = "Generic TXx9 ACLC Audio",34.dai_link = &txx9aclc_generic_dai,35.num_links = 1,36};3738static struct platform_device *soc_pdev;3940static int __init txx9aclc_generic_probe(struct platform_device *pdev)41{42int ret;4344soc_pdev = platform_device_alloc("soc-audio", -1);45if (!soc_pdev)46return -ENOMEM;47platform_set_drvdata(soc_pdev, &txx9aclc_generic_card);48ret = platform_device_add(soc_pdev);49if (ret) {50platform_device_put(soc_pdev);51return ret;52}5354return 0;55}5657static int __exit txx9aclc_generic_remove(struct platform_device *pdev)58{59platform_device_unregister(soc_pdev);60return 0;61}6263static struct platform_driver txx9aclc_generic_driver = {64.remove = txx9aclc_generic_remove,65.driver = {66.name = "txx9aclc-generic",67.owner = THIS_MODULE,68},69};7071static int __init txx9aclc_generic_init(void)72{73return platform_driver_probe(&txx9aclc_generic_driver,74txx9aclc_generic_probe);75}7677static void __exit txx9aclc_generic_exit(void)78{79platform_driver_unregister(&txx9aclc_generic_driver);80}8182module_init(txx9aclc_generic_init);83module_exit(txx9aclc_generic_exit);8485MODULE_AUTHOR("Atsushi Nemoto <[email protected]>");86MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver");87MODULE_LICENSE("GPL");88MODULE_ALIAS("platform:txx9aclc-generic");899091