提交 ee42381e 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: AC97

Modules: AC97 Codec

Remove xxx_t typedefs from the AC97 codec support.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 dc4cafba
...@@ -391,38 +391,35 @@ ...@@ -391,38 +391,35 @@
* *
*/ */
typedef struct _snd_ac97_bus ac97_bus_t; struct snd_ac97;
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_build_ops { struct snd_ac97_build_ops {
int (*build_3d) (ac97_t *ac97); int (*build_3d) (struct snd_ac97 *ac97);
int (*build_specific) (ac97_t *ac97); int (*build_specific) (struct snd_ac97 *ac97);
int (*build_spdif) (ac97_t *ac97); int (*build_spdif) (struct snd_ac97 *ac97);
int (*build_post_spdif) (ac97_t *ac97); int (*build_post_spdif) (struct snd_ac97 *ac97);
#ifdef CONFIG_PM #ifdef CONFIG_PM
void (*suspend) (ac97_t *ac97); void (*suspend) (struct snd_ac97 *ac97);
void (*resume) (ac97_t *ac97); void (*resume) (struct snd_ac97 *ac97);
#endif #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 { struct snd_ac97_bus_ops {
void (*reset) (ac97_t *ac97); void (*reset) (struct snd_ac97 *ac97);
void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val); void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
unsigned short (*read) (ac97_t *ac97, unsigned short reg); unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
void (*wait) (ac97_t *ac97); void (*wait) (struct snd_ac97 *ac97);
void (*init) (ac97_t *ac97); void (*init) (struct snd_ac97 *ac97);
}; };
struct _snd_ac97_bus { struct snd_ac97_bus {
/* -- lowlevel (hardware) driver specific -- */ /* -- lowlevel (hardware) driver specific -- */
ac97_bus_ops_t *ops; struct snd_ac97_bus_ops *ops;
void *private_data; 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 num; /* bus number */
unsigned short no_vra: 1, /* bridge doesn't support VRA */ unsigned short no_vra: 1, /* bridge doesn't support VRA */
dra: 1, /* bridge supports double rate */ dra: 1, /* bridge supports double rate */
...@@ -432,13 +429,13 @@ struct _snd_ac97_bus { ...@@ -432,13 +429,13 @@ struct _snd_ac97_bus {
unsigned short used_slots[2][4]; /* actually used PCM slots */ unsigned short used_slots[2][4]; /* actually used PCM slots */
unsigned short pcms_count; /* count of PCMs */ unsigned short pcms_count; /* count of PCMs */
struct ac97_pcm *pcms; struct ac97_pcm *pcms;
ac97_t *codec[4]; struct snd_ac97 *codec[4];
snd_info_entry_t *proc; struct snd_info_entry *proc;
}; };
struct _snd_ac97_template { struct snd_ac97_template {
void *private_data; 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 */ struct pci_dev *pci; /* assigned PCI device - used for quirks */
unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
unsigned short addr; /* physical address of codec [0-3] */ unsigned short addr; /* physical address of codec [0-3] */
...@@ -447,16 +444,16 @@ struct _snd_ac97_template { ...@@ -447,16 +444,16 @@ struct _snd_ac97_template {
DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
}; };
struct _snd_ac97 { struct snd_ac97 {
/* -- lowlevel (hardware) driver specific -- */ /* -- lowlevel (hardware) driver specific -- */
struct snd_ac97_build_ops * build_ops; struct snd_ac97_build_ops * build_ops;
void *private_data; 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 */ struct pci_dev *pci; /* assigned PCI device - used for quirks */
snd_info_entry_t *proc; struct snd_info_entry *proc;
snd_info_entry_t *proc_regs; struct snd_info_entry *proc_regs;
unsigned short subsystem_vendor; unsigned short subsystem_vendor;
unsigned short subsystem_device; unsigned short subsystem_device;
struct semaphore reg_mutex; struct semaphore reg_mutex;
...@@ -490,43 +487,47 @@ struct _snd_ac97 { ...@@ -490,43 +487,47 @@ struct _snd_ac97 {
struct device dev; 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 */ /* 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); 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); 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; 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; 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; return (ac97->ext_id & AC97_EI_SPDIF) != 0;
} }
/* functions */ /* 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 */ /* create new AC97 bus */
int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
const char *snd_ac97_get_short_name(ac97_t *ac97); void *private_data, struct snd_ac97_bus **rbus);
/* create mixer controls */
void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value); int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg); struct snd_ac97 **rac97);
void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value); const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);
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 #ifdef CONFIG_PM
void snd_ac97_suspend(ac97_t *ac97); void snd_ac97_suspend(struct snd_ac97 *ac97);
void snd_ac97_resume(ac97_t *ac97); void snd_ac97_resume(struct snd_ac97 *ac97);
#endif #endif
/* quirk types */ /* quirk types */
...@@ -551,8 +552,8 @@ struct ac97_quirk { ...@@ -551,8 +552,8 @@ struct ac97_quirk {
int type; /* quirk type above */ int type; /* quirk type above */
}; };
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 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);
/* /*
* PCM allocation * PCM allocation
...@@ -568,7 +569,7 @@ enum ac97_pcm_cfg { ...@@ -568,7 +569,7 @@ enum ac97_pcm_cfg {
}; };
struct ac97_pcm { struct ac97_pcm {
ac97_bus_t *bus; struct snd_ac97_bus *bus;
unsigned int stream: 1, /* stream type: 1 = capture */ unsigned int stream: 1, /* stream type: 1 = capture */
exclusive: 1, /* exclusive mode, don't override with other pcms */ exclusive: 1, /* exclusive mode, don't override with other pcms */
copy_flag: 1, /* lowlevel driver must fill all entries */ copy_flag: 1, /* lowlevel driver must fill all entries */
...@@ -579,18 +580,18 @@ struct ac97_pcm { ...@@ -579,18 +580,18 @@ struct ac97_pcm {
unsigned short slots; /* driver input: requested AC97 slot numbers */ unsigned short slots; /* driver input: requested AC97 slot numbers */
unsigned short rslots[4]; /* allocated slots per codecs */ unsigned short rslots[4]; /* allocated slots per codecs */
unsigned char rate_table[4]; 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 */ } r[2]; /* 0 = standard rates, 1 = double rates */
unsigned long private_value; /* used by the hardware driver */ 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, unsigned short pcms_count,
const struct ac97_pcm *pcms); const struct ac97_pcm *pcms);
int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
enum ac97_pcm_cfg cfg, unsigned short slots); enum ac97_pcm_cfg cfg, unsigned short slots);
int snd_ac97_pcm_close(struct ac97_pcm *pcm); 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 */ /* ad hoc AC97 device driver access */
extern struct bus_type ac97_bus_type; extern struct bus_type ac97_bus_type;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
* Let drivers decide whether they want to support given codec from their * 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. * decide based on the id field amongst other things.
*/ */
static int ac97_bus_match(struct device *dev, struct device_driver *drv) static int ac97_bus_match(struct device *dev, struct device_driver *drv)
......
此差异已折叠。
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
.get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \ .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
.private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) } .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
/* enum control */
struct ac97_enum { struct ac97_enum {
unsigned char reg; unsigned char reg;
unsigned char shift_l; unsigned char shift_l;
...@@ -57,33 +58,33 @@ struct ac97_enum { ...@@ -57,33 +58,33 @@ struct ac97_enum {
/* ac97_codec.c */ /* ac97_codec.c */
extern const char *snd_ac97_stereo_enhancements[]; extern const char *snd_ac97_stereo_enhancements[];
extern const snd_kcontrol_new_t snd_ac97_controls_3d[]; extern const struct snd_kcontrol_new snd_ac97_controls_3d[];
extern const snd_kcontrol_new_t snd_ac97_controls_spdif[]; extern const struct snd_kcontrol_new snd_ac97_controls_spdif[];
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);
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);
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 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);
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);
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);
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);
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);
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);
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);
void snd_ac97_restore_status(ac97_t *ac97); void snd_ac97_restore_status(struct snd_ac97 *ac97);
void snd_ac97_restore_iec958(ac97_t *ac97); void snd_ac97_restore_iec958(struct snd_ac97 *ac97);
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);
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);
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);
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); unsigned short mask, unsigned short value);
/* ac97_proc.c */ /* ac97_proc.c */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
void snd_ac97_bus_proc_init(ac97_bus_t * ac97); void snd_ac97_bus_proc_init(struct snd_ac97_bus * ac97);
void snd_ac97_bus_proc_done(ac97_bus_t * ac97); void snd_ac97_bus_proc_done(struct snd_ac97_bus * ac97);
void snd_ac97_proc_init(ac97_t * ac97); void snd_ac97_proc_init(struct snd_ac97 * ac97);
void snd_ac97_proc_done(ac97_t * ac97); void snd_ac97_proc_done(struct snd_ac97 * ac97);
#else #else
#define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0) #define snd_ac97_bus_proc_init(ac97_bus_t) do { } while (0)
#define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0) #define snd_ac97_bus_proc_done(ac97_bus_t) do { } while (0)
......
此差异已折叠。
...@@ -22,40 +22,40 @@ ...@@ -22,40 +22,40 @@
* *
*/ */
int patch_yamaha_ymf753(ac97_t * ac97); int patch_yamaha_ymf753(struct snd_ac97 * ac97);
int patch_wolfson00(ac97_t * ac97); int patch_wolfson00(struct snd_ac97 * ac97);
int patch_wolfson03(ac97_t * ac97); int patch_wolfson03(struct snd_ac97 * ac97);
int patch_wolfson04(ac97_t * ac97); int patch_wolfson04(struct snd_ac97 * ac97);
int patch_wolfson05(ac97_t * ac97); int patch_wolfson05(struct snd_ac97 * ac97);
int patch_wolfson11(ac97_t * ac97); int patch_wolfson11(struct snd_ac97 * ac97);
int patch_wolfson13(ac97_t * ac97); int patch_wolfson13(struct snd_ac97 * ac97);
int patch_tritech_tr28028(ac97_t * ac97); int patch_tritech_tr28028(struct snd_ac97 * ac97);
int patch_sigmatel_stac9700(ac97_t * ac97); int patch_sigmatel_stac9700(struct snd_ac97 * ac97);
int patch_sigmatel_stac9708(ac97_t * ac97); int patch_sigmatel_stac9708(struct snd_ac97 * ac97);
int patch_sigmatel_stac9721(ac97_t * ac97); int patch_sigmatel_stac9721(struct snd_ac97 * ac97);
int patch_sigmatel_stac9744(ac97_t * ac97); int patch_sigmatel_stac9744(struct snd_ac97 * ac97);
int patch_sigmatel_stac9756(ac97_t * ac97); int patch_sigmatel_stac9756(struct snd_ac97 * ac97);
int patch_sigmatel_stac9758(ac97_t * ac97); int patch_sigmatel_stac9758(struct snd_ac97 * ac97);
int patch_cirrus_cs4299(ac97_t * ac97); int patch_cirrus_cs4299(struct snd_ac97 * ac97);
int patch_cirrus_spdif(ac97_t * ac97); int patch_cirrus_spdif(struct snd_ac97 * ac97);
int patch_conexant(ac97_t * ac97); int patch_conexant(struct snd_ac97 * ac97);
int patch_ad1819(ac97_t * ac97); int patch_ad1819(struct snd_ac97 * ac97);
int patch_ad1881(ac97_t * ac97); int patch_ad1881(struct snd_ac97 * ac97);
int patch_ad1885(ac97_t * ac97); int patch_ad1885(struct snd_ac97 * ac97);
int patch_ad1886(ac97_t * ac97); int patch_ad1886(struct snd_ac97 * ac97);
int patch_ad1888(ac97_t * ac97); int patch_ad1888(struct snd_ac97 * ac97);
int patch_ad1980(ac97_t * ac97); int patch_ad1980(struct snd_ac97 * ac97);
int patch_ad1981a(ac97_t * ac97); int patch_ad1981a(struct snd_ac97 * ac97);
int patch_ad1981b(ac97_t * ac97); int patch_ad1981b(struct snd_ac97 * ac97);
int patch_ad1985(ac97_t * ac97); int patch_ad1985(struct snd_ac97 * ac97);
int patch_alc650(ac97_t * ac97); int patch_alc650(struct snd_ac97 * ac97);
int patch_alc655(ac97_t * ac97); int patch_alc655(struct snd_ac97 * ac97);
int patch_alc850(ac97_t * ac97); int patch_alc850(struct snd_ac97 * ac97);
int patch_cm9738(ac97_t * ac97); int patch_cm9738(struct snd_ac97 * ac97);
int patch_cm9739(ac97_t * ac97); int patch_cm9739(struct snd_ac97 * ac97);
int patch_cm9761(ac97_t * ac97); int patch_cm9761(struct snd_ac97 * ac97);
int patch_cm9780(ac97_t * ac97); int patch_cm9780(struct snd_ac97 * ac97);
int patch_vt1616(ac97_t * ac97); int patch_vt1616(struct snd_ac97 * ac97);
int patch_vt1617a(ac97_t * ac97); int patch_vt1617a(struct snd_ac97 * ac97);
int patch_it2646(ac97_t * ac97); int patch_it2646(struct snd_ac97 * ac97);
int mpatch_si3036(ac97_t * 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, ...@@ -170,7 +170,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,
return rate_cregs[slot - 3]; 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 short old, bits, reg, mask;
unsigned int sbits; unsigned int sbits;
...@@ -254,7 +254,7 @@ static int set_spdif_rate(ac97_t *ac97, unsigned short rate) ...@@ -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. * 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; int dbl;
unsigned int tmp; unsigned int tmp;
...@@ -315,7 +315,7 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate) ...@@ -315,7 +315,7 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate)
return 0; 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)) if (!ac97_is_audio(ac97))
return 0; return 0;
...@@ -390,7 +390,7 @@ static unsigned short get_pslots(ac97_t *ac97, unsigned char *rate_table, unsign ...@@ -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; unsigned short slots;
...@@ -437,7 +437,7 @@ static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned ...@@ -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 * some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members
* are reduced and might be zero. * 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, unsigned short pcms_count,
const struct ac97_pcm *pcms) const struct ac97_pcm *pcms)
{ {
...@@ -449,7 +449,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus, ...@@ -449,7 +449,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus,
unsigned short tmp, slots; unsigned short tmp, slots;
unsigned short spdif_slots[4]; unsigned short spdif_slots[4];
unsigned int rates; unsigned int rates;
ac97_t *codec; struct snd_ac97 *codec;
rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL); rpcms = kcalloc(pcms_count, sizeof(struct ac97_pcm), GFP_KERNEL);
if (rpcms == NULL) if (rpcms == NULL)
...@@ -560,7 +560,7 @@ int snd_ac97_pcm_assign(ac97_bus_t *bus, ...@@ -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, int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
enum ac97_pcm_cfg cfg, unsigned short slots) enum ac97_pcm_cfg cfg, unsigned short slots)
{ {
ac97_bus_t *bus; struct snd_ac97_bus *bus;
int i, cidx, r, ok_flag; int i, cidx, r, ok_flag;
unsigned int reg_ok[4] = {0,0,0,0}; unsigned int reg_ok[4] = {0,0,0,0};
unsigned char reg; unsigned char reg;
...@@ -639,7 +639,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, ...@@ -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) int snd_ac97_pcm_close(struct ac97_pcm *pcm)
{ {
ac97_bus_t *bus; struct snd_ac97_bus *bus;
unsigned short slots = pcm->aslots; unsigned short slots = pcm->aslots;
int i, cidx; int i, cidx;
...@@ -656,31 +656,31 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm) ...@@ -656,31 +656,31 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
return 0; return 0;
} }
static int double_rate_hw_constraint_rate(snd_pcm_hw_params_t *params, static int double_rate_hw_constraint_rate(struct snd_pcm_hw_params *params,
snd_pcm_hw_rule_t *rule) 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) { if (channels->min > 2) {
static const snd_interval_t single_rates = { static const struct snd_interval single_rates = {
.min = 1, .min = 1,
.max = 48000, .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 snd_interval_refine(rate, &single_rates);
} }
return 0; return 0;
} }
static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params, static int double_rate_hw_constraint_channels(struct snd_pcm_hw_params *params,
snd_pcm_hw_rule_t *rule) 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) { if (rate->min > 48000) {
static const snd_interval_t double_rate_channels = { static const struct snd_interval double_rate_channels = {
.min = 2, .min = 2,
.max = 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 snd_interval_refine(channels, &double_rate_channels);
} }
return 0; return 0;
...@@ -693,7 +693,7 @@ static int double_rate_hw_constraint_channels(snd_pcm_hw_params_t *params, ...@@ -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 * Installs the hardware constraint rules to prevent using double rates and
* more than two channels at the same time. * 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; int err;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* proc interface * 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; int header = 0, function;
unsigned short info, sense_info; unsigned short info, sense_info;
...@@ -68,7 +68,7 @@ static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer ...@@ -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]; char name[64];
unsigned short val, tmp, ext, mext; 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 ...@@ -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_ac97_get_name(NULL, ac97->id, name, 0);
snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name); snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name);
if ((ac97->scaps & AC97_SCAP_AUDIO) == 0) if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
goto __modem; goto __modem;
...@@ -299,9 +298,9 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in ...@@ -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); down(&ac97->page_mutex);
if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 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 ...@@ -334,9 +333,9 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
/* direct register write for debugging */ /* 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]; char line[64];
unsigned int reg, val; unsigned int reg, val;
down(&ac97->page_mutex); down(&ac97->page_mutex);
...@@ -351,7 +350,7 @@ static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t ...@@ -351,7 +350,7 @@ static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t
} }
#endif #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; int reg, val;
...@@ -361,10 +360,10 @@ static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffe ...@@ -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, static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
snd_info_buffer_t * buffer) struct snd_info_buffer *buffer)
{ {
ac97_t *ac97 = entry->private_data; struct snd_ac97 *ac97 = entry->private_data;
down(&ac97->page_mutex); down(&ac97->page_mutex);
if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 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, ...@@ -385,9 +384,9 @@ static void snd_ac97_proc_regs_read(snd_info_entry_t *entry,
up(&ac97->page_mutex); 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]; char name[32];
const char *prefix; const char *prefix;
...@@ -419,7 +418,7 @@ void snd_ac97_proc_init(ac97_t * ac97) ...@@ -419,7 +418,7 @@ void snd_ac97_proc_init(ac97_t * ac97)
ac97->proc_regs = entry; 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) { if (ac97->proc_regs) {
snd_info_unregister(ac97->proc_regs); snd_info_unregister(ac97->proc_regs);
...@@ -431,9 +430,9 @@ void snd_ac97_proc_done(ac97_t * ac97) ...@@ -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]; char name[32];
sprintf(name, "codec97#%d", bus->num); sprintf(name, "codec97#%d", bus->num);
...@@ -447,7 +446,7 @@ void snd_ac97_bus_proc_init(ac97_bus_t * bus) ...@@ -447,7 +446,7 @@ void snd_ac97_bus_proc_init(ac97_bus_t * bus)
bus->proc = entry; 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) { if (bus->proc) {
snd_info_unregister(bus->proc); snd_info_unregister(bus->proc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册