linux/sound/pci/aw2/aw2-alsa.c

// SPDX-License-Identifier: GPL-2.0-only
/*****************************************************************************
 *
 * Copyright (C) 2008 Cedric Bregardis <[email protected]> and
 * Jean-Christian Hassler <[email protected]>
 *
 * This file is part of the Audiowerk2 ALSA driver
 *
 *****************************************************************************/
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>

#include "saa7146.h"
#include "aw2-saa7146.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/*********************************
 * DEFINES
 ********************************/
#define CTL_ROUTE_ANALOG
#define CTL_ROUTE_DIGITAL

/*********************************
 * TYPEDEFS
 ********************************/
  /* hardware definition */
static const struct snd_pcm_hardware snd_aw2_playback_hw =;

static const struct snd_pcm_hardware snd_aw2_capture_hw =;

struct aw2_pcm_device {};

struct aw2 {};

/*********************************
 * FUNCTION DECLARATIONS
 ********************************/
static int snd_aw2_create(struct snd_card *card, struct pci_dev *pci);
static int snd_aw2_probe(struct pci_dev *pci,
			 const struct pci_device_id *pci_id);
static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream,
					int cmd);
static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream,
				       int cmd);
static snd_pcm_uframes_t snd_aw2_pcm_pointer_playback(struct snd_pcm_substream
						      *substream);
static snd_pcm_uframes_t snd_aw2_pcm_pointer_capture(struct snd_pcm_substream
						     *substream);
static int snd_aw2_new_pcm(struct aw2 *chip);

static int snd_aw2_control_switch_capture_info(struct snd_kcontrol *kcontrol,
					       struct snd_ctl_elem_info *uinfo);
static int snd_aw2_control_switch_capture_get(struct snd_kcontrol *kcontrol,
					      struct snd_ctl_elem_value
					      *ucontrol);
static int snd_aw2_control_switch_capture_put(struct snd_kcontrol *kcontrol,
					      struct snd_ctl_elem_value
					      *ucontrol);

/*********************************
 * VARIABLES
 ********************************/
static int index[SNDRV_CARDS] =;
static char *id[SNDRV_CARDS] =;
static bool enable[SNDRV_CARDS] =;

module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();

static const struct pci_device_id snd_aw2_ids[] =;

MODULE_DEVICE_TABLE(pci, snd_aw2_ids);

/* pci_driver definition */
static struct pci_driver aw2_driver =;

module_pci_driver();

/* operators for playback PCM alsa interface */
static const struct snd_pcm_ops snd_aw2_playback_ops =;

/* operators for capture PCM alsa interface */
static const struct snd_pcm_ops snd_aw2_capture_ops =;

static const struct snd_kcontrol_new aw2_control =;

/*********************************
 * FUNCTION IMPLEMENTATIONS
 ********************************/

/* component-destructor */
static void snd_aw2_free(struct snd_card *card)
{}

/* chip-specific constructor */
static int snd_aw2_create(struct snd_card *card,
			  struct pci_dev *pci)
{}

/* constructor */
static int snd_aw2_probe(struct pci_dev *pci,
			 const struct pci_device_id *pci_id)
{}

/* open callback */
static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream)
{}

/* close callback */
static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream)
{}

static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream)
{}

/* close callback */
static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream)
{}

/* prepare callback for playback */
static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream)
{}

/* prepare callback for capture */
static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream)
{}

/* playback trigger callback */
static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream,
					int cmd)
{}

/* capture trigger callback */
static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream,
				       int cmd)
{}

/* playback pointer callback */
static snd_pcm_uframes_t snd_aw2_pcm_pointer_playback(struct snd_pcm_substream
						      *substream)
{}

/* capture pointer callback */
static snd_pcm_uframes_t snd_aw2_pcm_pointer_capture(struct snd_pcm_substream
						     *substream)
{}

/* create a pcm device */
static int snd_aw2_new_pcm(struct aw2 *chip)
{}

static int snd_aw2_control_switch_capture_info(struct snd_kcontrol *kcontrol,
					       struct snd_ctl_elem_info *uinfo)
{}

static int snd_aw2_control_switch_capture_get(struct snd_kcontrol *kcontrol,
					      struct snd_ctl_elem_value
					      *ucontrol)
{}

static int snd_aw2_control_switch_capture_put(struct snd_kcontrol *kcontrol,
					      struct snd_ctl_elem_value
					      *ucontrol)
{}