MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
static char composite_manufacturer[50];
-
+static int gadget_connected = 0;
/*-------------------------------------------------------------------------*/
/**
goto done;
cdev->config = c;
+
+ /* reset delay status to zero every time usb reconnect */
+ cdev->delayed_status = 0;
/* Initialize all interfaces by setting them to altsetting zero. */
for (tmp = 0; tmp < MAX_CONFIG_INTERFACES; tmp++) {
/* when we return, be sure our power usage is valid */
power = c->bMaxPower ? (2 * c->bMaxPower) : CONFIG_USB_GADGET_VBUS_DRAW;
+
+ /* usb gadget connect flag */
+ gadget_connected = 1;
done:
usb_gadget_vbus_draw(gadget, power);
reset_config(cdev);
if (composite->disconnect)
composite->disconnect(cdev);
+ /* usb gadget connect flag */
+ gadget_connected = 0;
spin_unlock_irqrestore(&cdev->lock, flags);
}
/*-------------------------------------------------------------------------*/
+int get_gadget_connect_flag( void )
+{
+ return gadget_connected;
+}
+EXPORT_SYMBOL(get_gadget_connect_flag);
static ssize_t composite_show_suspended(struct device *dev,
struct device_attribute *attr,
composite_setup_complete(cdev->gadget->ep0, req);
}
}
+ else{
+ WARN(cdev, "%s: Unexpected delayed status 0x%x\n", __func__, cdev->delayed_status);
+ }
spin_unlock_irqrestore(&cdev->lock, flags);
}
#include <linux/reboot.h>
#include <linux/syscalls.h>
-static int usb_msc_connected; /*usb charge status*/
-
-static void set_msc_connect_flag( int connected )
-{
- printk("%s status = %d 20101216\n" , __func__, connected);
- if( usb_msc_connected == connected )
- return;
- usb_msc_connected = connected;//usb mass storage is ok
-}
-
-int get_msc_connect_flag( void )
-{
- return usb_msc_connected;
-}
-EXPORT_SYMBOL(get_msc_connect_flag);
#endif
/*------------------------------------------------------------------------*/
struct fsg_dev *fsg = fsg_from_func(f);
fsg->common->new_fsg = NULL;
raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
- // yk 201009
- set_msc_connect_flag(0);
}