diff options
author | Greg Kroah-Hartman <greg@kroah.com> | 2005-01-06 22:36:18 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <greg@kroah.com> | 2005-01-06 22:36:18 -0800 |
commit | 2354096ea3829086d2ba83f6dbfe961ce5500bfe (patch) | |
tree | 33cd069b9aff3744cb43ed0f3b8f5c37318cdb85 /sound | |
parent | 04c736903385b1b6273ca3a32d6ab262acd73725 (diff) | |
parent | 6b4e64f0b16d907a9ee0b79ed14159a98b2053bb (diff) | |
download | history-2354096ea3829086d2ba83f6dbfe961ce5500bfe.tar.gz |
merge
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/usbaudio.c | 62 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 8 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 6 | ||||
-rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 4 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 11 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 5 |
6 files changed, 53 insertions, 43 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 560b62de82b005..e7520f99054c7e 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -2178,13 +2178,13 @@ static int add_audio_endpoint(snd_usb_audio_t *chip, int stream, struct audiofor static int is_big_endian_format(struct usb_device *dev, struct audioformat *fp) { /* M-Audio */ - if (dev->descriptor.idVendor == 0x0763) { + if (le16_to_cpu(dev->descriptor.idVendor) == 0x0763) { /* Quattro: captured data only */ - if (dev->descriptor.idProduct == 0x2001 && + if (le16_to_cpu(dev->descriptor.idProduct) == 0x2001 && fp->endpoint & USB_DIR_IN) return 1; /* Audiophile USB */ - if (dev->descriptor.idProduct == 0x2003) + if (le16_to_cpu(dev->descriptor.idProduct) == 0x2003) return 1; } return 0; @@ -2248,7 +2248,8 @@ static int parse_audio_format_i_type(struct usb_device *dev, struct audioformat break; case USB_AUDIO_FORMAT_PCM8: /* Dallas DS4201 workaround */ - if (dev->descriptor.idVendor == 0x04fa && dev->descriptor.idProduct == 0x4201) + if (le16_to_cpu(dev->descriptor.idVendor) == 0x04fa && + le16_to_cpu(dev->descriptor.idProduct) == 0x4201) pcm_format = SNDRV_PCM_FORMAT_S8; else pcm_format = SNDRV_PCM_FORMAT_U8; @@ -2416,7 +2417,8 @@ static int parse_audio_format(struct usb_device *dev, struct audioformat *fp, /* extigy apparently supports sample rates other than 48k * but not in ordinary way. so we enable only 48k atm. */ - if (dev->descriptor.idVendor == 0x041e && dev->descriptor.idProduct == 0x3000) { + if (le16_to_cpu(dev->descriptor.idVendor) == 0x041e && + le16_to_cpu(dev->descriptor.idProduct) == 0x3000) { if (fmt[3] == USB_FORMAT_TYPE_I && stream == SNDRV_PCM_STREAM_PLAYBACK && fp->rates != SNDRV_PCM_RATE_48000) @@ -2450,7 +2452,7 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) (altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIO_STREAMING && altsd->bInterfaceSubClass != USB_SUBCLASS_VENDOR_SPEC) || altsd->bNumEndpoints < 1 || - get_endpoint(alts, 0)->wMaxPacketSize == 0) + le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) == 0) continue; /* must be isochronous */ if ((get_endpoint(alts, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != @@ -2513,14 +2515,14 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; /* FIXME: decode wMaxPacketSize of high bandwith endpoints */ - fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize; + fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); fp->attributes = csep[3]; /* some quirks for attributes here */ /* workaround for AudioTrak Optoplay */ - if (dev->descriptor.idVendor == 0x0a92 && - dev->descriptor.idProduct == 0x0053) { + if (le16_to_cpu(dev->descriptor.idVendor) == 0x0a92 && + le16_to_cpu(dev->descriptor.idProduct) == 0x0053) { /* Optoplay sets the sample rate attribute although * it seems not supporting it in fact. */ @@ -2528,8 +2530,8 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) } /* workaround for M-Audio Audiophile USB */ - if (dev->descriptor.idVendor == 0x0763 && - dev->descriptor.idProduct == 0x2003) { + if (le16_to_cpu(dev->descriptor.idVendor) == 0x0763 && + le16_to_cpu(dev->descriptor.idProduct) == 0x2003) { /* doesn't set the sample rate attribute, but supports it */ fp->attributes |= EP_CS_ATTR_SAMPLE_RATE; } @@ -2538,11 +2540,11 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no) * plantronics headset and Griffin iMic have set adaptive-in * although it's really not... */ - if ((dev->descriptor.idVendor == 0x047f && - dev->descriptor.idProduct == 0x0ca1) || + if ((le16_to_cpu(dev->descriptor.idVendor) == 0x047f && + le16_to_cpu(dev->descriptor.idProduct) == 0x0ca1) || /* Griffin iMic (note that there is an older model 77d:223) */ - (dev->descriptor.idVendor == 0x077d && - dev->descriptor.idProduct == 0x07af)) { + (le16_to_cpu(dev->descriptor.idVendor) == 0x077d && + le16_to_cpu(dev->descriptor.idProduct) == 0x07af)) { fp->ep_attr &= ~EP_ATTR_MASK; if (stream == SNDRV_PCM_STREAM_PLAYBACK) fp->ep_attr |= EP_ATTR_ADAPTIVE; @@ -2786,7 +2788,7 @@ static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, .type = QUIRK_MIDI_FIXED_ENDPOINT, .data = &ua25_ep }; - if (chip->dev->descriptor.idProduct == 0x002b) + if (le16_to_cpu(chip->dev->descriptor.idProduct) == 0x002b) return snd_usb_create_midi_interface(chip, iface, &ua700_quirk); else @@ -2805,7 +2807,7 @@ static int create_ua700_ua25_quirk(snd_usb_audio_t *chip, fp->iface = altsd->bInterfaceNumber; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; - fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize; + fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); switch (fp->maxpacksize) { case 0x120: @@ -2871,7 +2873,7 @@ static int create_ua1000_quirk(snd_usb_audio_t *chip, struct usb_interface *ifac fp->iface = altsd->bInterfaceNumber; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; - fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize; + fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]); stream = (fp->endpoint & USB_DIR_IN) @@ -2929,8 +2931,8 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac struct usb_host_config *config = dev->actconfig; int err; - if (get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_OLD || - get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_NEW) { + if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD || + le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) { snd_printdd("sending Extigy boot sequence...\n"); /* Send message to force it to reconnect with full interface. */ err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0), @@ -2942,7 +2944,8 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err); err = usb_reset_configuration(dev); if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err); - snd_printdd("extigy_boot: new boot length = %d\n", get_cfg_desc(config)->wTotalLength); + snd_printdd("extigy_boot: new boot length = %d\n", + le16_to_cpu(get_cfg_desc(config)->wTotalLength)); return -ENODEV; /* quit this anyway */ } return 0; @@ -2998,7 +3001,9 @@ static void proc_audio_usbid_read(snd_info_entry_t *entry, snd_info_buffer_t *bu { snd_usb_audio_t *chip = entry->private_data; if (! chip->shutdown) - snd_iprintf(buffer, "%04x:%04x\n", chip->dev->descriptor.idVendor, chip->dev->descriptor.idProduct); + snd_iprintf(buffer, "%04x:%04x\n", + le16_to_cpu(chip->dev->descriptor.idVendor), + le16_to_cpu(chip->dev->descriptor.idProduct)); } static void snd_usb_audio_create_proc(snd_usb_audio_t *chip) @@ -3079,7 +3084,8 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, strcpy(card->driver, "USB-Audio"); sprintf(component, "USB%04x:%04x", - dev->descriptor.idVendor, dev->descriptor.idProduct); + le16_to_cpu(dev->descriptor.idVendor), + le16_to_cpu(dev->descriptor.idProduct)); snd_component_add(card, component); /* retrieve the device string as shortname */ @@ -3091,7 +3097,8 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, card->shortname, sizeof(card->shortname)) <= 0) { /* no name available from anywhere, so use ID */ sprintf(card->shortname, "USB Device %#04x:%#04x", - dev->descriptor.idVendor, dev->descriptor.idProduct); + le16_to_cpu(dev->descriptor.idVendor), + le16_to_cpu(dev->descriptor.idProduct)); } } @@ -3158,7 +3165,8 @@ static void *snd_usb_audio_probe(struct usb_device *dev, /* SB Extigy needs special boot-up sequence */ /* if more models come, this will go to the quirk list. */ - if (dev->descriptor.idVendor == 0x041e && dev->descriptor.idProduct == 0x3000) { + if (le16_to_cpu(dev->descriptor.idVendor) == 0x041e && + le16_to_cpu(dev->descriptor.idProduct) == 0x3000) { if (snd_usb_extigy_boot_quirk(dev, intf) < 0) goto __err_val; config = dev->actconfig; @@ -3192,8 +3200,8 @@ static void *snd_usb_audio_probe(struct usb_device *dev, } for (i = 0; i < SNDRV_CARDS; i++) if (enable[i] && ! usb_chip[i] && - (vid[i] == -1 || vid[i] == dev->descriptor.idVendor) && - (pid[i] == -1 || pid[i] == dev->descriptor.idProduct)) { + (vid[i] == -1 || vid[i] == le16_to_cpu(dev->descriptor.idVendor)) && + (pid[i] == -1 || pid[i] == le16_to_cpu(dev->descriptor.idProduct))) { if (snd_usb_audio_create(dev, i, quirk, &chip) < 0) { goto __error; } diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index c91f02fd4cb646..496e520c5bdee3 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -59,7 +59,7 @@ struct usb_ms_header_descriptor { __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bcdMSC[2]; - __u16 wTotalLength; + __le16 wTotalLength; } __attribute__ ((packed)); struct usb_ms_endpoint_descriptor { @@ -520,7 +520,7 @@ static struct usb_endpoint_descriptor* snd_usbmidi_get_int_epd(snd_usb_midi_t* u struct usb_host_interface *hostif; struct usb_interface_descriptor* intfd; - if (umidi->chip->dev->descriptor.idVendor != 0x0582) + if (le16_to_cpu(umidi->chip->dev->descriptor.idVendor) != 0x0582) return NULL; intf = umidi->iface; if (!intf || intf->num_altsetting != 2) @@ -837,8 +837,8 @@ static void snd_usbmidi_init_substream(snd_usb_midi_t* umidi, /* TODO: read port name from jack descriptor */ name_format = "%s MIDI %d"; - vendor = umidi->chip->dev->descriptor.idVendor; - product = umidi->chip->dev->descriptor.idProduct; + vendor = le16_to_cpu(umidi->chip->dev->descriptor.idVendor); + product = le16_to_cpu(umidi->chip->dev->descriptor.idProduct); for (i = 0; i < ARRAY_SIZE(snd_usbmidi_port_names); ++i) { if (snd_usbmidi_port_names[i].vendor == vendor && snd_usbmidi_port_names[i].product == product && diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 8ce14dbf168379..ccc0069e458d0b 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c @@ -1514,12 +1514,12 @@ int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif) state.buffer = hostif->extra; state.buflen = hostif->extralen; state.ctrlif = ctrlif; - state.vendor = dev->idVendor; - state.product = dev->idProduct; + state.vendor = le16_to_cpu(dev->idVendor); + state.product = le16_to_cpu(dev->idProduct); /* check the mapping table */ for (map = usbmix_ctl_maps; map->vendor; map++) { - if (map->vendor == dev->idVendor && map->product == dev->idProduct) { + if (map->vendor == le16_to_cpu(dev->idVendor) && map->product == le16_to_cpu(dev->idProduct)) { state.map = map->map; chip->ignore_ctl_error = map->ignore_ctl_error; break; diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 4d5a4c8a7437d4..40ca82a3e6c5c6 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c @@ -129,7 +129,7 @@ static int snd_usX2Y_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *i }; int id = -1; - switch (((usX2Ydev_t*)hw->private_data)->chip.dev->descriptor.idProduct) { + switch (le16_to_cpu(((usX2Ydev_t*)hw->private_data)->chip.dev->descriptor.idProduct)) { case USB_ID_US122: id = USX2Y_TYPE_122; break; @@ -181,7 +181,7 @@ static int usX2Y_create_usbmidi(snd_card_t* card ) }; struct usb_device *dev = usX2Y(card)->chip.dev; struct usb_interface *iface = usb_ifnum_to_if(dev, 0); - snd_usb_audio_quirk_t *quirk = dev->descriptor.idProduct == USB_ID_US428 ? &quirk_2 : &quirk_1; + snd_usb_audio_quirk_t *quirk = le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? &quirk_2 : &quirk_1; snd_printdd("usX2Y_create_usbmidi \n"); return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index 542dc4845091e7..b06a267e5dac22 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c @@ -355,7 +355,8 @@ static snd_card_t* usX2Y_create_card(struct usb_device* device) sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", card->shortname, - device->descriptor.idVendor, device->descriptor.idProduct, + le16_to_cpu(device->descriptor.idVendor), + le16_to_cpu(device->descriptor.idProduct), 0,//us428(card)->usbmidi.ifnum, usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum ); @@ -368,10 +369,10 @@ static void* usX2Y_usb_probe(struct usb_device* device, struct usb_interface *in { int err; snd_card_t* card; - if (device->descriptor.idVendor != 0x1604 || - (device->descriptor.idProduct != USB_ID_US122 && - device->descriptor.idProduct != USB_ID_US224 && - device->descriptor.idProduct != USB_ID_US428) || + if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 || + (le16_to_cpu(device->descriptor.idProduct) != USB_ID_US122 && + le16_to_cpu(device->descriptor.idProduct) != USB_ID_US224 && + le16_to_cpu(device->descriptor.idProduct) != USB_ID_US428) || !(card = usX2Y_create_card(device))) return NULL; if ((err = usX2Y_hwdep_new(card, device)) < 0 || diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 73b4e09bb150d8..ef89bcde40c940 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -415,6 +415,7 @@ static int usX2Y_urbs_allocate(snd_usX2Y_substream_t *subs) unsigned int pipe; int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; struct usb_device *dev = subs->usX2Y->chip.dev; + struct usb_host_endpoint *ep; pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) : usb_rcvisocpipe(dev, subs->endpoint); @@ -1017,10 +1018,10 @@ int usX2Y_audio_create(snd_card_t* card) if (0 > (err = usX2Y_audio_stream_new(card, 0xA, 0x8))) return err; - if (usX2Y(card)->chip.dev->descriptor.idProduct == USB_ID_US428) + if (le16_to_cpu(usX2Y(card)->chip.dev->descriptor.idProduct) == USB_ID_US428) if (0 > (err = usX2Y_audio_stream_new(card, 0, 0xA))) return err; - if (usX2Y(card)->chip.dev->descriptor.idProduct != USB_ID_US122) + if (le16_to_cpu(usX2Y(card)->chip.dev->descriptor.idProduct) != USB_ID_US122) err = usX2Y_rate_set(usX2Y(card), 44100); // Lets us428 recognize output-volume settings, disturbs us122. return err; } |