Revert "Reset Battery levels"

This reverts commit 547f4e29d6e88fb03773da97135fbb84e50f9d25.
SET GPU and Bus Clock Turbo mode to 200mhz

Actually, We are running fine on 200mhz at max only.
fs: add per-file sync disable

This is a rebase of two of arighi's patches into a single commit:
https://github.com/arighi/linux-gt-i9100/commit/924375d3872db6c16894e9d2e7c3f1b408df0e45
https://github.com/arighi/linux-gt-i9100/commit/8b19d5e1c0cc929a0821c7bf1e78d21b34caeaff

Export a new parameter in sysfs:

  /sys/module/sync/parameters/fsync_disabled

Writing 1 to this file disable all the per-file sync capabilities:
fsync(), fdatasync(), sync_file_range(); writing 0 re-enables them.

WARNING: disabling fsync may cause loss of data if application crashes
in unsafe ways! Use it only if you know what you're doing.

This has two side-effects: making software that writes data safely to
disk via fsync(), fdatasync() or sync_file_range() a lot quicker and
battery safe, but also making the software no longer crash safe.

Filesystem buffers will be flushed all at once by the kernel or by
calling the sync() syscall (that is still enabled).

Signed-off-by: Andrea Righi <andrea@betterlinux.com>
Acked-by:  Andrew Dodd <atd7@cornell.edu>
msm: qdsp5: Real Video Decoder support

This change is to support Real Video decoder. 0x9201 is the
frame header ID for Real decoder. Slice data has YUV
buffer addresses where DSP has to write decoded data, but
these addresses are virtual addresses. This code is added to
convert virtual addresses to physical addresses before
passing them to DSP.

Change-Id: Ib129047291558d55708d31994f723ac332ce5092
Signed-off-by: Mahesh Lanka <mlanka@codeaurora.org>
Board : Finalize Memory and Clk values
Update Default Config
base: genlock: Properly destroy handle resources

The resources allocated for a handle were not being freed on device
release.  This included releasing the lock.  Unfortunately, the
lock release had a fput() too many which was screwing up the
reference counting on the file descriptors.  When attaching a lock,
we only need the file pointer for a short time so fput() it back
immediately.  That way, only there will only be one reference to
the lock per process, and the process will be responsible for
closing the fd directly and the fput() in genlock_release_lock
is no longer needed.

CRs-fixed: 322645
Change-Id: Ic0dedbad55300a2f8463c800cf8361719583b0b8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Avoid a race condition when releasing locks

Avoid a race condition if a lock gets released by all owners
but a process fails to close a lock file descriptor and tries
to reuse it.  Clearing the pointers to the data will ensure
that attaching a dead lock will return an error.

Change-Id: Ic0dedbadd693c7a22b027052cdd247370b28a7c5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Add error messages for failure cases

Signed-off-by: Naomi Luis <nluis@codeaurora.org>
Change-Id: I833e480abfc11ce4aa00a5ae46144895429a0339
base: genlock: Check for instances where handle is NULL

Check for the possibility of NULL handles passed into the
in-kernel API functions and return error where appropriate.
There is a non-zero chance that the private_data will be
cleared while the FD is still active, so check in the ioctl()
function as well.

(cherry picked from commit a73ed097420c53451e843ae61d9aadc8fefabc94)

Change-Id: If481b98a6a2ab01ab788c23bffe9df7ab8bc6aee
CRs-fixed: 332835
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Remove genlock_release_lock and associated ioctl

Allowing a lock to be asynchronously released while a handle
was still active turned out to be too dangerous to use in a
multi-threaded environment and it served no pratical
purpose anyway.  Handles now hold an attached lock until they
are destroyed.

CRs-fixed: 333141
Change-Id: Ic0dedbad8050ff01927ddb165c65a939bf297c10
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: allow synchronization with a single gralloc handle

In order to support synchronization in a process with a single
gralloc handle we require the ability to write lock a buffer
while it is already read locked by the same handle. This change
extends the concept of an exclusive write lock or recursive read
locks to a genlock handle (rather than the genlock lock).
Genlock cannot provide deadlock protection because the same
handle can be used simultaneously by a producer and consumer.
In practice an error will still be generated when the timeout
expires.

CRs-fixed: 356263

Signed-off-by: Jeff Boody <jboody@codeaurora.org>
(cherry picked from commit 6d9076fe46bcba71986a25cf357e71a4d83958c1)

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