Commit 526f55a9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: tidy up the usb endpoint defines

Rename the defines so they have namespace associated with the driver.
Tidy up the defines.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2cf0cd9
...@@ -74,20 +74,12 @@ Status: testing ...@@ -74,20 +74,12 @@ Status: testing
/* max lenghth of the transfer-buffer for software upload */ /* max lenghth of the transfer-buffer for software upload */
#define TB_LEN 0x2000 #define TB_LEN 0x2000
/* Input endpoint number: ISO/IRQ */ /* USB endpoints */
#define ISOINEP 6 #define USBDUXSIGMA_CMD_OUT_EP 1 /* command output */
#define USBDUXSIGMA_ISO_OUT_EP 2 /* analog output ISO/IRQ */
/* Output endpoint number: ISO/IRQ */ #define USBDUXSIGMA_PWM_OUT_EP 4 /* pwm output */
#define ISOOUTEP 2 #define USBDUXSIGMA_ISO_IN_EP 6 /* analog input ISO/IRQ */
#define USBDUXSIGMA_CMD_IN_EP 8 /* command input */
/* This EP sends DUX commands to USBDUX */
#define COMMAND_OUT_EP 1
/* This EP receives the DUX commands from USBDUX */
#define COMMAND_IN_EP 8
/* Output endpoint for PWM */
#define PWM_EP 4
/* 300Hz max frequ under PWM */ /* 300Hz max frequ under PWM */
#define MIN_PWM_PERIOD ((long)(1E9/300)) #define MIN_PWM_PERIOD ((long)(1E9/300))
...@@ -662,7 +654,7 @@ static int usbbuxsigma_send_cmd(struct comedi_device *dev, int cmd_type) ...@@ -662,7 +654,7 @@ static int usbbuxsigma_send_cmd(struct comedi_device *dev, int cmd_type)
devpriv->dux_commands[0] = cmd_type; devpriv->dux_commands[0] = cmd_type;
return usb_bulk_msg(usb, usb_sndbulkpipe(usb, COMMAND_OUT_EP), return usb_bulk_msg(usb, usb_sndbulkpipe(usb, USBDUXSIGMA_CMD_OUT_EP),
devpriv->dux_commands, SIZEOFDUXBUFFER, devpriv->dux_commands, SIZEOFDUXBUFFER,
&nsent, BULK_TIMEOUT); &nsent, BULK_TIMEOUT);
} }
...@@ -676,7 +668,8 @@ static int usbduxsigma_receive_cmd(struct comedi_device *dev, int command) ...@@ -676,7 +668,8 @@ static int usbduxsigma_receive_cmd(struct comedi_device *dev, int command)
int i; int i;
for (i = 0; i < RETRIES; i++) { for (i = 0; i < RETRIES; i++) {
ret = usb_bulk_msg(usb, usb_rcvbulkpipe(usb, COMMAND_IN_EP), ret = usb_bulk_msg(usb,
usb_rcvbulkpipe(usb, USBDUXSIGMA_CMD_IN_EP),
devpriv->insnBuffer, SIZEINSNBUF, devpriv->insnBuffer, SIZEINSNBUF,
&nrec, BULK_TIMEOUT); &nrec, BULK_TIMEOUT);
if (ret < 0) if (ret < 0)
...@@ -1212,7 +1205,8 @@ static int usbduxsigma_submit_pwm_urb(struct comedi_device *dev) ...@@ -1212,7 +1205,8 @@ static int usbduxsigma_submit_pwm_urb(struct comedi_device *dev)
struct urb *urb = devpriv->urbPwm; struct urb *urb = devpriv->urbPwm;
/* in case of a resubmission after an unlink... */ /* in case of a resubmission after an unlink... */
usb_fill_bulk_urb(urb, usb, usb_sndbulkpipe(usb, PWM_EP), usb_fill_bulk_urb(urb,
usb, usb_sndbulkpipe(usb, USBDUXSIGMA_PWM_OUT_EP),
urb->transfer_buffer, devpriv->sizePwmBuf, urb->transfer_buffer, devpriv->sizePwmBuf,
usbduxsigma_pwm_urb_complete, dev); usbduxsigma_pwm_urb_complete, dev);
...@@ -1588,7 +1582,7 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev) ...@@ -1588,7 +1582,7 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev)
/* will be filled later with a pointer to the comedi-device */ /* will be filled later with a pointer to the comedi-device */
/* and ONLY then the urb should be submitted */ /* and ONLY then the urb should be submitted */
urb->context = NULL; urb->context = NULL;
urb->pipe = usb_rcvisocpipe(usb, ISOINEP); urb->pipe = usb_rcvisocpipe(usb, USBDUXSIGMA_ISO_IN_EP);
urb->transfer_flags = URB_ISO_ASAP; urb->transfer_flags = URB_ISO_ASAP;
urb->transfer_buffer = kzalloc(SIZEINBUF, GFP_KERNEL); urb->transfer_buffer = kzalloc(SIZEINBUF, GFP_KERNEL);
if (!urb->transfer_buffer) if (!urb->transfer_buffer)
...@@ -1610,7 +1604,7 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev) ...@@ -1610,7 +1604,7 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev)
/* will be filled later with a pointer to the comedi-device */ /* will be filled later with a pointer to the comedi-device */
/* and ONLY then the urb should be submitted */ /* and ONLY then the urb should be submitted */
urb->context = NULL; urb->context = NULL;
urb->pipe = usb_sndisocpipe(usb, ISOOUTEP); urb->pipe = usb_sndisocpipe(usb, USBDUXSIGMA_ISO_OUT_EP);
urb->transfer_flags = URB_ISO_ASAP; urb->transfer_flags = URB_ISO_ASAP;
urb->transfer_buffer = kzalloc(SIZEOUTBUF, GFP_KERNEL); urb->transfer_buffer = kzalloc(SIZEOUTBUF, GFP_KERNEL);
if (!urb->transfer_buffer) if (!urb->transfer_buffer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment