battery: Implement improved charging algorithm A port of charginghacks for the Samsung Infuse, this implements a stepped charging algorithm - 800 mA at low battery, dropping to 550 as battery fills up. This should be less stressful on the battery than 800 mA all the way.

In addition, it terminates charge at a higher current threshold than before,
which provides slightly less battery capacity but should improve battery
lifetime in terms of capacity retention over time.  This is especially important
on a unit without a replacable battery.

Signed-off-by:  Andrew Dodd <atd7@cornell.edu>
JHash 3
cpuidle: commit 7467571f4480b273007517b26297c07154c73924 upstream.

Cpuidle menu governor is using u32 as a temporary datatype for storing
nanosecond values which wrap around at 4.294 seconds. This causes errors
in predicted sleep times resulting in higher than should be C state
selection and increased power consumption. This also breaks cpuidle
state residency statistics.
mmc: core: eMMC in Sleep mode before suspend

Put MMC to sleep if it supports SLEEP/AWAKE (CMD5)
in the mmc suspend so that Vcc (NAND core) can be cut
to minimize power consumption.
eMMC put into SLEEP can respond to CMD0 or H/W reset or CMD5.
Current implemention on resume from suspend relies on CMD0 in
mmc_init_card to get out of SLEEP mode.

Signed-off-by: Balaji T K <balajitk <at> ti.com>
Acked-by: Venkatraman S <svenkatr <at> ti.com>
input: evdev: Add missing wake_lock_destroy

Signed-off-by: Benoit Goby <benoit@android.com>
genirq: pm: Fix the enable ordering in resume
usb battery drain fix by farmatito
USB: Fix unplug of device with active streams

upstream commit: b214f191d95ba4b5a35aebd69cd129cf7e3b1884

If I unplug a device while the UAS driver is loaded, I get an oops
in usb_free_streams().  This is because usb_unbind_interface() calls
usb_disable_interface() which calls usb_disable_endpoint() which sets
ep_out and ep_in to NULL.  Then the UAS driver calls usb_pipe_endpoint()
which returns a NULL pointer and passes an array of NULL pointers to
usb_free_streams().

I think the correct fix for this is to check for the NULL pointer
in usb_free_streams() rather than making the driver check for this
situation.  My original patch for this checked for dev->state ==
USB_STATE_NOTATTACHED, but the call to usb_disable_interface() is
conditional, so not all drivers would want this check.

Note from Sarah Sharp: This patch does avoid a potential dereference,
but the real fix (which will be implemented later) is to set the
.soft_unbind flag in the usb_driver structure for the UAS driver, and
all drivers that allocate streams.  The driver should free any streams
when it is unbound from the interface.  This avoids leaking stream rings
in the xHCI driver when usb_disable_interface() is called.

This should be queued for stable trees back to 2.6.35.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: stable@kernel.org
[SCRIPT] optimization of the building script to take automatically all the modules. Thanks @Entropy512
Merge branch 'master' of github.com:Belphemur/Galaxy-Player-4.0-Kernel