Humble beginings
This commit is contained in:
parent
256abd8e55
commit
a2949ed0e7
|
@ -0,0 +1,63 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* AES67 soundcard
|
||||
*
|
||||
* */
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/interval.h>
|
||||
|
||||
/* Definistion of AES67 Virtual SoundCard */
|
||||
struct aes67 {
|
||||
struct snd_card *card;
|
||||
};
|
||||
|
||||
/* Destructor */
|
||||
static int snd_aes67_free(struct aes67 *virtcard)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Component Free */
|
||||
static int snd_aes67_dev_free(struct snd_device *device)
|
||||
{
|
||||
return snd_aes67_free(device->device_data);
|
||||
}
|
||||
|
||||
/* Constructor */
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
*rvirtcard = NULL:
|
||||
|
||||
/* Setup Connection Handlers */
|
||||
|
||||
/* allocate memory for virt card */
|
||||
virtcard = kzalloc(sizeof(*virtcard), GFP_KERNEL);
|
||||
if (virtcard == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
virtcard->card = card;
|
||||
|
||||
/* COnnect to things */
|
||||
|
||||
|
||||
/* Build Sound Device */
|
||||
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, virtcard, &ops);
|
||||
if (err < 0) {
|
||||
snd_aes67_free(virtcard);
|
||||
return err;
|
||||
}
|
||||
|
||||
*rvirtcard = virtcard;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue