Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-26 Thread Greg KH
On Fri, Jul 26, 2013 at 01:56:19PM +0800, Barry Song wrote: > 2013/7/18 Felipe Balbi : > > On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: > >> Hi Felipe, > >> > >> Thanks, I'll test the patch. > >> > >> But sysfs_notify(>dev.kobj, NULL, "status"), status or state ? > >> I notice that

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-26 Thread Greg KH
On Fri, Jul 26, 2013 at 01:56:19PM +0800, Barry Song wrote: 2013/7/18 Felipe Balbi ba...@ti.com: On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: Hi Felipe, Thanks, I'll test the patch. But sysfs_notify(gadget-dev.kobj, NULL, status), status or state ? I notice that

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-25 Thread Barry Song
2013/7/18 Felipe Balbi : > On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: >> Hi Felipe, >> >> Thanks, I'll test the patch. >> >> But sysfs_notify(>dev.kobj, NULL, "status"), status or state ? >> I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) > > good eyes,

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-25 Thread Barry Song
2013/7/18 Felipe Balbi ba...@ti.com: On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: Hi Felipe, Thanks, I'll test the patch. But sysfs_notify(gadget-dev.kobj, NULL, status), status or state ? I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) good eyes,

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-24 Thread Barry Song
2013/7/18 Greg KH : > On Wed, Jul 17, 2013 at 10:57:06AM +0300, Felipe Balbi wrote: >> Hi, >> >> On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: >> > > The question is since we default GADGET, so the g_mass_storage.ko is >> > > installed early but connecting to a host PC >> > > is

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-24 Thread Barry Song
2013/7/18 Greg KH gre...@linuxfoundation.org: On Wed, Jul 17, 2013 at 10:57:06AM +0300, Felipe Balbi wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early but connecting to a host PC is

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-22 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 09:50:37AM -0400, Alan Stern wrote: > On Thu, 18 Jul 2013, Felipe Balbi wrote: > > > > > yes. Only the UDC driver knows when the controller is moving among those > > > > states. > > > > > > Not quite. Only the gadget driver knows when the transition between > > >

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-22 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 09:50:37AM -0400, Alan Stern wrote: On Thu, 18 Jul 2013, Felipe Balbi wrote: yes. Only the UDC driver knows when the controller is moving among those states. Not quite. Only the gadget driver knows when the transition between ADDRESS and

RE: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-20 Thread Chen Peter-B29397
> > On Wed, Jul 17, 2013 at 10:36 AM, Peter Chen > wrote: > > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > >> On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: > >> > Hi Greg, > >> > > >> > The USB on our platform can change roles between HOST and GADGET, > but > >> >

RE: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-20 Thread Chen Peter-B29397
On Wed, Jul 17, 2013 at 10:36 AM, Peter Chen peter.c...@freescale.com wrote: On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Alan Stern
On Thu, 18 Jul 2013, Felipe Balbi wrote: > > > yes. Only the UDC driver knows when the controller is moving among those > > > states. > > > > Not quite. Only the gadget driver knows when the transition between > > ADDRESS and CONFIGURED occurs. This should be added to composite.c. > > that's

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
On Thu, Jul 18, 2013 at 06:54:38PM +0800, Rong Wang wrote: > Hi Felipe, > > Here's the patch. If you are OK with it, I'll send it to the list formally. > Thanks. > > - > > usb: gadget: udc-core: make

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Felipe, Here's the patch. If you are OK with it, I'll send it to the list formally. Thanks. - usb: gadget: udc-core: make udc state attribute name consistent The name of udc state attribute file

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: > Hi Felipe, > > Thanks, I'll test the patch. > > But sysfs_notify(>dev.kobj, NULL, "status"), status or state ? > I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) good eyes, please send a patch which I'll queue on

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 11:40:41AM +0300, Felipe Balbi wrote: > > >> >> > The question is since we default GADGET, so the g_mass_storage.ko is > > >> >> > installed early but connecting to a host PC > > >> >> > is randomly, But the udev has no idea when a host PC connects our > > >> >> >

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Felipe, Thanks, I'll test the patch. But sysfs_notify(>dev.kobj, NULL, "status"), status or state ? I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) On Thu, Jul 18, 2013 at 4:40 PM, Felipe Balbi wrote: > Hi, > > On Thu, Jul 18, 2013 at 04:33:43PM +0800, Rong Wang

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 04:33:43PM +0800, Rong Wang wrote: > On Wed, Jul 17, 2013 at 9:27 PM, Felipe Balbi wrote: > > On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: > >> Hi Felipe, > >> > >> On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: > >> > Hi, > >> > > >> > On Mon,

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
On Wed, Jul 17, 2013 at 9:27 PM, Felipe Balbi wrote: > On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: >> Hi Felipe, >> >> On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: >> > Hi, >> > >> > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: >> >> > The question is since we

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Peter, On Wed, Jul 17, 2013 at 10:36 AM, Peter Chen wrote: > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: >> On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: >> > Hi Greg, >> > >> > The USB on our platform can change roles between HOST and GADGET, but >> > it is not

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Wed, Jul 17, 2013 at 11:37:35AM -0400, Alan Stern wrote: > On Wed, 17 Jul 2013, Felipe Balbi wrote: > > > On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: > > > Hi Felipe, > > > > > > On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: > > > > Hi, > > > > > > > > On Mon, Jul

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Wed, Jul 17, 2013 at 11:37:35AM -0400, Alan Stern wrote: On Wed, 17 Jul 2013, Felipe Balbi wrote: On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 15, 2013 at

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Peter, On Wed, Jul 17, 2013 at 10:36 AM, Peter Chen peter.c...@freescale.com wrote: On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
On Wed, Jul 17, 2013 at 9:27 PM, Felipe Balbi ba...@ti.com wrote: On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 04:33:43PM +0800, Rong Wang wrote: On Wed, Jul 17, 2013 at 9:27 PM, Felipe Balbi ba...@ti.com wrote: On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon,

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Felipe, Thanks, I'll test the patch. But sysfs_notify(gadget-dev.kobj, NULL, status), status or state ? I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) On Thu, Jul 18, 2013 at 4:40 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Thu, Jul 18, 2013 at 04:33:43PM +0800,

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
Hi, On Thu, Jul 18, 2013 at 11:40:41AM +0300, Felipe Balbi wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early but connecting to a host PC is randomly, But the udev has no idea when a host PC connects our device. So we

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote: Hi Felipe, Thanks, I'll test the patch. But sysfs_notify(gadget-dev.kobj, NULL, status), status or state ? I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL) good eyes, please send a patch which I'll queue on

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Rong Wang
Hi Felipe, Here's the patch. If you are OK with it, I'll send it to the list formally. Thanks. - usb: gadget: udc-core: make udc state attribute name consistent The name of udc state attribute file

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Felipe Balbi
On Thu, Jul 18, 2013 at 06:54:38PM +0800, Rong Wang wrote: Hi Felipe, Here's the patch. If you are OK with it, I'll send it to the list formally. Thanks. - usb: gadget: udc-core: make udc

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-18 Thread Alan Stern
On Thu, 18 Jul 2013, Felipe Balbi wrote: yes. Only the UDC driver knows when the controller is moving among those states. Not quite. Only the gadget driver knows when the transition between ADDRESS and CONFIGURED occurs. This should be added to composite.c. that's not entirely

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Greg KH
On Wed, Jul 17, 2013 at 10:57:06AM +0300, Felipe Balbi wrote: > Hi, > > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > > > The question is since we default GADGET, so the g_mass_storage.ko is > > > installed early but connecting to a host PC > > > is randomly, But the udev has no idea

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Alan Stern
On Wed, 17 Jul 2013, Felipe Balbi wrote: > On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: > > Hi Felipe, > > > > On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: > > > Hi, > > > > > > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > > >> > The question is since we

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Felipe Balbi
On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: > Hi Felipe, > > On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: > > Hi, > > > > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > >> > The question is since we default GADGET, so the g_mass_storage.ko is > >> > installed

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Rong Wang
Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi wrote: > Hi, > > On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: >> > The question is since we default GADGET, so the g_mass_storage.ko is >> > installed early but connecting to a host PC >> > is randomly, But the udev has no idea

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Felipe Balbi
Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > > The question is since we default GADGET, so the g_mass_storage.ko is > > installed early but connecting to a host PC > > is randomly, But the udev has no idea when a host PC connects our device. > > > > So we consider it's

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Felipe Balbi
Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early but connecting to a host PC is randomly, But the udev has no idea when a host PC connects our device. So we consider it's reasonable to let

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Rong Wang
Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early but connecting to a host PC is randomly, But the udev has no idea

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Felipe Balbi
On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Alan Stern
On Wed, 17 Jul 2013, Felipe Balbi wrote: On Wed, Jul 17, 2013 at 09:04:54PM +0800, Rong Wang wrote: Hi Felipe, On Wed, Jul 17, 2013 at 3:57 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-17 Thread Greg KH
On Wed, Jul 17, 2013 at 10:57:06AM +0300, Felipe Balbi wrote: Hi, On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: The question is since we default GADGET, so the g_mass_storage.ko is installed early but connecting to a host PC is randomly, But the udev has no idea when a host

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Rong Wang
Hi Greg, On Tue, Jul 16, 2013 at 2:31 PM, Greg KH wrote: > On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: >> Hi Greg, >> >> The USB on our platform can change roles between HOST and GADGET, but >> it is not capable of OTG. > > That kind of sounds like the definition of OTG :) Yes.

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Peter Chen
On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: > On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: > > Hi Greg, > > > > The USB on our platform can change roles between HOST and GADGET, but > > it is not capable of OTG. > > That kind of sounds like the definition of OTG :) >

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Greg KH
On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: > Hi Greg, > > The USB on our platform can change roles between HOST and GADGET, but > it is not capable of OTG. That kind of sounds like the definition of OTG :) > When the USB changes between roles the udev will run some scripts >

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Greg KH
On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it is not capable of OTG. That kind of sounds like the definition of OTG :) When the USB changes between roles the udev will run some scripts

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Peter Chen
On Mon, Jul 15, 2013 at 11:31:17PM -0700, Greg KH wrote: On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it is not capable of OTG. That kind of sounds like the definition of OTG :) When the

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-16 Thread Rong Wang
Hi Greg, On Tue, Jul 16, 2013 at 2:31 PM, Greg KH gre...@linuxfoundation.org wrote: On Tue, Jul 16, 2013 at 11:49:07AM +0800, Rong Wang wrote: Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it is not capable of OTG. That kind of sounds like the definition of

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-15 Thread Rong Wang
Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it is not capable of OTG. When the USB changes between roles the udev will run some scripts automatically according to the udev rules. The default role is GADGET, and we bind the g_mass_storage to the USB GADGET role.

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-15 Thread Greg KH
On Mon, Jul 15, 2013 at 11:57:24AM +0800, Rong Wang wrote: > usb: udc: add gadget state kobject uevent > > Add USB_UDC_STATE environment variable in udc uevent > callback and trigger kobject_uevent in usb_gadget_set_state > to inform the user-space the state of the gadget. Why?

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-15 Thread Greg KH
On Mon, Jul 15, 2013 at 11:57:24AM +0800, Rong Wang wrote: usb: udc: add gadget state kobject uevent Add USB_UDC_STATE environment variable in udc uevent callback and trigger kobject_uevent in usb_gadget_set_state to inform the user-space the state of the gadget. Why? And

Re: [PATCH] usb: udc: add gadget state kobject uevent

2013-07-15 Thread Rong Wang
Hi Greg, The USB on our platform can change roles between HOST and GADGET, but it is not capable of OTG. When the USB changes between roles the udev will run some scripts automatically according to the udev rules. The default role is GADGET, and we bind the g_mass_storage to the USB GADGET role.

[PATCH] usb: udc: add gadget state kobject uevent

2013-07-14 Thread Rong Wang
usb: udc: add gadget state kobject uevent Add USB_UDC_STATE environment variable in udc uevent callback and trigger kobject_uevent in usb_gadget_set_state to inform the user-space the state of the gadget. Signed-off-by: Rong Wang diff --git a/drivers/usb/gadget/udc-core.c

[PATCH] usb: udc: add gadget state kobject uevent

2013-07-14 Thread Rong Wang
usb: udc: add gadget state kobject uevent Add USB_UDC_STATE environment variable in udc uevent callback and trigger kobject_uevent in usb_gadget_set_state to inform the user-space the state of the gadget. Signed-off-by: Rong Wang diff --git a/drivers/usb/gadget/udc-core.c

[PATCH] usb: udc: add gadget state kobject uevent

2013-07-14 Thread Rong Wang
usb: udc: add gadget state kobject uevent Add USB_UDC_STATE environment variable in udc uevent callback and trigger kobject_uevent in usb_gadget_set_state to inform the user-space the state of the gadget. Signed-off-by: Rong Wang rong.w...@csr.com diff --git

[PATCH] usb: udc: add gadget state kobject uevent

2013-07-14 Thread Rong Wang
usb: udc: add gadget state kobject uevent Add USB_UDC_STATE environment variable in udc uevent callback and trigger kobject_uevent in usb_gadget_set_state to inform the user-space the state of the gadget. Signed-off-by: Rong Wang rong.w...@csr.com diff --git