Patchwork [U-Boot] usb:udc:samsung Add functions for storing private gadget data in UDC driver

login
register
mail settings
Submitter Łukasz Majewski
Date April 12, 2012, 7:16 a.m.
Message ID <1334214969-19664-1-git-send-email-l.majewski@samsung.com>
Download mbox | patch
Permalink /patch/151988/
State Changes Requested
Delegated to: Marek Vasut
Headers show

Comments

Łukasz Majewski - April 12, 2012, 7:16 a.m.
This commit adds support for storing private data to Samsung's UDC
driver. This data is afterward used by usb gadget.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
---
 drivers/usb/gadget/s3c_udc_otg.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Marek Vasut - April 14, 2012, 9:48 a.m.
Dear Lukasz Majewski,

> This commit adds support for storing private data to Samsung's UDC
> driver. This data is afterward used by usb gadget.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
>  drivers/usb/gadget/s3c_udc_otg.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c_udc_otg.c
> b/drivers/usb/gadget/s3c_udc_otg.c index f7f7b54..cb4916c 100644
> --- a/drivers/usb/gadget/s3c_udc_otg.c
> +++ b/drivers/usb/gadget/s3c_udc_otg.c
> @@ -133,6 +133,18 @@ static void nuke(struct s3c_ep *ep, int status);
>  static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
>  static void s3c_udc_set_nak(struct s3c_ep *ep);
> 
> +void set_udc_gadget_private_data(void *p)
> +{
> +	printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,
> +	       the_controller, p);
> +	the_controller->gadget.dev.device_data = p;
> +}
> +
> +void *get_udc_gadget_private_data(struct usb_gadget *gadget)
> +{
> +	return gadget->dev.device_data;
> +}
> +

Is this part of some bigger patchset or are you simply adding dead code?

>  static struct usb_ep_ops s3c_ep_ops = {
>  	.enable = s3c_ep_enable,
>  	.disable = s3c_ep_disable,

Best regards,
Marek Vasut
Wolfgang Denk - April 14, 2012, 1:47 p.m.
Dear Lukasz Majewski,

In message <1334214969-19664-1-git-send-email-l.majewski@samsung.com> you wrote:
> This commit adds support for storing private data to Samsung's UDC
> driver. This data is afterward used by usb gadget.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
...
> +void set_udc_gadget_private_data(void *p)
> +{
> +	printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,

s/printf/debug/ ??


Best regards,

Wolfgang Denk
Łukasz Majewski - April 16, 2012, 9:33 a.m.
Hi Marek Vasut,

> Dear Lukasz Majewski,
> 
> > This commit adds support for storing private data to Samsung's UDC
> > driver. This data is afterward used by usb gadget.
> > 
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Marek Vasut <marex@denx.de>
> > ---
> >  drivers/usb/gadget/s3c_udc_otg.c |   12 ++++++++++++
> >  1 files changed, 12 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/s3c_udc_otg.c
> > b/drivers/usb/gadget/s3c_udc_otg.c index f7f7b54..cb4916c 100644
> > --- a/drivers/usb/gadget/s3c_udc_otg.c
> > +++ b/drivers/usb/gadget/s3c_udc_otg.c
> > @@ -133,6 +133,18 @@ static void nuke(struct s3c_ep *ep, int
> > status); static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
> >  static void s3c_udc_set_nak(struct s3c_ep *ep);
> > 
> > +void set_udc_gadget_private_data(void *p)
> > +{
> > +	printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,
> > +	       the_controller, p);
> > +	the_controller->gadget.dev.device_data = p;
> > +}
> > +
> > +void *get_udc_gadget_private_data(struct usb_gadget *gadget)
> > +{
> > +	return gadget->dev.device_data;
> > +}
> > +
> 
> Is this part of some bigger patchset or are you simply adding dead
> code?

Yes, this is the part of a bigger patchset :-) - the composite gadget
(g_dnl) requires this change.

e.g.

http://patchwork.ozlabs.org/patch/151989/

> 
> >  static struct usb_ep_ops s3c_ep_ops = {
> >  	.enable = s3c_ep_enable,
> >  	.disable = s3c_ep_disable,
> 
> Best regards,
> Marek Vasut
Marek Vasut - April 16, 2012, 9:41 a.m.
Dear Lukasz Majewski,

> Hi Marek Vasut,
> 
> > Dear Lukasz Majewski,
> > 
> > > This commit adds support for storing private data to Samsung's UDC
> > > driver. This data is afterward used by usb gadget.
> > > 
> > > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > > Cc: Marek Vasut <marex@denx.de>
> > > ---
> > > 
> > >  drivers/usb/gadget/s3c_udc_otg.c |   12 ++++++++++++
> > >  1 files changed, 12 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/usb/gadget/s3c_udc_otg.c
> > > b/drivers/usb/gadget/s3c_udc_otg.c index f7f7b54..cb4916c 100644
> > > --- a/drivers/usb/gadget/s3c_udc_otg.c
> > > +++ b/drivers/usb/gadget/s3c_udc_otg.c
> > > @@ -133,6 +133,18 @@ static void nuke(struct s3c_ep *ep, int
> > > status); static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
> > > 
> > >  static void s3c_udc_set_nak(struct s3c_ep *ep);
> > > 
> > > +void set_udc_gadget_private_data(void *p)
> > > +{
> > > +	printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,
> > > +	       the_controller, p);
> > > +	the_controller->gadget.dev.device_data = p;
> > > +}
> > > +
> > > +void *get_udc_gadget_private_data(struct usb_gadget *gadget)
> > > +{
> > > +	return gadget->dev.device_data;
> > > +}
> > > +
> > 
> > Is this part of some bigger patchset or are you simply adding dead
> > code?
> 
> Yes, this is the part of a bigger patchset :-) - the composite gadget
> (g_dnl) requires this change.
> 
> e.g.
> 
> http://patchwork.ozlabs.org/patch/151989/

Can you please make it into a patchset then? You know -- so we all know what 
this is part of.

> 
> > >  static struct usb_ep_ops s3c_ep_ops = {
> > >  
> > >  	.enable = s3c_ep_enable,
> > >  	.disable = s3c_ep_disable,
> > 
> > Best regards,
> > Marek Vasut

Best regards,
Marek Vasut

Patch

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index f7f7b54..cb4916c 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -133,6 +133,18 @@  static void nuke(struct s3c_ep *ep, int status);
 static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
 static void s3c_udc_set_nak(struct s3c_ep *ep);
 
+void set_udc_gadget_private_data(void *p)
+{
+	printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,
+	       the_controller, p);
+	the_controller->gadget.dev.device_data = p;
+}
+
+void *get_udc_gadget_private_data(struct usb_gadget *gadget)
+{
+	return gadget->dev.device_data;
+}
+
 static struct usb_ep_ops s3c_ep_ops = {
 	.enable = s3c_ep_enable,
 	.disable = s3c_ep_disable,