2019-06-04 10:11:33 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2009-05-19 15:12:15 +02:00
|
|
|
/*
|
|
|
|
* Generic TXx9 ACLC machine driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Atsushi Nemoto
|
|
|
|
*
|
|
|
|
* Based on RBTX49xx patch from CELF patch archive.
|
|
|
|
* (C) Copyright TOSHIBA CORPORATION 2004-2006
|
|
|
|
*
|
|
|
|
* This is a very generic AC97 sound machine driver for boards which
|
|
|
|
* have (AC97) audio at ACLC (e.g. RBTX49XX boards).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <sound/core.h>
|
|
|
|
#include <sound/pcm.h>
|
|
|
|
#include <sound/soc.h>
|
|
|
|
#include "txx9aclc.h"
|
|
|
|
|
2019-06-06 06:18:25 +02:00
|
|
|
SND_SOC_DAILINK_DEFS(hifi,
|
|
|
|
DAILINK_COMP_ARRAY(COMP_CPU("txx9aclc-ac97")),
|
|
|
|
DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
|
|
|
|
DAILINK_COMP_ARRAY(COMP_PLATFORM("txx9aclc-pcm-audio")));
|
|
|
|
|
2009-05-19 15:12:15 +02:00
|
|
|
static struct snd_soc_dai_link txx9aclc_generic_dai = {
|
|
|
|
.name = "AC97",
|
|
|
|
.stream_name = "AC97 HiFi",
|
2019-06-06 06:18:25 +02:00
|
|
|
SND_SOC_DAILINK_REG(hifi),
|
2009-05-19 15:12:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct snd_soc_card txx9aclc_generic_card = {
|
|
|
|
.name = "Generic TXx9 ACLC Audio",
|
2011-12-23 07:54:30 +01:00
|
|
|
.owner = THIS_MODULE,
|
2009-05-19 15:12:15 +02:00
|
|
|
.dai_link = &txx9aclc_generic_dai,
|
|
|
|
.num_links = 1,
|
|
|
|
};
|
|
|
|
|
2010-03-17 21:15:21 +01:00
|
|
|
static struct platform_device *soc_pdev;
|
2009-05-19 15:12:15 +02:00
|
|
|
|
|
|
|
static int __init txx9aclc_generic_probe(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
soc_pdev = platform_device_alloc("soc-audio", -1);
|
|
|
|
if (!soc_pdev)
|
|
|
|
return -ENOMEM;
|
2010-03-17 21:15:21 +01:00
|
|
|
platform_set_drvdata(soc_pdev, &txx9aclc_generic_card);
|
2009-05-19 15:12:15 +02:00
|
|
|
ret = platform_device_add(soc_pdev);
|
|
|
|
if (ret) {
|
|
|
|
platform_device_put(soc_pdev);
|
|
|
|
return ret;
|
|
|
|
}
|
2010-03-17 21:15:21 +01:00
|
|
|
|
2009-05-19 15:12:15 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __exit txx9aclc_generic_remove(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
platform_device_unregister(soc_pdev);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver txx9aclc_generic_driver = {
|
2011-10-03 03:38:32 +02:00
|
|
|
.remove = __exit_p(txx9aclc_generic_remove),
|
2009-05-19 15:12:15 +02:00
|
|
|
.driver = {
|
|
|
|
.name = "txx9aclc-generic",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init txx9aclc_generic_init(void)
|
|
|
|
{
|
|
|
|
return platform_driver_probe(&txx9aclc_generic_driver,
|
|
|
|
txx9aclc_generic_probe);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit txx9aclc_generic_exit(void)
|
|
|
|
{
|
|
|
|
platform_driver_unregister(&txx9aclc_generic_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(txx9aclc_generic_init);
|
|
|
|
module_exit(txx9aclc_generic_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
|
|
|
|
MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver");
|
|
|
|
MODULE_LICENSE("GPL");
|
2010-04-08 20:52:00 +02:00
|
|
|
MODULE_ALIAS("platform:txx9aclc-generic");
|