msm: camera: Remove duplicate video device list initialization.

When a video device is registered through video_register_device,
the fh_lock and fh_list variables are already initialized. So we
dont need to explicitly initialize them during v4l2 event queue
setup. Doing this overwrites the fh_list in some cases like
mctl pp node, where each instance can have its own eventHandle but
linked to the mctl pp video node. This can cause video device list
corruption in some usecases like HDR. Remove this extra
initialization for v4l2 nodes which register their video devices.
For native nodes using v4l2 event handles, add the initialization
before setting up the v4l2 event queue.
Move the function setup_v4l2_event_queue and
destroy_v4l2_event_queue into msm_cam_server.c for better code
organization.

CRs-fixed: 443659

Change-Id: Iad6a4108f1c970fdf5a64300b9a3194bc48b8a8b
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>

Conflicts:

	drivers/media/video/msm/msm.c

Signed-off-by: Manish Kumar <manishku@codeaurora.org>
msm-camera:Fix for ZSL flicker in ov5647
Change in register setting of AEC.

Change-Id: I47eaff2938309ae052f55fa2980d1b35c75e3e68
Signed-off-by: Monika Alekhya <malekh@codeaurora.org>
Merge "msm-camera:Fix for ZSL flicker in ov5647 Change in register setting of AEC."
msm7x27a: Add FIQ and PBUS interrupts to fake wakeup list

Add fiq and pbus interrupts to fake wakeup list so that
when system decides to enter IdlePC these interrupts are ignored.

Change-Id: If71c65acbdddac0673bf788affe86293128fde03
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: 7627a: Increase ADSP heap size to 19MB

ADSP heap memory is increased from 18MB to 19MB to support
720P video playback suspend/resume and CTS media stress test cases.

Change-Id: Id521b9cf8c010e2c0d9c07b1730a4edc91c81a2f
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
Merge "msm7x27a: Add FIQ and PBUS interrupts to fake wakeup list"
Merge "msm: 7627a: Increase ADSP heap size to 19MB"
Merge "msm: camera: Remove duplicate video device list initialization."
USB: msm72k_udc: Flush both control out and in requests on _dequeue

NULL pointer dereference crash is observed, while pending control requests
of rndis are dequeued as a part of usb reset interrupt, during composition
switch.

So during composition switch, check if there are any pending control
requests on both control-in and control-out endpoints and flush them in
msm72k_dequeue, before we receive an usb reset interrupt.

Also, don't queue further requests if usb gadget is disconnected.

CRs-Fixed: 438065
Change-Id: I78b6d5fa96766060ceff6bb40aef7ee4698d7be3
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Merge "USB: msm72k_udc: Flush both control out and in requests on _dequeue"
msm: 7627a: Increase ADSP heap size to 19MB

ADSP heap memory is increased from 18MB to 19MB to support
720P video playback suspend/resume.

Change-Id: Ie98cb4ac683931ddbf8c84ffd0c5fc2f573e6b6c

CRs-Fixed: 455603
Signed-off-by: Rajani Davuluri <rdavul@codeaurora.org>
Merge "msm: 7627a: Increase ADSP heap size to 19MB"
use clamp_t in UNAME26 fix

The min/max call needed to have explicit types on some architectures
(e.g. mn10300). Use clamp_t instead to avoid the warning:

  kernel/sys.c: In function 'override_release':
  kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]

Change-Id: Ie1e1c69919186f9d80e212a9e2fb5071bc627b8c
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Signed-off-by: Akhila Musunuri <makhila@codeaurora.org>
Merge "use clamp_t in UNAME26 fix"
Add ACCESSORY_SET_AUDIO_MODE control request and ioctl

The control request will be used by the host to enable/disable USB audio
and the ioctl will be used by userspace to read the audio mode

(cherry picked from commit cf869dfae059b8ff443de231e241a1200d8da1df)

(cherry picked from commit 9a2fab4692dc6c29a2e1d332290401bcd43589f9)

(cherry picked from commit e9dfc4d9b494d38147573b9dfeff06bcfc1cfb33)

Change-Id: I1f992cf1a8dc302c8e1e0fd9da2651355c141782
Signed-off-by: Mike Lockwood <lockwood@google.com>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: gadget: f_accessory: Add support for HID input devices

(cherry picked from commit d51bc42ba2bdb1720f2bad64cbfdc5fe1e15b544)

(cherry picked from commit ca409d6bc04a202f9feeb3acde1b6956803eaae4)

(cherry picked from commit 100b37423fbb8211166f69cd0d77aae6f9ebcb14)

Change-Id: I85192f670e6a8e85c42022b1cef63602cee70b21
Signed-off-by: Mike Lockwood <lockwood@google.com>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
usb: gadget: audio: Add to audio function record functionality

This module enhances the USB audio function driver with
record functionality and adapts descriptors structures
to support compatibility with Win7.

(cherry picked from commit b59b806894f55998a0a301532d1eb92ad871f973)

(cherry picked from commit 761ac914c1515d3c4fd343b0ed8fed21856b1ac9)

(cherry picked from commit 92ad8e81a5eb9b35b406c4ec4c46b63c32a9c3fb)

Change-Id: I4d9117a895ac6be107417c6edc9afe5347f22376
CRs-Fixed: 363272
Signed-off-by: Anna Perel <aperel@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: gadget: f_audio_source: New gadget driver for audio output

This driver presents a standard USB audio class interface to the host
and an ALSA PCM device to userspace

(cherry picked from commit 7ba5d4881027d4813e4f40d1c742b4af6bc43701)

(cherry picked from commit 705ff3e2ebdddd09f1b69e98210531ddc188d245)

(cherry picked from commit f2f116e4327db9a8972b359343ed0f65c3e68533)

Change-Id: I61f860050138c2f60051cdf46e7febcd319c6c1f
Signed-off-by: Mike Lockwood <lockwood@google.com>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: gadget: f_audio_source: Adjust packet timing to reduce glitches

Increase max packet size and clean up timing logic so we can better
recover from not getting an interrupt in time for a SOF.

(cherry picked from commit 822a0c99b9635fe9d8c84f81a9d6da237d0e145b)

(cherry picked from commit 1bf9103bf5438780e018c2406af218e4ca3bcefb)

(cherry picked from commit 55c00b20a2e784285ecdb846413ba0a8ecbb9bb4)

Change-Id: I21c11cb65e833c25d0a01c0efac451d421592117
Signed-off-by: Mike Lockwood <lockwood@google.com>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: gadget: f_audio_source: Fix error handling and increase packet size

Fixes watchdog reset on USB disconnect
Larger packet size fixes performance in fullspeed mode

(cherry picked from commit c0f61345a8cad7dbf90e3ae158128070de6068a6)

(cherry picked from commit a3c6191df0e78431bca71633f160793f738c4a7b)

(cherry picked from commit aad3ba515ec89259afd0f1d104ceea71589585d1)

Change-Id: I8fc6cffa4c25031aa1e129f1103c744a610c4473
Signed-off-by: Mike Lockwood <lockwood@google.com>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>