Humble beginings

This commit is contained in:
Preston Baxter 2024-07-08 22:12:34 -05:00
parent 256abd8e55
commit a2949ed0e7
2 changed files with 63 additions and 0 deletions

0
include/sound/aes67.h Normal file
View File

63
sound/drivers/aes67.c Normal file
View File

@ -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;
}