aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/ac97_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:21:36 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:12 -0500
commitee42381e71c56328db9e9d64d19a4de7a2f09a93 (patch)
tree641cdecfa64347efb7d402c707412e0a45fe7ced /include/sound/ac97_codec.h
parentdc4cafbadad1ae2322e598f2cb72720ef4095fee (diff)
[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>
Diffstat (limited to 'include/sound/ac97_codec.h')
-rw-r--r--include/sound/ac97_codec.h107
1 files changed, 54 insertions, 53 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 6f1e6ba2a190..a1814cd95491 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -391,38 +391,35 @@
391 * 391 *
392 */ 392 */
393 393
394typedef struct _snd_ac97_bus ac97_bus_t; 394struct snd_ac97;
395typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
396typedef struct _snd_ac97_template ac97_template_t;
397typedef struct _snd_ac97 ac97_t;
398 395
399struct snd_ac97_build_ops { 396struct snd_ac97_build_ops {
400 int (*build_3d) (ac97_t *ac97); 397 int (*build_3d) (struct snd_ac97 *ac97);
401 int (*build_specific) (ac97_t *ac97); 398 int (*build_specific) (struct snd_ac97 *ac97);
402 int (*build_spdif) (ac97_t *ac97); 399 int (*build_spdif) (struct snd_ac97 *ac97);
403 int (*build_post_spdif) (ac97_t *ac97); 400 int (*build_post_spdif) (struct snd_ac97 *ac97);
404#ifdef CONFIG_PM 401#ifdef CONFIG_PM
405 void (*suspend) (ac97_t *ac97); 402 void (*suspend) (struct snd_ac97 *ac97);
406 void (*resume) (ac97_t *ac97); 403 void (*resume) (struct snd_ac97 *ac97);
407#endif 404#endif
408 void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */ 405 void (*update_jacks) (struct snd_ac97 *ac97); /* for jack-sharing */
409}; 406};
410 407
411struct _snd_ac97_bus_ops { 408struct snd_ac97_bus_ops {
412 void (*reset) (ac97_t *ac97); 409 void (*reset) (struct snd_ac97 *ac97);
413 void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val); 410 void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
414 unsigned short (*read) (ac97_t *ac97, unsigned short reg); 411 unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
415 void (*wait) (ac97_t *ac97); 412 void (*wait) (struct snd_ac97 *ac97);
416 void (*init) (ac97_t *ac97); 413 void (*init) (struct snd_ac97 *ac97);
417}; 414};
418 415
419struct _snd_ac97_bus { 416struct snd_ac97_bus {
420 /* -- lowlevel (hardware) driver specific -- */ 417 /* -- lowlevel (hardware) driver specific -- */
421 ac97_bus_ops_t *ops; 418 struct snd_ac97_bus_ops *ops;
422 void *private_data; 419 void *private_data;
423 void (*private_free) (ac97_bus_t *bus); 420 void (*private_free) (struct snd_ac97_bus *bus);
424 /* --- */ 421 /* --- */
425 snd_card_t *card; 422 struct snd_card *card;
426 unsigned short num; /* bus number */ 423 unsigned short num; /* bus number */
427 unsigned short no_vra: 1, /* bridge doesn't support VRA */ 424 unsigned short no_vra: 1, /* bridge doesn't support VRA */
428 dra: 1, /* bridge supports double rate */ 425 dra: 1, /* bridge supports double rate */
@@ -432,13 +429,13 @@ struct _snd_ac97_bus {
432 unsigned short used_slots[2][4]; /* actually used PCM slots */ 429 unsigned short used_slots[2][4]; /* actually used PCM slots */
433 unsigned short pcms_count; /* count of PCMs */ 430 unsigned short pcms_count; /* count of PCMs */
434 struct ac97_pcm *pcms; 431 struct ac97_pcm *pcms;
435 ac97_t *codec[4]; 432 struct snd_ac97 *codec[4];
436 snd_info_entry_t *proc; 433 struct snd_info_entry *proc;
437}; 434};
438 435
439struct _snd_ac97_template { 436struct snd_ac97_template {
440 void *private_data; 437 void *private_data;
441 void (*private_free) (ac97_t *ac97); 438 void (*private_free) (struct snd_ac97 *ac97);
442 struct pci_dev *pci; /* assigned PCI device - used for quirks */ 439 struct pci_dev *pci; /* assigned PCI device - used for quirks */
443 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ 440 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
444 unsigned short addr; /* physical address of codec [0-3] */ 441 unsigned short addr; /* physical address of codec [0-3] */
@@ -447,16 +444,16 @@ struct _snd_ac97_template {
447 DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ 444 DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
448}; 445};
449 446
450struct _snd_ac97 { 447struct snd_ac97 {
451 /* -- lowlevel (hardware) driver specific -- */ 448 /* -- lowlevel (hardware) driver specific -- */
452 struct snd_ac97_build_ops * build_ops; 449 struct snd_ac97_build_ops * build_ops;
453 void *private_data; 450 void *private_data;
454 void (*private_free) (ac97_t *ac97); 451 void (*private_free) (struct snd_ac97 *ac97);
455 /* --- */ 452 /* --- */
456 ac97_bus_t *bus; 453 struct snd_ac97_bus *bus;
457 struct pci_dev *pci; /* assigned PCI device - used for quirks */ 454 struct pci_dev *pci; /* assigned PCI device - used for quirks */
458 snd_info_entry_t *proc; 455 struct snd_info_entry *proc;
459 snd_info_entry_t *proc_regs; 456 struct snd_info_entry *proc_regs;
460 unsigned short subsystem_vendor; 457 unsigned short subsystem_vendor;
461 unsigned short subsystem_device; 458 unsigned short subsystem_device;
462 struct semaphore reg_mutex; 459 struct semaphore reg_mutex;
@@ -490,43 +487,47 @@ struct _snd_ac97 {
490 struct device dev; 487 struct device dev;
491}; 488};
492 489
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)
494 491
495/* conditions */ 492/* conditions */
496static inline int ac97_is_audio(ac97_t * ac97) 493static inline int ac97_is_audio(struct snd_ac97 * ac97)
497{ 494{
498 return (ac97->scaps & AC97_SCAP_AUDIO); 495 return (ac97->scaps & AC97_SCAP_AUDIO);
499} 496}
500static inline int ac97_is_modem(ac97_t * ac97) 497static inline int ac97_is_modem(struct snd_ac97 * ac97)
501{ 498{
502 return (ac97->scaps & AC97_SCAP_MODEM); 499 return (ac97->scaps & AC97_SCAP_MODEM);
503} 500}
504static inline int ac97_is_rev22(ac97_t * ac97) 501static inline int ac97_is_rev22(struct snd_ac97 * ac97)
505{ 502{
506 return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22; 503 return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;
507} 504}
508static inline int ac97_can_amap(ac97_t * ac97) 505static inline int ac97_can_amap(struct snd_ac97 * ac97)
509{ 506{
510 return (ac97->ext_id & AC97_EI_AMAP) != 0; 507 return (ac97->ext_id & AC97_EI_AMAP) != 0;
511} 508}
512static inline int ac97_can_spdif(ac97_t * ac97) 509static inline int ac97_can_spdif(struct snd_ac97 * ac97)
513{ 510{
514 return (ac97->ext_id & AC97_EI_SPDIF) != 0; 511 return (ac97->ext_id & AC97_EI_SPDIF) != 0;
515} 512}
516 513
517/* functions */ 514/* functions */
518int 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 */ 515/* create new AC97 bus */
519int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */ 516int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
520const char *snd_ac97_get_short_name(ac97_t *ac97); 517 void *private_data, struct snd_ac97_bus **rbus);
521 518/* create mixer controls */
522void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value); 519int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
523unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg); 520 struct snd_ac97 **rac97);
524void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value); 521const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);
525int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value); 522
526int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value); 523void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
524unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
525void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
526int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
527int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value);
527#ifdef CONFIG_PM 528#ifdef CONFIG_PM
528void snd_ac97_suspend(ac97_t *ac97); 529void snd_ac97_suspend(struct snd_ac97 *ac97);
529void snd_ac97_resume(ac97_t *ac97); 530void snd_ac97_resume(struct snd_ac97 *ac97);
530#endif 531#endif
531 532
532/* quirk types */ 533/* quirk types */
@@ -551,8 +552,8 @@ struct ac97_quirk {
551 int type; /* quirk type above */ 552 int type; /* quirk type above */
552}; 553};
553 554
554int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override); 555int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override);
555int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate); 556int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate);
556 557
557/* 558/*
558 * PCM allocation 559 * PCM allocation
@@ -568,7 +569,7 @@ enum ac97_pcm_cfg {
568}; 569};
569 570
570struct ac97_pcm { 571struct ac97_pcm {
571 ac97_bus_t *bus; 572 struct snd_ac97_bus *bus;
572 unsigned int stream: 1, /* stream type: 1 = capture */ 573 unsigned int stream: 1, /* stream type: 1 = capture */
573 exclusive: 1, /* exclusive mode, don't override with other pcms */ 574 exclusive: 1, /* exclusive mode, don't override with other pcms */
574 copy_flag: 1, /* lowlevel driver must fill all entries */ 575 copy_flag: 1, /* lowlevel driver must fill all entries */
@@ -579,18 +580,18 @@ struct ac97_pcm {
579 unsigned short slots; /* driver input: requested AC97 slot numbers */ 580 unsigned short slots; /* driver input: requested AC97 slot numbers */
580 unsigned short rslots[4]; /* allocated slots per codecs */ 581 unsigned short rslots[4]; /* allocated slots per codecs */
581 unsigned char rate_table[4]; 582 unsigned char rate_table[4];
582 ac97_t *codec[4]; /* allocated codecs */ 583 struct snd_ac97 *codec[4]; /* allocated codecs */
583 } r[2]; /* 0 = standard rates, 1 = double rates */ 584 } r[2]; /* 0 = standard rates, 1 = double rates */
584 unsigned long private_value; /* used by the hardware driver */ 585 unsigned long private_value; /* used by the hardware driver */
585}; 586};
586 587
587int snd_ac97_pcm_assign(ac97_bus_t *ac97, 588int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,
588 unsigned short pcms_count, 589 unsigned short pcms_count,
589 const struct ac97_pcm *pcms); 590 const struct ac97_pcm *pcms);
590int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, 591int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
591 enum ac97_pcm_cfg cfg, unsigned short slots); 592 enum ac97_pcm_cfg cfg, unsigned short slots);
592int snd_ac97_pcm_close(struct ac97_pcm *pcm); 593int snd_ac97_pcm_close(struct ac97_pcm *pcm);
593int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime); 594int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);
594 595
595/* ad hoc AC97 device driver access */ 596/* ad hoc AC97 device driver access */
596extern struct bus_type ac97_bus_type; 597extern struct bus_type ac97_bus_type;