mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jamie Lentin <jm@lentin.co.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/udl: Ensure channel is selected before using the device.
Date: Tue, 23 Aug 2016 07:57:58 +0200	[thread overview]
Message-ID: <20160823055758.GI24290@phenom.ffwll.local> (raw)
In-Reply-To: <1471904254-26545-1-git-send-email-jm@lentin.co.uk>

On Mon, Aug 22, 2016 at 11:17:34PM +0100, Jamie Lentin wrote:
> 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>
> ---
> udl_encoder_commit() is too late to do this set up in it seems. This
> setup doesn't need to be performed again after a suspend, although this
> is somewhat academic until I send the patch adding suspend and resume
> functions.
> 
> Tested with a Rextron VCUD-60 attached to a Thinkpad X201s on Linux 4.7.0

Applied to drm-misc, thanks.
-Daniel

> 
> Cheers,
> ---
>  drivers/gpu/drm/udl/udl_main.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index 33dbfb2..29f0207 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -16,6 +16,8 @@
>  /* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */
>  #define BULK_SIZE 512
>  
> +#define NR_USB_REQUEST_CHANNEL 0x12
> +
>  #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE)
>  #define WRITES_IN_FLIGHT (4)
>  #define MAX_VENDOR_DESCRIPTOR_SIZE 256
> @@ -90,6 +92,26 @@ success:
>  	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)
>  {
>  	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;
>  	}
>  
> +	if (udl_select_std_channel(udl))
> +		DRM_ERROR("Selecting channel failed\n");
> +
>  	if (!udl_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
>  		DRM_ERROR("udl_alloc_urb_list failed\n");
>  		goto err;
> -- 
> 2.8.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-08-23  5:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-14 18:19 [PATCH] " Jamie Lentin
2016-08-15  6:43 ` Daniel Vetter
2016-08-22 22:17   ` [PATCH v2] " Jamie Lentin
2016-08-23  5:57     ` Daniel Vetter [this message]
2016-11-08  6:32       ` poma
2016-11-08  6:40         ` Dave Airlie
2016-11-08  6:48           ` Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160823055758.GI24290@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jm@lentin.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®