Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ALSA] Remove xxx_t typedefs: PARISC Harmony

Modules: PARISC Harmony driver

Remove xxx_t typedefs from the PARIC Harmony driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Iwai and committed by
Jaroslav Kysela
67b1020d 475675d6

+91 -92
+84 -85
sound/parisc/harmony.c
··· 99 99 HARMONY_SR_44KHZ, HARMONY_SR_48KHZ 100 100 }; 101 101 102 - static snd_pcm_hw_constraint_list_t hw_constraint_rates = { 102 + static struct snd_pcm_hw_constraint_list hw_constraint_rates = { 103 103 .count = ARRAY_SIZE(snd_harmony_rates), 104 104 .list = snd_harmony_rates, 105 105 .mask = 0, 106 106 }; 107 107 108 - inline unsigned long 109 - harmony_read(harmony_t *h, unsigned r) 108 + static inline unsigned long 109 + harmony_read(struct snd_harmony *h, unsigned r) 110 110 { 111 111 return __raw_readl(h->iobase + r); 112 112 } 113 113 114 - inline void 115 - harmony_write(harmony_t *h, unsigned r, unsigned long v) 114 + static inline void 115 + harmony_write(struct snd_harmony *h, unsigned r, unsigned long v) 116 116 { 117 117 __raw_writel(v, h->iobase + r); 118 118 } 119 119 120 - static void 121 - harmony_wait_for_control(harmony_t *h) 120 + static inline void 121 + harmony_wait_for_control(struct snd_harmony *h) 122 122 { 123 123 while (harmony_read(h, HARMONY_CNTL) & HARMONY_CNTL_C) ; 124 124 } 125 125 126 - inline void 127 - harmony_reset(harmony_t *h) 126 + static inline void 127 + harmony_reset(struct snd_harmony *h) 128 128 { 129 129 harmony_write(h, HARMONY_RESET, 1); 130 130 mdelay(50); ··· 132 132 } 133 133 134 134 static void 135 - harmony_disable_interrupts(harmony_t *h) 135 + harmony_disable_interrupts(struct snd_harmony *h) 136 136 { 137 137 u32 dstatus; 138 138 harmony_wait_for_control(h); ··· 142 142 } 143 143 144 144 static void 145 - harmony_enable_interrupts(harmony_t *h) 145 + harmony_enable_interrupts(struct snd_harmony *h) 146 146 { 147 147 u32 dstatus; 148 148 harmony_wait_for_control(h); ··· 152 152 } 153 153 154 154 static void 155 - harmony_mute(harmony_t *h) 155 + harmony_mute(struct snd_harmony *h) 156 156 { 157 157 unsigned long flags; 158 158 ··· 163 163 } 164 164 165 165 static void 166 - harmony_unmute(harmony_t *h) 166 + harmony_unmute(struct snd_harmony *h) 167 167 { 168 168 unsigned long flags; 169 169 ··· 174 174 } 175 175 176 176 static void 177 - harmony_set_control(harmony_t *h) 177 + harmony_set_control(struct snd_harmony *h) 178 178 { 179 179 u32 ctrl; 180 180 unsigned long flags; ··· 196 196 snd_harmony_interrupt(int irq, void *dev, struct pt_regs *regs) 197 197 { 198 198 u32 dstatus; 199 - harmony_t *h = dev; 199 + struct snd_harmony *h = dev; 200 200 201 201 spin_lock(&h->lock); 202 202 harmony_disable_interrupts(h); ··· 261 261 return HARMONY_SR_44KHZ; 262 262 } 263 263 264 - static snd_pcm_hardware_t snd_harmony_playback = 264 + static struct snd_pcm_hardware snd_harmony_playback = 265 265 { 266 266 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 267 267 SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID | ··· 282 282 .fifo_size = 0, 283 283 }; 284 284 285 - static snd_pcm_hardware_t snd_harmony_capture = 285 + static struct snd_pcm_hardware snd_harmony_capture = 286 286 { 287 287 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 288 288 SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID | ··· 304 304 }; 305 305 306 306 static int 307 - snd_harmony_playback_trigger(snd_pcm_substream_t *ss, int cmd) 307 + snd_harmony_playback_trigger(struct snd_pcm_substream *ss, int cmd) 308 308 { 309 - harmony_t *h = snd_pcm_substream_chip(ss); 309 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 310 310 311 311 if (h->st.capturing) 312 312 return -EBUSY; ··· 340 340 } 341 341 342 342 static int 343 - snd_harmony_capture_trigger(snd_pcm_substream_t *ss, int cmd) 343 + snd_harmony_capture_trigger(struct snd_pcm_substream *ss, int cmd) 344 344 { 345 - harmony_t *h = snd_pcm_substream_chip(ss); 345 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 346 346 347 347 if (h->st.playing) 348 348 return -EBUSY; ··· 376 376 } 377 377 378 378 static int 379 - snd_harmony_set_data_format(harmony_t *h, int fmt, int force) 379 + snd_harmony_set_data_format(struct snd_harmony *h, int fmt, int force) 380 380 { 381 381 int o = h->st.format; 382 382 int n; ··· 406 406 } 407 407 408 408 static int 409 - snd_harmony_playback_prepare(snd_pcm_substream_t *ss) 409 + snd_harmony_playback_prepare(struct snd_pcm_substream *ss) 410 410 { 411 - harmony_t *h = snd_pcm_substream_chip(ss); 412 - snd_pcm_runtime_t *rt = ss->runtime; 411 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 412 + struct snd_pcm_runtime *rt = ss->runtime; 413 413 414 414 if (h->st.capturing) 415 415 return -EBUSY; ··· 436 436 } 437 437 438 438 static int 439 - snd_harmony_capture_prepare(snd_pcm_substream_t *ss) 439 + snd_harmony_capture_prepare(struct snd_pcm_substream *ss) 440 440 { 441 - harmony_t *h = snd_pcm_substream_chip(ss); 442 - snd_pcm_runtime_t *rt = ss->runtime; 441 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 442 + struct snd_pcm_runtime *rt = ss->runtime; 443 443 444 444 if (h->st.playing) 445 445 return -EBUSY; ··· 466 466 } 467 467 468 468 static snd_pcm_uframes_t 469 - snd_harmony_playback_pointer(snd_pcm_substream_t *ss) 469 + snd_harmony_playback_pointer(struct snd_pcm_substream *ss) 470 470 { 471 - snd_pcm_runtime_t *rt = ss->runtime; 472 - harmony_t *h = snd_pcm_substream_chip(ss); 471 + struct snd_pcm_runtime *rt = ss->runtime; 472 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 473 473 unsigned long pcuradd; 474 474 unsigned long played; 475 475 ··· 495 495 } 496 496 497 497 static snd_pcm_uframes_t 498 - snd_harmony_capture_pointer(snd_pcm_substream_t *ss) 498 + snd_harmony_capture_pointer(struct snd_pcm_substream *ss) 499 499 { 500 - snd_pcm_runtime_t *rt = ss->runtime; 501 - harmony_t *h = snd_pcm_substream_chip(ss); 500 + struct snd_pcm_runtime *rt = ss->runtime; 501 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 502 502 unsigned long rcuradd; 503 503 unsigned long caught; 504 504 ··· 524 524 } 525 525 526 526 static int 527 - snd_harmony_playback_open(snd_pcm_substream_t *ss) 527 + snd_harmony_playback_open(struct snd_pcm_substream *ss) 528 528 { 529 - harmony_t *h = snd_pcm_substream_chip(ss); 530 - snd_pcm_runtime_t *rt = ss->runtime; 529 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 530 + struct snd_pcm_runtime *rt = ss->runtime; 531 531 int err; 532 532 533 533 h->psubs = ss; ··· 543 543 } 544 544 545 545 static int 546 - snd_harmony_capture_open(snd_pcm_substream_t *ss) 546 + snd_harmony_capture_open(struct snd_pcm_substream *ss) 547 547 { 548 - harmony_t *h = snd_pcm_substream_chip(ss); 549 - snd_pcm_runtime_t *rt = ss->runtime; 548 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 549 + struct snd_pcm_runtime *rt = ss->runtime; 550 550 int err; 551 551 552 552 h->csubs = ss; ··· 562 562 } 563 563 564 564 static int 565 - snd_harmony_playback_close(snd_pcm_substream_t *ss) 565 + snd_harmony_playback_close(struct snd_pcm_substream *ss) 566 566 { 567 - harmony_t *h = snd_pcm_substream_chip(ss); 567 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 568 568 h->psubs = NULL; 569 569 return 0; 570 570 } 571 571 572 572 static int 573 - snd_harmony_capture_close(snd_pcm_substream_t *ss) 573 + snd_harmony_capture_close(struct snd_pcm_substream *ss) 574 574 { 575 - harmony_t *h = snd_pcm_substream_chip(ss); 575 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 576 576 h->csubs = NULL; 577 577 return 0; 578 578 } 579 579 580 580 static int 581 - snd_harmony_hw_params(snd_pcm_substream_t *ss, 582 - snd_pcm_hw_params_t *hw) 581 + snd_harmony_hw_params(struct snd_pcm_substream *ss, 582 + struct snd_pcm_hw_params *hw) 583 583 { 584 584 int err; 585 - harmony_t *h = snd_pcm_substream_chip(ss); 585 + struct snd_harmony *h = snd_pcm_substream_chip(ss); 586 586 587 587 err = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw)); 588 588 if (err > 0 && h->dma.type == SNDRV_DMA_TYPE_CONTINUOUS) ··· 592 592 } 593 593 594 594 static int 595 - snd_harmony_hw_free(snd_pcm_substream_t *ss) 595 + snd_harmony_hw_free(struct snd_pcm_substream *ss) 596 596 { 597 597 return snd_pcm_lib_free_pages(ss); 598 598 } 599 599 600 - static snd_pcm_ops_t snd_harmony_playback_ops = { 600 + static struct snd_pcm_ops snd_harmony_playback_ops = { 601 601 .open = snd_harmony_playback_open, 602 602 .close = snd_harmony_playback_close, 603 603 .ioctl = snd_pcm_lib_ioctl, ··· 608 608 .pointer = snd_harmony_playback_pointer, 609 609 }; 610 610 611 - static snd_pcm_ops_t snd_harmony_capture_ops = { 611 + static struct snd_pcm_ops snd_harmony_capture_ops = { 612 612 .open = snd_harmony_capture_open, 613 613 .close = snd_harmony_capture_close, 614 614 .ioctl = snd_pcm_lib_ioctl, ··· 620 620 }; 621 621 622 622 static int 623 - snd_harmony_pcm_init(harmony_t *h) 623 + snd_harmony_pcm_init(struct snd_harmony *h) 624 624 { 625 - snd_pcm_t *pcm; 625 + struct snd_pcm *pcm; 626 626 int err; 627 627 628 628 harmony_disable_interrupts(h); ··· 683 683 } 684 684 685 685 static void 686 - snd_harmony_set_new_gain(harmony_t *h) 686 + snd_harmony_set_new_gain(struct snd_harmony *h) 687 687 { 688 688 harmony_wait_for_control(h); 689 689 harmony_write(h, HARMONY_GAINCTL, h->st.gain); 690 690 } 691 691 692 692 static int 693 - snd_harmony_mixercontrol_info(snd_kcontrol_t *kc, 694 - snd_ctl_elem_info_t *uinfo) 693 + snd_harmony_mixercontrol_info(struct snd_kcontrol *kc, 694 + struct snd_ctl_elem_info *uinfo) 695 695 { 696 696 int mask = (kc->private_value >> 16) & 0xff; 697 697 int left_shift = (kc->private_value) & 0xff; ··· 707 707 } 708 708 709 709 static int 710 - snd_harmony_volume_get(snd_kcontrol_t *kc, 711 - snd_ctl_elem_value_t *ucontrol) 710 + snd_harmony_volume_get(struct snd_kcontrol *kc, 711 + struct snd_ctl_elem_value *ucontrol) 712 712 { 713 - harmony_t *h = snd_kcontrol_chip(kc); 713 + struct snd_harmony *h = snd_kcontrol_chip(kc); 714 714 int shift_left = (kc->private_value) & 0xff; 715 715 int shift_right = (kc->private_value >> 8) & 0xff; 716 716 int mask = (kc->private_value >> 16) & 0xff; ··· 736 736 } 737 737 738 738 static int 739 - snd_harmony_volume_put(snd_kcontrol_t *kc, 740 - snd_ctl_elem_value_t *ucontrol) 739 + snd_harmony_volume_put(struct snd_kcontrol *kc, 740 + struct snd_ctl_elem_value *ucontrol) 741 741 { 742 - harmony_t *h = snd_kcontrol_chip(kc); 742 + struct snd_harmony *h = snd_kcontrol_chip(kc); 743 743 int shift_left = (kc->private_value) & 0xff; 744 744 int shift_right = (kc->private_value >> 8) & 0xff; 745 745 int mask = (kc->private_value >> 16) & 0xff; ··· 771 771 } 772 772 773 773 static int 774 - snd_harmony_captureroute_info(snd_kcontrol_t *kc, 775 - snd_ctl_elem_info_t *uinfo) 774 + snd_harmony_captureroute_info(struct snd_kcontrol *kc, 775 + struct snd_ctl_elem_info *uinfo) 776 776 { 777 777 static char *texts[2] = { "Line", "Mic" }; 778 778 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 786 786 } 787 787 788 788 static int 789 - snd_harmony_captureroute_get(snd_kcontrol_t *kc, 790 - snd_ctl_elem_value_t *ucontrol) 789 + snd_harmony_captureroute_get(struct snd_kcontrol *kc, 790 + struct snd_ctl_elem_value *ucontrol) 791 791 { 792 - harmony_t *h = snd_kcontrol_chip(kc); 792 + struct snd_harmony *h = snd_kcontrol_chip(kc); 793 793 int value; 794 794 795 795 spin_lock_irq(&h->mixer_lock); ··· 803 803 } 804 804 805 805 static int 806 - snd_harmony_captureroute_put(snd_kcontrol_t *kc, 807 - snd_ctl_elem_value_t *ucontrol) 806 + snd_harmony_captureroute_put(struct snd_kcontrol *kc, 807 + struct snd_ctl_elem_value *ucontrol) 808 808 { 809 - harmony_t *h = snd_kcontrol_chip(kc); 809 + struct snd_harmony *h = snd_kcontrol_chip(kc); 810 810 int value; 811 811 int old_gain = h->st.gain; 812 812 ··· 823 823 return h->st.gain != old_gain; 824 824 } 825 825 826 - #define HARMONY_CONTROLS (sizeof(snd_harmony_controls)/ \ 827 - sizeof(snd_kcontrol_new_t)) 826 + #define HARMONY_CONTROLS ARRAY_SIZE(snd_harmony_controls) 828 827 829 828 #define HARMONY_VOLUME(xname, left_shift, right_shift, mask, invert) \ 830 829 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ ··· 832 833 .private_value = ((left_shift) | ((right_shift) << 8) | \ 833 834 ((mask) << 16) | ((invert) << 24)) } 834 835 835 - static snd_kcontrol_new_t snd_harmony_controls[] = { 836 + static struct snd_kcontrol_new snd_harmony_controls[] = { 836 837 HARMONY_VOLUME("Master Playback Volume", HARMONY_GAIN_LO_SHIFT, 837 838 HARMONY_GAIN_RO_SHIFT, HARMONY_GAIN_OUT, 1), 838 839 HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT, ··· 855 856 }; 856 857 857 858 static void __init 858 - snd_harmony_mixer_reset(harmony_t *h) 859 + snd_harmony_mixer_reset(struct snd_harmony *h) 859 860 { 860 861 harmony_mute(h); 861 862 harmony_reset(h); ··· 864 865 } 865 866 866 867 static int __init 867 - snd_harmony_mixer_init(harmony_t *h) 868 + snd_harmony_mixer_init(struct snd_harmony *h) 868 869 { 869 - snd_card_t *card = h->card; 870 + struct snd_card *card = h->card; 870 871 int idx, err; 871 872 872 873 snd_assert(h != NULL, return -EINVAL); ··· 885 886 } 886 887 887 888 static int 888 - snd_harmony_free(harmony_t *h) 889 + snd_harmony_free(struct snd_harmony *h) 889 890 { 890 891 if (h->gdma.addr) 891 892 snd_dma_free_pages(&h->gdma); ··· 905 906 } 906 907 907 908 static int 908 - snd_harmony_dev_free(snd_device_t *dev) 909 + snd_harmony_dev_free(struct snd_device *dev) 909 910 { 910 - harmony_t *h = dev->device_data; 911 + struct snd_harmony *h = dev->device_data; 911 912 return snd_harmony_free(h); 912 913 } 913 914 914 915 static int __devinit 915 - snd_harmony_create(snd_card_t *card, 916 + snd_harmony_create(struct snd_card *card, 916 917 struct parisc_device *padev, 917 - harmony_t **rchip) 918 + struct snd_harmony **rchip) 918 919 { 919 920 int err; 920 - harmony_t *h; 921 - static snd_device_ops_t ops = { 921 + struct snd_harmony *h; 922 + static struct snd_device_ops ops = { 922 923 .dev_free = snd_harmony_dev_free, 923 924 }; 924 925 ··· 972 973 snd_harmony_probe(struct parisc_device *padev) 973 974 { 974 975 int err; 975 - snd_card_t *card; 976 - harmony_t *h; 976 + struct snd_card *card; 977 + struct snd_harmony *h; 977 978 978 979 card = snd_card_new(index, id, THIS_MODULE, 0); 979 980 if (card == NULL) ··· 1032 1033 static void __exit 1033 1034 alsa_harmony_fini(void) 1034 1035 { 1035 - return unregister_parisc_driver(&snd_harmony_driver); 1036 + unregister_parisc_driver(&snd_harmony_driver); 1036 1037 } 1037 1038 1038 1039 MODULE_LICENSE("GPL");
+7 -7
sound/parisc/harmony.h
··· 13 13 int coherent; 14 14 }; 15 15 16 - typedef struct snd_card_harmony { 16 + struct snd_harmony { 17 17 int irq; 18 18 19 19 unsigned long hpa; /* hard physical address */ ··· 44 44 unsigned long silence_intr; 45 45 } stats; 46 46 47 - snd_pcm_t *pcm; 48 - snd_card_t *card; 49 - snd_pcm_substream_t *psubs; 50 - snd_pcm_substream_t *csubs; 51 - snd_info_entry_t *proc; 47 + struct snd_pcm *pcm; 48 + struct snd_card *card; 49 + struct snd_pcm_substream *psubs; 50 + struct snd_pcm_substream *csubs; 51 + struct snd_info_entry *proc; 52 52 53 53 spinlock_t lock; 54 54 spinlock_t mixer_lock; 55 - } harmony_t; 55 + }; 56 56 57 57 #define MAX_PCM_DEVICES 1 58 58 #define MAX_PCM_SUBSTREAMS 4