Revert Faux Sound Control - Squash commits from version 3.2 - version 3.6

Sound Control: add line gain to cached and register lock

bump version to 3.6

Signed-off-by: Paul Reioux <reioux@gmail.com>

(cherry picked from commit 2196eda56b495cc8f41553f6d487337eaa33ea12)
Sound Control : WCD9320 Audio Codec aka. "FauxSound" v3.5 (squashed, details below) (faux123)

Sound Control: expose direct register manipulations to userspace

bump driver version to 3.3

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: Misc clean up for newer WCD9xxx SOCs

Bump driver version to 3.4

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	sound/soc/codecs/sound_control_3_gpl.c
Sound Control: let register lock be dependent on different hw revisions

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: separate locking mechanism for recording and playback

with newer hardware revisions coming from Qualcomm, single register lock
control isn't sufficient to cover both playback and recording usage scenarios

bump to version 3.5

Signed-off-by: Paul Reioux <reioux@gmail.com>

(cherry picked from commit 7ed080f04ae4a0ac34c486dcf25abd428c525b20)
Sound Control : WCD9320 Audio Codec aka. "FauxSound" v3.2

sound control: add register cache

bump to version 3.2

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: (OPTIONAL) add power amp registers access control as well

Signed-off-by: Paul Reioux <reioux@gmail.com>

Sound Control: (Optional) work around for WCD93xx audio issues

(Use this only for devices with audio reset issues)

Also bump version to 3.1

Signed-off-by: Paul Reioux <reioux@gmail.com>

wcd9xxx-core: add register write without mutex protection

This is assuming the calling function will take care of the mutex.

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:

	include/linux/mfd/wcd9xxx/core.h
	sound/soc/codecs/wcd9320.c

sound control: WCD9320: update speaker gain control for Z1

Signed-off-by: Paul Reioux <reioux@gmail.com>

sound control 3.x: Initial GPL release for WCD9320 Audio Codec

This is first official GPL release based on my private implementation.

This release has been tested for xperia Z officially.  It may work
with other devices using the same WCD9320 Audio Codec as well, but not tested

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:

	sound/soc/codecs/Makefile

Sound Control: WCD9320: expose additional controls

Signed-off-by: Paul Reioux <reioux@gmail.com>
Sound Control : FauxSound - fix a merge derp with new kernel base

caused bootloops
Sound Control : FauxSound - fix mic register lock issue with new kernel base (faux123)

caused mic not working when calling on speaker

NB: Previous fix wasn't wide enough.

(cherry picked from commit 2d4c7551389980b850495f35863aede36514f84e) (reverted from commit fb2e5757faf60d13317a49d31dbfbc6870967d18)

(cherry picked from commit f4d9498f6bffcf8b61c779bc47ca184b0d2ca5d3)

(cherry picked from commit f7ac198c38dd2e3dd1870d19e95949224dbccc36)
block: fiops ioscheduler core

FIOPS (Fair IOPS) ioscheduler is IOPS based ioscheduler, so only targets
for drive without I/O seek. It's quite similar like CFQ, but the dispatch
decision is made according to IOPS instead of slice.

The algorithm is simple. Drive has a service tree, and each task lives in
the tree. The key into the tree is called vios (virtual I/O). Every request
has vios, which is calculated according to its ioprio, request size and so
on. Task's vios is the sum of vios of all requests it dispatches. FIOPS
always selects task with minimum vios in the service tree and let the task
dispatch request. The dispatched request's vios is then added to the task's
vios and the task is repositioned in the sevice tree.

Unlike CFQ, FIOPS doesn't have separate sync/async queues, because with I/O
less writeback, usually a task can only dispatch either sync or async requests.
Bias read or write request can still be done with read/write scale.

One issue is if workload iodepth is lower than drive queue_depth, IOPS
share of a task might not be strictly according to its priority, request
Bias read or write request can still be done with read/write scale.

One issue is if workload iodepth is lower than drive queue_depth, IOPS
share of a task might not be strictly according to its priority, request
size and so on. In this case, the drive is in idle actually. Solving the
problem need make drive idle, so impact performance. I believe CFQ isn't
completely fair between tasks in such case too.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	block/Makefile

Conflicts:
	block/Makefile

(cherry picked from commit 7e9efecb09272538062ffb1b86ac3df16bfe6d36)

(cherry picked from commit 6b758eb860d031361a2a9ca2a4cc20e7f0608d77)

(cherry picked from commit 57f8be74b9860b8d0b0d3ecae6f27cbfe5f3824f)
block: fiops read/write request scale

read/write speed of Flash based storage usually is different. For example,
in my SSD maxium thoughput of read is about 3 times faster than that of
write. Add a scale to differenate read and write. Also add a tunable, so
user can assign different scale for read and write.

By default, the scale is 1:1, which means the scale is a noop.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit a71920957578d6f9e35db26ac905ab8883787788)

(cherry picked from commit 7737f01ee9291fd65ae2bfdf910e2e2389b98078)

(cherry picked from commit 4961c42f9c2496b23c55ad2b74472d3741e9e2dc)
block: fiops sync/async scale

CFQ gives 2.5 times more share to sync workload. This matches CFQ.

Note this is different with the read/write scale. We have 3 types of
requests:
1. read
2. sync write
3. write
CFQ doesn't differentitate type 1 and 2, but request cost of 1 and 2
are usually different for flash based storage. So we have both sync/async
and read/write scale here.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit 4bfc3141f7266dc450b58d5ef77d6528f30a96a6)

(cherry picked from commit 16ed5da99cb186e4b6084244b710623a3c8414d7)

(cherry picked from commit 90a6d2f2fa90a4d51624bec358b6ae23761c18a1)
block: fiops add ioprio support

Add CFQ-like ioprio support. Priority A will get 20% more share than priority
A+1, which matches CFQ.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit 25728f04bc32dcd7ef570f861d1e28b4bd8b4083)

(cherry picked from commit c02307c0ea45f45e59feb44d76168bcc427ab731)

(cherry picked from commit ce38b16de264705f2c91a1656995e681505bdf38)
block: fiops preserve vios key for deep queue depth workload

If the task has running request, even it's added into service tree newly,
we preserve its vios key, so it will not lost its share. This should work
for task driving big queue depth. For single depth task, there is no approach
to preserve its vios key.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit 1942dfc4a03403d7912ef7ea43f994f9c563ceb5)

(cherry picked from commit b3ed9ff825a729936b394daacd98cc9984e44a15)

(cherry picked from commit 5283c34ad7502a11d39029e2642acb7555879dc3)
block: fiops bias sync workload

If there are async requests running, delay async workload. Otherwise
async workload (usually very deep iodepth) will use all queue iodepth
and later sync requests will get long delayed. The idea is from CFQ.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit 9ab45eadf75156bd5471d4dd3faab93e08b8479d)

(cherry picked from commit 62504ada424273a86bc51a92f26121beef70a340)

(cherry picked from commit bd4a2c041756e41c2c3ee320222ebd3b6d98f564)
block: fiops add some trace information

Add some trace information, which is helpful when I do debugging.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

(cherry picked from commit b10664f003a9500f0877c29c235909e3d381c494)

(cherry picked from commit 2918052d30a89a50d860346be49fd92243c65f5d)

(cherry picked from commit f7c483e2a0a1fb5a20d73c7355fd57382b407f15)
FIOPS: forward port for use on 3.10 Linux

Signed-off-by: Paul Reioux <reioux@gmail.com>

(cherry picked from commit 60ff0f713df0fdbe4fac36289c86fe6363a8b798)

(cherry picked from commit 2f089ae6c7f5218e0de8878929283d02a2055ff7)

(cherry picked from commit 9abff99a0ae498600776cb757ef080006e81a06e)
Sound Control: initial bring up for Nexus 6 Linux 3.10 kernel driver

Initial import of FauxSound Driver 3.6 from 3.4 linux kernel drivers tailored
for Nexus 6

GPL Copyright 2014 Paul Reioux (Faux123)

Signed-off-by: Paul Reioux <reioux@gmail.com>

(cherry picked from commit 792a3cf30ba3cb4e1e6fb28285a632e42598a041)

(cherry picked from commit 18f0b750d4fa4770726589a8e0ce1ebfb248e835)