mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-20 16:46:23 +08:00
[ALSA] Remove xxx_t typedefs: AC97
Modules: AC97 Codec Remove xxx_t typedefs from the AC97 codec support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
dc4cafbada
commit
ee42381e71
@ -391,38 +391,35 @@
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct _snd_ac97_bus ac97_bus_t;
|
||||
typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
|
||||
typedef struct _snd_ac97_template ac97_template_t;
|
||||
typedef struct _snd_ac97 ac97_t;
|
||||
struct snd_ac97;
|
||||
|
||||
struct snd_ac97_build_ops {
|
||||
int (*build_3d) (ac97_t *ac97);
|
||||
int (*build_specific) (ac97_t *ac97);
|
||||
int (*build_spdif) (ac97_t *ac97);
|
||||
int (*build_post_spdif) (ac97_t *ac97);
|
||||
int (*build_3d) (struct snd_ac97 *ac97);
|
||||
int (*build_specific) (struct snd_ac97 *ac97);
|
||||
int (*build_spdif) (struct snd_ac97 *ac97);
|
||||
int (*build_post_spdif) (struct snd_ac97 *ac97);
|
||||
#ifdef CONFIG_PM
|
||||
void (*suspend) (ac97_t *ac97);
|
||||
void (*resume) (ac97_t *ac97);
|
||||
void (*suspend) (struct snd_ac97 *ac97);
|
||||
void (*resume) (struct snd_ac97 *ac97);
|
||||
#endif
|
||||
void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */
|
||||
void (*update_jacks) (struct snd_ac97 *ac97); /* for jack-sharing */
|
||||
};
|
||||
|
||||
struct _snd_ac97_bus_ops {
|
||||
void (*reset) (ac97_t *ac97);
|
||||
void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val);
|
||||
unsigned short (*read) (ac97_t *ac97, unsigned short reg);
|
||||
void (*wait) (ac97_t *ac97);
|
||||
void (*init) (ac97_t *ac97);
|
||||
struct snd_ac97_bus_ops {
|
||||
void (*reset) (struct snd_ac97 *ac97);
|
||||
void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
|
||||
unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
|
||||
void (*wait) (struct snd_ac97 *ac97);
|
||||
void (*init) (struct snd_ac97 *ac97);
|
||||
};
|
||||
|
||||
struct _snd_ac97_bus {
|
||||
struct snd_ac97_bus {
|
||||
/* -- lowlevel (hardware) driver specific -- */
|
||||
ac97_bus_ops_t *ops;
|
||||
struct snd_ac97_bus_ops *ops;
|
||||
void *private_data;
|
||||
void (*private_free) (ac97_bus_t *bus);
|
||||
void (*private_free) (struct snd_ac97_bus *bus);
|
||||
/* --- */
|
||||
snd_card_t *card;
|
||||
struct snd_card *card;
|
||||
unsigned short num; /* bus number */
|
||||
unsigned short no_vra: 1, /* bridge doesn't support VRA */
|
||||
dra: 1, /* bridge supports double rate */
|
||||
@ -432,13 +429,13 @@ struct _snd_ac97_bus {
|
||||
unsigned short used_slots[2][4]; /* actually used PCM slots */
|
||||
unsigned short pcms_count; /* count of PCMs */
|
||||
struct ac97_pcm *pcms;
|
||||
ac97_t *codec[4];
|
||||
snd_info_entry_t *proc;
|
||||
struct snd_ac97 *codec[4];
|
||||
struct snd_info_entry *proc;
|
||||
};
|
||||
|
||||
struct _snd_ac97_template {
|
||||
struct snd_ac97_template {
|
||||
void *private_data;
|
||||
void (*private_free) (ac97_t *ac97);
|
||||
void (*private_free) (struct snd_ac97 *ac97);
|
||||
struct pci_dev *pci; /* assigned PCI device - used for quirks */
|
||||
unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
|
||||
unsigned short addr; /* physical address of codec [0-3] */
|
||||
@ -447,16 +444,16 @@ struct _snd_ac97_template {
|
||||
DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
|
||||
};
|
||||
|
||||
struct _snd_ac97 {
|
||||
struct snd_ac97 {
|
||||
/* -- lowlevel (hardware) driver specific -- */
|
||||
struct snd_ac97_build_ops * build_ops;
|
||||
void *private_data;
|
||||
void (*private_free) (ac97_t *ac97);
|
||||
void (*private_free) (struct snd_ac97 *ac97);
|
||||
/* --- */
|
||||
ac97_bus_t *bus;
|
||||
struct snd_ac97_bus *bus;
|
||||
struct pci_dev *pci; /* assigned PCI device - used for quirks */
|
||||
snd_info_entry_t *proc;
|
||||
snd_info_entry_t *proc_regs;
|
||||
struct snd_info_entry *proc;
|
||||
struct snd_info_entry *proc_regs;
|
||||
unsigned short subsystem_vendor;
|
||||
unsigned short subsystem_device;
|
||||
struct semaphore reg_mutex;
|
||||
@ -490,43 +487,47 @@ struct _snd_ac97 {
|
||||
struct device dev;
|
||||
};
|
||||
|
||||
#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev)
|
||||
#define to_ac97_t(d) container_of(d, struct snd_ac97, dev)
|
||||
|
||||
/* conditions */
|
||||
static inline int ac97_is_audio(ac97_t * ac97)
|
||||
static inline int ac97_is_audio(struct snd_ac97 * ac97)
|
||||
{
|
||||
return (ac97->scaps & AC97_SCAP_AUDIO);
|
||||
}
|
||||
static inline int ac97_is_modem(ac97_t * ac97)
|
||||
static inline int ac97_is_modem(struct snd_ac97 * ac97)
|
||||
{
|
||||
return (ac97->scaps & AC97_SCAP_MODEM);
|
||||
}
|
||||
static inline int ac97_is_rev22(ac97_t * ac97)
|
||||
static inline int ac97_is_rev22(struct snd_ac97 * ac97)
|
||||
{
|
||||
return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;
|
||||
}
|
||||
static inline int ac97_can_amap(ac97_t * ac97)
|
||||
static inline int ac97_can_amap(struct snd_ac97 * ac97)
|
||||
{
|
||||
return (ac97->ext_id & AC97_EI_AMAP) != 0;
|
||||
}
|
||||
static inline int ac97_can_spdif(ac97_t * ac97)
|
||||
static inline int ac97_can_spdif(struct snd_ac97 * ac97)
|
||||
{
|
||||
return (ac97->ext_id & AC97_EI_SPDIF) != 0;
|
||||
}
|
||||
|
||||
/* functions */
|
||||
int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops, void *private_data, ac97_bus_t **rbus); /* create new AC97 bus */
|
||||
int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */
|
||||
const char *snd_ac97_get_short_name(ac97_t *ac97);
|
||||
/* create new AC97 bus */
|
||||
int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
|
||||
void *private_data, struct snd_ac97_bus **rbus);
|
||||
/* create mixer controls */
|
||||
int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
|
||||
struct snd_ac97 **rac97);
|
||||
const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);
|
||||
|
||||
void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);
|
||||
unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);
|
||||
void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value);
|
||||
int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value);
|
||||
int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value);
|
||||
void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
|
||||
unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
|
||||
void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
|
||||
int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
|
||||
int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value);
|
||||
#ifdef CONFIG_PM
|
||||
void snd_ac97_suspend(ac97_t *ac97);
|
||||
void snd_ac97_resume(ac97_t *ac97);
|
||||
void snd_ac97_suspend(struct snd_ac97 *ac97);
|
||||
void snd_ac97_resume(struct snd_ac97 *ac97);
|
||||
#endif
|
||||
|
||||
/* quirk types */
|
||||
@ -551,8 +552,8 @@ struct ac97_quirk {
|
||||
int type; /* quirk type above */
|
||||
};
|
||||
|
||||
int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override);
|
||||
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate);
|
||||
int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override);
|
||||
int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate);
|
||||
|
||||
/*
|
||||
* PCM allocation
|
||||
@ -568,7 +569,7 @@ enum ac97_pcm_cfg {
|
||||
};
|
||||
|
||||
struct ac97_pcm {
|
||||
ac97_bus_t *bus;
|
||||
struct snd_ac97_bus *bus;
|
||||
unsigned int stream: 1, /* stream type: 1 = capture */
|
||||
exclusive: 1, /* exclusive mode, don't override with other pcms */
|
||||
copy_flag: 1, /* lowlevel driver must fill all entries */
|
||||
@ -579,18 +580,18 @@ struct ac97_pcm {
|
||||
unsigned short slots; /* driver input: requested AC97 slot numbers */
|
||||
unsigned short rslots[4]; /* allocated slots per codecs */
|
||||
unsigned char rate_table[4];
|
||||
ac97_t *codec[4]; /* allocated codecs */
|
||||
struct snd_ac97 *codec[4]; /* allocated codecs */
|
||||
} r[2]; /* 0 = standard rates, 1 = double rates */
|
||||
unsigned long private_value; /* used by the hardware driver */
|
||||
};
|
||||
|
||||
int snd_ac97_pcm_assign(ac97_bus_t *ac97,
|
||||
int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,
|
||||
unsigned short pcms_count,
|
||||
const struct ac97_pcm *pcms);
|
||||
int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
|
||||
enum ac97_pcm_cfg cfg, unsigned short slots);
|
||||
int snd_ac97_pcm_close(struct ac97_pcm *pcm);
|
||||
int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime);
|
||||
int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);
|
||||
|
||||
/* ad hoc AC97 device driver access */
|
||||
extern struct bus_type ac97_bus_type;
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
/*
|
||||
* Let drivers decide whether they want to support given codec from their
|
||||
* probe method. Drivers have direct access to the ac97_t structure and may
|
||||
* probe method. Drivers have direct access to the struct snd_ac97 structure and may
|
||||
* decide based on the id field amongst other things.
|
||||
*/
|
||||
static int ac97_bus_match(struct device *dev, struct device_driver *drv)
|
||||
|
@ -50,16 +50,16 @@ MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
|
||||
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
struct ac97_codec_id {
|
||||
unsigned int id;
|
||||
unsigned int mask;
|
||||
const char *name;
|
||||
int (*patch)(ac97_t *ac97);
|
||||
int (*mpatch)(ac97_t *ac97);
|
||||
int (*patch)(struct snd_ac97 *ac97);
|
||||
int (*mpatch)(struct snd_ac97 *ac97);
|
||||
unsigned int flags;
|
||||
} ac97_codec_id_t;
|
||||
};
|
||||
|
||||
static const ac97_codec_id_t snd_ac97_codec_id_vendors[] = {
|
||||
static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
|
||||
{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
|
||||
{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },
|
||||
{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },
|
||||
@ -86,7 +86,7 @@ static const ac97_codec_id_t snd_ac97_codec_id_vendors[] = {
|
||||
{ 0, 0, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static const ac97_codec_id_t snd_ac97_codec_ids[] = {
|
||||
static const struct ac97_codec_id snd_ac97_codec_ids[] = {
|
||||
{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
|
||||
{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
|
||||
{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
|
||||
@ -225,7 +225,7 @@ const char *snd_ac97_stereo_enhancements[] =
|
||||
* I/O routines
|
||||
*/
|
||||
|
||||
static int snd_ac97_valid_reg(ac97_t *ac97, unsigned short reg)
|
||||
static int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg)
|
||||
{
|
||||
if (ac97->limited_regs && ! test_bit(reg, ac97->reg_accessed))
|
||||
return 0;
|
||||
@ -278,7 +278,7 @@ static int snd_ac97_valid_reg(ac97_t *ac97, unsigned short reg)
|
||||
* #snd_ca97_write_cache(), so use this only when you don't want to
|
||||
* reflect the change to the suspend/resume state.
|
||||
*/
|
||||
void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value)
|
||||
void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
|
||||
{
|
||||
if (!snd_ac97_valid_reg(ac97, reg))
|
||||
return;
|
||||
@ -301,7 +301,7 @@ void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value)
|
||||
*
|
||||
* Returns the read value.
|
||||
*/
|
||||
unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)
|
||||
unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
|
||||
{
|
||||
if (!snd_ac97_valid_reg(ac97, reg))
|
||||
return 0;
|
||||
@ -309,7 +309,7 @@ unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)
|
||||
}
|
||||
|
||||
/* read a register - return the cached value if already read */
|
||||
static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short reg)
|
||||
static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97, unsigned short reg)
|
||||
{
|
||||
if (! test_bit(reg, ac97->reg_accessed)) {
|
||||
ac97->regs[reg] = ac97->bus->ops->read(ac97, reg);
|
||||
@ -328,7 +328,7 @@ static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short re
|
||||
* cache. The cached values are used for the cached-read and the
|
||||
* suspend/resume.
|
||||
*/
|
||||
void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value)
|
||||
void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
|
||||
{
|
||||
if (!snd_ac97_valid_reg(ac97, reg))
|
||||
return;
|
||||
@ -351,7 +351,7 @@ void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value
|
||||
* Returns 1 if the value is changed, 0 if no change, or a negative
|
||||
* code on failure.
|
||||
*/
|
||||
int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value)
|
||||
int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
|
||||
{
|
||||
int change;
|
||||
|
||||
@ -381,7 +381,7 @@ int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value)
|
||||
* Returns 1 if the bits are changed, 0 if no change, or a negative
|
||||
* code on failure.
|
||||
*/
|
||||
int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value)
|
||||
int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value)
|
||||
{
|
||||
int change;
|
||||
|
||||
@ -394,7 +394,7 @@ int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask,
|
||||
}
|
||||
|
||||
/* no lock version - see snd_ac97_updat_bits() */
|
||||
int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,
|
||||
int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,
|
||||
unsigned short mask, unsigned short value)
|
||||
{
|
||||
int change;
|
||||
@ -411,7 +411,7 @@ int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,
|
||||
return change;
|
||||
}
|
||||
|
||||
static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short mask, unsigned short value)
|
||||
static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec, unsigned short mask, unsigned short value)
|
||||
{
|
||||
int change;
|
||||
unsigned short old, new, cfg;
|
||||
@ -443,7 +443,7 @@ static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned sho
|
||||
* Controls
|
||||
*/
|
||||
|
||||
int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
|
||||
|
||||
@ -457,9 +457,9 @@ int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * ui
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
|
||||
unsigned short val, bitmask;
|
||||
|
||||
@ -473,9 +473,9 @@ int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * u
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
|
||||
unsigned short val;
|
||||
unsigned short mask, bitmask;
|
||||
@ -496,7 +496,7 @@ int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * u
|
||||
}
|
||||
|
||||
/* save/restore ac97 v2.3 paging */
|
||||
static int snd_ac97_page_save(ac97_t *ac97, int reg, snd_kcontrol_t *kcontrol)
|
||||
static int snd_ac97_page_save(struct snd_ac97 *ac97, int reg, struct snd_kcontrol *kcontrol)
|
||||
{
|
||||
int page_save = -1;
|
||||
if ((kcontrol->private_value & (1<<25)) &&
|
||||
@ -510,7 +510,7 @@ static int snd_ac97_page_save(ac97_t *ac97, int reg, snd_kcontrol_t *kcontrol)
|
||||
return page_save;
|
||||
}
|
||||
|
||||
static void snd_ac97_page_restore(ac97_t *ac97, int page_save)
|
||||
static void snd_ac97_page_restore(struct snd_ac97 *ac97, int page_save)
|
||||
{
|
||||
if (page_save >= 0) {
|
||||
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save);
|
||||
@ -519,7 +519,7 @@ static void snd_ac97_page_restore(ac97_t *ac97, int page_save)
|
||||
}
|
||||
|
||||
/* volume and switch controls */
|
||||
int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
int mask = (kcontrol->private_value >> 16) & 0xff;
|
||||
int shift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
@ -532,9 +532,9 @@ int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int reg = kcontrol->private_value & 0xff;
|
||||
int shift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
@ -555,9 +555,9 @@ int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontro
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int reg = kcontrol->private_value & 0xff;
|
||||
int shift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
@ -584,22 +584,22 @@ int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontro
|
||||
return err;
|
||||
}
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_master_mono[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_master_mono[2] = {
|
||||
AC97_SINGLE("Master Mono Playback Switch", AC97_MASTER_MONO, 15, 1, 1),
|
||||
AC97_SINGLE("Master Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_tone[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_tone[2] = {
|
||||
AC97_SINGLE("Tone Control - Bass", AC97_MASTER_TONE, 8, 15, 1),
|
||||
AC97_SINGLE("Tone Control - Treble", AC97_MASTER_TONE, 0, 15, 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_pc_beep[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_pc_beep[2] = {
|
||||
AC97_SINGLE("PC Speaker Playback Switch", AC97_PC_BEEP, 15, 1, 1),
|
||||
AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_mic_boost =
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
|
||||
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
|
||||
|
||||
|
||||
@ -615,18 +615,18 @@ AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 9, 2, std_mix),
|
||||
AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, std_mic),
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_control_capture_src =
|
||||
static const struct snd_kcontrol_new snd_ac97_control_capture_src =
|
||||
AC97_ENUM("Capture Source", std_enum[0]);
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_control_capture_vol =
|
||||
static const struct snd_kcontrol_new snd_ac97_control_capture_vol =
|
||||
AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0);
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_mic_capture[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_mic_capture[2] = {
|
||||
AC97_SINGLE("Mic Capture Switch", AC97_REC_GAIN_MIC, 15, 1, 1),
|
||||
AC97_SINGLE("Mic Capture Volume", AC97_REC_GAIN_MIC, 0, 15, 0)
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
enum {
|
||||
AC97_GENERAL_PCM_OUT = 0,
|
||||
AC97_GENERAL_STEREO_ENHANCEMENT,
|
||||
AC97_GENERAL_3D,
|
||||
@ -634,9 +634,9 @@ typedef enum {
|
||||
AC97_GENERAL_MONO,
|
||||
AC97_GENERAL_MIC,
|
||||
AC97_GENERAL_LOOPBACK
|
||||
} ac97_general_index_t;
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_general[7] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_general[7] = {
|
||||
AC97_ENUM("PCM Out Path & Mute", std_enum[1]),
|
||||
AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),
|
||||
AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),
|
||||
@ -646,45 +646,45 @@ AC97_ENUM("Mic Select", std_enum[3]),
|
||||
AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)
|
||||
};
|
||||
|
||||
const snd_kcontrol_new_t snd_ac97_controls_3d[2] = {
|
||||
const struct snd_kcontrol_new snd_ac97_controls_3d[2] = {
|
||||
AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0),
|
||||
AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_center[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_center[2] = {
|
||||
AC97_SINGLE("Center Playback Switch", AC97_CENTER_LFE_MASTER, 7, 1, 1),
|
||||
AC97_SINGLE("Center Playback Volume", AC97_CENTER_LFE_MASTER, 0, 31, 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_lfe[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_lfe[2] = {
|
||||
AC97_SINGLE("LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 1, 1),
|
||||
AC97_SINGLE("LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 31, 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_control_eapd =
|
||||
static const struct snd_kcontrol_new snd_ac97_control_eapd =
|
||||
AC97_SINGLE("External Amplifier", AC97_POWERDOWN, 15, 1, 1);
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_modem_switches[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_modem_switches[2] = {
|
||||
AC97_SINGLE("Off-hook Switch", AC97_GPIO_STATUS, 0, 1, 0),
|
||||
AC97_SINGLE("Caller ID Switch", AC97_GPIO_STATUS, 2, 1, 0)
|
||||
};
|
||||
|
||||
/* change the existing EAPD control as inverted */
|
||||
static void set_inv_eapd(ac97_t *ac97, snd_kcontrol_t *kctl)
|
||||
static void set_inv_eapd(struct snd_ac97 *ac97, struct snd_kcontrol *kctl)
|
||||
{
|
||||
kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0);
|
||||
snd_ac97_update_bits(ac97, AC97_POWERDOWN, (1<<15), (1<<15)); /* EAPD up */
|
||||
ac97->scaps |= AC97_SCAP_INV_EAPD;
|
||||
}
|
||||
|
||||
static int snd_ac97_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
static int snd_ac97_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
|
||||
uinfo->count = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
|
||||
IEC958_AES0_NONAUDIO |
|
||||
@ -696,7 +696,7 @@ static int snd_ac97_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
/* FIXME: AC'97 spec doesn't say which bits are used for what */
|
||||
ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
|
||||
@ -706,9 +706,9 @@ static int snd_ac97_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_spdif_default_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
down(&ac97->reg_mutex);
|
||||
ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff;
|
||||
@ -719,9 +719,9 @@ static int snd_ac97_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
unsigned int new = 0;
|
||||
unsigned short val = 0;
|
||||
int change;
|
||||
@ -787,9 +787,9 @@ static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
|
||||
return change;
|
||||
}
|
||||
|
||||
static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
|
||||
static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int reg = kcontrol->private_value & 0xff;
|
||||
int shift = (kcontrol->private_value >> 8) & 0xff;
|
||||
int mask = (kcontrol->private_value >> 16) & 0xff;
|
||||
@ -817,7 +817,7 @@ static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
|
||||
return change;
|
||||
}
|
||||
|
||||
const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = {
|
||||
const struct snd_kcontrol_new snd_ac97_controls_spdif[5] = {
|
||||
{
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||
@ -856,9 +856,9 @@ const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = {
|
||||
.get = snd_ac97_ad18xx_pcm_get_bits, .put = snd_ac97_ad18xx_pcm_put_bits, \
|
||||
.private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 16) }
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
static int snd_ac97_ad18xx_pcm_info_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int mask = (kcontrol->private_value >> 16) & 0x0f;
|
||||
int lshift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
@ -873,9 +873,9 @@ static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_get_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_ad18xx_pcm_get_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int codec = kcontrol->private_value & 3;
|
||||
int lshift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
@ -887,9 +887,9 @@ static int snd_ac97_ad18xx_pcm_get_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_put_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_ad18xx_pcm_put_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int codec = kcontrol->private_value & 3;
|
||||
int lshift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
@ -910,7 +910,7 @@ static int snd_ac97_ad18xx_pcm_put_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_
|
||||
.get = snd_ac97_ad18xx_pcm_get_volume, .put = snd_ac97_ad18xx_pcm_put_volume, \
|
||||
.private_value = codec }
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
|
||||
static int snd_ac97_ad18xx_pcm_info_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||
uinfo->count = 2;
|
||||
@ -919,9 +919,9 @@ static int snd_ac97_ad18xx_pcm_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_ele
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_get_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int codec = kcontrol->private_value & 3;
|
||||
|
||||
down(&ac97->page_mutex);
|
||||
@ -931,9 +931,9 @@ static int snd_ac97_ad18xx_pcm_get_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_ad18xx_pcm_put_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
|
||||
static int snd_ac97_ad18xx_pcm_put_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int codec = kcontrol->private_value & 3;
|
||||
unsigned short val1, val2;
|
||||
|
||||
@ -942,22 +942,22 @@ static int snd_ac97_ad18xx_pcm_put_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele
|
||||
return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2);
|
||||
}
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_pcm[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_pcm[2] = {
|
||||
AD18XX_PCM_BITS("PCM Playback Switch", 0, 15, 7, 1),
|
||||
AD18XX_PCM_VOLUME("PCM Playback Volume", 0)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_surround[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_surround[2] = {
|
||||
AD18XX_PCM_BITS("Surround Playback Switch", 1, 15, 7, 1),
|
||||
AD18XX_PCM_VOLUME("Surround Playback Volume", 1)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_center[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_center[2] = {
|
||||
AD18XX_PCM_BITS("Center Playback Switch", 2, 15, 15, 1),
|
||||
AD18XX_PCM_BITS("Center Playback Volume", 2, 8, 8, 31)
|
||||
};
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_lfe[2] = {
|
||||
static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_lfe[2] = {
|
||||
AD18XX_PCM_BITS("LFE Playback Switch", 2, 7, 7, 1),
|
||||
AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
|
||||
};
|
||||
@ -966,9 +966,9 @@ AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
|
||||
*
|
||||
*/
|
||||
|
||||
static void snd_ac97_powerdown(ac97_t *ac97);
|
||||
static void snd_ac97_powerdown(struct snd_ac97 *ac97);
|
||||
|
||||
static int snd_ac97_bus_free(ac97_bus_t *bus)
|
||||
static int snd_ac97_bus_free(struct snd_ac97_bus *bus)
|
||||
{
|
||||
if (bus) {
|
||||
snd_ac97_bus_proc_done(bus);
|
||||
@ -980,13 +980,13 @@ static int snd_ac97_bus_free(ac97_bus_t *bus)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_bus_dev_free(snd_device_t *device)
|
||||
static int snd_ac97_bus_dev_free(struct snd_device *device)
|
||||
{
|
||||
ac97_bus_t *bus = device->device_data;
|
||||
struct snd_ac97_bus *bus = device->device_data;
|
||||
return snd_ac97_bus_free(bus);
|
||||
}
|
||||
|
||||
static int snd_ac97_free(ac97_t *ac97)
|
||||
static int snd_ac97_free(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (ac97) {
|
||||
snd_ac97_proc_done(ac97);
|
||||
@ -999,14 +999,14 @@ static int snd_ac97_free(ac97_t *ac97)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_dev_free(snd_device_t *device)
|
||||
static int snd_ac97_dev_free(struct snd_device *device)
|
||||
{
|
||||
ac97_t *ac97 = device->device_data;
|
||||
struct snd_ac97 *ac97 = device->device_data;
|
||||
snd_ac97_powerdown(ac97); /* for avoiding click noises during shut down */
|
||||
return snd_ac97_free(ac97);
|
||||
}
|
||||
|
||||
static int snd_ac97_try_volume_mix(ac97_t * ac97, int reg)
|
||||
static int snd_ac97_try_volume_mix(struct snd_ac97 * ac97, int reg)
|
||||
{
|
||||
unsigned short val, mask = 0x8000;
|
||||
|
||||
@ -1052,13 +1052,14 @@ static int snd_ac97_try_volume_mix(ac97_t * ac97, int reg)
|
||||
/* try another test */
|
||||
snd_ac97_write_cache(ac97, reg, val | mask);
|
||||
val = snd_ac97_read(ac97, reg);
|
||||
val = snd_ac97_read(ac97, reg);
|
||||
if (!(val & mask))
|
||||
return 0; /* nothing here */
|
||||
}
|
||||
return 1; /* success, useable */
|
||||
}
|
||||
|
||||
static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max)
|
||||
static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max)
|
||||
{
|
||||
unsigned short cbit[3] = { 0x20, 0x10, 0x01 };
|
||||
unsigned char max[3] = { 63, 31, 15 };
|
||||
@ -1083,7 +1084,7 @@ static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max
|
||||
}
|
||||
}
|
||||
|
||||
int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit)
|
||||
int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit)
|
||||
{
|
||||
unsigned short mask, val, orig, res;
|
||||
|
||||
@ -1097,7 +1098,7 @@ int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit)
|
||||
}
|
||||
|
||||
/* check the volume resolution of center/lfe */
|
||||
static void snd_ac97_change_volume_params2(ac97_t * ac97, int reg, int shift, unsigned char *max)
|
||||
static void snd_ac97_change_volume_params2(struct snd_ac97 * ac97, int reg, int shift, unsigned char *max)
|
||||
{
|
||||
unsigned short val, val1;
|
||||
|
||||
@ -1123,9 +1124,9 @@ static inline int printable(unsigned int x)
|
||||
return x;
|
||||
}
|
||||
|
||||
snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97)
|
||||
struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97)
|
||||
{
|
||||
snd_kcontrol_new_t template;
|
||||
struct snd_kcontrol_new template;
|
||||
memcpy(&template, _template, sizeof(template));
|
||||
template.index = ac97->num;
|
||||
return snd_ctl_new1(&template, ac97);
|
||||
@ -1134,9 +1135,9 @@ snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97
|
||||
/*
|
||||
* create mute switch(es) for normal stereo controls
|
||||
*/
|
||||
static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int check_stereo, ac97_t *ac97)
|
||||
static int snd_ac97_cmute_new_stereo(struct snd_card *card, char *name, int reg, int check_stereo, struct snd_ac97 *ac97)
|
||||
{
|
||||
snd_kcontrol_t *kctl;
|
||||
struct snd_kcontrol *kctl;
|
||||
int err;
|
||||
unsigned short val, val1, mute_mask;
|
||||
|
||||
@ -1153,11 +1154,11 @@ static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int
|
||||
mute_mask = 0x8080;
|
||||
}
|
||||
if (mute_mask == 0x8080) {
|
||||
snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1);
|
||||
struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1);
|
||||
tmp.index = ac97->num;
|
||||
kctl = snd_ctl_new1(&tmp, ac97);
|
||||
} else {
|
||||
snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 15, 1, 1);
|
||||
struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 15, 1, 1);
|
||||
tmp.index = ac97->num;
|
||||
kctl = snd_ctl_new1(&tmp, ac97);
|
||||
}
|
||||
@ -1172,22 +1173,22 @@ static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int
|
||||
/*
|
||||
* create a volume for normal stereo/mono controls
|
||||
*/
|
||||
static int snd_ac97_cvol_new(snd_card_t *card, char *name, int reg, unsigned int lo_max,
|
||||
unsigned int hi_max, ac97_t *ac97)
|
||||
static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigned int lo_max,
|
||||
unsigned int hi_max, struct snd_ac97 *ac97)
|
||||
{
|
||||
int err;
|
||||
snd_kcontrol_t *kctl;
|
||||
struct snd_kcontrol *kctl;
|
||||
|
||||
if (! snd_ac97_valid_reg(ac97, reg))
|
||||
return 0;
|
||||
if (hi_max) {
|
||||
/* invert */
|
||||
snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1);
|
||||
struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1);
|
||||
tmp.index = ac97->num;
|
||||
kctl = snd_ctl_new1(&tmp, ac97);
|
||||
} else {
|
||||
/* invert */
|
||||
snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 0, lo_max, 1);
|
||||
struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 0, lo_max, 1);
|
||||
tmp.index = ac97->num;
|
||||
kctl = snd_ctl_new1(&tmp, ac97);
|
||||
}
|
||||
@ -1203,7 +1204,7 @@ static int snd_ac97_cvol_new(snd_card_t *card, char *name, int reg, unsigned int
|
||||
/*
|
||||
* create a mute-switch and a volume for normal stereo/mono controls
|
||||
*/
|
||||
static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg, int check_stereo, ac97_t *ac97)
|
||||
static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx, int reg, int check_stereo, struct snd_ac97 *ac97)
|
||||
{
|
||||
int err;
|
||||
char name[44];
|
||||
@ -1229,12 +1230,12 @@ static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg,
|
||||
#define snd_ac97_cmix_new(card, pfx, reg, ac97) snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97)
|
||||
#define snd_ac97_cmute_new(card, name, reg, ac97) snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97)
|
||||
|
||||
static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97);
|
||||
static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97);
|
||||
|
||||
static int snd_ac97_mixer_build(ac97_t * ac97)
|
||||
static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
|
||||
{
|
||||
snd_card_t *card = ac97->bus->card;
|
||||
snd_kcontrol_t *kctl;
|
||||
struct snd_card *card = ac97->bus->card;
|
||||
struct snd_kcontrol *kctl;
|
||||
int err;
|
||||
unsigned int idx;
|
||||
unsigned char max;
|
||||
@ -1531,7 +1532,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
|
||||
static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)
|
||||
{
|
||||
int err, idx;
|
||||
|
||||
@ -1555,7 +1556,7 @@ static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_ac97_test_rate(ac97_t *ac97, int reg, int shadow_reg, int rate)
|
||||
static int snd_ac97_test_rate(struct snd_ac97 *ac97, int reg, int shadow_reg, int rate)
|
||||
{
|
||||
unsigned short val;
|
||||
unsigned int tmp;
|
||||
@ -1568,7 +1569,7 @@ static int snd_ac97_test_rate(ac97_t *ac97, int reg, int shadow_reg, int rate)
|
||||
return val == (tmp & 0xffff);
|
||||
}
|
||||
|
||||
static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsigned int *r_result)
|
||||
static void snd_ac97_determine_rates(struct snd_ac97 *ac97, int reg, int shadow_reg, unsigned int *r_result)
|
||||
{
|
||||
unsigned int result = 0;
|
||||
unsigned short saved;
|
||||
@ -1628,7 +1629,7 @@ static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsi
|
||||
}
|
||||
|
||||
/* check AC97_SPDIF register to accept which sample rates */
|
||||
static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97)
|
||||
static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97)
|
||||
{
|
||||
unsigned int result = 0;
|
||||
int i;
|
||||
@ -1648,10 +1649,10 @@ static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97)
|
||||
}
|
||||
|
||||
/* look for the codec id table matching with the given id */
|
||||
static const ac97_codec_id_t *look_for_codec_id(const ac97_codec_id_t *table,
|
||||
static const struct ac97_codec_id *look_for_codec_id(const struct ac97_codec_id *table,
|
||||
unsigned int id)
|
||||
{
|
||||
const ac97_codec_id_t *pid;
|
||||
const struct ac97_codec_id *pid;
|
||||
|
||||
for (pid = table; pid->id; pid++)
|
||||
if (pid->id == (id & pid->mask))
|
||||
@ -1659,9 +1660,9 @@ static const ac97_codec_id_t *look_for_codec_id(const ac97_codec_id_t *table,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)
|
||||
void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int modem)
|
||||
{
|
||||
const ac97_codec_id_t *pid;
|
||||
const struct ac97_codec_id *pid;
|
||||
|
||||
sprintf(name, "0x%x %c%c%c", id,
|
||||
printable(id >> 24),
|
||||
@ -1699,9 +1700,9 @@ void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)
|
||||
*
|
||||
* Returns the short identifying name of the codec.
|
||||
*/
|
||||
const char *snd_ac97_get_short_name(ac97_t *ac97)
|
||||
const char *snd_ac97_get_short_name(struct snd_ac97 *ac97)
|
||||
{
|
||||
const ac97_codec_id_t *pid;
|
||||
const struct ac97_codec_id *pid;
|
||||
|
||||
for (pid = snd_ac97_codec_ids; pid->id; pid++)
|
||||
if (pid->id == (ac97->id & pid->mask))
|
||||
@ -1713,7 +1714,7 @@ const char *snd_ac97_get_short_name(ac97_t *ac97)
|
||||
/* wait for a while until registers are accessible after RESET
|
||||
* return 0 if ok, negative not ready
|
||||
*/
|
||||
static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)
|
||||
static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)
|
||||
{
|
||||
unsigned long end_time;
|
||||
unsigned short val;
|
||||
@ -1758,7 +1759,7 @@ static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)
|
||||
* @private_data: private data pointer for the new instance
|
||||
* @rbus: the pointer to store the new AC97 bus instance.
|
||||
*
|
||||
* Creates an AC97 bus component. An ac97_bus_t instance is newly
|
||||
* Creates an AC97 bus component. An struct snd_ac97_bus instance is newly
|
||||
* allocated and initialized.
|
||||
*
|
||||
* The ops table must include valid callbacks (at least read and
|
||||
@ -1772,12 +1773,12 @@ static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)
|
||||
*
|
||||
* Returns zero if successful, or a negative error code on failure.
|
||||
*/
|
||||
int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops,
|
||||
void *private_data, ac97_bus_t **rbus)
|
||||
int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
|
||||
void *private_data, struct snd_ac97_bus **rbus)
|
||||
{
|
||||
int err;
|
||||
ac97_bus_t *bus;
|
||||
static snd_device_ops_t dev_ops = {
|
||||
struct snd_ac97_bus *bus;
|
||||
static struct snd_device_ops dev_ops = {
|
||||
.dev_free = snd_ac97_bus_dev_free,
|
||||
};
|
||||
|
||||
@ -1807,9 +1808,9 @@ static void ac97_device_release(struct device * dev)
|
||||
}
|
||||
|
||||
/* register ac97 codec to bus */
|
||||
static int snd_ac97_dev_register(snd_device_t *device)
|
||||
static int snd_ac97_dev_register(struct snd_device *device)
|
||||
{
|
||||
ac97_t *ac97 = device->device_data;
|
||||
struct snd_ac97 *ac97 = device->device_data;
|
||||
int err;
|
||||
|
||||
ac97->dev.bus = &ac97_bus_type;
|
||||
@ -1825,9 +1826,9 @@ static int snd_ac97_dev_register(snd_device_t *device)
|
||||
}
|
||||
|
||||
/* unregister ac97 codec */
|
||||
static int snd_ac97_dev_unregister(snd_device_t *device)
|
||||
static int snd_ac97_dev_unregister(struct snd_device *device)
|
||||
{
|
||||
ac97_t *ac97 = device->device_data;
|
||||
struct snd_ac97 *ac97 = device->device_data;
|
||||
if (ac97->dev.bus)
|
||||
device_unregister(&ac97->dev);
|
||||
return snd_ac97_free(ac97);
|
||||
@ -1843,7 +1844,7 @@ static struct snd_ac97_build_ops null_build_ops;
|
||||
* the private data.
|
||||
* @rac97: the pointer to store the new ac97 instance.
|
||||
*
|
||||
* Creates an Codec97 component. An ac97_t instance is newly
|
||||
* Creates an Codec97 component. An struct snd_ac97 instance is newly
|
||||
* allocated and initialized from the template. The codec
|
||||
* is then initialized by the standard procedure.
|
||||
*
|
||||
@ -1855,16 +1856,16 @@ static struct snd_ac97_build_ops null_build_ops;
|
||||
*
|
||||
* Returns zero if successful, or a negative error code on failure.
|
||||
*/
|
||||
int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
|
||||
int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, struct snd_ac97 **rac97)
|
||||
{
|
||||
int err;
|
||||
ac97_t *ac97;
|
||||
snd_card_t *card;
|
||||
struct snd_ac97 *ac97;
|
||||
struct snd_card *card;
|
||||
char name[64];
|
||||
unsigned long end_time;
|
||||
unsigned int reg;
|
||||
const ac97_codec_id_t *pid;
|
||||
static snd_device_ops_t ops = {
|
||||
const struct ac97_codec_id *pid;
|
||||
static struct snd_device_ops ops = {
|
||||
.dev_free = snd_ac97_dev_free,
|
||||
.dev_register = snd_ac97_dev_register,
|
||||
.dev_unregister = snd_ac97_dev_unregister,
|
||||
@ -2148,7 +2149,7 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
|
||||
* MASTER and HEADPHONE registers are muted but the register cache values
|
||||
* are not changed, so that the values can be restored in snd_ac97_resume().
|
||||
*/
|
||||
static void snd_ac97_powerdown(ac97_t *ac97)
|
||||
static void snd_ac97_powerdown(struct snd_ac97 *ac97)
|
||||
{
|
||||
unsigned short power;
|
||||
|
||||
@ -2181,7 +2182,7 @@ static void snd_ac97_powerdown(ac97_t *ac97)
|
||||
*
|
||||
* Suspends the codec, power down the chip.
|
||||
*/
|
||||
void snd_ac97_suspend(ac97_t *ac97)
|
||||
void snd_ac97_suspend(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (ac97->build_ops->suspend)
|
||||
ac97->build_ops->suspend(ac97);
|
||||
@ -2191,7 +2192,7 @@ void snd_ac97_suspend(ac97_t *ac97)
|
||||
/*
|
||||
* restore ac97 status
|
||||
*/
|
||||
void snd_ac97_restore_status(ac97_t *ac97)
|
||||
void snd_ac97_restore_status(struct snd_ac97 *ac97)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2212,7 +2213,7 @@ void snd_ac97_restore_status(ac97_t *ac97)
|
||||
/*
|
||||
* restore IEC958 status
|
||||
*/
|
||||
void snd_ac97_restore_iec958(ac97_t *ac97)
|
||||
void snd_ac97_restore_iec958(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (ac97->ext_id & AC97_EI_SPDIF) {
|
||||
if (ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_SPDIF) {
|
||||
@ -2235,7 +2236,7 @@ void snd_ac97_restore_iec958(ac97_t *ac97)
|
||||
* Do the standard resume procedure, power up and restoring the
|
||||
* old register values.
|
||||
*/
|
||||
void snd_ac97_resume(ac97_t *ac97)
|
||||
void snd_ac97_resume(struct snd_ac97 *ac97)
|
||||
{
|
||||
unsigned long end_time;
|
||||
|
||||
@ -2301,18 +2302,18 @@ static void set_ctl_name(char *dst, const char *src, const char *suffix)
|
||||
}
|
||||
|
||||
/* remove the control with the given name and optional suffix */
|
||||
int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix)
|
||||
int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix)
|
||||
{
|
||||
snd_ctl_elem_id_t id;
|
||||
struct snd_ctl_elem_id id;
|
||||
memset(&id, 0, sizeof(id));
|
||||
set_ctl_name(id.name, name, suffix);
|
||||
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
|
||||
return snd_ctl_remove_id(ac97->bus->card, &id);
|
||||
}
|
||||
|
||||
static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name, const char *suffix)
|
||||
static struct snd_kcontrol *ctl_find(struct snd_ac97 *ac97, const char *name, const char *suffix)
|
||||
{
|
||||
snd_ctl_elem_id_t sid;
|
||||
struct snd_ctl_elem_id sid;
|
||||
memset(&sid, 0, sizeof(sid));
|
||||
set_ctl_name(sid.name, name, suffix);
|
||||
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
|
||||
@ -2320,9 +2321,9 @@ static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name, const char *suff
|
||||
}
|
||||
|
||||
/* rename the control with the given name and optional suffix */
|
||||
int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix)
|
||||
int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix)
|
||||
{
|
||||
snd_kcontrol_t *kctl = ctl_find(ac97, src, suffix);
|
||||
struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix);
|
||||
if (kctl) {
|
||||
set_ctl_name(kctl->id.name, dst, suffix);
|
||||
return 0;
|
||||
@ -2331,16 +2332,16 @@ int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const ch
|
||||
}
|
||||
|
||||
/* rename both Volume and Switch controls - don't check the return value */
|
||||
void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst)
|
||||
void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst)
|
||||
{
|
||||
snd_ac97_rename_ctl(ac97, src, dst, "Switch");
|
||||
snd_ac97_rename_ctl(ac97, src, dst, "Volume");
|
||||
}
|
||||
|
||||
/* swap controls */
|
||||
int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix)
|
||||
int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix)
|
||||
{
|
||||
snd_kcontrol_t *kctl1, *kctl2;
|
||||
struct snd_kcontrol *kctl1, *kctl2;
|
||||
kctl1 = ctl_find(ac97, s1, suffix);
|
||||
kctl2 = ctl_find(ac97, s2, suffix);
|
||||
if (kctl1 && kctl2) {
|
||||
@ -2353,7 +2354,7 @@ int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *
|
||||
|
||||
#if 1
|
||||
/* bind hp and master controls instead of using only hp control */
|
||||
static int bind_hp_volsw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
|
||||
static int bind_hp_volsw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
int err = snd_ac97_put_volsw(kcontrol, ucontrol);
|
||||
if (err > 0) {
|
||||
@ -2366,10 +2367,10 @@ static int bind_hp_volsw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
|
||||
}
|
||||
|
||||
/* ac97 tune: bind Master and Headphone controls */
|
||||
static int tune_hp_only(ac97_t *ac97)
|
||||
static int tune_hp_only(struct snd_ac97 *ac97)
|
||||
{
|
||||
snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL);
|
||||
snd_kcontrol_t *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
|
||||
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
|
||||
struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
|
||||
if (! msw || ! mvol)
|
||||
return -ENOENT;
|
||||
msw->put = bind_hp_volsw_put;
|
||||
@ -2381,7 +2382,7 @@ static int tune_hp_only(ac97_t *ac97)
|
||||
|
||||
#else
|
||||
/* ac97 tune: use Headphone control as master */
|
||||
static int tune_hp_only(ac97_t *ac97)
|
||||
static int tune_hp_only(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)
|
||||
return -ENOENT;
|
||||
@ -2393,7 +2394,7 @@ static int tune_hp_only(ac97_t *ac97)
|
||||
#endif
|
||||
|
||||
/* ac97 tune: swap Headphone and Master controls */
|
||||
static int tune_swap_hp(ac97_t *ac97)
|
||||
static int tune_swap_hp(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)
|
||||
return -ENOENT;
|
||||
@ -2403,7 +2404,7 @@ static int tune_swap_hp(ac97_t *ac97)
|
||||
}
|
||||
|
||||
/* ac97 tune: swap Surround and Master controls */
|
||||
static int tune_swap_surround(ac97_t *ac97)
|
||||
static int tune_swap_surround(struct snd_ac97 *ac97)
|
||||
{
|
||||
if (snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Switch") ||
|
||||
snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Volume"))
|
||||
@ -2412,7 +2413,7 @@ static int tune_swap_surround(ac97_t *ac97)
|
||||
}
|
||||
|
||||
/* ac97 tune: set up mic sharing for AD codecs */
|
||||
static int tune_ad_sharing(ac97_t *ac97)
|
||||
static int tune_ad_sharing(struct snd_ac97 *ac97)
|
||||
{
|
||||
unsigned short scfg;
|
||||
if ((ac97->id & 0xffffff00) != 0x41445300) {
|
||||
@ -2425,11 +2426,11 @@ static int tune_ad_sharing(ac97_t *ac97)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const snd_kcontrol_new_t snd_ac97_alc_jack_detect =
|
||||
static const struct snd_kcontrol_new snd_ac97_alc_jack_detect =
|
||||
AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
|
||||
|
||||
/* ac97 tune: set up ALC jack-select */
|
||||
static int tune_alc_jack(ac97_t *ac97)
|
||||
static int tune_alc_jack(struct snd_ac97 *ac97)
|
||||
{
|
||||
if ((ac97->id & 0xffffff00) != 0x414c4700) {
|
||||
snd_printk(KERN_ERR "ac97_quirk ALC_JACK is only for Realtek codecs\n");
|
||||
@ -2441,20 +2442,20 @@ static int tune_alc_jack(ac97_t *ac97)
|
||||
}
|
||||
|
||||
/* ac97 tune: inversed EAPD bit */
|
||||
static int tune_inv_eapd(ac97_t *ac97)
|
||||
static int tune_inv_eapd(struct snd_ac97 *ac97)
|
||||
{
|
||||
snd_kcontrol_t *kctl = ctl_find(ac97, "External Amplifier", NULL);
|
||||
struct snd_kcontrol *kctl = ctl_find(ac97, "External Amplifier", NULL);
|
||||
if (! kctl)
|
||||
return -ENOENT;
|
||||
set_inv_eapd(ac97, kctl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int master_mute_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
|
||||
static int master_mute_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
int err = snd_ac97_put_volsw(kcontrol, ucontrol);
|
||||
if (err > 0) {
|
||||
ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
|
||||
int shift = (kcontrol->private_value >> 8) & 0x0f;
|
||||
int rshift = (kcontrol->private_value >> 12) & 0x0f;
|
||||
unsigned short mask;
|
||||
@ -2470,9 +2471,9 @@ static int master_mute_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
|
||||
}
|
||||
|
||||
/* ac97 tune: EAPD controls mute LED bound with the master mute */
|
||||
static int tune_mute_led(ac97_t *ac97)
|
||||
static int tune_mute_led(struct snd_ac97 *ac97)
|
||||
{
|
||||
snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL);
|
||||
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
|
||||
if (! msw)
|
||||
return -ENOENT;
|
||||
msw->put = master_mute_sw_put;
|
||||
@ -2483,7 +2484,7 @@ static int tune_mute_led(ac97_t *ac97)
|
||||
|
||||
struct quirk_table {
|
||||
const char *name;
|
||||
int (*func)(ac97_t *);
|
||||
int (*func)(struct snd_ac97 *);
|
||||
};
|
||||
|
||||
static struct quirk_table applicable_quirks[] = {
|
||||
@ -2498,7 +2499,7 @@ static struct quirk_table applicable_quirks[] = {
|
||||
};
|
||||
|
||||
/* apply the quirk with the given type */
|
||||
static int apply_quirk(ac97_t *ac97, int type)
|
||||
static int apply_quirk(struct snd_ac97 *ac97, int type)
|
||||
{
|
||||
if (type <= 0)
|
||||
return 0;
|
||||
@ -2510,7 +2511,7 @@ static int apply_quirk(ac97_t *ac97, int type)
|
||||
}
|
||||
|
||||
/* apply the quirk with the given name */
|
||||
static int apply_quirk_str(ac97_t *ac97, const char *typestr)
|
||||
static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr)
|
||||
{
|
||||
int i;
|
||||
struct quirk_table *q;
|
||||
@ -2539,7 +2540,7 @@ static int apply_quirk_str(ac97_t *ac97, const char *typestr)
|
||||
* Returns zero if successful, or a negative error code on failure.
|
||||
*/
|
||||
|
||||
int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override)
|
||||
int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override)
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
.get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
|
||||
.private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
|
||||
|
||||
/* enum control */
|
||||
struct ac97_enum {
|
||||
unsigned char reg;
|
||||
unsigned char shift_l;
|
||||
@ -57,33 +58,33 @@ struct ac97_enum {
|
||||
|
||||
/* ac97_codec.c */
|
||||
extern const char *snd_ac97_stereo_enhancements[];
|
||||
extern const snd_kcontrol_new_t snd_ac97_controls_3d[];
|
||||
extern const snd_kcontrol_new_t snd_ac97_controls_spdif[];
|
||||
snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97);
|
||||
void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem);
|
||||
int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
|
||||
int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
|
||||
int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
|
||||
int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit);
|
||||
int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix);
|
||||
int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix);
|
||||
int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix);
|
||||
void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst);
|
||||
void snd_ac97_restore_status(ac97_t *ac97);
|
||||
void snd_ac97_restore_iec958(ac97_t *ac97);
|
||||
int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
|
||||
int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
|
||||
int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
|
||||
extern const struct snd_kcontrol_new snd_ac97_controls_3d[];
|
||||
extern const struct snd_kcontrol_new snd_ac97_controls_spdif[];
|
||||
struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97);
|
||||
void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int modem);
|
||||
int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
|
||||
int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
|
||||
int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
|
||||
int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit);
|
||||
int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix);
|
||||
int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix);
|
||||
int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix);
|
||||
void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst);
|
||||
void snd_ac97_restore_status(struct snd_ac97 *ac97);
|
||||
void snd_ac97_restore_iec958(struct snd_ac97 *ac97);
|
||||
int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
|
||||
int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
|
||||
int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
|
||||
|
||||
int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,
|
||||
int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,
|
||||
unsigned short mask, unsigned short value);
|
||||
|
||||
/* ac97_proc.c */
|
||||
#ifdef CONFIG_PROC_FS
|
||||
void snd_ac97_bus_proc_init(ac97_bus_t * ac97);
|
||||
void snd_ac97_bus_proc_done(ac97_bus_t * ac97);
|
||||
void snd_ac97_proc_init(ac97_t * ac97);
|
||||
void snd_ac97_proc_done(ac97_t * ac97);
|
||||
void snd_ac97_bus_proc_init(struct snd_ac97_bus * ac97);
|
||||
void snd_ac97_bus_proc_done(struct snd_ac97_bus * ac97);
|
||||
void snd_ac97_proc_init(struct snd_ac97 * ac97);
|
||||
void snd_ac97_proc_done(struct snd_ac97 * ac97);
|
||||
#else
|
||||
#define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0)
|
||||
#define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,40 +22,40 @@
|
||||
*
|
||||
*/
|
||||
|
||||
int patch_yamaha_ymf753(ac97_t * ac97);
|
||||
int patch_wolfson00(ac97_t * ac97);
|
||||
int patch_wolfson03(ac97_t * ac97);
|
||||
int patch_wolfson04(ac97_t * ac97);
|
||||
int patch_wolfson05(ac97_t * ac97);
|
||||
int patch_wolfson11(ac97_t * ac97);
|
||||
int patch_wolfson13(ac97_t * ac97);
|
||||
int patch_tritech_tr28028(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9700(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9708(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9721(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9744(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9756(ac97_t * ac97);
|
||||
int patch_sigmatel_stac9758(ac97_t * ac97);
|
||||
int patch_cirrus_cs4299(ac97_t * ac97);
|
||||
int patch_cirrus_spdif(ac97_t * ac97);
|
||||
int patch_conexant(ac97_t * ac97);
|
||||
int patch_ad1819(ac97_t * ac97);
|
||||
int patch_ad1881(ac97_t * ac97);
|
||||
int patch_ad1885(ac97_t * ac97);
|
||||
int patch_ad1886(ac97_t * ac97);
|
||||
int patch_ad1888(ac97_t * ac97);
|
||||
int patch_ad1980(ac97_t * ac97);
|
||||
int patch_ad1981a(ac97_t * ac97);
|
||||
int patch_ad1981b(ac97_t * ac97);
|
||||
int patch_ad1985(ac97_t * ac97);
|
||||
int patch_alc650(ac97_t * ac97);
|
||||
int patch_alc655(ac97_t * ac97);
|
||||
int patch_alc850(ac97_t * ac97);
|
||||
int patch_cm9738(ac97_t * ac97);
|
||||
int patch_cm9739(ac97_t * ac97);
|
||||
int patch_cm9761(ac97_t * ac97);
|
||||
int patch_cm9780(ac97_t * ac97);
|
||||
int patch_vt1616(ac97_t * ac97);
|
||||
int patch_vt1617a(ac97_t * ac97);
|
||||
int patch_it2646(ac97_t * ac97);
|
||||
int mpatch_si3036(ac97_t * ac97);
|
||||
int patch_yamaha_ymf753(struct snd_ac97 * ac97);
|
||||
int patch_wolfson00(struct snd_ac97 * ac97);
|
||||
int patch_wolfson03(struct snd_ac97 * ac97);
|
||||
int patch_wolfson04(struct snd_ac97 * ac97);
|
||||
int patch_wolfson05(struct snd_ac97 * ac97);
|
||||
int patch_wolfson11(struct snd_ac97 * ac97);
|
||||
int patch_wolfson13(struct snd_ac97 * ac97);
|
||||
int patch_tritech_tr28028(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9700(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9708(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9721(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9744(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9756(struct snd_ac97 * ac97);
|
||||
int patch_sigmatel_stac9758(struct snd_ac97 * ac97);
|
||||
int patch_cirrus_cs4299(struct snd_ac97 * ac97);
|
||||
int patch_cirrus_spdif(struct snd_ac97 * ac97);
|
||||
int patch_conexant(struct snd_ac97 * ac97);
|
||||
int patch_ad1819(struct snd_ac97 * ac97);
|
||||
int patch_ad1881(struct snd_ac97 * ac97);
|
||||
int patch_ad1885(struct snd_ac97 * ac97);
|
||||
int patch_ad1886(struct snd_ac97 * ac97);
|
||||
int patch_ad1888(struct snd_ac97 * ac97);
|
||||
int patch_ad1980(struct snd_ac97 * ac97);
|
||||
int patch_ad1981a(struct snd_ac97 * ac97);
|
||||
int patch_ad1981b(struct snd_ac97 * ac97);
|
||||
int patch_ad1985(struct snd_ac97 * ac97);
|
||||
int patch_alc650(struct snd_ac97 * ac97);
|
||||
int patch_alc655(struct snd_ac97 * ac97);
|
||||
int patch_alc850(struct snd_ac97 * ac97);
|
||||
int patch_cm9738(struct snd_ac97 * ac97);
|
||||
int patch_cm9739(struct snd_ac97 * ac97);
|
||||
int patch_cm9761(struct snd_ac97 * ac97);
|
||||
int patch_cm9780(struct snd_ac97 * ac97);
|
||||
int patch_vt1616(struct snd_ac97 * ac97);
|
||||
int patch_vt1617a(struct snd_ac97 * ac97);
|
||||
int patch_it2646(struct snd_ac97 * ac97);
|
||||
int mpatch_si3036(struct snd_ac97 * ac97);
|
||||
|
@ -170,7 +170,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,
|
||||
return rate_cregs[slot - 3];
|
||||
}
|
||||
|
||||
static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
|
||||
static int set_spdif_rate(struct snd_ac97 *ac97, unsigned short rate)
|
||||
{
|
||||
unsigned short old, bits, reg, mask;
|
||||
unsigned int sbits;
|
||||
@ -254,7 +254,7 @@ static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
|
||||
*
|
||||
* Returns zero if successful, or a negative error code on failure.
|
||||
*/
|
||||
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate)
|
||||
int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
|
||||
{
|
||||
int dbl;
|
||||
unsigned int tmp;
|
||||
@ -315,7 +315,7 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsigned short *spdif_slots)
|
||||
static unsigned short get_pslots(struct snd_ac97 *ac97, unsigned char *rate_table, unsigned short *spdif_slots)
|
||||
{
|
||||
if (!ac97_is_audio(ac97))
|
||||
return 0;
|
||||
@ -390,7 +390,7 @@ static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsign
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned short get_cslots(ac97_t *ac97)
|
||||
static unsigned short get_cslots(struct snd_ac97 *ac97)
|
||||
{
|
||||
unsigned short slots;
|
||||
|
||||
@ -437,7 +437,7 @@ static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned
|
||||
* some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members
|
||||
* are reduced and might be zero.
|
||||
*/
|
||||
int snd_ac97_pcm_assign(ac97_bus_t *bus,
|
||||
int snd_ac97_pcm_assign(struct snd_ac97_bus *bus,
|
||||
unsigned short pcms_count,
|
||||
const struct ac97_pcm *pcms)
|
||||
{
|
||||
@ -449,7 +449,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus,
|
||||
unsigned short tmp, slots;
|
||||
unsigned short spdif_slots[4];
|
||||
unsigned int rates;
|
||||
ac97_t *codec;
|
||||
struct snd_ac97 *codec;
|
||||
|
||||
rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL);
|
||||
if (rpcms == NULL)
|
||||
@ -560,7 +560,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus,
|
||||
int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
|
||||
enum ac97_pcm_cfg cfg, unsigned short slots)
|
||||
{
|
||||
ac97_bus_t *bus;
|
||||
struct snd_ac97_bus *bus;
|
||||
int i, cidx, r, ok_flag;
|
||||
unsigned int reg_ok[4] = {0,0,0,0};
|
||||
unsigned char reg;
|
||||
@ -639,7 +639,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
|
||||
*/
|
||||
int snd_ac97_pcm_close(struct ac97_pcm *pcm)
|
||||
{
|
||||
ac97_bus_t *bus;
|
||||
struct snd_ac97_bus *bus;
|
||||
unsigned short slots = pcm->aslots;
|
||||
int i, cidx;
|
||||
|
||||
@ -656,31 +656,31 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int double_rate_hw_constraint_rate(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int double_rate_hw_constraint_rate(struct snd_pcm_hw_params *params,
|
||||
struct snd_pcm_hw_rule *rule)
|
||||
{
|
||||
snd_interval_t *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
if (channels->min > 2) {
|
||||
static const snd_interval_t single_rates = {
|
||||
static const struct snd_interval single_rates = {
|
||||
.min = 1,
|
||||
.max = 48000,
|
||||
};
|
||||
snd_interval_t *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
|
||||
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
|
||||
return snd_interval_refine(rate, &single_rates);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int double_rate_hw_constraint_channels(struct snd_pcm_hw_params *params,
|
||||
struct snd_pcm_hw_rule *rule)
|
||||
{
|
||||
snd_interval_t *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
|
||||
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
|
||||
if (rate->min > 48000) {
|
||||
static const snd_interval_t double_rate_channels = {
|
||||
static const struct snd_interval double_rate_channels = {
|
||||
.min = 2,
|
||||
.max = 2,
|
||||
};
|
||||
snd_interval_t *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
return snd_interval_refine(channels, &double_rate_channels);
|
||||
}
|
||||
return 0;
|
||||
@ -693,7 +693,7 @@ static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params,
|
||||
* Installs the hardware constraint rules to prevent using double rates and
|
||||
* more than two channels at the same time.
|
||||
*/
|
||||
int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime)
|
||||
int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* proc interface
|
||||
*/
|
||||
|
||||
static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer)
|
||||
static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_buffer *buffer)
|
||||
{
|
||||
int header = 0, function;
|
||||
unsigned short info, sense_info;
|
||||
@ -68,7 +68,7 @@ static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer
|
||||
}
|
||||
}
|
||||
|
||||
static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx)
|
||||
static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx)
|
||||
{
|
||||
char name[64];
|
||||
unsigned short val, tmp, ext, mext;
|
||||
@ -80,7 +80,6 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
|
||||
snd_ac97_get_name(NULL, ac97->id, name, 0);
|
||||
snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name);
|
||||
|
||||
|
||||
if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
|
||||
goto __modem;
|
||||
|
||||
@ -299,9 +298,9 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
|
||||
}
|
||||
}
|
||||
|
||||
static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
|
||||
static void snd_ac97_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
|
||||
{
|
||||
ac97_t *ac97 = entry->private_data;
|
||||
struct snd_ac97 *ac97 = entry->private_data;
|
||||
|
||||
down(&ac97->page_mutex);
|
||||
if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
|
||||
@ -334,9 +333,9 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
|
||||
|
||||
#ifdef CONFIG_SND_DEBUG
|
||||
/* direct register write for debugging */
|
||||
static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
|
||||
static void snd_ac97_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
|
||||
{
|
||||
ac97_t *ac97 = entry->private_data;
|
||||
struct snd_ac97 *ac97 = entry->private_data;
|
||||
char line[64];
|
||||
unsigned int reg, val;
|
||||
down(&ac97->page_mutex);
|
||||
@ -351,7 +350,7 @@ static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t
|
||||
}
|
||||
#endif
|
||||
|
||||
static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx)
|
||||
static void snd_ac97_proc_regs_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx)
|
||||
{
|
||||
int reg, val;
|
||||
|
||||
@ -361,10 +360,10 @@ static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffe
|
||||
}
|
||||
}
|
||||
|
||||
static void snd_ac97_proc_regs_read(snd_info_entry_t *entry,
|
||||
snd_info_buffer_t * buffer)
|
||||
static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
|
||||
struct snd_info_buffer *buffer)
|
||||
{
|
||||
ac97_t *ac97 = entry->private_data;
|
||||
struct snd_ac97 *ac97 = entry->private_data;
|
||||
|
||||
down(&ac97->page_mutex);
|
||||
if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
|
||||
@ -385,9 +384,9 @@ static void snd_ac97_proc_regs_read(snd_info_entry_t *entry,
|
||||
up(&ac97->page_mutex);
|
||||
}
|
||||
|
||||
void snd_ac97_proc_init(ac97_t * ac97)
|
||||
void snd_ac97_proc_init(struct snd_ac97 * ac97)
|
||||
{
|
||||
snd_info_entry_t *entry;
|
||||
struct snd_info_entry *entry;
|
||||
char name[32];
|
||||
const char *prefix;
|
||||
|
||||
@ -419,7 +418,7 @@ void snd_ac97_proc_init(ac97_t * ac97)
|
||||
ac97->proc_regs = entry;
|
||||
}
|
||||
|
||||
void snd_ac97_proc_done(ac97_t * ac97)
|
||||
void snd_ac97_proc_done(struct snd_ac97 * ac97)
|
||||
{
|
||||
if (ac97->proc_regs) {
|
||||
snd_info_unregister(ac97->proc_regs);
|
||||
@ -431,9 +430,9 @@ void snd_ac97_proc_done(ac97_t * ac97)
|
||||
}
|
||||
}
|
||||
|
||||
void snd_ac97_bus_proc_init(ac97_bus_t * bus)
|
||||
void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus)
|
||||
{
|
||||
snd_info_entry_t *entry;
|
||||
struct snd_info_entry *entry;
|
||||
char name[32];
|
||||
|
||||
sprintf(name, "codec97#%d", bus->num);
|
||||
@ -447,7 +446,7 @@ void snd_ac97_bus_proc_init(ac97_bus_t * bus)
|
||||
bus->proc = entry;
|
||||
}
|
||||
|
||||
void snd_ac97_bus_proc_done(ac97_bus_t * bus)
|
||||
void snd_ac97_bus_proc_done(struct snd_ac97_bus * bus)
|
||||
{
|
||||
if (bus->proc) {
|
||||
snd_info_unregister(bus->proc);
|
||||
|
Loading…
Reference in New Issue
Block a user