diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 09:08:26 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:19:56 -0500 |
commit | bbe85bbd02b2220c819ad1e33c9d6327131ad281 (patch) | |
tree | f22dffee1b6211dae18ac7946facbb7add845ca3 /sound/usb/usx2y/usX2Yhwdep.c | |
parent | 86e07d34658bb85b3424f4db64fa28f884edbe8d (diff) |
[ALSA] Remove xxx_t typedefs: USB-USX2Y
Modules: USB USX2Y
Remove xxx_t typedefs from the USB-USX2Y driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usX2Yhwdep.c')
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index fc0d534ec7fc..4b52d18dcd53 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "usbusx2y.h" | 31 | #include "usbusx2y.h" |
32 | #include "usX2Yhwdep.h" | 32 | #include "usX2Yhwdep.h" |
33 | 33 | ||
34 | int usX2Y_hwdep_pcm_new(snd_card_t* card); | 34 | int usX2Y_hwdep_pcm_new(struct snd_card *card); |
35 | 35 | ||
36 | 36 | ||
37 | static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type) | 37 | static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type) |
@@ -49,7 +49,7 @@ static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsign | |||
49 | offset = area->vm_pgoff << PAGE_SHIFT; | 49 | offset = area->vm_pgoff << PAGE_SHIFT; |
50 | offset += address - area->vm_start; | 50 | offset += address - area->vm_start; |
51 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); | 51 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); |
52 | vaddr = (char*)((usX2Ydev_t*)area->vm_private_data)->us428ctls_sharedmem + offset; | 52 | vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset; |
53 | page = virt_to_page(vaddr); | 53 | page = virt_to_page(vaddr); |
54 | get_page(page); | 54 | get_page(page); |
55 | snd_printdd( "vaddr=%p made us428ctls_vm_nopage() return %p; offset=%lX\n", vaddr, page, offset); | 55 | snd_printdd( "vaddr=%p made us428ctls_vm_nopage() return %p; offset=%lX\n", vaddr, page, offset); |
@@ -64,10 +64,10 @@ static struct vm_operations_struct us428ctls_vm_ops = { | |||
64 | .nopage = snd_us428ctls_vm_nopage, | 64 | .nopage = snd_us428ctls_vm_nopage, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | static int snd_us428ctls_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_area_struct *area) | 67 | static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct vm_area_struct *area) |
68 | { | 68 | { |
69 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); | 69 | unsigned long size = (unsigned long)(area->vm_end - area->vm_start); |
70 | usX2Ydev_t *us428 = hw->private_data; | 70 | struct usX2Ydev *us428 = hw->private_data; |
71 | 71 | ||
72 | // FIXME this hwdep interface is used twice: fpga download and mmap for controlling Lights etc. Maybe better using 2 hwdep devs? | 72 | // FIXME this hwdep interface is used twice: fpga download and mmap for controlling Lights etc. Maybe better using 2 hwdep devs? |
73 | // so as long as the device isn't fully initialised yet we return -EBUSY here. | 73 | // so as long as the device isn't fully initialised yet we return -EBUSY here. |
@@ -75,16 +75,16 @@ static int snd_us428ctls_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_are | |||
75 | return -EBUSY; | 75 | return -EBUSY; |
76 | 76 | ||
77 | /* if userspace tries to mmap beyond end of our buffer, fail */ | 77 | /* if userspace tries to mmap beyond end of our buffer, fail */ |
78 | if (size > PAGE_ALIGN(sizeof(us428ctls_sharedmem_t))) { | 78 | if (size > PAGE_ALIGN(sizeof(struct us428ctls_sharedmem))) { |
79 | snd_printd( "%lu > %lu\n", size, (unsigned long)sizeof(us428ctls_sharedmem_t)); | 79 | snd_printd( "%lu > %lu\n", size, (unsigned long)sizeof(struct us428ctls_sharedmem)); |
80 | return -EINVAL; | 80 | return -EINVAL; |
81 | } | 81 | } |
82 | 82 | ||
83 | if (!us428->us428ctls_sharedmem) { | 83 | if (!us428->us428ctls_sharedmem) { |
84 | init_waitqueue_head(&us428->us428ctls_wait_queue_head); | 84 | init_waitqueue_head(&us428->us428ctls_wait_queue_head); |
85 | if(!(us428->us428ctls_sharedmem = snd_malloc_pages(sizeof(us428ctls_sharedmem_t), GFP_KERNEL))) | 85 | if(!(us428->us428ctls_sharedmem = snd_malloc_pages(sizeof(struct us428ctls_sharedmem), GFP_KERNEL))) |
86 | return -ENOMEM; | 86 | return -ENOMEM; |
87 | memset(us428->us428ctls_sharedmem, -1, sizeof(us428ctls_sharedmem_t)); | 87 | memset(us428->us428ctls_sharedmem, -1, sizeof(struct us428ctls_sharedmem)); |
88 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; | 88 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; |
89 | } | 89 | } |
90 | area->vm_ops = &us428ctls_vm_ops; | 90 | area->vm_ops = &us428ctls_vm_ops; |
@@ -93,11 +93,11 @@ static int snd_us428ctls_mmap(snd_hwdep_t * hw, struct file *filp, struct vm_are | |||
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | static unsigned int snd_us428ctls_poll(snd_hwdep_t *hw, struct file *file, poll_table *wait) | 96 | static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, poll_table *wait) |
97 | { | 97 | { |
98 | unsigned int mask = 0; | 98 | unsigned int mask = 0; |
99 | usX2Ydev_t *us428 = hw->private_data; | 99 | struct usX2Ydev *us428 = hw->private_data; |
100 | us428ctls_sharedmem_t *shm = us428->us428ctls_sharedmem; | 100 | struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; |
101 | if (us428->chip_status & USX2Y_STAT_CHIP_HUP) | 101 | if (us428->chip_status & USX2Y_STAT_CHIP_HUP) |
102 | return POLLHUP; | 102 | return POLLHUP; |
103 | 103 | ||
@@ -110,24 +110,25 @@ static unsigned int snd_us428ctls_poll(snd_hwdep_t *hw, struct file *file, poll_ | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | static int snd_usX2Y_hwdep_open(snd_hwdep_t *hw, struct file *file) | 113 | static int snd_usX2Y_hwdep_open(struct snd_hwdep *hw, struct file *file) |
114 | { | 114 | { |
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int snd_usX2Y_hwdep_release(snd_hwdep_t *hw, struct file *file) | 118 | static int snd_usX2Y_hwdep_release(struct snd_hwdep *hw, struct file *file) |
119 | { | 119 | { |
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int snd_usX2Y_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) | 123 | static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, |
124 | struct snd_hwdep_dsp_status *info) | ||
124 | { | 125 | { |
125 | static char *type_ids[USX2Y_TYPE_NUMS] = { | 126 | static char *type_ids[USX2Y_TYPE_NUMS] = { |
126 | [USX2Y_TYPE_122] = "us122", | 127 | [USX2Y_TYPE_122] = "us122", |
127 | [USX2Y_TYPE_224] = "us224", | 128 | [USX2Y_TYPE_224] = "us224", |
128 | [USX2Y_TYPE_428] = "us428", | 129 | [USX2Y_TYPE_428] = "us428", |
129 | }; | 130 | }; |
130 | usX2Ydev_t *us428 = hw->private_data; | 131 | struct usX2Ydev *us428 = hw->private_data; |
131 | int id = -1; | 132 | int id = -1; |
132 | 133 | ||
133 | switch (le16_to_cpu(us428->chip.dev->descriptor.idProduct)) { | 134 | switch (le16_to_cpu(us428->chip.dev->descriptor.idProduct)) { |
@@ -145,35 +146,35 @@ static int snd_usX2Y_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *i | |||
145 | return -ENODEV; | 146 | return -ENODEV; |
146 | strcpy(info->id, type_ids[id]); | 147 | strcpy(info->id, type_ids[id]); |
147 | info->num_dsps = 2; // 0: Prepad Data, 1: FPGA Code | 148 | info->num_dsps = 2; // 0: Prepad Data, 1: FPGA Code |
148 | if (us428->chip_status & USX2Y_STAT_CHIP_INIT) | 149 | if (us428->chip_status & USX2Y_STAT_CHIP_INIT) |
149 | info->chip_ready = 1; | 150 | info->chip_ready = 1; |
150 | info->version = USX2Y_DRIVER_VERSION; | 151 | info->version = USX2Y_DRIVER_VERSION; |
151 | return 0; | 152 | return 0; |
152 | } | 153 | } |
153 | 154 | ||
154 | 155 | ||
155 | static int usX2Y_create_usbmidi(snd_card_t* card ) | 156 | static int usX2Y_create_usbmidi(struct snd_card *card) |
156 | { | 157 | { |
157 | static snd_usb_midi_endpoint_info_t quirk_data_1 = { | 158 | static struct snd_usb_midi_endpoint_info quirk_data_1 = { |
158 | .out_ep =0x06, | 159 | .out_ep = 0x06, |
159 | .in_ep = 0x06, | 160 | .in_ep = 0x06, |
160 | .out_cables = 0x001, | 161 | .out_cables = 0x001, |
161 | .in_cables = 0x001 | 162 | .in_cables = 0x001 |
162 | }; | 163 | }; |
163 | static snd_usb_audio_quirk_t quirk_1 = { | 164 | static struct snd_usb_audio_quirk quirk_1 = { |
164 | .vendor_name = "TASCAM", | 165 | .vendor_name = "TASCAM", |
165 | .product_name = NAME_ALLCAPS, | 166 | .product_name = NAME_ALLCAPS, |
166 | .ifnum = 0, | 167 | .ifnum = 0, |
167 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | 168 | .type = QUIRK_MIDI_FIXED_ENDPOINT, |
168 | .data = &quirk_data_1 | 169 | .data = &quirk_data_1 |
169 | }; | 170 | }; |
170 | static snd_usb_midi_endpoint_info_t quirk_data_2 = { | 171 | static struct snd_usb_midi_endpoint_info quirk_data_2 = { |
171 | .out_ep =0x06, | 172 | .out_ep = 0x06, |
172 | .in_ep = 0x06, | 173 | .in_ep = 0x06, |
173 | .out_cables = 0x003, | 174 | .out_cables = 0x003, |
174 | .in_cables = 0x003 | 175 | .in_cables = 0x003 |
175 | }; | 176 | }; |
176 | static snd_usb_audio_quirk_t quirk_2 = { | 177 | static struct snd_usb_audio_quirk quirk_2 = { |
177 | .vendor_name = "TASCAM", | 178 | .vendor_name = "TASCAM", |
178 | .product_name = "US428", | 179 | .product_name = "US428", |
179 | .ifnum = 0, | 180 | .ifnum = 0, |
@@ -182,13 +183,15 @@ static int usX2Y_create_usbmidi(snd_card_t* card ) | |||
182 | }; | 183 | }; |
183 | struct usb_device *dev = usX2Y(card)->chip.dev; | 184 | struct usb_device *dev = usX2Y(card)->chip.dev; |
184 | struct usb_interface *iface = usb_ifnum_to_if(dev, 0); | 185 | struct usb_interface *iface = usb_ifnum_to_if(dev, 0); |
185 | snd_usb_audio_quirk_t *quirk = le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? &quirk_2 : &quirk_1; | 186 | struct snd_usb_audio_quirk *quirk = |
187 | le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? | ||
188 | &quirk_2 : &quirk_1; | ||
186 | 189 | ||
187 | snd_printdd("usX2Y_create_usbmidi \n"); | 190 | snd_printdd("usX2Y_create_usbmidi \n"); |
188 | return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); | 191 | return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); |
189 | } | 192 | } |
190 | 193 | ||
191 | static int usX2Y_create_alsa_devices(snd_card_t* card) | 194 | static int usX2Y_create_alsa_devices(struct snd_card *card) |
192 | { | 195 | { |
193 | int err; | 196 | int err; |
194 | 197 | ||
@@ -208,9 +211,10 @@ static int usX2Y_create_alsa_devices(snd_card_t* card) | |||
208 | return err; | 211 | return err; |
209 | } | 212 | } |
210 | 213 | ||
211 | static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | 214 | static int snd_usX2Y_hwdep_dsp_load(struct snd_hwdep *hw, |
215 | struct snd_hwdep_dsp_image *dsp) | ||
212 | { | 216 | { |
213 | usX2Ydev_t *priv = hw->private_data; | 217 | struct usX2Ydev *priv = hw->private_data; |
214 | int lret, err = -EINVAL; | 218 | int lret, err = -EINVAL; |
215 | snd_printdd( "dsp_load %s\n", dsp->name); | 219 | snd_printdd( "dsp_load %s\n", dsp->name); |
216 | 220 | ||
@@ -257,10 +261,10 @@ static int snd_usX2Y_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) | |||
257 | } | 261 | } |
258 | 262 | ||
259 | 263 | ||
260 | int usX2Y_hwdep_new(snd_card_t* card, struct usb_device* device) | 264 | int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device) |
261 | { | 265 | { |
262 | int err; | 266 | int err; |
263 | snd_hwdep_t *hw; | 267 | struct snd_hwdep *hw; |
264 | 268 | ||
265 | if ((err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw)) < 0) | 269 | if ((err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw)) < 0) |
266 | return err; | 270 | return err; |