···391391 *392392 */393393394394-typedef struct _snd_ac97_bus ac97_bus_t;395395-typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;396396-typedef struct _snd_ac97_template ac97_template_t;397397-typedef struct _snd_ac97 ac97_t;394394+struct snd_ac97;398395399396struct snd_ac97_build_ops {400400- int (*build_3d) (ac97_t *ac97);401401- int (*build_specific) (ac97_t *ac97);402402- int (*build_spdif) (ac97_t *ac97);403403- int (*build_post_spdif) (ac97_t *ac97);397397+ int (*build_3d) (struct snd_ac97 *ac97);398398+ int (*build_specific) (struct snd_ac97 *ac97);399399+ int (*build_spdif) (struct snd_ac97 *ac97);400400+ int (*build_post_spdif) (struct snd_ac97 *ac97);404401#ifdef CONFIG_PM405405- void (*suspend) (ac97_t *ac97);406406- void (*resume) (ac97_t *ac97);402402+ void (*suspend) (struct snd_ac97 *ac97);403403+ void (*resume) (struct snd_ac97 *ac97);407404#endif408408- void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */405405+ void (*update_jacks) (struct snd_ac97 *ac97); /* for jack-sharing */409406};410407411411-struct _snd_ac97_bus_ops {412412- void (*reset) (ac97_t *ac97);413413- void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val);414414- unsigned short (*read) (ac97_t *ac97, unsigned short reg);415415- void (*wait) (ac97_t *ac97);416416- void (*init) (ac97_t *ac97);408408+struct snd_ac97_bus_ops {409409+ void (*reset) (struct snd_ac97 *ac97);410410+ void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);411411+ unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);412412+ void (*wait) (struct snd_ac97 *ac97);413413+ void (*init) (struct snd_ac97 *ac97);417414};418415419419-struct _snd_ac97_bus {416416+struct snd_ac97_bus {420417 /* -- lowlevel (hardware) driver specific -- */421421- ac97_bus_ops_t *ops;418418+ struct snd_ac97_bus_ops *ops;422419 void *private_data;423423- void (*private_free) (ac97_bus_t *bus);420420+ void (*private_free) (struct snd_ac97_bus *bus);424421 /* --- */425425- snd_card_t *card;422422+ struct snd_card *card;426423 unsigned short num; /* bus number */427424 unsigned short no_vra: 1, /* bridge doesn't support VRA */428425 dra: 1, /* bridge supports double rate */···429432 unsigned short used_slots[2][4]; /* actually used PCM slots */430433 unsigned short pcms_count; /* count of PCMs */431434 struct ac97_pcm *pcms;432432- ac97_t *codec[4];433433- snd_info_entry_t *proc;435435+ struct snd_ac97 *codec[4];436436+ struct snd_info_entry *proc;434437};435438436436-struct _snd_ac97_template {439439+struct snd_ac97_template {437440 void *private_data;438438- void (*private_free) (ac97_t *ac97);441441+ void (*private_free) (struct snd_ac97 *ac97);439442 struct pci_dev *pci; /* assigned PCI device - used for quirks */440443 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */441444 unsigned short addr; /* physical address of codec [0-3] */···444447 DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */445448};446449447447-struct _snd_ac97 {450450+struct snd_ac97 {448451 /* -- lowlevel (hardware) driver specific -- */449452 struct snd_ac97_build_ops * build_ops;450453 void *private_data;451451- void (*private_free) (ac97_t *ac97);454454+ void (*private_free) (struct snd_ac97 *ac97);452455 /* --- */453453- ac97_bus_t *bus;456456+ struct snd_ac97_bus *bus;454457 struct pci_dev *pci; /* assigned PCI device - used for quirks */455455- snd_info_entry_t *proc;456456- snd_info_entry_t *proc_regs;458458+ struct snd_info_entry *proc;459459+ struct snd_info_entry *proc_regs;457460 unsigned short subsystem_vendor;458461 unsigned short subsystem_device;459462 struct semaphore reg_mutex;···487490 struct device dev;488491};489492490490-#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev)493493+#define to_ac97_t(d) container_of(d, struct snd_ac97, dev)491494492495/* conditions */493493-static inline int ac97_is_audio(ac97_t * ac97)496496+static inline int ac97_is_audio(struct snd_ac97 * ac97)494497{495498 return (ac97->scaps & AC97_SCAP_AUDIO);496499}497497-static inline int ac97_is_modem(ac97_t * ac97)500500+static inline int ac97_is_modem(struct snd_ac97 * ac97)498501{499502 return (ac97->scaps & AC97_SCAP_MODEM);500503}501501-static inline int ac97_is_rev22(ac97_t * ac97)504504+static inline int ac97_is_rev22(struct snd_ac97 * ac97)502505{503506 return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;504507}505505-static inline int ac97_can_amap(ac97_t * ac97)508508+static inline int ac97_can_amap(struct snd_ac97 * ac97)506509{507510 return (ac97->ext_id & AC97_EI_AMAP) != 0;508511}509509-static inline int ac97_can_spdif(ac97_t * ac97)512512+static inline int ac97_can_spdif(struct snd_ac97 * ac97)510513{511514 return (ac97->ext_id & AC97_EI_SPDIF) != 0;512515}513516514517/* functions */515515-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 */516516-int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */517517-const char *snd_ac97_get_short_name(ac97_t *ac97);518518+/* create new AC97 bus */519519+int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,520520+ void *private_data, struct snd_ac97_bus **rbus);521521+/* create mixer controls */522522+int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,523523+ struct snd_ac97 **rac97);524524+const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);518525519519-void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);520520-unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);521521-void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value);522522-int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value);523523-int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value);526526+void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);527527+unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg);528528+void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);529529+int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);530530+int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value);524531#ifdef CONFIG_PM525525-void snd_ac97_suspend(ac97_t *ac97);526526-void snd_ac97_resume(ac97_t *ac97);532532+void snd_ac97_suspend(struct snd_ac97 *ac97);533533+void snd_ac97_resume(struct snd_ac97 *ac97);527534#endif528535529536/* quirk types */···552551 int type; /* quirk type above */553552};554553555555-int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override);556556-int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate);554554+int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override);555555+int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate);557556558557/*559558 * PCM allocation···569568};570569571570struct ac97_pcm {572572- ac97_bus_t *bus;571571+ struct snd_ac97_bus *bus;573572 unsigned int stream: 1, /* stream type: 1 = capture */574573 exclusive: 1, /* exclusive mode, don't override with other pcms */575574 copy_flag: 1, /* lowlevel driver must fill all entries */···580579 unsigned short slots; /* driver input: requested AC97 slot numbers */581580 unsigned short rslots[4]; /* allocated slots per codecs */582581 unsigned char rate_table[4];583583- ac97_t *codec[4]; /* allocated codecs */582582+ struct snd_ac97 *codec[4]; /* allocated codecs */584583 } r[2]; /* 0 = standard rates, 1 = double rates */585584 unsigned long private_value; /* used by the hardware driver */586585};587586588588-int snd_ac97_pcm_assign(ac97_bus_t *ac97,587587+int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,589588 unsigned short pcms_count,590589 const struct ac97_pcm *pcms);591590int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,592591 enum ac97_pcm_cfg cfg, unsigned short slots);593592int snd_ac97_pcm_close(struct ac97_pcm *pcm);594594-int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime);593593+int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);595594596595/* ad hoc AC97 device driver access */597596extern struct bus_type ac97_bus_type;
+1-1
sound/pci/ac97/ac97_bus.c
···18181919/*2020 * Let drivers decide whether they want to support given codec from their2121- * probe method. Drivers have direct access to the ac97_t structure and may2121+ * probe method. Drivers have direct access to the struct snd_ac97 structure and may2222 * decide based on the id field amongst other things.2323 */2424static int ac97_bus_match(struct device *dev, struct device_driver *drv)
+157-156
sound/pci/ac97/ac97_codec.c
···50505151 */52525353-typedef struct {5353+struct ac97_codec_id {5454 unsigned int id;5555 unsigned int mask;5656 const char *name;5757- int (*patch)(ac97_t *ac97);5858- int (*mpatch)(ac97_t *ac97);5757+ int (*patch)(struct snd_ac97 *ac97);5858+ int (*mpatch)(struct snd_ac97 *ac97);5959 unsigned int flags;6060-} ac97_codec_id_t;6060+};61616262-static const ac97_codec_id_t snd_ac97_codec_id_vendors[] = {6262+static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {6363{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },6464{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },6565{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },···8686{ 0, 0, NULL, NULL, NULL }8787};88888989-static const ac97_codec_id_t snd_ac97_codec_ids[] = {8989+static const struct ac97_codec_id snd_ac97_codec_ids[] = {9090{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },9191{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },9292{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },···225225 * I/O routines226226 */227227228228-static int snd_ac97_valid_reg(ac97_t *ac97, unsigned short reg)228228+static int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg)229229{230230 if (ac97->limited_regs && ! test_bit(reg, ac97->reg_accessed))231231 return 0;···278278 * #snd_ca97_write_cache(), so use this only when you don't want to279279 * reflect the change to the suspend/resume state.280280 */281281-void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value)281281+void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)282282{283283 if (!snd_ac97_valid_reg(ac97, reg))284284 return;···301301 *302302 * Returns the read value.303303 */304304-unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)304304+unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg)305305{306306 if (!snd_ac97_valid_reg(ac97, reg))307307 return 0;···309309}310310311311/* read a register - return the cached value if already read */312312-static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short reg)312312+static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97, unsigned short reg)313313{314314 if (! test_bit(reg, ac97->reg_accessed)) {315315 ac97->regs[reg] = ac97->bus->ops->read(ac97, reg);···328328 * cache. The cached values are used for the cached-read and the329329 * suspend/resume.330330 */331331-void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value)331331+void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)332332{333333 if (!snd_ac97_valid_reg(ac97, reg))334334 return;···351351 * Returns 1 if the value is changed, 0 if no change, or a negative352352 * code on failure.353353 */354354-int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value)354354+int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)355355{356356 int change;357357···381381 * Returns 1 if the bits are changed, 0 if no change, or a negative382382 * code on failure.383383 */384384-int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value)384384+int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value)385385{386386 int change;387387···394394}395395396396/* no lock version - see snd_ac97_updat_bits() */397397-int snd_ac97_update_bits_nolock(ac97_t *ac97, unsigned short reg,397397+int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,398398 unsigned short mask, unsigned short value)399399{400400 int change;···411411 return change;412412}413413414414-static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short mask, unsigned short value)414414+static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec, unsigned short mask, unsigned short value)415415{416416 int change;417417 unsigned short old, new, cfg;···443443 * Controls444444 */445445446446-int snd_ac97_info_enum_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)446446+int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)447447{448448 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;449449···457457 return 0;458458}459459460460-int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)460460+int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)461461{462462- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);462462+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);463463 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;464464 unsigned short val, bitmask;465465···473473 return 0;474474}475475476476-int snd_ac97_put_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)476476+int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)477477{478478- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);478478+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);479479 struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;480480 unsigned short val;481481 unsigned short mask, bitmask;···496496}497497498498/* save/restore ac97 v2.3 paging */499499-static int snd_ac97_page_save(ac97_t *ac97, int reg, snd_kcontrol_t *kcontrol)499499+static int snd_ac97_page_save(struct snd_ac97 *ac97, int reg, struct snd_kcontrol *kcontrol)500500{501501 int page_save = -1;502502 if ((kcontrol->private_value & (1<<25)) &&···510510 return page_save;511511}512512513513-static void snd_ac97_page_restore(ac97_t *ac97, int page_save)513513+static void snd_ac97_page_restore(struct snd_ac97 *ac97, int page_save)514514{515515 if (page_save >= 0) {516516 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save);···519519}520520521521/* volume and switch controls */522522-int snd_ac97_info_volsw(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)522522+int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)523523{524524 int mask = (kcontrol->private_value >> 16) & 0xff;525525 int shift = (kcontrol->private_value >> 8) & 0x0f;···532532 return 0;533533}534534535535-int snd_ac97_get_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)535535+int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)536536{537537- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);537537+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);538538 int reg = kcontrol->private_value & 0xff;539539 int shift = (kcontrol->private_value >> 8) & 0x0f;540540 int rshift = (kcontrol->private_value >> 12) & 0x0f;···555555 return 0;556556}557557558558-int snd_ac97_put_volsw(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)558558+int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)559559{560560- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);560560+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);561561 int reg = kcontrol->private_value & 0xff;562562 int shift = (kcontrol->private_value >> 8) & 0x0f;563563 int rshift = (kcontrol->private_value >> 12) & 0x0f;···584584 return err;585585}586586587587-static const snd_kcontrol_new_t snd_ac97_controls_master_mono[2] = {587587+static const struct snd_kcontrol_new snd_ac97_controls_master_mono[2] = {588588AC97_SINGLE("Master Mono Playback Switch", AC97_MASTER_MONO, 15, 1, 1),589589AC97_SINGLE("Master Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1)590590};591591592592-static const snd_kcontrol_new_t snd_ac97_controls_tone[2] = {592592+static const struct snd_kcontrol_new snd_ac97_controls_tone[2] = {593593AC97_SINGLE("Tone Control - Bass", AC97_MASTER_TONE, 8, 15, 1),594594AC97_SINGLE("Tone Control - Treble", AC97_MASTER_TONE, 0, 15, 1)595595};596596597597-static const snd_kcontrol_new_t snd_ac97_controls_pc_beep[2] = {597597+static const struct snd_kcontrol_new snd_ac97_controls_pc_beep[2] = {598598AC97_SINGLE("PC Speaker Playback Switch", AC97_PC_BEEP, 15, 1, 1),599599AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1)600600};601601602602-static const snd_kcontrol_new_t snd_ac97_controls_mic_boost =602602+static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =603603 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);604604605605···615615AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, std_mic),616616};617617618618-static const snd_kcontrol_new_t snd_ac97_control_capture_src = 618618+static const struct snd_kcontrol_new snd_ac97_control_capture_src = 619619AC97_ENUM("Capture Source", std_enum[0]); 620620621621-static const snd_kcontrol_new_t snd_ac97_control_capture_vol =621621+static const struct snd_kcontrol_new snd_ac97_control_capture_vol =622622AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0);623623624624-static const snd_kcontrol_new_t snd_ac97_controls_mic_capture[2] = {624624+static const struct snd_kcontrol_new snd_ac97_controls_mic_capture[2] = {625625AC97_SINGLE("Mic Capture Switch", AC97_REC_GAIN_MIC, 15, 1, 1),626626AC97_SINGLE("Mic Capture Volume", AC97_REC_GAIN_MIC, 0, 15, 0)627627};628628629629-typedef enum {629629+enum {630630 AC97_GENERAL_PCM_OUT = 0,631631 AC97_GENERAL_STEREO_ENHANCEMENT,632632 AC97_GENERAL_3D,···634634 AC97_GENERAL_MONO,635635 AC97_GENERAL_MIC,636636 AC97_GENERAL_LOOPBACK637637-} ac97_general_index_t;637637+};638638639639-static const snd_kcontrol_new_t snd_ac97_controls_general[7] = {639639+static const struct snd_kcontrol_new snd_ac97_controls_general[7] = {640640AC97_ENUM("PCM Out Path & Mute", std_enum[1]),641641AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),642642AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),···646646AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)647647};648648649649-const snd_kcontrol_new_t snd_ac97_controls_3d[2] = {649649+const struct snd_kcontrol_new snd_ac97_controls_3d[2] = {650650AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0),651651AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0)652652};653653654654-static const snd_kcontrol_new_t snd_ac97_controls_center[2] = {654654+static const struct snd_kcontrol_new snd_ac97_controls_center[2] = {655655AC97_SINGLE("Center Playback Switch", AC97_CENTER_LFE_MASTER, 7, 1, 1),656656AC97_SINGLE("Center Playback Volume", AC97_CENTER_LFE_MASTER, 0, 31, 1)657657};658658659659-static const snd_kcontrol_new_t snd_ac97_controls_lfe[2] = {659659+static const struct snd_kcontrol_new snd_ac97_controls_lfe[2] = {660660AC97_SINGLE("LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 1, 1),661661AC97_SINGLE("LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 31, 1)662662};663663664664-static const snd_kcontrol_new_t snd_ac97_control_eapd =664664+static const struct snd_kcontrol_new snd_ac97_control_eapd =665665AC97_SINGLE("External Amplifier", AC97_POWERDOWN, 15, 1, 1);666666667667-static const snd_kcontrol_new_t snd_ac97_controls_modem_switches[2] = {667667+static const struct snd_kcontrol_new snd_ac97_controls_modem_switches[2] = {668668AC97_SINGLE("Off-hook Switch", AC97_GPIO_STATUS, 0, 1, 0),669669AC97_SINGLE("Caller ID Switch", AC97_GPIO_STATUS, 2, 1, 0)670670};671671672672/* change the existing EAPD control as inverted */673673-static void set_inv_eapd(ac97_t *ac97, snd_kcontrol_t *kctl)673673+static void set_inv_eapd(struct snd_ac97 *ac97, struct snd_kcontrol *kctl)674674{675675 kctl->private_value = AC97_SINGLE_VALUE(AC97_POWERDOWN, 15, 1, 0);676676 snd_ac97_update_bits(ac97, AC97_POWERDOWN, (1<<15), (1<<15)); /* EAPD up */677677 ac97->scaps |= AC97_SCAP_INV_EAPD;678678}679679680680-static int snd_ac97_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)680680+static int snd_ac97_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)681681{682682 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;683683 uinfo->count = 1;684684 return 0;685685}686686687687-static int snd_ac97_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)687687+static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)688688{689689 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |690690 IEC958_AES0_NONAUDIO |···696696 return 0;697697}698698699699-static int snd_ac97_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)699699+static int snd_ac97_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)700700{701701 /* FIXME: AC'97 spec doesn't say which bits are used for what */702702 ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |···706706 return 0;707707}708708709709-static int snd_ac97_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)709709+static int snd_ac97_spdif_default_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)710710{711711- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);711711+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);712712713713 down(&ac97->reg_mutex);714714 ucontrol->value.iec958.status[0] = ac97->spdif_status & 0xff;···719719 return 0;720720}721721722722-static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * ucontrol)722722+static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)723723{724724- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);724724+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);725725 unsigned int new = 0;726726 unsigned short val = 0;727727 int change;···787787 return change;788788}789789790790-static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)790790+static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)791791{792792- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);792792+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);793793 int reg = kcontrol->private_value & 0xff;794794 int shift = (kcontrol->private_value >> 8) & 0xff;795795 int mask = (kcontrol->private_value >> 16) & 0xff;···817817 return change;818818}819819820820-const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = {820820+const struct snd_kcontrol_new snd_ac97_controls_spdif[5] = {821821 {822822 .access = SNDRV_CTL_ELEM_ACCESS_READ,823823 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,···856856 .get = snd_ac97_ad18xx_pcm_get_bits, .put = snd_ac97_ad18xx_pcm_put_bits, \857857 .private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 16) }858858859859-static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)859859+static int snd_ac97_ad18xx_pcm_info_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)860860{861861- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);861861+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);862862 int mask = (kcontrol->private_value >> 16) & 0x0f;863863 int lshift = (kcontrol->private_value >> 8) & 0x0f;864864 int rshift = (kcontrol->private_value >> 12) & 0x0f;···873873 return 0;874874}875875876876-static int snd_ac97_ad18xx_pcm_get_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)876876+static int snd_ac97_ad18xx_pcm_get_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)877877{878878- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);878878+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);879879 int codec = kcontrol->private_value & 3;880880 int lshift = (kcontrol->private_value >> 8) & 0x0f;881881 int rshift = (kcontrol->private_value >> 12) & 0x0f;···887887 return 0;888888}889889890890-static int snd_ac97_ad18xx_pcm_put_bits(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)890890+static int snd_ac97_ad18xx_pcm_put_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)891891{892892- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);892892+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);893893 int codec = kcontrol->private_value & 3;894894 int lshift = (kcontrol->private_value >> 8) & 0x0f;895895 int rshift = (kcontrol->private_value >> 12) & 0x0f;···910910 .get = snd_ac97_ad18xx_pcm_get_volume, .put = snd_ac97_ad18xx_pcm_put_volume, \911911 .private_value = codec }912912913913-static int snd_ac97_ad18xx_pcm_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)913913+static int snd_ac97_ad18xx_pcm_info_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)914914{915915 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;916916 uinfo->count = 2;···919919 return 0;920920}921921922922-static int snd_ac97_ad18xx_pcm_get_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)922922+static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)923923{924924- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);924924+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);925925 int codec = kcontrol->private_value & 3;926926927927 down(&ac97->page_mutex);···931931 return 0;932932}933933934934-static int snd_ac97_ad18xx_pcm_put_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)934934+static int snd_ac97_ad18xx_pcm_put_volume(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)935935{936936- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);936936+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);937937 int codec = kcontrol->private_value & 3;938938 unsigned short val1, val2;939939···942942 return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2);943943}944944945945-static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_pcm[2] = {945945+static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_pcm[2] = {946946AD18XX_PCM_BITS("PCM Playback Switch", 0, 15, 7, 1),947947AD18XX_PCM_VOLUME("PCM Playback Volume", 0)948948};949949950950-static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_surround[2] = {950950+static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_surround[2] = {951951AD18XX_PCM_BITS("Surround Playback Switch", 1, 15, 7, 1),952952AD18XX_PCM_VOLUME("Surround Playback Volume", 1)953953};954954955955-static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_center[2] = {955955+static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_center[2] = {956956AD18XX_PCM_BITS("Center Playback Switch", 2, 15, 15, 1),957957AD18XX_PCM_BITS("Center Playback Volume", 2, 8, 8, 31)958958};959959960960-static const snd_kcontrol_new_t snd_ac97_controls_ad18xx_lfe[2] = {960960+static const struct snd_kcontrol_new snd_ac97_controls_ad18xx_lfe[2] = {961961AD18XX_PCM_BITS("LFE Playback Switch", 2, 7, 7, 1),962962AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)963963};···966966 *967967 */968968969969-static void snd_ac97_powerdown(ac97_t *ac97);969969+static void snd_ac97_powerdown(struct snd_ac97 *ac97);970970971971-static int snd_ac97_bus_free(ac97_bus_t *bus)971971+static int snd_ac97_bus_free(struct snd_ac97_bus *bus)972972{973973 if (bus) {974974 snd_ac97_bus_proc_done(bus);···980980 return 0;981981}982982983983-static int snd_ac97_bus_dev_free(snd_device_t *device)983983+static int snd_ac97_bus_dev_free(struct snd_device *device)984984{985985- ac97_bus_t *bus = device->device_data;985985+ struct snd_ac97_bus *bus = device->device_data;986986 return snd_ac97_bus_free(bus);987987}988988989989-static int snd_ac97_free(ac97_t *ac97)989989+static int snd_ac97_free(struct snd_ac97 *ac97)990990{991991 if (ac97) {992992 snd_ac97_proc_done(ac97);···999999 return 0;10001000}1001100110021002-static int snd_ac97_dev_free(snd_device_t *device)10021002+static int snd_ac97_dev_free(struct snd_device *device)10031003{10041004- ac97_t *ac97 = device->device_data;10041004+ struct snd_ac97 *ac97 = device->device_data;10051005 snd_ac97_powerdown(ac97); /* for avoiding click noises during shut down */10061006 return snd_ac97_free(ac97);10071007}1008100810091009-static int snd_ac97_try_volume_mix(ac97_t * ac97, int reg)10091009+static int snd_ac97_try_volume_mix(struct snd_ac97 * ac97, int reg)10101010{10111011 unsigned short val, mask = 0x8000;10121012···10521052 /* try another test */10531053 snd_ac97_write_cache(ac97, reg, val | mask);10541054 val = snd_ac97_read(ac97, reg);10551055+ val = snd_ac97_read(ac97, reg);10551056 if (!(val & mask))10561057 return 0; /* nothing here */10571058 }10581059 return 1; /* success, useable */10591060}1060106110611061-static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max)10621062+static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned char *lo_max, unsigned char *hi_max)10621063{10631064 unsigned short cbit[3] = { 0x20, 0x10, 0x01 };10641065 unsigned char max[3] = { 63, 31, 15 };···10841083 }10851084}1086108510871087-int snd_ac97_try_bit(ac97_t * ac97, int reg, int bit)10861086+int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit)10881087{10891088 unsigned short mask, val, orig, res;10901089···10981097}1099109811001099/* check the volume resolution of center/lfe */11011101-static void snd_ac97_change_volume_params2(ac97_t * ac97, int reg, int shift, unsigned char *max)11001100+static void snd_ac97_change_volume_params2(struct snd_ac97 * ac97, int reg, int shift, unsigned char *max)11021101{11031102 unsigned short val, val1;11041103···11241123 return x;11251124}1126112511271127-snd_kcontrol_t *snd_ac97_cnew(const snd_kcontrol_new_t *_template, ac97_t * ac97)11261126+struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97)11281127{11291129- snd_kcontrol_new_t template;11281128+ struct snd_kcontrol_new template;11301129 memcpy(&template, _template, sizeof(template));11311130 template.index = ac97->num;11321131 return snd_ctl_new1(&template, ac97);···11351134/*11361135 * create mute switch(es) for normal stereo controls11371136 */11381138-static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int check_stereo, ac97_t *ac97)11371137+static int snd_ac97_cmute_new_stereo(struct snd_card *card, char *name, int reg, int check_stereo, struct snd_ac97 *ac97)11391138{11401140- snd_kcontrol_t *kctl;11391139+ struct snd_kcontrol *kctl;11411140 int err;11421141 unsigned short val, val1, mute_mask;11431142···11541153 mute_mask = 0x8080;11551154 }11561155 if (mute_mask == 0x8080) {11571157- snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1);11561156+ struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 15, 7, 1, 1);11581157 tmp.index = ac97->num;11591158 kctl = snd_ctl_new1(&tmp, ac97);11601159 } else {11611161- snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 15, 1, 1);11601160+ struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 15, 1, 1);11621161 tmp.index = ac97->num;11631162 kctl = snd_ctl_new1(&tmp, ac97);11641163 }···11731172/*11741173 * create a volume for normal stereo/mono controls11751174 */11761176-static int snd_ac97_cvol_new(snd_card_t *card, char *name, int reg, unsigned int lo_max,11771177- unsigned int hi_max, ac97_t *ac97)11751175+static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigned int lo_max,11761176+ unsigned int hi_max, struct snd_ac97 *ac97)11781177{11791178 int err;11801180- snd_kcontrol_t *kctl;11791179+ struct snd_kcontrol *kctl;1181118011821181 if (! snd_ac97_valid_reg(ac97, reg))11831182 return 0;11841183 if (hi_max) {11851184 /* invert */11861186- snd_kcontrol_new_t tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1);11851185+ struct snd_kcontrol_new tmp = AC97_DOUBLE(name, reg, 8, 0, lo_max, 1);11871186 tmp.index = ac97->num;11881187 kctl = snd_ctl_new1(&tmp, ac97);11891188 } else {11901189 /* invert */11911191- snd_kcontrol_new_t tmp = AC97_SINGLE(name, reg, 0, lo_max, 1);11901190+ struct snd_kcontrol_new tmp = AC97_SINGLE(name, reg, 0, lo_max, 1);11921191 tmp.index = ac97->num;11931192 kctl = snd_ctl_new1(&tmp, ac97);11941193 }···12041203/*12051204 * create a mute-switch and a volume for normal stereo/mono controls12061205 */12071207-static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg, int check_stereo, ac97_t *ac97)12061206+static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx, int reg, int check_stereo, struct snd_ac97 *ac97)12081207{12091208 int err;12101209 char name[44];···12301229#define snd_ac97_cmix_new(card, pfx, reg, ac97) snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97)12311230#define snd_ac97_cmute_new(card, name, reg, ac97) snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97)1232123112331233-static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97);12321232+static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97);1234123312351235-static int snd_ac97_mixer_build(ac97_t * ac97)12341234+static int snd_ac97_mixer_build(struct snd_ac97 * ac97)12361235{12371237- snd_card_t *card = ac97->bus->card;12381238- snd_kcontrol_t *kctl;12361236+ struct snd_card *card = ac97->bus->card;12371237+ struct snd_kcontrol *kctl;12391238 int err;12401239 unsigned int idx;12411240 unsigned char max;···15321531 return 0;15331532}1534153315351535-static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)15341534+static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)15361535{15371536 int err, idx;15381537···15561555 return 0;15571556}1558155715591559-static int snd_ac97_test_rate(ac97_t *ac97, int reg, int shadow_reg, int rate)15581558+static int snd_ac97_test_rate(struct snd_ac97 *ac97, int reg, int shadow_reg, int rate)15601559{15611560 unsigned short val;15621561 unsigned int tmp;···15691568 return val == (tmp & 0xffff);15701569}1571157015721572-static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsigned int *r_result)15711571+static void snd_ac97_determine_rates(struct snd_ac97 *ac97, int reg, int shadow_reg, unsigned int *r_result)15731572{15741573 unsigned int result = 0;15751574 unsigned short saved;···16291628}1630162916311630/* check AC97_SPDIF register to accept which sample rates */16321632-static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97)16311631+static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97)16331632{16341633 unsigned int result = 0;16351634 int i;···16491648}1650164916511650/* look for the codec id table matching with the given id */16521652-static const ac97_codec_id_t *look_for_codec_id(const ac97_codec_id_t *table,16531653- unsigned int id)16511651+static const struct ac97_codec_id *look_for_codec_id(const struct ac97_codec_id *table,16521652+ unsigned int id)16541653{16551655- const ac97_codec_id_t *pid;16541654+ const struct ac97_codec_id *pid;1656165516571656 for (pid = table; pid->id; pid++)16581657 if (pid->id == (id & pid->mask))···16601659 return NULL;16611660}1662166116631663-void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)16621662+void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int modem)16641663{16651665- const ac97_codec_id_t *pid;16641664+ const struct ac97_codec_id *pid;1666166516671666 sprintf(name, "0x%x %c%c%c", id,16681667 printable(id >> 24),···17001699 *17011700 * Returns the short identifying name of the codec.17021701 */17031703-const char *snd_ac97_get_short_name(ac97_t *ac97)17021702+const char *snd_ac97_get_short_name(struct snd_ac97 *ac97)17041703{17051705- const ac97_codec_id_t *pid;17041704+ const struct ac97_codec_id *pid;1706170517071706 for (pid = snd_ac97_codec_ids; pid->id; pid++)17081707 if (pid->id == (ac97->id & pid->mask))···17141713/* wait for a while until registers are accessible after RESET17151714 * return 0 if ok, negative not ready17161715 */17171717-static int ac97_reset_wait(ac97_t *ac97, int timeout, int with_modem)17161716+static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)17181717{17191718 unsigned long end_time;17201719 unsigned short val;···17591758 * @private_data: private data pointer for the new instance17601759 * @rbus: the pointer to store the new AC97 bus instance.17611760 *17621762- * Creates an AC97 bus component. An ac97_bus_t instance is newly17611761+ * Creates an AC97 bus component. An struct snd_ac97_bus instance is newly17631762 * allocated and initialized.17641763 *17651764 * The ops table must include valid callbacks (at least read and···17731772 *17741773 * Returns zero if successful, or a negative error code on failure.17751774 */17761776-int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops,17771777- void *private_data, ac97_bus_t **rbus)17751775+int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,17761776+ void *private_data, struct snd_ac97_bus **rbus)17781777{17791778 int err;17801780- ac97_bus_t *bus;17811781- static snd_device_ops_t dev_ops = {17791779+ struct snd_ac97_bus *bus;17801780+ static struct snd_device_ops dev_ops = {17821781 .dev_free = snd_ac97_bus_dev_free,17831782 };17841783···18081807}1809180818101809/* register ac97 codec to bus */18111811-static int snd_ac97_dev_register(snd_device_t *device)18101810+static int snd_ac97_dev_register(struct snd_device *device)18121811{18131813- ac97_t *ac97 = device->device_data;18121812+ struct snd_ac97 *ac97 = device->device_data;18141813 int err;1815181418161815 ac97->dev.bus = &ac97_bus_type;···18261825}1827182618281827/* unregister ac97 codec */18291829-static int snd_ac97_dev_unregister(snd_device_t *device)18281828+static int snd_ac97_dev_unregister(struct snd_device *device)18301829{18311831- ac97_t *ac97 = device->device_data;18301830+ struct snd_ac97 *ac97 = device->device_data;18321831 if (ac97->dev.bus)18331832 device_unregister(&ac97->dev);18341833 return snd_ac97_free(ac97);···18441843 * the private data.18451844 * @rac97: the pointer to store the new ac97 instance.18461845 *18471847- * Creates an Codec97 component. An ac97_t instance is newly18461846+ * Creates an Codec97 component. An struct snd_ac97 instance is newly18481847 * allocated and initialized from the template. The codec18491848 * is then initialized by the standard procedure.18501849 *···18561855 *18571856 * Returns zero if successful, or a negative error code on failure.18581857 */18591859-int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)18581858+int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, struct snd_ac97 **rac97)18601859{18611860 int err;18621862- ac97_t *ac97;18631863- snd_card_t *card;18611861+ struct snd_ac97 *ac97;18621862+ struct snd_card *card;18641863 char name[64];18651864 unsigned long end_time;18661865 unsigned int reg;18671867- const ac97_codec_id_t *pid;18681868- static snd_device_ops_t ops = {18661866+ const struct ac97_codec_id *pid;18671867+ static struct snd_device_ops ops = {18691868 .dev_free = snd_ac97_dev_free,18701869 .dev_register = snd_ac97_dev_register,18711870 .dev_unregister = snd_ac97_dev_unregister,···21492148 * MASTER and HEADPHONE registers are muted but the register cache values21502149 * are not changed, so that the values can be restored in snd_ac97_resume().21512150 */21522152-static void snd_ac97_powerdown(ac97_t *ac97)21512151+static void snd_ac97_powerdown(struct snd_ac97 *ac97)21532152{21542153 unsigned short power;21552154···21822181 *21832182 * Suspends the codec, power down the chip.21842183 */21852185-void snd_ac97_suspend(ac97_t *ac97)21842184+void snd_ac97_suspend(struct snd_ac97 *ac97)21862185{21872186 if (ac97->build_ops->suspend)21882187 ac97->build_ops->suspend(ac97);···21922191/*21932192 * restore ac97 status21942193 */21952195-void snd_ac97_restore_status(ac97_t *ac97)21942194+void snd_ac97_restore_status(struct snd_ac97 *ac97)21962195{21972196 int i;21982197···22132212/*22142213 * restore IEC958 status22152214 */22162216-void snd_ac97_restore_iec958(ac97_t *ac97)22152215+void snd_ac97_restore_iec958(struct snd_ac97 *ac97)22172216{22182217 if (ac97->ext_id & AC97_EI_SPDIF) {22192218 if (ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_SPDIF) {···22362235 * Do the standard resume procedure, power up and restoring the22372236 * old register values.22382237 */22392239-void snd_ac97_resume(ac97_t *ac97)22382238+void snd_ac97_resume(struct snd_ac97 *ac97)22402239{22412240 unsigned long end_time;22422241···23022301} 2303230223042303/* remove the control with the given name and optional suffix */23052305-int snd_ac97_remove_ctl(ac97_t *ac97, const char *name, const char *suffix)23042304+int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix)23062305{23072307- snd_ctl_elem_id_t id;23062306+ struct snd_ctl_elem_id id;23082307 memset(&id, 0, sizeof(id));23092308 set_ctl_name(id.name, name, suffix);23102309 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;23112310 return snd_ctl_remove_id(ac97->bus->card, &id);23122311}2313231223142314-static snd_kcontrol_t *ctl_find(ac97_t *ac97, const char *name, const char *suffix)23132313+static struct snd_kcontrol *ctl_find(struct snd_ac97 *ac97, const char *name, const char *suffix)23152314{23162316- snd_ctl_elem_id_t sid;23152315+ struct snd_ctl_elem_id sid;23172316 memset(&sid, 0, sizeof(sid));23182317 set_ctl_name(sid.name, name, suffix);23192318 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;···23212320}2322232123232322/* rename the control with the given name and optional suffix */23242324-int snd_ac97_rename_ctl(ac97_t *ac97, const char *src, const char *dst, const char *suffix)23232323+int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix)23252324{23262326- snd_kcontrol_t *kctl = ctl_find(ac97, src, suffix);23252325+ struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix);23272326 if (kctl) {23282327 set_ctl_name(kctl->id.name, dst, suffix);23292328 return 0;···23322331}2333233223342333/* rename both Volume and Switch controls - don't check the return value */23352335-void snd_ac97_rename_vol_ctl(ac97_t *ac97, const char *src, const char *dst)23342334+void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst)23362335{23372336 snd_ac97_rename_ctl(ac97, src, dst, "Switch");23382337 snd_ac97_rename_ctl(ac97, src, dst, "Volume");23392338}2340233923412340/* swap controls */23422342-int snd_ac97_swap_ctl(ac97_t *ac97, const char *s1, const char *s2, const char *suffix)23412341+int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix)23432342{23442344- snd_kcontrol_t *kctl1, *kctl2;23432343+ struct snd_kcontrol *kctl1, *kctl2;23452344 kctl1 = ctl_find(ac97, s1, suffix);23462345 kctl2 = ctl_find(ac97, s2, suffix);23472346 if (kctl1 && kctl2) {···2354235323552354#if 123562355/* bind hp and master controls instead of using only hp control */23572357-static int bind_hp_volsw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)23562356+static int bind_hp_volsw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)23582357{23592358 int err = snd_ac97_put_volsw(kcontrol, ucontrol);23602359 if (err > 0) {···23672366}2368236723692368/* ac97 tune: bind Master and Headphone controls */23702370-static int tune_hp_only(ac97_t *ac97)23692369+static int tune_hp_only(struct snd_ac97 *ac97)23712370{23722372- snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL);23732373- snd_kcontrol_t *mvol = ctl_find(ac97, "Master Playback Volume", NULL);23712371+ struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);23722372+ struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);23742373 if (! msw || ! mvol)23752374 return -ENOENT;23762375 msw->put = bind_hp_volsw_put;···2382238123832382#else23842383/* ac97 tune: use Headphone control as master */23852385-static int tune_hp_only(ac97_t *ac97)23842384+static int tune_hp_only(struct snd_ac97 *ac97)23862385{23872386 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)23882387 return -ENOENT;···23942393#endif2395239423962395/* ac97 tune: swap Headphone and Master controls */23972397-static int tune_swap_hp(ac97_t *ac97)23962396+static int tune_swap_hp(struct snd_ac97 *ac97)23982397{23992398 if (ctl_find(ac97, "Headphone Playback Switch", NULL) == NULL)24002399 return -ENOENT;···24042403}2405240424062405/* ac97 tune: swap Surround and Master controls */24072407-static int tune_swap_surround(ac97_t *ac97)24062406+static int tune_swap_surround(struct snd_ac97 *ac97)24082407{24092408 if (snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Switch") ||24102409 snd_ac97_swap_ctl(ac97, "Master Playback", "Surround Playback", "Volume"))···24132412}2414241324152414/* ac97 tune: set up mic sharing for AD codecs */24162416-static int tune_ad_sharing(ac97_t *ac97)24152415+static int tune_ad_sharing(struct snd_ac97 *ac97)24172416{24182417 unsigned short scfg;24192418 if ((ac97->id & 0xffffff00) != 0x41445300) {···24262425 return 0;24272426}2428242724292429-static const snd_kcontrol_new_t snd_ac97_alc_jack_detect = 24282428+static const struct snd_kcontrol_new snd_ac97_alc_jack_detect = 24302429AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);2431243024322431/* ac97 tune: set up ALC jack-select */24332433-static int tune_alc_jack(ac97_t *ac97)24322432+static int tune_alc_jack(struct snd_ac97 *ac97)24342433{24352434 if ((ac97->id & 0xffffff00) != 0x414c4700) {24362435 snd_printk(KERN_ERR "ac97_quirk ALC_JACK is only for Realtek codecs\n");···24422441}2443244224442443/* ac97 tune: inversed EAPD bit */24452445-static int tune_inv_eapd(ac97_t *ac97)24442444+static int tune_inv_eapd(struct snd_ac97 *ac97)24462445{24472447- snd_kcontrol_t *kctl = ctl_find(ac97, "External Amplifier", NULL);24462446+ struct snd_kcontrol *kctl = ctl_find(ac97, "External Amplifier", NULL);24482447 if (! kctl)24492448 return -ENOENT;24502449 set_inv_eapd(ac97, kctl);24512450 return 0;24522451}2453245224542454-static int master_mute_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)24532453+static int master_mute_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)24552454{24562455 int err = snd_ac97_put_volsw(kcontrol, ucontrol);24572456 if (err > 0) {24582458- ac97_t *ac97 = snd_kcontrol_chip(kcontrol);24572457+ struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);24592458 int shift = (kcontrol->private_value >> 8) & 0x0f;24602459 int rshift = (kcontrol->private_value >> 12) & 0x0f;24612460 unsigned short mask;···24712470}2472247124732472/* ac97 tune: EAPD controls mute LED bound with the master mute */24742474-static int tune_mute_led(ac97_t *ac97)24732473+static int tune_mute_led(struct snd_ac97 *ac97)24752474{24762476- snd_kcontrol_t *msw = ctl_find(ac97, "Master Playback Switch", NULL);24752475+ struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);24772476 if (! msw)24782477 return -ENOENT;24792478 msw->put = master_mute_sw_put;···2484248324852484struct quirk_table {24862485 const char *name;24872487- int (*func)(ac97_t *);24862486+ int (*func)(struct snd_ac97 *);24882487};2489248824902489static struct quirk_table applicable_quirks[] = {···24992498};2500249925012500/* apply the quirk with the given type */25022502-static int apply_quirk(ac97_t *ac97, int type)25012501+static int apply_quirk(struct snd_ac97 *ac97, int type)25032502{25042503 if (type <= 0)25052504 return 0;···25112510}2512251125132512/* apply the quirk with the given name */25142514-static int apply_quirk_str(ac97_t *ac97, const char *typestr)25132513+static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr)25152514{25162515 int i;25172516 struct quirk_table *q;···25402539 * Returns zero if successful, or a negative error code on failure.25412540 */2542254125432543-int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override)25422542+int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override)25442543{25452544 int result;25462545