timekeeping: fix 32-bit overflow in get_monotonic_boottime

get_monotonic_boottime adds three nanonsecond values stored
in longs, followed by an s64.  If the long values are all
close to 1e9 the first three additions can overflow and
become negative when added to the s64.  Cast the first
value to s64 so that all additions are 64 bit.

Change-Id: Ic996d8b6fbef0b72f2d027b0d8ef5259b5c1a540
Signed-off-by: Colin Cross <ccross@android.com>
netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>
netfilter: xt_qtaguid: start tracking iface rx/tx at low level

qtaguid tracks the device stats by monitoring when it goes up and down,
then it gets the dev_stats().
But devs don't correctly report stats (either they don't count headers
symmetrically between rx/tx, or they count internal control messages).

Now qtaguid counts the rx/tx bytes/packets during raw:prerouting and
mangle:postrouting (nat is not available in ipv6).

The results are in
  /proc/net/xt_qtaguid/iface_stat_fmt
which outputs a format line (bash expansion):
  ifname  total_skb_{rx,tx}_{bytes,packets}

Added event counters for pre/post handling.
Added extra ctrl_*() pid/uid debugging.

Change-Id: Id84345d544ad1dd5f63e3842cab229e71d339297
Signed-off-by: JP Abgrall <jpa@google.com>
ipv4: Check if dev_out is NULL in ip_route_output_slow()

Change-Id: If04a8e99942dbe7e099e736dc87c2a49e1e778f9
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ipv4: Skip calling fib_detect_death() if fib_dev is NULL

Change-Id: I1b8c6c7e79cb8a05b4b715ddb3299d74edef0e14
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Restore stock snddev_data_marimba.c
Some apache-specific change
Added persistent_ram and ram_console support
input: Phantom Key Presses filtering

Attempt to workaround a well known hardware bug of some Samsung devices.
Pratically, the high activity of the radio hardware, in particular the antenna, could cause interference on Melfas chip, which is located very close to the antenna.
This interference could induce bad interrupts that are seen by the chip as possible HOME, MENU or BACK key presses.
These phantom key presses are happening expecially in 2G mode.

The solution includes a new device module (phantom_kp_filter), which also allow the filtering parameters customization, and various changes to cypress-touchkey and pmic8xxx-keypad modules.

-- Phantom MENU and BACK key presses --

The solution can be divided into two parts:
- Validity check of the interrupt _3_TOUCH_INT checking for a predefined (and customizable) times that the corresponding value is 0, in fact, in the case of interference, the value can be 1, then you can decide whether or not to ignore the key press interrupt
- Validity check of the key pressed event, ignoring the possible events of key down and up on different keys (eg. MENU key down -> BACK key up), or too rapid wrong key presses

The problem and the possible workarounds are described by Electric Bill on this XDA forum thread:
http://forum.xda-developers.com/showthread.php?t=1551580

The code changes are also based on these commits made by CyanogenMod Team:
- https://github.com/CyanogenMod/android_kernel_samsung_aries/commit/4afad77c61c7cb54cce293034cdb07a928f22d20
- https://github.com/CyanogenMod/android_kernel_samsung_aries/commit/cb8fa22cba177709848321e8100ee60ee1684530

-- Phantom HOME key presses --

The solution can be divided into two parts:
- Validity check of the incoming key state, ignoring the key press if the status is not changed
- The key press states are temporarly collected inside a bit array and reported with a small delayed time, if there are too many interrupts, they could be related to radio interference, so the collected key states won't be reported to avoid phantom key presses

-- Module sysfs interface --

The new device module allow to show the number of ignored key press and to customize the filtering parameters by means of a sysfs interface, at the following system path:
/sys/class/misc/phantom_kp_filter

- home_enabled: the enabled status of the phantom HOME key presses filtering (0 = disabled, 1 = enabled)
- home_allowed_irqs: show/edit the allowed max number of incoming interrupts to consider a HOME key press as valid (from 1 to 32)
- home_report_wait: show/edit the wait time in ms before report the collected HOME key presses (from 5 to 25 ms)
- home_ignored_kp: show the ignored possible phantom HOME key presses
- menuback_enabled: show/edit the enabled status of the phantom MENU and BACK key presses filtering (0 = disabled, 1 = enabled)
- menuback_interrupt_checks: show/edit the interrupt checks number to be performed for the incoming MENU and BACK key presses (from 1 to 10)
- menuback_first_err_wait: show/edit the time in ms to wait after the first error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms)
- menuback_last_err_wait: show/edit the time in ms to wait after the last error on MENU or BACK keys if there are many invalid key errors in rapid sequence (from 50 to 1000 ms)
- menuback_ignored_kp: show the ignored possible phantom MENU and BACK key presses
- version: show the module version
Update defconfigs
ancora: Fix front cam regulator