Re: [PATCH v6 partial v2 2/3] usb: gadget: pxa27x_udc: transfer mach_info into pxa_udc

2014-09-25 Thread Felipe Balbi
On Wed, Sep 24, 2014 at 11:06:00PM +0200, Robert Jarzmik wrote:
> Convert the mach info, and store the udc_command in the pxa_udc control
> structure.
> 
> It is to be noticed that the udc_is_connected() in mach info is not
> transfered. This was not used, as mioa701 machine doesn't need it,
> balloon3 doesn't really use it, and most importantly the current driver
> never uses it.
> 
> Signed-off-by: Robert Jarzmik 

this looks good to me.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH v6 partial v2 2/3] usb: gadget: pxa27x_udc: transfer mach_info into pxa_udc

2014-09-24 Thread Robert Jarzmik
Convert the mach info, and store the udc_command in the pxa_udc control
structure.

It is to be noticed that the udc_is_connected() in mach info is not
transfered. This was not used, as mioa701 machine doesn't need it,
balloon3 doesn't really use it, and most importantly the current driver
never uses it.

Signed-off-by: Robert Jarzmik 
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 10 +-
 drivers/usb/gadget/udc/pxa27x_udc.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c 
b/drivers/usb/gadget/udc/pxa27x_udc.c
index edad66c..e11f9c5 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -1510,11 +1510,11 @@ static void dplus_pullup(struct pxa_udc *udc, int on)
 {
if (udc->gpiod) {
gpiod_set_value(udc->gpiod, on);
-   } else if (udc->mach && udc->mach->udc_command) {
+   } else if (udc->udc_command) {
if (on)
-   udc->mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
+   udc->udc_command(PXA2XX_UDC_CMD_CONNECT);
else
-   udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
+   udc->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
}
udc->pullup_on = on;
 }
@@ -1605,7 +1605,7 @@ static int pxa_udc_pullup(struct usb_gadget *_gadget, int 
is_active)
 {
struct pxa_udc *udc = to_gadget_udc(_gadget);
 
-   if (!udc->gpiod && !udc->mach->udc_command)
+   if (!udc->gpiod && !udc->udc_command)
return -EOPNOTSUPP;
 
dplus_pullup(udc, is_active);
@@ -2416,7 +2416,7 @@ static int pxa_udc_probe(struct platform_device *pdev)
 
if (mach) {
udc->gpiod = gpio_to_desc(mach->gpio_pullup);
-   udc->mach = mach;
+   udc->udc_command = mach->udc_command;
}
 
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.h 
b/drivers/usb/gadget/udc/pxa27x_udc.h
index f025693..11e1423 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.h
+++ b/drivers/usb/gadget/udc/pxa27x_udc.h
@@ -420,7 +420,7 @@ struct udc_stats {
  * @usb_gadget: udc gadget structure
  * @driver: bound gadget (zero, g_ether, g_mass_storage, ...)
  * @dev: device
- * @mach: machine info, used to activate specific GPIO
+ * @udc_command: machine specific function to activate D+ pullup
  * @gpiod: gpio descriptor of gpio for D+ pullup (or NULL if none)
  * @transceiver: external transceiver to handle vbus sense and D+ pullup
  * @ep0state: control endpoint state machine state
@@ -447,7 +447,7 @@ struct pxa_udc {
struct usb_gadget   gadget;
struct usb_gadget_driver*driver;
struct device   *dev;
-   struct pxa2xx_udc_mach_info *mach;
+   void(*udc_command)(int);
struct gpio_desc*gpiod;
struct usb_phy  *transceiver;
 
-- 
2.0.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html