[Sony Xperia P, U, Sola, Go] munjeni:
Android side:

dmesg:

<3>[ 8.734497] android_usb: already disabled
<6>[ 8.746368] mtp_bind_config
<6>[ 8.746429] adb_bind_config
[COLOR="Blue"]<6>[ 8.751068] adb_open[/COLOR]
<6>[ 8.772674] Adding 65532k swap on /dev/zram0. Priority:-1 extents:1 across:65532k SS
<6>[ 8.849670] cg2900-uart cg2900-uart.0: Received Read Local Version Information with:
<6>[ 8.849670]	hci_version: 0x06
<6>[ 8.849670]	hci_revision: 0x0200
<6>[ 8.849670]	lmp_pal_version: 0x06
<6>[ 8.849670]	manufacturer: 0x0030
<6>[ 8.849670]	hci_sub_version: 0x0000
<6>[ 8.880676] cg2900-uart cg2900-uart.0: Chip supported by the CG2900 driver
<6>[ 8.880706] cg2900-uart cg2900-uart.0: Chip handler found
<6>[ 8.903076] u8500_shrm shrm_bus: Open SECURITY_MESSAGING Device
<6>[ 9.028717] android_work: sent uevent USB_STATE=CONNECTED
<6>[ 9.036499] android_work: sent uevent USB_STATE=DISCONNECTED
<6>[ 9.056030] u8500_shrm shrm_bus: Open RPC_MESSAGING Device
<6>[ 9.284057] android_usb gadget: high speed config #1: android
[COLOR="Red"]<6>[ 9.326141] u8500_shrm shrm_bus: mod-query-state from user-space[/COLOR]
[COLOR="Red"]<6>[ 9.326171] u8500_shrm shrm_bus: Sending unicast message
<7>[ 9.332183] Probe called, function 1[/COLOR]
<6>[ 9.339111] android_work: sent uevent USB_STATE=CONNECTED
<6>[ 9.348663] android_work: sent uevent USB_STATE=CONFIGURED

after queries... sending unicast message, after that usb state is CONNECTED and CONFIGURED. We are still at blue line with USB_STATE DISCONNECTED but everything is writen to sysfs like (manufacturer, vendor, config=mass_storage,adb, enable 1...etc) so we only need to send RPC packet for enabling usb?!

"mod-query-state from user-space" is interested too :)

Edit:

Maybe we need to setprop boot.complete 1 ??? See this:

+/**
+ * isa_open() - Open device file
+ * @inode:	structure is used by the kernel internally to represent files
+ * @filp:	device file descriptor
+ *
+ * This function performs initialization tasks needed to open SHRM channel.
+ * Following tasks are performed.
+ * -return if device is already opened
+ * -create uplink FIFO
+ * -create downlink FIFO
+ * -init delayed workqueue thread
+ * -register to l2mux driver
+ */
+static int isa_open(struct inode *inode, struct file *filp)
+{
+	int err = 0;
+	u8 m;
+	int idx;
+	struct isadev_context *isadev;
+	struct isa_driver_context *isa_context = container_of(
+	inode->i_cdev,
+	struct isa_driver_context,
+	cdev);
+	struct shrm_dev *shrm = isa_context->isadev->dl_queue.shrm;
+
+	dev_dbg(shrm->dev, "%s IN\n", __func__);
+
[COLOR="Red"]+	if (get_boot_state() != BOOT_DONE) {
+	dev_err(shrm->dev, "Boot is not done\n");
+	return -EBUSY;
+	}[/COLOR]
+	mutex_lock(&isa_lock);
+	m = iminor(inode);
+
+	if ((m != RPC_MESSAGING) &&
+	(m != AUDIO_LOOPBACK_MESSAGING) &&
+	(m != COMMON_LOOPBACK_MESSAGING) &&
+	(m != AUDIO_MESSAGING) &&
+	(m != SECURITY_MESSAGING) &&
+	(m != CIQ_MESSAGING) &&
+	(m != RTC_CAL_MESSAGING)) {
+	dev_err(shrm->dev, "No such device present\n");
+	mutex_unlock(&isa_lock);
+	return -ENODEV;
+	}
+	idx = shrm_get_cdev_index(m);
+	if (idx < 0) {
+	dev_err(shrm->dev, "failed to get index\n");
+	mutex_unlock(&isa_lock);
+	return idx;
+	}
+	if (!atomic_dec_and_test(&isa_context->is_open[idx])) {
+	atomic_inc(&isa_context->is_open[idx]);
+	dev_err(shrm->dev, "Device already opened\n");
+	mutex_unlock(&isa_lock);
+	return -EBUSY;
+	}
+	isadev = &isa_context->isadev[idx];
+	filp->private_data = isadev;
+
+	switch (m) {
+	case RPC_MESSAGING:
+	isadev->addr = NULL;
[COLOR="Red"]+	dev_info(shrm->dev, "Open RPC_MESSAGING Device\n");[/COLOR]
+	break;
+	case AUDIO_MESSAGING:
+	isadev->addr = NULL;
+	dev_info(shrm->dev, "Open AUDIO_MESSAGING Device\n");
+	break;
+	case SECURITY_MESSAGING:
+	isadev->addr = NULL;
+	dev_info(shrm->dev, "Open SECURITY_MESSAGING Device\n");
+	break;
+	case COMMON_LOOPBACK_MESSAGING:
+	isadev->addr = kzalloc(10 * 1024, GFP_KERNEL);
+	if (!isadev->addr) {
+	mutex_unlock(&isa_lock);
+	return -ENOMEM;
+	}
+	dev_info(shrm->dev, "Open COMMON_LOOPBACK_MESSAGING Device\n");
+	break;
+	case AUDIO_LOOPBACK_MESSAGING:
+	isadev->addr = kzalloc(10 * 1024, GFP_KERNEL);
+	if (!isadev->addr) {
+	mutex_unlock(&isa_lock);
+	return -ENOMEM;
+	}
+	dev_info(shrm->dev, "Open AUDIO_LOOPBACK_MESSAGING Device\n");
+	break;
+	case CIQ_MESSAGING:
+	isadev->addr = kzalloc(10 * 1024, GFP_KERNEL);
+	if (!isadev->addr) {
+	mutex_unlock(&isa_lock);
+	return -ENOMEM;
+	}
+	dev_info(shrm->dev, "Open CIQ_MESSAGING Device\n");
+	break;
+	case RTC_CAL_MESSAGING:
+	isadev->addr = NULL;
+	dev_info(shrm->dev, "Open RTC_CAL_MESSAGING Device\n");
+	break;
+	};
+
+	mutex_unlock(&isa_lock);
+	dev_dbg(shrm->dev, "%s OUT\n", __func__);
+	return err;
+}