public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Robert Baldyga <r.baldyga@samsung.com>, balbi@ti.com
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, stern@rowland.harvard.edu
Subject: Re: [PATCH v7 7/8] usb: musb: gadget: add musb_match_ep() function
Date: Thu, 6 Aug 2015 14:18:52 +0300	[thread overview]
Message-ID: <55C3429C.2030200@cogentembedded.com> (raw)
In-Reply-To: <1438847923-27595-8-git-send-email-r.baldyga@samsung.com>

On 8/6/2015 10:58 AM, Robert Baldyga wrote:

> Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
> process. Function does the same that was done by chip-specific code inside
> of epautoconf. Now this code can be removed from there to separate generic code
> from platform specific logic.

> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
>   drivers/usb/gadget/epautoconf.c | 23 -----------------------
>   drivers/usb/musb/musb_gadget.c  | 34 ++++++++++++++++++++++++++++++++++
>   2 files changed, 34 insertions(+), 23 deletions(-)

[...]
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index 4150baf..ac2f188 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -1684,6 +1684,39 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
>   	return 0;
>   }
>
> +#ifdef CONFIG_BLACKFIN
> +static struct usb_ep *musb_match_ep(struct usb_gadget *g,
> +		struct usb_endpoint_descriptor *desc,
> +		struct usb_ss_ep_comp_descriptor *ep_comp)
> +{
> +	struct usb_ep *ep = NULL;
> +	u8 type = usb_endpoint_type(desc);

    You hardly need this variable.

> +
> +	switch (type) {
> +	case USB_ENDPOINT_XFER_ISOC:
> +	case USB_ENDPOINT_XFER_BULK:
> +		if (usb_endpoint_dir_in(desc))
> +			ep = gadget_find_ep_by_name(g, "ep5in");
> +		else
> +			ep = gadget_find_ep_by_name(g, "ep6out");
> +		break;
> +	case USB_ENDPOINT_XFER_INT:
> +		if (usb_endpoint_dir_in(desc))
> +			ep = gadget_find_ep_by_name(g, "ep1in");
> +		else
> +			ep = gadget_find_ep_by_name(g, "ep2out");
> +	default:
> +	}
> +
> +	if (ep && usb_gadget_ep_match_desc(g, ep, desc, ep_comp))
> +		return ep;
> +
> +	return NULL;
> +}
> +#else
> +#define musb_match_ep NULL
> +#endif
> +
>   static int musb_gadget_start(struct usb_gadget *g,
>   		struct usb_gadget_driver *driver);
>   static int musb_gadget_stop(struct usb_gadget *g);
[...]

MBR, Sergei


  reply	other threads:[~2015-08-06 11:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  7:58 [PATCH v7 0/8] usb: gadget: rework ep matching and claiming mechanism Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 1/8] usb: gadget: epautoconf: rework ep_matches() function Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 2/8] usb: gadget: add 'ep_match' callback to usb_gadget_ops Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 3/8] usb: gadget: move ep_matches() from epautoconf to udc-core Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 4/8] usb: gadget: move find_ep() " Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 5/8] usb: gadget: net2280: add net2280_match_ep() function Robert Baldyga
2015-08-06  7:58 ` [PATCH v7 6/8] usb: gadget: goku_udc: add goku_match_ep() function Robert Baldyga
2015-08-06 11:17   ` Sergei Shtylyov
2015-08-06  7:58 ` [PATCH v7 7/8] usb: musb: gadget: add musb_match_ep() function Robert Baldyga
2015-08-06 11:18   ` Sergei Shtylyov [this message]
2015-08-06  7:58 ` [PATCH v7 8/8] usb: gadget: remove gadget_chips.h Robert Baldyga

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=55C3429C.2030200@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=r.baldyga@samsung.com \
    --cc=stern@rowland.harvard.edu \
    /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