#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/cs8427.h>
#include <sound/info.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/asoundef.h>
#include "ice1712.h"
#include "delta.h"
#include "ews.h"
#include "hoontech.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
static char *model[SNDRV_CARDS];
static bool omni[SNDRV_CARDS];
static int cs8427_timeout[SNDRV_CARDS] = …;
static int dxr_enable[SNDRV_CARDS];
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
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_ice1712_ids[] = …;
MODULE_DEVICE_TABLE(pci, snd_ice1712_ids);
static int snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice);
static int snd_ice1712_build_controls(struct snd_ice1712 *ice);
static int PRO_RATE_LOCKED;
static int PRO_RATE_RESET = …;
static unsigned int PRO_RATE_DEFAULT = …;
static inline int is_spdif_master(struct snd_ice1712 *ice)
{ … }
static inline int is_pro_rate_locked(struct snd_ice1712 *ice)
{ … }
static inline void snd_ice1712_ds_write(struct snd_ice1712 *ice, u8 channel, u8 addr, u32 data)
{ … }
static inline u32 snd_ice1712_ds_read(struct snd_ice1712 *ice, u8 channel, u8 addr)
{ … }
static void snd_ice1712_ac97_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{ … }
static unsigned short snd_ice1712_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{ … }
static void snd_ice1712_pro_ac97_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{ … }
static unsigned short snd_ice1712_pro_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{ … }
#define snd_ice1712_digmix_route_ac97_info …
static int snd_ice1712_digmix_route_ac97_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_mixer_digmix_route_ac97 = …;
static void snd_ice1712_set_gpio_dir(struct snd_ice1712 *ice, unsigned int data)
{ … }
static unsigned int snd_ice1712_get_gpio_dir(struct snd_ice1712 *ice)
{ … }
static unsigned int snd_ice1712_get_gpio_mask(struct snd_ice1712 *ice)
{ … }
static void snd_ice1712_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data)
{ … }
static unsigned int snd_ice1712_get_gpio_data(struct snd_ice1712 *ice)
{ … }
static void snd_ice1712_set_gpio_data(struct snd_ice1712 *ice, unsigned int val)
{ … }
static int snd_ice1712_cs8427_set_input_clock(struct snd_ice1712 *ice, int spdif_clock)
{ … }
static void open_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ … }
static void close_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ … }
static void setup_cs8427(struct snd_ice1712 *ice, int rate)
{ … }
int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
{ … }
static void snd_ice1712_set_input_clock_source(struct snd_ice1712 *ice, int spdif_is_master)
{ … }
static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id)
{ … }
static int snd_ice1712_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_ice1712_playback_ds_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_ice1712_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_ice1712_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_ds_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_prepare(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_hardware snd_ice1712_playback = …;
static const struct snd_pcm_hardware snd_ice1712_playback_ds = …;
static const struct snd_pcm_hardware snd_ice1712_capture = …;
static int snd_ice1712_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_ds_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_ds_close(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_close(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_ice1712_playback_ops = …;
static const struct snd_pcm_ops snd_ice1712_playback_ds_ops = …;
static const struct snd_pcm_ops snd_ice1712_capture_ops = …;
static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device)
{ … }
static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device)
{ … }
static const unsigned int rates[] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_rates = …;
static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static void snd_ice1712_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate, int force)
{ … }
static int snd_ice1712_playback_pro_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_pro_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int snd_ice1712_capture_pro_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_pro_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_hardware snd_ice1712_playback_pro = …;
static const struct snd_pcm_hardware snd_ice1712_capture_pro = …;
static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_playback_pro_close(struct snd_pcm_substream *substream)
{ … }
static int snd_ice1712_capture_pro_close(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_ice1712_playback_pro_ops = …;
static const struct snd_pcm_ops snd_ice1712_capture_pro_ops = …;
static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device)
{ … }
static void snd_ice1712_update_volume(struct snd_ice1712 *ice, int index)
{ … }
#define snd_ice1712_pro_mixer_switch_info …
static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_mixer_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_SCALE(db_scale_playback, -14400, 150, 0);
static const struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] = …;
static const struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch = …;
static const struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch = …;
static const struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume = …;
static const struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume = …;
static int snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice)
{ … }
static void snd_ice1712_mixer_free_ac97(struct snd_ac97 *ac97)
{ … }
static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice)
{ … }
static inline unsigned int eeprom_double(struct snd_ice1712 *ice, int idx)
{ … }
static void snd_ice1712_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ … }
static void snd_ice1712_proc_init(struct snd_ice1712 *ice)
{ … }
static int snd_ice1712_eeprom_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_eeprom_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_eeprom = …;
static int snd_ice1712_spdif_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_spdif_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_spdif_default_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_spdif_default = …;
static int snd_ice1712_spdif_maskc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_spdif_maskp_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_spdif_maskc = …;
static const struct snd_kcontrol_new snd_ice1712_spdif_maskp = …;
static int snd_ice1712_spdif_stream_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_spdif_stream = …;
int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_internal_clock_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_internal_clock_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_pro_internal_clock = …;
static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_internal_clock_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_pro_internal_clock_default = …;
#define snd_ice1712_pro_rate_locking_info …
static int snd_ice1712_pro_rate_locking_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_rate_locking_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_pro_rate_locking = …;
#define snd_ice1712_pro_rate_reset_info …
static int snd_ice1712_pro_rate_reset_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_rate_reset_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_pro_rate_reset = …;
static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_route_analog_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_route_analog_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_route_spdif_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route = …;
static const struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route = …;
static int snd_ice1712_pro_volume_rate_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_volume_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_ice1712_pro_volume_rate_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_mixer_pro_volume_rate = …;
static int snd_ice1712_pro_peak_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new snd_ice1712_mixer_pro_peak = …;
static const struct snd_ice1712_card_info *card_tables[] = …;
static unsigned char snd_ice1712_read_i2c(struct snd_ice1712 *ice,
unsigned char dev,
unsigned char addr)
{ … }
static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
const char *modelname)
{ … }
static int snd_ice1712_chip_init(struct snd_ice1712 *ice)
{ … }
int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice)
{ … }
static int snd_ice1712_build_controls(struct snd_ice1712 *ice)
{ … }
static void snd_ice1712_free(struct snd_card *card)
{ … }
static int snd_ice1712_create(struct snd_card *card,
struct pci_dev *pci,
const char *modelname,
int omni,
int cs8427_timeout,
int dxr_enable)
{ … }
static struct snd_ice1712_card_info no_matched;
static int snd_ice1712_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
#ifdef CONFIG_PM_SLEEP
static int snd_ice1712_suspend(struct device *dev)
{ … }
static int snd_ice1712_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(snd_ice1712_pm, snd_ice1712_suspend, snd_ice1712_resume);
#define SND_VT1712_PM_OPS …
#else
#define SND_VT1712_PM_OPS …
#endif
static struct pci_driver ice1712_driver = …;
module_pci_driver(…) …;