it builds now, however need to add the module configuration so it can load
This commit is contained in:
parent
a2949ed0e7
commit
5857de19f4
|
@ -43,7 +43,7 @@ menuconfig SND_DRIVERS
|
|||
default y
|
||||
help
|
||||
Support for generic sound devices.
|
||||
|
||||
|
||||
if SND_DRIVERS
|
||||
|
||||
config SND_PCSP
|
||||
|
@ -89,6 +89,12 @@ config SND_DUMMY
|
|||
To compile this driver as a module, choose M here: the module
|
||||
will be called snd-dummy.
|
||||
|
||||
config SND_AES67
|
||||
tristate "AES67 Network Soundcard"
|
||||
select SND_PCM
|
||||
help
|
||||
Y for AES67 Goodness
|
||||
|
||||
config SND_ALOOP
|
||||
tristate "Generic loopback driver (PCM)"
|
||||
select SND_PCM
|
||||
|
@ -160,12 +166,12 @@ config SND_MTS64
|
|||
depends on PARPORT
|
||||
select SND_RAWMIDI
|
||||
help
|
||||
The ESI Miditerminal 4140 is a 4 In 4 Out MIDI Interface with
|
||||
The ESI Miditerminal 4140 is a 4 In 4 Out MIDI Interface with
|
||||
additional SMPTE Timecode capabilities for the parallel port.
|
||||
|
||||
Say 'Y' to include support for this device.
|
||||
|
||||
To compile this driver as a module, chose 'M' here: the module
|
||||
To compile this driver as a module, chose 'M' here: the module
|
||||
will be called snd-mts64.
|
||||
|
||||
config SND_SERIAL_U16550
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#
|
||||
|
||||
snd-dummy-y := dummy.o
|
||||
snd-aes67-y := aes67.o
|
||||
snd-aloop-y := aloop.o
|
||||
snd-mtpav-y := mtpav.o
|
||||
snd-mts64-y := mts64.o
|
||||
|
@ -16,6 +17,7 @@ snd-virmidi-y := virmidi.o
|
|||
|
||||
# Toplevel Module Dependency
|
||||
obj-$(CONFIG_SND_DUMMY) += snd-dummy.o
|
||||
obj-$(CONFIG_SND_AES67) += snd-aes67.o
|
||||
obj-$(CONFIG_SND_ALOOP) += snd-aloop.o
|
||||
obj-$(CONFIG_SND_VIRMIDI) += snd-virmidi.o
|
||||
obj-$(CONFIG_SND_PCMTEST) += snd-pcmtest.o
|
||||
|
|
|
@ -6,8 +6,13 @@
|
|||
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/interval.h>
|
||||
|
||||
MODULE_AUTHOR("Preston Baxter <preston@preston-baxter.xom>");
|
||||
MODULE_DESCRIPTION("AES67 Virtual Soundcard");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
/* Definistion of AES67 Virtual SoundCard */
|
||||
struct aes67 {
|
||||
|
@ -33,10 +38,10 @@ static int snd_aes67_create(struct snd_card *card, struct aes67 **rvirtcard)
|
|||
struct aes67 *virtcard;
|
||||
int err;
|
||||
static const struct snd_device_ops ops = {
|
||||
.dev_free = snd_aes67_free,
|
||||
.dev_free = snd_aes67_dev_free,
|
||||
};
|
||||
|
||||
*rvirtcard = NULL:
|
||||
*rvirtcard = NULL;
|
||||
|
||||
/* Setup Connection Handlers */
|
||||
|
||||
|
@ -49,7 +54,6 @@ static int snd_aes67_create(struct snd_card *card, struct aes67 **rvirtcard)
|
|||
|
||||
/* COnnect to things */
|
||||
|
||||
|
||||
/* Build Sound Device */
|
||||
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, virtcard, &ops);
|
||||
if (err < 0) {
|
||||
|
@ -61,3 +65,96 @@ static int snd_aes67_create(struct snd_card *card, struct aes67 **rvirtcard)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Probe method */
|
||||
static int aes67_probe(struct platform_device *devptr)
|
||||
{
|
||||
static int deviceNumber;
|
||||
struct snd_card *card;
|
||||
struct aes67 *virtcard;
|
||||
int err;
|
||||
|
||||
//Incredibly temporary
|
||||
if (deviceNumber > 1) {
|
||||
return -ENODEV;
|
||||
}
|
||||
deviceNumber++;
|
||||
|
||||
snd_printk(KERN_INFO "Attempting to create Soundcard for AES67\n");
|
||||
err = snd_devm_card_new(&devptr->dev, 0, "xid", THIS_MODULE,
|
||||
sizeof(struct aes67), &card);
|
||||
if (err < 0)
|
||||
snd_printk(KERN_ERR "Unable to create AES67 Soundcard\n");
|
||||
return err;
|
||||
virtcard = card->private_data;
|
||||
|
||||
snd_printk(KERN_INFO "Attempting to create AES67 Virtual Soundcard\n");
|
||||
err = snd_aes67_create(card, &virtcard);
|
||||
if (err < 0)
|
||||
snd_printk(KERN_ERR "Unable to create AES67rtual Soundcard\n");
|
||||
goto error;
|
||||
|
||||
/* Setup Names */
|
||||
strcpy(card->driver, "AES67 VSC");
|
||||
strcpy(card->shortname, "AES67 Virtual Soundcard");
|
||||
strcpy(card->longname, "AES67 Virtual Soundcard - 8x8");
|
||||
|
||||
snd_printk(KERN_INFO
|
||||
"Attempting to Register AES67 Virtual Soundcard\n");
|
||||
err = snd_card_register(card);
|
||||
if (err < 0)
|
||||
snd_printk(KERN_ERR
|
||||
"Unable to Register AES67 Virtual Soundcard\n");
|
||||
goto error;
|
||||
|
||||
error:
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Power Methods */
|
||||
static int snd_aes67_suspend(struct device *pdev)
|
||||
{
|
||||
struct snd_card *card = dev_get_drvdata(pdev);
|
||||
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_aes67_resume(struct device *pdev)
|
||||
{
|
||||
struct snd_card *card = dev_get_drvdata(pdev);
|
||||
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||
return 0;
|
||||
}
|
||||
/* Power management operations. Most definitely need to revisit this */
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(snd_aes67_pm, snd_aes67_suspend,
|
||||
snd_aes67_resume);
|
||||
|
||||
#define SND_AES67_DRIVER "snd_aes67"
|
||||
|
||||
static struct platform_driver snd_aes67_driver = {
|
||||
.probe = aes67_probe,
|
||||
.driver = {
|
||||
.name = SND_AES67_DRIVER,
|
||||
.pm = &snd_aes67_pm,
|
||||
},
|
||||
};
|
||||
|
||||
/* Module init and exit functions */
|
||||
static int __init alsa_card_aes67_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = platform_driver_register(&snd_aes67_driver);
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit alsa_card_aes67_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&snd_aes67_driver);
|
||||
}
|
||||
|
||||
module_init(alsa_card_aes67_init) module_exit(alsa_card_aes67_exit)
|
||||
|
|
Loading…
Reference in New Issue