Skip to content

Commit ee42381

Browse files
tiwaiJaroslav Kysela
authored andcommitted
[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>
1 parent dc4cafb commit ee42381

8 files changed

Lines changed: 511 additions & 509 deletions

File tree

‎include/sound/ac97_codec.h‎

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -391,38 +391,35 @@
391391
*
392392
*/
393393

394-
typedef struct _snd_ac97_bus ac97_bus_t;
395-
typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
396-
typedef struct _snd_ac97_template ac97_template_t;
397-
typedef struct _snd_ac97 ac97_t;
394+
struct snd_ac97;
398395

399396
struct snd_ac97_build_ops {
400-
int (*build_3d) (ac97_t *ac97);
401-
int (*build_specific) (ac97_t *ac97);
402-
int (*build_spdif) (ac97_t *ac97);
403-
int (*build_post_spdif) (ac97_t *ac97);
397+
int (*build_3d) (struct snd_ac97 *ac97);
398+
int (*build_specific) (struct snd_ac97 *ac97);
399+
int (*build_spdif) (struct snd_ac97 *ac97);
400+
int (*build_post_spdif) (struct snd_ac97 *ac97);
404401
#ifdef CONFIG_PM
405-
void (*suspend) (ac97_t *ac97);
406-
void (*resume) (ac97_t *ac97);
402+
void (*suspend) (struct snd_ac97 *ac97);
403+
void (*resume) (struct snd_ac97 *ac97);
407404
#endif
408-
void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */
405+
void (*update_jacks) (struct snd_ac97 *ac97); /* for jack-sharing */
409406
};
410407

411-
struct _snd_ac97_bus_ops {
412-
void (*reset) (ac97_t *ac97);
413-
void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val);
414-
unsigned short (*read) (ac97_t *ac97, unsigned short reg);
415-
void (*wait) (ac97_t *ac97);
416-
void (*init) (ac97_t *ac97);
408+
struct snd_ac97_bus_ops {
409+
void (*reset) (struct snd_ac97 *ac97);
410+
void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
411+
unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
412+
void (*wait) (struct snd_ac97 *ac97);
413+
void (*init) (struct snd_ac97 *ac97);
417414
};
418415

419-
struct _snd_ac97_bus {
416+
struct snd_ac97_bus {
420417
/* -- lowlevel (hardware) driver specific -- */
421-
ac97_bus_ops_t *ops;
418+
struct snd_ac97_bus_ops *ops;
422419
void *private_data;
423-
void (*private_free) (ac97_bus_t *bus);
420+
void (*private_free) (struct snd_ac97_bus *bus);
424421
/* --- */
425-
snd_card_t *card;
422+
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 */
@@ -432,13 +429,13 @@ struct _snd_ac97_bus {
432429
unsigned short used_slots[2][4]; /* actually used PCM slots */
433430
unsigned short pcms_count; /* count of PCMs */
434431
struct ac97_pcm *pcms;
435-
ac97_t *codec[4];
436-
snd_info_entry_t *proc;
432+
struct snd_ac97 *codec[4];
433+
struct snd_info_entry *proc;
437434
};
438435

439-
struct _snd_ac97_template {
436+
struct snd_ac97_template {
440437
void *private_data;
441-
void (*private_free) (ac97_t *ac97);
438+
void (*private_free) (struct snd_ac97 *ac97);
442439
struct pci_dev *pci; /* assigned PCI device - used for quirks */
443440
unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
444441
unsigned short addr; /* physical address of codec [0-3] */
@@ -447,16 +444,16 @@ struct _snd_ac97_template {
447444
DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
448445
};
449446

450-
struct _snd_ac97 {
447+
struct snd_ac97 {
451448
/* -- lowlevel (hardware) driver specific -- */
452449
struct snd_ac97_build_ops * build_ops;
453450
void *private_data;
454-
void (*private_free) (ac97_t *ac97);
451+
void (*private_free) (struct snd_ac97 *ac97);
455452
/* --- */
456-
ac97_bus_t *bus;
453+
struct snd_ac97_bus *bus;
457454
struct pci_dev *pci; /* assigned PCI device - used for quirks */
458-
snd_info_entry_t *proc;
459-
snd_info_entry_t *proc_regs;
455+
struct snd_info_entry *proc;
456+
struct snd_info_entry *proc_regs;
460457
unsigned short subsystem_vendor;
461458
unsigned short subsystem_device;
462459
struct semaphore reg_mutex;
@@ -490,43 +487,47 @@ struct _snd_ac97 {
490487
struct device dev;
491488
};
492489

493-
#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev)
490+
#define to_ac97_t(d) container_of(d, struct snd_ac97, dev)
494491

495492
/* conditions */
496-
static inline int ac97_is_audio(ac97_t * ac97)
493+
static inline int ac97_is_audio(struct snd_ac97 * ac97)
497494
{
498495
return (ac97->scaps & AC97_SCAP_AUDIO);
499496
}
500-
static inline int ac97_is_modem(ac97_t * ac97)
497+
static inline int ac97_is_modem(struct snd_ac97 * ac97)
501498
{
502499
return (ac97->scaps & AC97_SCAP_MODEM);
503500
}
504-
static inline int ac97_is_rev22(ac97_t * ac97)
501+
static inline int ac97_is_rev22(struct snd_ac97 * ac97)
505502
{
506503
return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;
507504
}
508-
static inline int ac97_can_amap(ac97_t * ac97)
505+
static inline int ac97_can_amap(struct snd_ac97 * ac97)
509506
{
510507
return (ac97->ext_id & AC97_EI_AMAP) != 0;
511508
}
512-
static inline int ac97_can_spdif(ac97_t * ac97)
509+
static inline int ac97_can_spdif(struct snd_ac97 * ac97)
513510
{
514511
return (ac97->ext_id & AC97_EI_SPDIF) != 0;
515512
}
516513

517514
/* functions */
518-
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 */
519-
int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */
520-
const char *snd_ac97_get_short_name(ac97_t *ac97);
521-
522-
void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);
523-
unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);
524-
void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value);
525-
int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value);
526-
int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value);
515+
/* create new AC97 bus */
516+
int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
517+
void *private_data, struct snd_ac97_bus **rbus);
518+
/* create mixer controls */
519+
int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
520+
struct snd_ac97 **rac97);
521+
const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);
522+
523+
void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
524+
unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
525+
void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
526+
int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
527+
int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value);
527528
#ifdef CONFIG_PM
528-
void snd_ac97_suspend(ac97_t *ac97);
529-
void snd_ac97_resume(ac97_t *ac97);
529+
void snd_ac97_suspend(struct snd_ac97 *ac97);
530+
void snd_ac97_resume(struct snd_ac97 *ac97);
530531
#endif
531532

532533
/* quirk types */
@@ -551,8 +552,8 @@ struct ac97_quirk {
551552
int type; /* quirk type above */
552553
};
553554

554-
int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override);
555-
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate);
555+
int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override);
556+
int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate);
556557

557558
/*
558559
* PCM allocation
@@ -568,7 +569,7 @@ enum ac97_pcm_cfg {
568569
};
569570

570571
struct ac97_pcm {
571-
ac97_bus_t *bus;
572+
struct snd_ac97_bus *bus;
572573
unsigned int stream: 1, /* stream type: 1 = capture */
573574
exclusive: 1, /* exclusive mode, don't override with other pcms */
574575
copy_flag: 1, /* lowlevel driver must fill all entries */
@@ -579,18 +580,18 @@ struct ac97_pcm {
579580
unsigned short slots; /* driver input: requested AC97 slot numbers */
580581
unsigned short rslots[4]; /* allocated slots per codecs */
581582
unsigned char rate_table[4];
582-
ac97_t *codec[4]; /* allocated codecs */
583+
struct snd_ac97 *codec[4]; /* allocated codecs */
583584
} r[2]; /* 0 = standard rates, 1 = double rates */
584585
unsigned long private_value; /* used by the hardware driver */
585586
};
586587

587-
int snd_ac97_pcm_assign(ac97_bus_t *ac97,
588+
int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,
588589
unsigned short pcms_count,
589590
const struct ac97_pcm *pcms);
590591
int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
591592
enum ac97_pcm_cfg cfg, unsigned short slots);
592593
int snd_ac97_pcm_close(struct ac97_pcm *pcm);
593-
int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime);
594+
int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);
594595

595596
/* ad hoc AC97 device driver access */
596597
extern struct bus_type ac97_bus_type;

‎sound/pci/ac97/ac97_bus.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/*
2020
* Let drivers decide whether they want to support given codec from their
21-
* probe method. Drivers have direct access to the ac97_t structure and may
21+
* probe method. Drivers have direct access to the struct snd_ac97 structure and may
2222
* decide based on the id field amongst other things.
2323
*/
2424
static int ac97_bus_match(struct device *dev, struct device_driver *drv)

0 commit comments

Comments
 (0)