tuna: sensors: proximity + light sensor driver

Driver for Sharp GP2A002S00F light + proximity sensor

Depends on patches I9636f271 and I9d47be44

Change-Id: I5c2e360db607dc94573a5c38e04b8e2ff814ec1b
Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>

Conflicts:
	drivers/input/misc/Kconfig
	drivers/input/misc/Makefile
tuna: sensors: Restore wakelock to proximity sensor

Restore the wakelock in a separate patch so it can be removed when
user land is repaired.

Arve Hjønnevåg: I looked some more at the user-space code, and
it is a lot of work to fix it. It puts the events back in a pipe
to deliver it to the apps, and since the user-space c wakelock
api does not support timeouts the workaround is easier to do in
the driver. If we need to wake up from this sensor, then lets
put the wakelock back in the driver as a separate patch
that can be reverted after the user-space code is fixed.

Change-Id: Ie427f00e594b3228d0b0b61481a011362e7cbcea
Signed-off-by: Marty Fouts <mfouts@sta.samsung.com>
tuna: sensors: proximity sensor driver bug fix

This change fixes a bug in the proximity sensor.

The bug is that proximity sensor did not always report a value
when it turns on.

Change-Id: Ibe68d2b04242318629686fd740c652b7d20b6a33
Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>
tuna: sensors: light sensor bug fixes

Fixed the following bugs in light sensor driver:

1. Eliminated error values from being considered as valid light values
2. Fix an off-by-one error in the averaging buffer

Change-Id: I7ec86ab0d3e423a0e736406c4f786d2933cb7e8d
Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>
gp2a: report light sensor value on enable

Driver changes to make light sensor value to be reported on
enabling light sensor.
 - On enable, push a dummy value -1 to  input subsystem

Change-Id: Icd154fc04ef78fcae2eadfde280abe19da6a7b2a
Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>
gp2a: delay first read after light sensor enable

Light sensor was delaying first time read to
poll delay milli seconds. This fix changes the
first time read delay to 50 milli seconds.

This ensures a valid first read with minimum delay.

Change-Id: Idd9ad6d51cf244131777ecab1f5526a952ed7d81
Signed-off-by: Vishnudev Ramakrishnan <vramakri@sta.samsung.com>
input: gp2a: Remove cusom filtering of adc values and set the fuzz value instead

This makes the sensor quicker to respond when the light level changes,
and reduces the number of events sent when the light level is stable.

Change-Id: I7cc1912ff5f111b4890a38a14acc3f8996d74a66
Signed-off-by: Arve Hjønnevåg <arve@android.com>
gp2a: set poll_delay to DELAY_LOWBOUND when new delay < DELAY_LOWBOUND

If a delay of 0 or some low value is passed from any apps,
then system can lock up.

Change-Id: I543d48a1e02becd1f74cc81e0212909d3e864082
Signed-off-by: Won Hyoung Lee <whlee@sta.samsung.com>