All of lore.kernel.org
 help / color / mirror / Atom feed
* USB gadget mode in laptop
@ 2016-08-04 17:02 Susanoo Tux
  2016-08-04 17:08 ` Dave Hylands
  2016-08-05 10:31 ` Greg KH
  0 siblings, 2 replies; 10+ messages in thread
From: Susanoo Tux @ 2016-08-04 17:02 UTC (permalink / raw)
  To: kernelnewbies

Hello All,

I was looking into USB gadget mode to work on my laptop. One simple basic
doubt I have is how do I know whether my USB controller supports gadget
mode ? If it supports which module do I need to modprobe ?


Found gadget directory here
/lib/modules/4.6.4-1-ARCH/kernel/drivers/usb/gadget , but not getting which
one to load. Any pointer where I can learn about this more ?

Thanks
SusanooTux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/fbfa2994/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:02 USB gadget mode in laptop Susanoo Tux
@ 2016-08-04 17:08 ` Dave Hylands
  2016-08-04 17:45   ` Susanoo Tux
  2016-08-05 10:31 ` Greg KH
  1 sibling, 1 reply; 10+ messages in thread
From: Dave Hylands @ 2016-08-04 17:08 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 10:02 AM, Susanoo Tux <susanootux@gmail.com> wrote:

> Hello All,
>
> I was looking into USB gadget mode to work on my laptop. One simple basic
> doubt I have is how do I know whether my USB controller supports gadget
> mode ? If it supports which module do I need to modprobe ?
>
>
> Found gadget directory here /lib/modules/4.6.4-1-ARCH/kernel/drivers/usb/gadget
> , but not getting which one to load. Any pointer where I can learn about
> this more ?
>

Checkout Documentation/usb (in your kernel source tree). You'll find a
bunch of files starting with the word gadget which describe the various
gadget drivers and how to use them.


-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/0e7bcc08/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:08 ` Dave Hylands
@ 2016-08-04 17:45   ` Susanoo Tux
  2016-08-04 17:48     ` Dave Hylands
  0 siblings, 1 reply; 10+ messages in thread
From: Susanoo Tux @ 2016-08-04 17:45 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 10:38 PM, Dave Hylands <dhylands@gmail.com> wrote:

>
> On Thu, Aug 4, 2016 at 10:02 AM, Susanoo Tux <susanootux@gmail.com> wrote:
>
>> Hello All,
>>
>> I was looking into USB gadget mode to work on my laptop. One simple basic
>> doubt I have is how do I know whether my USB controller supports gadget
>> mode ? If it supports which module do I need to modprobe ?
>>
>>
>> Found gadget directory here /lib/modules/4.6.4-1-ARCH/kernel/drivers/usb/gadget
>> , but not getting which one to load. Any pointer where I can learn about
>> this more ?
>>
>
> Checkout Documentation/usb (in your kernel source tree). You'll find a
> bunch of files starting with the word gadget which describe the various
> gadget drivers and how to use them.
>
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com
>


Hi Dave,


Thanks for the reference, I gone through the configfs. And tried creating
it, but
it's not working. I am using x86, is that configfs method configures the usb
controllers to behave a device ? because nothing is there
in /sys/class/udc/.

Thanks

Regards,
SusanooTux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/1470b012/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:45   ` Susanoo Tux
@ 2016-08-04 17:48     ` Dave Hylands
  2016-08-04 17:54       ` Susanoo Tux
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Hylands @ 2016-08-04 17:48 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 10:45 AM, Susanoo Tux <susanootux@gmail.com> wrote:

>
>
> On Thu, Aug 4, 2016 at 10:38 PM, Dave Hylands <dhylands@gmail.com> wrote:
>
>>
>> ...snip...

> Checkout Documentation/usb (in your kernel source tree). You'll find a
>> bunch of files starting with the word gadget which describe the various
>> gadget drivers and how to use them.
>>
> ...snip...

>
> Thanks for the reference, I gone through the configfs. And tried creating
> it, but
> it's not working. I am using x86, is that configfs method configures the
> usb
> controllers to behave a device ? because nothing is there
> in /sys/class/udc/.
>

Yes - it requires that the USB controller be able to behave as a device.
I've only used this on SoC's that had that capability (like gumstix or
BeagleBone) and not on a desktop.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/0e56efe9/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:48     ` Dave Hylands
@ 2016-08-04 17:54       ` Susanoo Tux
  2016-08-04 18:04         ` Dave Hylands
  0 siblings, 1 reply; 10+ messages in thread
From: Susanoo Tux @ 2016-08-04 17:54 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 11:18 PM, Dave Hylands <dhylands@gmail.com> wrote:

>
> On Thu, Aug 4, 2016 at 10:45 AM, Susanoo Tux <susanootux@gmail.com> wrote:
>
>>
>>
>> On Thu, Aug 4, 2016 at 10:38 PM, Dave Hylands <dhylands@gmail.com> wrote:
>>
>>>
>>> ...snip...
>
>> Checkout Documentation/usb (in your kernel source tree). You'll find a
>>> bunch of files starting with the word gadget which describe the various
>>> gadget drivers and how to use them.
>>>
>> ...snip...
>
>>
>> Thanks for the reference, I gone through the configfs. And tried creating
>> it, but
>> it's not working. I am using x86, is that configfs method configures the
>> usb
>> controllers to behave a device ? because nothing is there
>> in /sys/class/udc/.
>>
>
> Yes - it requires that the USB controller be able to behave as a device.
> I've only used this on SoC's that had that capability (like gumstix or
> BeagleBone) and not on a desktop.
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com
>

Yes, I can see the error in dmesg "couldn't find an available UDC - added
[g1] to list of pending drivers" :(.

But I didn't get the meaning of this. May be one basic question, how to
check whether my desktop supports device/gadget mode?

Thanks

Regards,
SusanoTux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/0f3a7a15/attachment-0001.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:54       ` Susanoo Tux
@ 2016-08-04 18:04         ` Dave Hylands
  2016-08-04 18:15           ` Susanoo Tux
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Hylands @ 2016-08-04 18:04 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 10:54 AM, Susanoo Tux <susanootux@gmail.com> wrote:

>
>
> On Thu, Aug 4, 2016 at 11:18 PM, Dave Hylands <dhylands@gmail.com> wrote:
>
>>
>> On Thu, Aug 4, 2016 at 10:45 AM, Susanoo Tux <susanootux@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Thu, Aug 4, 2016 at 10:38 PM, Dave Hylands <dhylands@gmail.com>
>>> wrote:
>>>
>>>>
>>>> ...snip...
>>
>>> Checkout Documentation/usb (in your kernel source tree). You'll find a
>>>> bunch of files starting with the word gadget which describe the various
>>>> gadget drivers and how to use them.
>>>>
>>> ...snip...
>>
>>>
>>> Thanks for the reference, I gone through the configfs. And tried
>>> creating it, but
>>> it's not working. I am using x86, is that configfs method configures the
>>> usb
>>> controllers to behave a device ? because nothing is there
>>> in /sys/class/udc/.
>>>
>>
>> Yes - it requires that the USB controller be able to behave as a device.
>> I've only used this on SoC's that had that capability (like gumstix or
>> BeagleBone) and not on a desktop.
>>
>> --
>> Dave Hylands
>> Shuswap, BC, Canada
>> http://www.davehylands.com
>>
>
> Yes, I can see the error in dmesg "couldn't find an available UDC - added
> [g1] to list of pending drivers" :(.
>
> But I didn't get the meaning of this. May be one basic question, how to
> check whether my desktop supports device/gadget mode?
>

It's been a while since I worked on this stuff, but I seem to recall that
you need a USB device that supports OTG (On-The-Go). I believe that you can
get PCI cards that support USB OTG. I suspect the USB hosts builtin to most
x86 motherboards don't support it. But that's the feature you need to look
for.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/3c5b3bce/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 18:04         ` Dave Hylands
@ 2016-08-04 18:15           ` Susanoo Tux
  0 siblings, 0 replies; 10+ messages in thread
From: Susanoo Tux @ 2016-08-04 18:15 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 4, 2016 at 11:34 PM, Dave Hylands <dhylands@gmail.com> wrote:

>
> On Thu, Aug 4, 2016 at 10:54 AM, Susanoo Tux <susanootux@gmail.com> wrote:
>
>>
>>
>> On Thu, Aug 4, 2016 at 11:18 PM, Dave Hylands <dhylands@gmail.com> wrote:
>>
>>>
>>> On Thu, Aug 4, 2016 at 10:45 AM, Susanoo Tux <susanootux@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Thu, Aug 4, 2016 at 10:38 PM, Dave Hylands <dhylands@gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>> ...snip...
>>>
>>>> Checkout Documentation/usb (in your kernel source tree). You'll find a
>>>>> bunch of files starting with the word gadget which describe the various
>>>>> gadget drivers and how to use them.
>>>>>
>>>> ...snip...
>>>
>>>>
>>>> Thanks for the reference, I gone through the configfs. And tried
>>>> creating it, but
>>>> it's not working. I am using x86, is that configfs method configures
>>>> the usb
>>>> controllers to behave a device ? because nothing is there
>>>> in /sys/class/udc/.
>>>>
>>>
>>> Yes - it requires that the USB controller be able to behave as a device.
>>> I've only used this on SoC's that had that capability (like gumstix or
>>> BeagleBone) and not on a desktop.
>>>
>>> --
>>> Dave Hylands
>>> Shuswap, BC, Canada
>>> http://www.davehylands.com
>>>
>>
>> Yes, I can see the error in dmesg "couldn't find an available UDC - added
>> [g1] to list of pending drivers" :(.
>>
>> But I didn't get the meaning of this. May be one basic question, how to
>> check whether my desktop supports device/gadget mode?
>>
>
> It's been a while since I worked on this stuff, but I seem to recall that
> you need a USB device that supports OTG (On-The-Go). I believe that you can
> get PCI cards that support USB OTG. I suspect the USB hosts builtin to most
> x86 motherboards don't support it. But that's the feature you need to look
> for.
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com
>

Oh yes, Something like this might be helpful
http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=124;74;110&

Thanks Dave :)..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160804/8051e275/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-04 17:02 USB gadget mode in laptop Susanoo Tux
  2016-08-04 17:08 ` Dave Hylands
@ 2016-08-05 10:31 ` Greg KH
  2016-08-05 18:12   ` Susanoo Tux
  1 sibling, 1 reply; 10+ messages in thread
From: Greg KH @ 2016-08-05 10:31 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Aug 04, 2016 at 10:32:16PM +0530, Susanoo Tux wrote:
> Hello All,
> 
> I was looking into USB gadget mode to work on my laptop. One simple basic doubt
> I have is how do I know whether my USB controller supports gadget mode ? If it
> supports which module do I need to modprobe ??

Why would a laptop support gadget mode?  A USB "gadget" is USB hardware
that acts like a device (keyboard, mouse, storage, etc.).  Laptops
almost never have that type of hardware in them as they are USB "hosts"
and control USB devices.

You can buy PCI devices that act as USB gadgets, and that's used for
development of systems, and many smaller devices (phone, tablets, etc.)
have hardware that can act in both host and gadget mode.  But again, you
need special hardware for this, something that I have never seen built
into a laptop.

So, sorry, I don't think you will be able to do this.

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-05 10:31 ` Greg KH
@ 2016-08-05 18:12   ` Susanoo Tux
  2016-08-05 18:53     ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Susanoo Tux @ 2016-08-05 18:12 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Aug 5, 2016 at 4:01 PM, Greg KH <greg@kroah.com> wrote:

> On Thu, Aug 04, 2016 at 10:32:16PM +0530, Susanoo Tux wrote:
> > Hello All,
> >
> > I was looking into USB gadget mode to work on my laptop. One simple
> basic doubt
> > I have is how do I know whether my USB controller supports gadget mode ?
> If it
> > supports which module do I need to modprobe ?
>
> Why would a laptop support gadget mode?  A USB "gadget" is USB hardware
> that acts like a device (keyboard, mouse, storage, etc.).  Laptops
> almost never have that type of hardware in them as they are USB "hosts"
> and control USB devices.
>
> You can buy PCI devices that act as USB gadgets, and that's used for
> development of systems, and many smaller devices (phone, tablets, etc.)
> have hardware that can act in both host and gadget mode.  But again, you
> need special hardware for this, something that I have never seen built
> into a laptop.
>
> So, sorry, I don't think you will be able to do this.
>
> greg k-h
>

Hi Greg,

Its basically for embedded Linux simulation which I am running in my
laptop. So, some
applications I know needs USB device mode enabled. So, this requirement
came
into picture and worked on it and no use :(.

Yes, Had looked into some PCI cards, where it can be installed into desktop
and
make it works as device mode. This is one option for me :).

I think all the laptop manufacturers are closely depending on windows and
don't enable the device
mode (OTG) or I can say they don't put the OTG supported controller :(.
AFAIK, only from windows
10 on wards they have OTG support. So, bad for Linux users where  we have
capability in OS but
hardware won't supports. Not sure, windows 10 based laptop hardwares
supports OTG now.

Anyways, Great. Got clear picture now :)

Thanks Greg

Regards,
SusanooTux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160805/a8f06f96/attachment.html 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* USB gadget mode in laptop
  2016-08-05 18:12   ` Susanoo Tux
@ 2016-08-05 18:53     ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2016-08-05 18:53 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Aug 05, 2016 at 11:42:22PM +0530, Susanoo Tux wrote:
> I think all the laptop manufacturers are closely depending on windows and don't
> enable the device mode (OTG) or I can say they don't put the OTG
> supported controller :(.

It's the latter, there is no OTG supported controller in your laptop,
nor would it ever make sense to add such a thing for a "normal" consumer
device as there is nothing that anyone could plug into their laptop in
that mode that would work.

Now with USB-C connections, and newer hardware, we might see this
happening in a year or so, but give companies time to get the hardware
made properly, it's still not quite done...

good luck!

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-05 18:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 17:02 USB gadget mode in laptop Susanoo Tux
2016-08-04 17:08 ` Dave Hylands
2016-08-04 17:45   ` Susanoo Tux
2016-08-04 17:48     ` Dave Hylands
2016-08-04 17:54       ` Susanoo Tux
2016-08-04 18:04         ` Dave Hylands
2016-08-04 18:15           ` Susanoo Tux
2016-08-05 10:31 ` Greg KH
2016-08-05 18:12   ` Susanoo Tux
2016-08-05 18:53     ` Greg KH

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.