mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 13:11:14 +00:00
drm/udl: Ensure channel is selected before using the device.
Lift configuration command from udlfb. This appears to be essential for at least a Rextron VCUD-60, without which no URB communication occurs. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1471904254-26545-1-git-send-email-jm@lentin.co.uk
This commit is contained in:
parent
b4ba97e767
commit
d1c151dcae
1 changed files with 25 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
||||||
/* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */
|
/* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */
|
||||||
#define BULK_SIZE 512
|
#define BULK_SIZE 512
|
||||||
|
|
||||||
|
#define NR_USB_REQUEST_CHANNEL 0x12
|
||||||
|
|
||||||
#define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE)
|
#define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE)
|
||||||
#define WRITES_IN_FLIGHT (4)
|
#define WRITES_IN_FLIGHT (4)
|
||||||
#define MAX_VENDOR_DESCRIPTOR_SIZE 256
|
#define MAX_VENDOR_DESCRIPTOR_SIZE 256
|
||||||
|
@ -90,6 +92,26 @@ success:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Need to ensure a channel is selected before submitting URBs
|
||||||
|
*/
|
||||||
|
static int udl_select_std_channel(struct udl_device *udl)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
u8 set_def_chn[] = {0x57, 0xCD, 0xDC, 0xA7,
|
||||||
|
0x1C, 0x88, 0x5E, 0x15,
|
||||||
|
0x60, 0xFE, 0xC6, 0x97,
|
||||||
|
0x16, 0x3D, 0x47, 0xF2};
|
||||||
|
|
||||||
|
ret = usb_control_msg(udl->udev,
|
||||||
|
usb_sndctrlpipe(udl->udev, 0),
|
||||||
|
NR_USB_REQUEST_CHANNEL,
|
||||||
|
(USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0,
|
||||||
|
set_def_chn, sizeof(set_def_chn),
|
||||||
|
USB_CTRL_SET_TIMEOUT);
|
||||||
|
return ret < 0 ? ret : 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void udl_release_urb_work(struct work_struct *work)
|
static void udl_release_urb_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct urb_node *unode = container_of(work, struct urb_node,
|
struct urb_node *unode = container_of(work, struct urb_node,
|
||||||
|
@ -301,6 +323,9 @@ int udl_driver_load(struct drm_device *dev, unsigned long flags)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (udl_select_std_channel(udl))
|
||||||
|
DRM_ERROR("Selecting channel failed\n");
|
||||||
|
|
||||||
if (!udl_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
|
if (!udl_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
|
||||||
DRM_ERROR("udl_alloc_urb_list failed\n");
|
DRM_ERROR("udl_alloc_urb_list failed\n");
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue