Revert "HACK: power: make wakelocks work"

This reverts commit fa166e47ad34a583f730b34f38d7d25eb5f2864c.
Revert "PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock"

This reverts commit 11388c87d2abca1f01975ced28ce9eacea239104.
Standalone recovery defconfig for gta04

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
omapfb: Default to 16 bits per pixel

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
bq27x00: Shortly retry more often to update data after inconsistent states

This is especially relevant when an external power supply is plugged:
bq27x00_external_power_changed will trigger bq27x00_battery_poll immediately,
though the battery might not have yet detected the change and will still
report discharging status. This makes the driver try to reach a consistent
state for a few seconds by polling the battery every 2 seconds.

The same issue happens when an external power is unplugged: the battery
will still report charging status.

Since the bq27x00 is not driven by interrupt, this change makes it possible to
detect the status change as soon as possible while still giving up shortly if
it cannot reach a consistent state.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
bq27x00: Always report charge information

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
twl4030 charger: Declare supplicants from platform data

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
gta04: bq27000-battery supplicant for twl4030 charger

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Revert "Android Gadget: make ADB work"

This reverts commit 4f6caa8b5bda4c2d4103568bed5a25acf443924a.
Revert "usb: gadget: adb: Add ADB function"

This reverts commit 85a5ad272ffb64067b8dd3c72a631c54169b6153.
Revert "Android Gadget: disable android_acm for now, to prevent kernel panic."

This reverts commit d395bccb46686f961351d20d79b2e879d8650aec.
Revert "gadget/android.c: fix compilation on 3.11"

This reverts commit 941b99efa3dd974009fbaa5e932825343d533f8a.
Revert "Import Android gadget driver"

This reverts commit c51e7924d64de814cfdeff2b415ab6b721d49254.
usb: gadget: Add Android Composite Gadget driver

The Android Gadget driver is a composite driver that allows
userspace to change at runtime the list of functions enabled in
its configuration and to configure these functions. It supports
multiple functions: acm, adb, rndis, mtp/ptp, mass storage and
accessory.

It is usually controlled by a daemon that changes the configuration
based on user settings. For example, rndis is enabled when the user
enables sharing the phone data connection and adb (Android Debug
Bridge) is only enabled when the user wants to debug applications
for security reasons.

As an example on how to use it, the following shell commands will
make the gadget disconnect from the host and make it be re-enumerated
as a composite with 1 rndis and 2 acm interfaces, and a different
product id:

echo 0       > /sys/class/android_usb/android0/enable
echo rndis,acm > /sys/class/android_usb/android0/functions
echo 2       > /sys/class/android_usb/android0/f_acm/instances
echo 2d01    > /sys/class/android_usb/android0/idProduct
echo 1       > /sys/class/android_usb/android0/enable

The driver requires a gadget controller that supports software
control of the D+ pullup and the controller driver must support
disabling the pullup during composite_bind.

Signed-off-by: Mike Lockwood <lockwood@android.com>
Signed-off-by: Benoit Goby <benoit@android.com>
usb: gadget: mtp: Add MTP/PTP function

USB gadget function driver used by the Android framework to
implement the MTP and PTP protocols. It creates a character device
that provides an interface for fast transfer of files and
supports transferring files greater than 4GB.

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: adb: Add ADB function

Android Debug Bridge (adb) is a command line tool that lets
users communicate with a Android-powered device. It is used
mainly to debug applications and tranfer files. f_adb implements
the transport layer between the ADB Server (on the host) and the
ADBD daemon (on the device).

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: accessory: Add Android Accessory function

USB accessory mode allows users to connect USB host hardware
specifically designed for Android-powered devices. The accessories
must adhere to the Android accessory protocol outlined in the
http://accessories.android.com documentation. This allows
Android devices that cannot act as a USB host to still interact with
USB hardware. When an Android device is in USB accessory mode, the
attached Android USB accessory acts as the host, provides power
to the USB bus, and enumerates connected devices.

Signed-off-by: Mike Lockwood <lockwood@android.com>
usb: gadget: adb: allow freezing in adb_read

wait_event_interruptible in adb_read might return -ERESTARTSYS if
userspace is frozen during adb_read or another signal is delivered
to adb.  If so, don't set dev->error to avoid resetting the adb
connection.

Change-Id: I5a7baa013a9a3a3b5305de7e6a0d18546a560018
Signed-off-by: Colin Cross <ccross@android.com>
usb: gadget: adb: do not set error flag when dequeuing req

When an ep_out req is dequeued because of userspace freezing,
don't set the error flag.

Change-Id: I680f1a1059b8ac2244aaa069e7d42dc44abf98e9
Signed-off-by: Colin Cross <ccross@android.com>
usb: gadget: adb: Only enable the gadget when adbd is ready

When adb is enabled, only connect the gadget when adbd is ready. If adbd
dies or is restarted (e.g. "adb root"), the gadget is disconnected when
the adb device is close, and it is re-connected once adb re-open the
device.

- Add callbacks to adb, similar to FunctionFs callbacks, to notify the
  gadget when the daemon is ready or closed.
- Refcount calls to android_enable/android_disable to enable the gadget
  only once all the function daemons are ready.
- Add enable/disble to android_usb_function to notify the function when
  it is added/removed from the list of enabled functions.

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