All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] AT91 USB Serial Device
Date: Fri, 03 Dec 2010 16:17:08 +0100	[thread overview]
Message-ID: <4CF909F4.4060905@atmel.com> (raw)
In-Reply-To: <AANLkTimV2ENcWajrrMQ2Too4pf=XBfLczJ9HehNt4V_8@mail.gmail.com>

Rob,

Le 11/11/2010 02:16, Rob Emanuele :
> Hi Nicolas,
> 
> I came across a small bug while debugging my problems of getting the
> host interface and device interface to work at the same time but on
> different ports.  I had compiled the atmel usb device support as a
> module and after unloading it and trying to reload it, the irq for
> vbus was not released.  This little patch fixes that

I have created the patch. The only thing that is missing it your
Signed-off-by: xxxxx xxx <xxxx@xxx>
line..

Can you please send it to me (even quickly replying to this email saying
ok)? I will add it before I send your patch upstream (to usb maintainer).

Bye,

> diff --git a/drivers/usb/gadget/atmel_usba_udc.c
> b/drivers/usb/gadget/atmel_usba_udc.c
> index d6ef3d5..bc70e53 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -2052,8 +2052,10 @@ static int __exit usba_udc_remove(struct
> platform_device *pdev)
>                 usba_ep_cleanup_debugfs(&usba_ep[i]);
>         usba_cleanup_debugfs(udc);
> 
> -       if (gpio_is_valid(udc->vbus_pin))
> +       if (gpio_is_valid(udc->vbus_pin)) {
> +               free_irq(gpio_to_irq(udc->vbus_pin), udc);
>                 gpio_free(udc->vbus_pin);
> +       }
> 
>         free_irq(udc->irq, udc);
>         kfree(usba_ep);
> 
> 
> On Tue, Nov 9, 2010 at 3:59 PM, Rob Emanuele <poorarm@shoreis.com> wrote:
>> Nicolas et al,
>>
>> Thank you for the information.  For the moment I have a boot option to
>> use either 2 host ports or a host and a device port.  That would seem
>> to fit my needs except for the case that I'm loading the usb serial
>> gadget as a module and then specifying in the inittab that getty use
>> it as ttyGS0.  In that case connecting the device port to a host does
>> not seem to ever register on the host.  If I remove the getty line
>> from inittab and then run getty manually after it boots, it works
>> fine.  To add insult to injury, then it will work after reboot also
>> until a hard power down.
>>
>> Anyone experience this?
>>
>> Thank you,
>>
>> Rob
>>
>> On Tue, Nov 9, 2010 at 9:46 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>>> Le 05/11/2010 22:09, Rob Emanuele :
>>>> Greetings,
>>>>
>>>> We've been developing a at91sam9g45 product and it is finally available at:
>>>> https://www.crystalfontz.com/product/CFA910.html
>>>
>>> Very nice platform!
>>>
>>>> We are looking into supporting USB OTG on this device as the 'g45 has
>>>> the USB host/device port.  As far at I can tell Atmel or anyone else
>>>> working on this platform has not made full use of this as an OTG
>>>> device.
>>>
>>> Indeed, it is not done for the moment...
>>>
>>>>  I haven't found support in the USB or the OTG code for
>>>> reading the USB ID line to determine host or device mode.
>>>
>>> I am not sure USB ID is well supported by consumer cable providers and
>>> is a reliable way to determine host or device mode.
>>>
>>>> Am I missing something or is that an area that needs some code written for it?
>>>
>>> Anyway, using this port as host or device is a matter of
>>> 1/ driving or not VBUS pin
>>> 2/ dealing with loading the gadget driver (as the "Enable" of the usba
>>> IP is responsible for swithing to device mode).
>>>
>>> I think that determining if the port shall be used in host or device
>>> mode can be asked through the GUI... But note that I am not an USB expert...
>>> --
>>> Nicolas Ferre
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>>
>>
> 


-- 
Nicolas Ferre

  parent reply	other threads:[~2010-12-03 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11  1:16 [PATCH] AT91 USB Serial Device Rob Emanuele
2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-03 15:17 ` Nicolas Ferre [this message]
2010-12-14 15:05 ` [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove() Nicolas Ferre
2010-12-14 15:05   ` Nicolas Ferre
2010-12-14 16:21   ` David Brownell
2010-12-14 16:21     ` David Brownell
2010-12-14 18:00     ` [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove() Nicolas Ferre
2010-12-14 18:00       ` Nicolas Ferre
2010-12-15  1:29       ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-15  1:29         ` Jean-Christophe PLAGNIOL-VILLARD

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=4CF909F4.4060905@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.