Fix build warnings related camera
Fix build warnings related swift keypad
Fix build warnings related swift panel
Fix build warnings related swift backlight
Cleanup swift gpio i2c
Cleanup swift bma150 driver
Cleanup swift ak8973 driver
msm: audio: qdsp5: Handle EOS buffer after audio flush

EOS buffer is not getting processed in following scenario is
encountered:
-Driver Recieves FLUSH command from apps
-Application sends EOS buffer to the driver after flush
command has completed
-NEEDS_DATA messages from DSP is Recieved by driver

In above scenario driver blocks for forever in write wait queue
and EOS buffer never gets processed.

Fix this by sending wakeup when NEEDS_DATA message is received.

CRs-Fixed: 292954, 293145
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
(cherry picked from commit c729e63e1adc0b1e3b542477731e3485574150cd)

Change-Id: Iba4f7850e546d3816c31389a33984af28cca6503
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
rtc: alarm: Update hrtimer if alarm at the head of the queue is reprogrammed

If an alarm was restarted with a value that moved it away from the head
of a queue, the hrtimer would not be updated. This would cause unnecessary
wakeups.

Change-Id: I7c6dc7e6085a1f03722b2fcb14a83987ef674917
Signed-off-by: Arve Hjønnevåg <arve@android.com>
staging: binder: Fix use of uninitialized variable.

Under an extremely rare condition, the variable return_error may
not be set.  This patch initializes the value to a known "bad"
value, and checks before return to ensure return_error has been
set.

Signed-off-by: Nick Kralevich <nnk@google.com>
qdsp5: audio: Set audio stopped flag before calling wakeup

During audio flush and stop command processing, wakeup on read
and write wait queue is done first and then audio stopped flag
is set to true. If a process waiting on read and write queue gets
scheduled first before stopped flag is set then this may result in
read or write command being sent to DSP after adsp disable operation,
which is unexpected.

Fix this by setting stopped flag before calling wakeup.

Change-Id: I20ef197e572d0ffc015d6004296ea7b9f5db2806
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/audio_aac_in.c
	arch/arm/mach-msm/qdsp5/audio_evrc_in.c
	arch/arm/mach-msm/qdsp5/audio_pcm_in.c
	arch/arm/mach-msm/qdsp5/audio_qcelp_in.c
qdsp5: audio: Protect common data between ADSP ISR and flush operation

During NEEDS_DATA or BUFFER_UPDATE event processing in ISR
context, if flush command is issued by application then
there is chance of concurrent access of some of the variables
shared between ISR and Process context. This may result in race
condition causing values of these shared variables to be
inconsistent.

Fix this by protecting these variables using spin lock. Also corrected
locking sequence order in encode drivers.

Change-Id: I06b4d08053ad13d1b118ab6f29e69e95b49d133f
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/audio_aac.c
	arch/arm/mach-msm/qdsp5/audio_aac_in.c
	arch/arm/mach-msm/qdsp5/audio_amrnb.c
	arch/arm/mach-msm/qdsp5/audio_amrwb.c
	arch/arm/mach-msm/qdsp5/audio_evrc.c
	arch/arm/mach-msm/qdsp5/audio_evrc_in.c
	arch/arm/mach-msm/qdsp5/audio_mp3.c
	arch/arm/mach-msm/qdsp5/audio_pcm.c
	arch/arm/mach-msm/qdsp5/audio_qcelp.c
	arch/arm/mach-msm/qdsp5/audio_qcelp_in.c
	arch/arm/mach-msm/qdsp5/audio_wma.c
	arch/arm/mach-msm/qdsp5/audio_wmapro.c
msm: qdsp5: Avoid race condition of init info cmd being sent multiple times

GET_INIT_INFO command is sent to modem adsp service to get the information
such as task/queues supported by adsp. This command is sent whenever
msm_adsp_get() is called first time by any decoder/encoder drivers. This
command needs to be sent only once, to achieve this a global flag
init_info_cmd_sent is set in msm_get_adsp() after sending GET_INIT_INFO
command to adsp services. Currently flag init_info_cmd_sent is not
protected by any lock. Hence there is chance of GET_INIT_INFO command
being sent multiple times if there are concurrent calls to msm_adsp_get()
where each caller observes flag init_info_cmd_sent not to be set.

Fix this by protecting adsp info initialization sequence with mutex.

Change-Id: Ib0bd865d44e4687f9a85b56854e1fd3277a5707d
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
qdsp5: adsp: Add NULL check in adsp driver functions

ADSP driver functions are directly accessing module without checking
for NULL. This can result in crash if module supplied points to NULL.

Added NULL check to solve this.

Change-Id: I47eef0ea03086935ebfe33a2585ba214780e73f7
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/adsp.c
msm: qdsp5: Initialize audio stopped flag at open

Audio stopped flag is used to track if current audio recording
session is in stopped state or not. Whenever audio recording
session is stopped or released, this flag gets set to 1.
Currently this flag is not initialized to 0 during audio open or
start. From second audio recording session onwards it is causing
failure in read() as it finds audio stopped to be already set.

Fix this by initializing audio stopped flag to 0 during audio open.

Change-Id: Ibdfbf8a7b1ef9d679b474cece7f053763dbabe87
Signed-off-by: Manish Dewangan <manish@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/qdsp5/audio_voicememo.c
msm: qdsp5: Initialize event length during adsp fake event generation

During adsp fake event generation, event length is not getting
initialized. This sometimes results in incorrect event data being read
during fake event processing by adsp driver clients.

Fix this by initializing event length properly before generating the
fake event.

Change-Id: Ifcab5adf542b04eef3dc03913b8e10c68f686e8c
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Fix mistake