msm: camera: Fix msm_camera_i2c_poll function call

Change-Id: Ie99e61811332054b2b7e4b0f3a05a932e988729c
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
CRs-Fixed: 348564
(cherry picked from commit e14cb2fd294c6dc2a3a825255bfafe2ce4fe4386)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: camera: Handle failure during camera open gracefully.

When the application tries to open the camera device and
the open command sent to the backend fails for some reason,
handle the error gracefully and rollback all the changes
done in the reverse order.

CRs-Fixed: 349291
Change-Id: I446db98512a0ea3b7ce7cfacad2dca45a8b91385
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
(cherry picked from commit c18d2c971cb4d5a707eb0fa15dd95a7d80f38a42)

Conflicts:

	drivers/media/video/msm/msm_mctl.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/media/video/msm/msm_mctl.c
msm: camera: Assign Null to unmapped addresses

Observed unhandled virtual addresses with all the camera drivers
while performing reads and writes to the ioremap addresses in different
scenarios, Hence assigining NULL to all the hardware remapped addresses
immediately after the iounmap calls

Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
(cherry picked from commit 72ee044121488cc9f4cde91c5e3a2b820d7a0fad)

Change-Id: I27d69a8f97d7bd944f838e3d5804ffab761be294
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:

	drivers/media/video/msm/csi/msm_csic.c
msm: camera: add fields to msm_stats_buf for cache operations.

Add a couple of fields to the msm_stats_buf structure
for cache coherence support on stats buffers from
user-space.

(cherry picked from commit 073e0cab00d6cf60279de167d8063c5e5f4b5715)

Change-Id: I4358bb9f8fff444d9879e351af29e47513d114ed
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
(cherry picked from commit 490e18c8ccde8c4450d20781faf7529c8c9d1512)
(cherry picked from commit 1467469bb4783e9fd18f2081b2c3eb044815e22b)
msm: camera: handle mediaserver crash elegantly.

This change stops the VFE first, before unmapping the buffers
registered in the kernel in the scenario of a mediaserver
crash.

(cherry picked from commit f3ae3699dd3140c857835901b68d293fb0629f85)

Change-Id: I38a4e62b3adf12582b07084056975f74db56086b
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
(cherry picked from commit a7c397f44e5c28ae9c0fed21771acc12837ee1d4)
(cherry picked from commit 01e1261625181f00e42335ccc16942f6b3928b87)
msm: camera: allocate memory properly to avoid passing local variable as reference.

1. allocate memory in msm_server_control to avoid passing local variable as
   reference to event queue
2. Safe coding: Set pointer to NULL in some kfree
3. only dqbuf when streamon
4. Add per instance lock to serialize stream operation

Change-Id: I6e87faa1bd05ada9dc94510cb6414c2a670dae63
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
(cherry picked from commit 49253c236c00ffa5d83e809a7d6f68db28aa3852)

Conflicts:

	drivers/media/video/msm/actuators/msm_actuator.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: camera: Adjust exposure setting

While changing between preview and snapshot modes, different
frame length line is configured. Coarse integration time may
become invalid for some frame length line values. Validate and
reconfigure coarse integration time while switching between
modes

CRs-fixed: 356564

Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
(cherry picked from commit 6a6ccd619fb9a8317e4f6673b9af76abe213633a)

Conflicts:

	drivers/media/video/msm/sensors/msm_sensor.h

Change-Id: I295d9b85699bd1bd763b4d702f621314b52c0184
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>

Conflicts:

	drivers/media/video/msm/sensors/msm_sensor.h
msm: camera: Add retry logic if stream ops fails.

During monkey/stability runs the open/close sequence is going out of
sync. This patch ensures that the sequence is maintained and also add
retry mechanism in case stream ops fails.

Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
(cherry picked from commit 2ddecacee48508b4a89d568c01c9e5ddbdd29999)

Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
(cherry picked from commit 3351b3811abdd9e2158223bda15aac2d01091cd6)

Change-Id: I0f214b4e38ad53dffde5b211b3f54ed7f6e0d914
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: camera: Not allocate memory for the buffer done event.

Unnecessary code cleaned.

Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
(cherry picked from commit a236290fa341c3bd10ffd7295e65eceb600f5b6c)

Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
(cherry picked from commit 269fd3713401028c4db9e21ddf615a59a92c1f31)

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
(cherry picked from commit 07d49ca235577e2c35f3f52c620eb07a9a209405)

Change-Id: Iac57aec7aaf92d241c90dc4f5407f224991b3bf5
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>