msm: smd_pkt: Handle wakelocks appropriately to optimize power usage

If the user-space application performs a poll() operation before a
read() operation, then release the wakelock in the read operation.
This is under the assumption that user-space application can grab a
wakelock between poll() and read() operations. If the user-space
application does not perform poll() operation at all before read()
operation, then allow the wakelock to timeout and release itself.

CRs-Fixed: 337654
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit 048ef381aca6b150953a4e6d9b196778589f8e71)

Change-Id: I3cb6e1b06dbb08522dd66dcd8f5cfe4069fefdb1
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>

msm: smd_pkt: Add packet arrival wakelock

While handling the incoming packets from remote subsystems, delay the
system suspension by holding a wakelock with a timeout value of 2 seconds.
This will allow the user-space clients to process the incoming packets
before the system goes to suspend.

(cherry picked from commit c3c5cd93233bccaff0d0230932a5e387ce8dcd4a)

Change-Id: I488f795b76c8aad546a9b14b004d6a59be63b01c
CRs-Fixed: 335782
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW

The maximum current draw was hard coded to 500 mA.  composite.c
has code that uses CONFIG_USB_GADGET_VBUS_DRAW to set the
bMaxPower and to set whether or not the device is self-powered if
they haven't been set.  This change removes the code in android.c
to allow composite.c to set them.

Change-Id: I9db37922e91ee86e9e5c0e14519e119e5c41ca48
Signed-off-by: Scott Anderson <saa@google.com>
usb: gadget: android: Fix product name

Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: Benoit Goby <benoit@android.com>