diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2012-11-08 17:11:52 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-22 20:17:52 (GMT) |
commit | c647a91a2558c4031eddd013e5860ca5a41363a7 (patch) | |
tree | 90a0b103355b59ef61fa7d2f88a6ec78e24e189b /drivers/media/usb/em28xx/em28xx.h | |
parent | c8e9d95b41f2a441b2af0a1899448dd45ad7632d (diff) | |
download | linux-fsl-qoriq-c647a91a2558c4031eddd013e5860ca5a41363a7.tar.xz |
[media] em28xx: improve USB endpoint logic, also use bulk transfers
The current enpoint logic ignores all bulk endpoints and uses
a fixed mapping between endpint addresses and the supported
data stream types (analog/audio/DVB):
Ep 0x82, isoc => analog
Ep 0x83, isoc => audio
Ep 0x84, isoc => DVB
Now that the code can also do bulk transfers, the endpoint
logic has to be extended to also consider bulk endpoints.
The new logic preserves backwards compatibility and reflects
the endpoint configurations we have seen so far:
Ep 0x82, isoc => analog
Ep 0x82, bulk => analog
Ep 0x83, isoc* => audio
Ep 0x84, isoc => digital
Ep 0x84, bulk => analog or digital**
(*: audio should always be isoc)
(**: analog, if ep 0x82 is isoc, otherwise digital)
[mchehab@redhat.com: Fix a CodingStyle issue: don't break strings
into separate lines]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx.h')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index f5be522..aa413bd 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -165,6 +165,12 @@ #define EM28XX_NUM_ISOC_PACKETS 64 #define EM28XX_DVB_NUM_ISOC_PACKETS 64 +/* bulk transfers: transfer buffer size = packet size * packet multiplier + USB 2.0 spec says bulk packet size is always 512 bytes + */ +#define EM28XX_BULK_PACKET_MULTIPLIER 384 +#define EM28XX_DVB_BULK_PACKET_MULTIPLIER 384 + #define EM28XX_INTERLACED_DEFAULT 1 /* @@ -584,8 +590,14 @@ struct em28xx { /* usb transfer */ struct usb_device *udev; /* the usb device */ + u8 analog_ep_isoc; /* address of isoc endpoint for analog */ + u8 analog_ep_bulk; /* address of bulk endpoint for analog */ + u8 dvb_ep_isoc; /* address of isoc endpoint for DVB */ + u8 dvb_ep_bulk; /* address of bulk endpoint for DVC */ int alt; /* alternate setting */ int max_pkt_size; /* max packet size of the selected ep at alt */ + int packet_multiplier; /* multiplier for wMaxPacketSize, used for + URB buffer size definition */ int num_alt; /* number of alternative settings */ unsigned int *alt_max_pkt_size_isoc; /* array of isoc wMaxPacketSize */ unsigned int analog_xfer_bulk:1; /* use bulk instead of isoc |