if (!config)
return -ENOMEM;
- config->fsg.nluns = 1;
+ config->fsg.nluns = 2;
config->fsg.luns[0].removable = 1;
+ config->fsg.luns[1].removable = 1;
common = fsg_common_init(NULL, cdev, &config->fsg);
if (IS_ERR(common)) {
err = sysfs_create_link(&f->dev->kobj,
&common->luns[0].dev.kobj,
"lun");
+ err = sysfs_create_link(&f->dev->kobj,
+ &common->luns[1].dev.kobj,
+ "lun1");
if (err) {
kfree(config);
return err;
#include <linux/usb/composite.h>
#include <asm/unaligned.h>
+static int gadget_connected = 0;
/*
* The code in this file is utility code, used to build a gadget driver
* from one or more "function" drivers, one or more "configuration"
/* when we return, be sure our power usage is valid */
power = c->MaxPower ? c->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW;
+ /* usb gadget connect flag */
+ gadget_connected = 1;
done:
usb_gadget_vbus_draw(gadget, power);
if (result >= 0 && cdev->delayed_status)
reset_config(cdev);
if (cdev->driver->disconnect)
cdev->driver->disconnect(cdev);
+ /* usb gadget connect flag */
+ gadget_connected = 0;
spin_unlock_irqrestore(&cdev->lock, flags);
}
+int get_gadget_connect_flag( void )
+{
+ return gadget_connected;
+}
/*-------------------------------------------------------------------------*/
static ssize_t composite_show_suspended(struct device *dev,