Revert "Update HTC baterry driver" - Reported battery drain. Others reverted as well.

This reverts commit aaede7169ef7686facc4044b794eec9ec6b5421d.
Cover some missing intellidemand features.
intellidemand: adjust browsing state detection to be smarter.
Reapply "Update HTC baterry driver" - Battery drain reports premature.
This reverts commit a75c5c232136ee5d41c68b19b545aeb58c5bb411.
RCU: Joe's RCU

Forward port jRCU to linux-3.0.

Thanks goes to Francisco Franco for his help
in testing out this version on the Android
Galaxy Nexus phone.

Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Ezekeel <notezekeel@googlemail.com>
Makefile:  add -mno-unaligned-access flag for better Linaro 4.7 compatibility
SCHEDULER: Autogroup patch group by current user android UID instead of task ID
Asynchronous I/O latency to a solid-state disk greatly increased

between the 2.6.32 and 3.0 kernels. By removing the plug from
do_io_submit(), we observed a 34% improvement in the I/O latency.

Unfortunately, at this level, we don't know if the request is to
a rotating disk or not.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: linux-aio@kvack.org
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
mmc: host: sdhci: Allow use of controller's native max blocksize

Currently, any controller supporting a blocksize of 4K or higher
is bumped back down to 512 bytes. This change allows using the
controller's native blocksize on a per-hardware basis.
SOURCE: Add zsmalloc from mainline linux 3.5
imoseyon - (modified) reduce wakelocks by  wifi
mm: adjust vm ratios

increase swappiness by 50%
decrease dirty_ratio by 50%
include: mm: increase readahead buffer
block/deadline: tweaked for better performance on android
net: wireless: bcmdhd: Fix division by 0 if dhd_watchdog_ms is 0

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
USB forced fast charge

Conflicts:

	arch/arm/mach-msm/Makefile

Conflicts:
	arch/arm/mach-msm/Kconfig
defconfig: update defconfig
USB forced fast charge

Conflicts:

	arch/arm/mach-msm/Makefile

Conflicts:
	arch/arm/mach-msm/Kconfig
USB forced fast charge v2

Soft force mode has been added (= mode 2).

In this mode fast charge will only kick in if no USB device is detected (as should be the case for wall/car chargers). Please note that in this case fast charge will NOT work on a USB 2.0 and 3.0 port on a computer !

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

Consider this beta, it needs testing !

USB forced fast charge v2

Soft force mode (2) is validated.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

For informational purposes I've also added a read-only sysfs file that indicates the USB port type : (new)

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

Corrected wrong detection of USB cable unplugged to reset "USB_porttype_detected", just informational, so nothing important, but it was wrong nonetheless and needed correcting.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * 0 - No USB device currently attached
 * 1 - USB device currently attached

For informational purposes I've also added a read-only sysfs file that indicates the USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

/sys/kernel/fast_charge/USB_peripheral_detected returns clear text now as well.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The state will be returned in clear text (Yes/No).

For informational purposes I've also added a read-only sysfs file that indicates the detected USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

USB forced fast charge v2

Small correction, forgot to remove the old line of code.

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The state will be returned in clear text (Yes/No).

For informational purposes I've also added a read-only sysfs file that indicates the detected USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.
USB forced fast charge v3

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added a read-only sysfs file that indicates the current USB state :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The state will be returned in clear text (Yes/No).

For informational purposes I've also added a read-only sysfs file that indicates the detected USB port type :

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

For informational purposes I've also added a read-only sysfs file that indicates if fast charge is currently being forced :

 * /sys/kernel/fast_charge/is_fast_charge_forced (ro)
 *
 * The current force state will be returned in clear text (Yes/No).
 *
 * (requested by hawkeyexp)
USB forced fast charge v3.1

Use sysfs interface to change behaviour :

 * /sys/kernel/fast_charge/force_fast_charge (rw)
 *
 *   0 - disabled (default)
 *   1 - substitute AC to USB charging always
 *   2 - substitute AC to USB charging only if no USB peripheral is detected

For informational purposes I've also added the following read-only sysfs files :

 * /sys/kernel/fast_charge/USB_peripheral_detected (ro)
 *
 * The detection state will be returned in clear text (Yes/No).

 * /sys/kernel/fast_charge/USB_porttype_detected (ro)
 *
 * The port type will be returned in clear text.

 * /sys/kernel/fast_charge/is_fast_charge_forced (ro)
 *
 * The current force state will be returned in clear text (Yes/No).
 *
 * (requested by hawkeyexp)

New :

 * /sys/kernel/fast_charge/current_charge_mode (ro)
 *
 * The current charge mode will be returned in clear text (Discharging/AC/USB).
 *
 * (requested by hawkeyexp)