Commit 41dceed5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix codingstyle issues in include/linux/usb/

Fixes a number of coding style issues in the USB public header files.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 969ab2ee
......@@ -27,13 +27,13 @@
/* 4.3.2 Class-Specific AC Interface Descriptor */
struct usb_ac_header_descriptor {
__u8 bLength; // 8+n
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_HEADER
__le16 bcdADC; // 0x0100
__le16 wTotalLength; // includes Unit and Terminal desc.
__u8 bInCollection; // n
__u8 baInterfaceNr[]; // [n]
__u8 bLength; /* 8+n */
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_HEADER */
__le16 bcdADC; /* 0x0100 */
__le16 wTotalLength; /* includes Unit and Terminal desc. */
__u8 bInCollection; /* n */
__u8 baInterfaceNr[]; /* [n] */
} __attribute__ ((packed));
#define USB_DT_AC_HEADER_SIZE(n) (8+(n))
......
......@@ -29,16 +29,16 @@
* Class-Specific descriptors ... there are a couple dozen of them
*/
#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
#define USB_CDC_COUNTRY_TYPE 0x07
#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
#define USB_CDC_WHCM_TYPE 0x11
#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
#define USB_CDC_DMM_TYPE 0x14
#define USB_CDC_OBEX_TYPE 0x15
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ enum usb_gadgetfs_event_type {
GADGETFS_DISCONNECT,
GADGETFS_SETUP,
GADGETFS_SUSPEND,
// and likely more !
/* and likely more ! */
};
/* NOTE: this structure must stay the same size and layout on
......@@ -44,15 +44,17 @@ enum usb_gadgetfs_event_type {
*/
struct usb_gadgetfs_event {
union {
// NOP, DISCONNECT, SUSPEND: nothing
// ... some hardware can't report disconnection
/* NOP, DISCONNECT, SUSPEND: nothing
* ... some hardware can't report disconnection
*/
// CONNECT: just the speed
/* CONNECT: just the speed */
enum usb_device_speed speed;
// SETUP: packet; DATA phase i/o precedes next event
// (setup.bmRequestType & USB_DIR_IN) flags direction
// ... includes SET_CONFIGURATION, SET_INTERFACE
/* SETUP: packet; DATA phase i/o precedes next event
*(setup.bmRequestType & USB_DIR_IN) flags direction
* ... includes SET_CONFIGURATION, SET_INTERFACE
*/
struct usb_ctrlrequest setup;
} u;
enum usb_gadgetfs_event_type type;
......@@ -73,14 +75,14 @@ struct usb_gadgetfs_event {
* THIS returns how many bytes are "unclaimed" in the endpoint fifo
* (needed for precise fault handling, when the hardware allows it)
*/
#define GADGETFS_FIFO_STATUS _IO('g',1)
#define GADGETFS_FIFO_STATUS _IO('g', 1)
/* discards any unclaimed data in the fifo. */
#define GADGETFS_FIFO_FLUSH _IO('g',2)
#define GADGETFS_FIFO_FLUSH _IO('g', 2)
/* resets endpoint halt+toggle; used to implement set_interface.
* some hardware (like pxa2xx) can't support this.
*/
#define GADGETFS_CLEAR_HALT _IO('g',3)
#define GADGETFS_CLEAR_HALT _IO('g', 3)
#endif /* __LINUX_USB_GADGETFS_H */
......@@ -14,14 +14,23 @@
this information.
*/
struct iowarrior_info {
__u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */
__u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */
__u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */
__u32 revision; /* revision number of the chip */
__u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */
__u32 power; /* power consumption of the device in mA */
__u32 if_num; /* the number of the endpoint */
__u32 report_size; /* size of the data-packets on this interface */
/* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */
__u32 vendor;
/* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */
__u32 product;
/* the serial number of our chip (if a serial-number is not available
* this is empty string) */
__u8 serial[9];
/* revision number of the chip */
__u32 revision;
/* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */
__u32 speed;
/* power consumption of the device in mA */
__u32 power;
/* the number of the endpoint */
__u32 if_num;
/* size of the data-packets on this interface */
__u32 report_size;
};
/*
......
......@@ -25,5 +25,5 @@ struct isp116x_platform_data {
300ns delay between access to ADDR_REG and DATA_REG
OE, WE MUST NOT be changed during these intervals
*/
void (*delay) (struct device * dev, int delay);
void (*delay) (struct device *dev, int delay);
};
......@@ -47,9 +47,9 @@ struct usb_ms_header_descriptor {
/* 6.1.2.2 MIDI IN Jack Descriptor */
struct usb_midi_in_jack_descriptor {
__u8 bLength;
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK
__u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */
__u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
__u8 bJackID;
__u8 iJack;
} __attribute__ ((packed));
......@@ -64,12 +64,12 @@ struct usb_midi_source_pin {
/* 6.1.2.3 MIDI OUT Jack Descriptor */
struct usb_midi_out_jack_descriptor {
__u8 bLength;
__u8 bDescriptorType; // USB_DT_CS_INTERFACE
__u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK
__u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL
__u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
__u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */
__u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
__u8 bJackID;
__u8 bNrInputPins; // p
struct usb_midi_source_pin pins[]; // [p]
__u8 bNrInputPins; /* p */
struct usb_midi_source_pin pins[]; /* [p] */
/*__u8 iJack; -- ommitted due to variable-sized pins[] */
} __attribute__ ((packed));
......@@ -90,11 +90,11 @@ struct usb_midi_out_jack_descriptor_##p { \
/* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */
struct usb_ms_endpoint_descriptor {
__u8 bLength; // 4+n
__u8 bDescriptorType; // USB_DT_CS_ENDPOINT
__u8 bDescriptorSubtype; // USB_MS_GENERAL
__u8 bNumEmbMIDIJack; // n
__u8 baAssocJackID[]; // [n]
__u8 bLength; /* 4+n */
__u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
__u8 bDescriptorSubtype; /* USB_MS_GENERAL */
__u8 bNumEmbMIDIJack; /* n */
__u8 baAssocJackID[]; /* [n] */
} __attribute__ ((packed));
#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
......
......@@ -37,7 +37,7 @@
/* main registers, BAR0 + 0x0000 */
struct net2280_regs {
// offset 0x0000
/* offset 0x0000 */
u32 devinit;
#define LOCAL_CLOCK_FREQUENCY 8
#define FORCE_PCI_RESET 7
......@@ -61,7 +61,7 @@ struct net2280_regs {
#define EEPROM_WRITE_DATA 0
u32 eeclkfreq;
u32 _unused0;
// offset 0x0010
/* offset 0x0010 */
u32 pciirqenb0; /* interrupt PCI master ... */
#define SETUP_PACKET_INTERRUPT_ENABLE 7
......@@ -131,7 +131,7 @@ struct net2280_regs {
#define RESUME_INTERRUPT_ENABLE 1
#define SOF_INTERRUPT_ENABLE 0
// offset 0x0020
/* offset 0x0020 */
u32 _unused1;
u32 usbirqenb1;
#define USB_INTERRUPT_ENABLE 31
......@@ -195,7 +195,7 @@ struct net2280_regs {
#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
#define RESUME_INTERRUPT 1
#define SOF_INTERRUPT 0
// offset 0x0030
/* offset 0x0030 */
u32 idxaddr;
u32 idxdata;
u32 fifoctl;
......@@ -204,7 +204,7 @@ struct net2280_regs {
#define PCI_BASE2_SELECT 2
#define FIFO_CONFIGURATION_SELECT 0
u32 _unused2;
// offset 0x0040
/* offset 0x0040 */
u32 memaddr;
#define START 28
#define DIRECTION 27
......@@ -213,7 +213,7 @@ struct net2280_regs {
u32 memdata0;
u32 memdata1;
u32 _unused3;
// offset 0x0050
/* offset 0x0050 */
u32 gpioctl;
#define GPIO3_LED_SELECT 12
#define GPIO3_INTERRUPT_ENABLE 11
......@@ -237,7 +237,7 @@ struct net2280_regs {
/* usb control, BAR0 + 0x0080 */
struct net2280_usb_regs {
// offset 0x0080
/* offset 0x0080 */
u32 stdrsp;
#define STALL_UNSUPPORTED_REQUESTS 31
#define SET_TEST_MODE 16
......@@ -275,7 +275,7 @@ struct net2280_usb_regs {
#define PME_WAKEUP_ENABLE 2
#define DEVICE_REMOTE_WAKEUP_ENABLE 1
#define SELF_POWERED_STATUS 0
// offset 0x0090
/* offset 0x0090 */
u32 usbstat;
#define HIGH_SPEED 7
#define FULL_SPEED 6
......@@ -291,7 +291,7 @@ struct net2280_usb_regs {
#define TERMINATION_SELECT 0
u32 setup0123;
u32 setup4567;
// offset 0x0090
/* offset 0x0090 */
u32 _unused0;
u32 ouraddr;
#define FORCE_IMMEDIATE 7
......@@ -301,7 +301,7 @@ struct net2280_usb_regs {
/* pci control, BAR0 + 0x0100 */
struct net2280_pci_regs {
// offset 0x0100
/* offset 0x0100 */
u32 pcimstctl;
#define PCI_ARBITER_PARK_SELECT 13
#define PCI_MULTI LEVEL_ARBITER 12
......@@ -331,7 +331,7 @@ struct net2280_pci_regs {
* that can be loaded into some of these registers.
*/
struct net2280_dma_regs { /* [11.7] */
// offset 0x0180, 0x01a0, 0x01c0, 0x01e0,
/* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */
u32 dmactl;
#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
#define DMA_CLEAR_COUNT_ENABLE 21
......@@ -355,7 +355,7 @@ struct net2280_dma_regs { /* [11.7] */
#define DMA_ABORT 1
#define DMA_START 0
u32 _unused0 [2];
// offset 0x0190, 0x01b0, 0x01d0, 0x01f0,
/* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
u32 dmacount;
#define VALID_BIT 31
#define DMA_DIRECTION 30
......@@ -371,9 +371,9 @@ struct net2280_dma_regs { /* [11.7] */
/* dedicated endpoint registers, BAR0 + 0x0200 */
struct net2280_dep_regs { /* [11.8] */
// offset 0x0200, 0x0210, 0x220, 0x230, 0x240
/* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */
u32 dep_cfg;
// offset 0x0204, 0x0214, 0x224, 0x234, 0x244
/* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
u32 dep_rsp;
u32 _unused [2];
} __attribute__ ((packed));
......@@ -383,7 +383,7 @@ struct net2280_dep_regs { /* [11.8] */
* ep0 reserved for control; E and F have only 64 bytes of fifo
*/
struct net2280_ep_regs { /* [11.9] */
// offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0
/* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */
u32 ep_cfg;
#define ENDPOINT_BYTE_COUNT 16
#define ENDPOINT_ENABLE 10
......@@ -435,7 +435,7 @@ struct net2280_ep_regs { /* [11.9] */
#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
#define DATA_OUT_PING_TOKEN_INTERRUPT 1
#define DATA_IN_TOKEN_INTERRUPT 0
// offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0
/* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
u32 ep_avail;
u32 ep_data;
u32 _unused0 [2];
......
// include/linux/usb/otg.h
/* USB OTG (On The Go) defines */
/*
* These APIs may be used between USB controllers. USB device drivers
......
This diff is collapsed.
......@@ -19,8 +19,8 @@ struct sl811_platform_data {
/* pulse sl811 nRST (probably with a GPIO) */
void (*reset)(struct device *dev);
// some boards need something like these:
// int (*check_overcurrent)(struct device *dev);
// void (*clock_enable)(struct device *dev, int is_on);
/* some boards need something like these: */
/* int (*check_overcurrent)(struct device *dev); */
/* void (*clock_enable)(struct device *dev, int is_on); */
};
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