msm: camera: Fix for enabling vfe_clk

call prepare before enabling vfe_clk.

Change-Id: I1ea305ed87cc01fcb0c0d96f526793042a453020
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
msm: pil-q6v3: Migrate to devm_clk_get()

This also fixes a missing clk_put() in this driver. Luckily on
MSM clk_put() does nothing.

Change-Id: I4203afeaf04650341125f9530d821e9e80dc894e
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: pil-modem: Migrate to devm_clk_get()

Clean up some error paths and simplify the code by moving to
devm_clk_get().

Change-Id: Icc4aedfc5bbd4e8c1dd96292cd1452a0d877211a
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: pil-riva: Migrate to devm_clk_get()

Clean up some error paths and simplify the code by moving to
devm_clk_get().

Change-Id: Ia172fbbe9af83020023fd61164b9d6c7efec7fb5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
ASoC: core: avoid scheduling delay work

ASoC framework prevents undesirable audio artifact
due to quick shutdown and startup of CODEC Rx path by
schedule delayed work. When timer expires, delayed work
callback function calls DAPM to tear down CODEC Rx path
This mechanism is undesirable when user-space application
manages shutdown of CODEC Rx path in similar fashion.
It causes false turning off of active CODEC path when
there is use case requiring co-processor manages audio use
cases while host processor goes to suspend mode. Change
power down time to 0 instead of 5 second by default.

CRs-fixed: 351956
Change-Id: I3b2692618d7c3cebbcb87e463e537e0e2bf321f2
Signed-off-by: Patrick Lai <plai@codeaurora.org>
msm: qdsp6v2: Fix for ANC issue after second time insert

- ANC works for the first time, after disconnecting and reinserting
  ANC is not working.
- CDC_ANC_INPUT_MUX (0x9A) register is not reprogrammed even though
  ANC headset device profile has entry to program this register.
  The register value is being restored back to 0x00. As driver is
  applying the profile, the desired register value matches cached
  value. So, driver skips rewriting the desired value.
- Mark this register as non-cacheable, so that driver rewrites
  the desired value.

Change-Id: Ia7701c1301ae6d6b1eaae364be245fcc804a378c
CRs-fixed: 352570
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
arm/dt: msmcopper: Update SDCC clock rates

Update the MSM SDCC clock frequencies to match
the frequency plan.

Change-Id: Iabcdfd638cdb021d6ee7cbdcb2298d5a4c4ae94f
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Perf: Dont reset PMU's if perf is not active

Perf would save and restore counters after resetting the PMU when
the CPU's came out of power collapse even if a perf session wasn't
active. Check if perf was running before going into power collapse
and only then reset PMU's while coming out.

This way PMU's can be accessed externally via the RPM or T32 without
perf intruding in counter output.

Change-Id: I33ac11b2a5cae21456341fde015aabe5b4bb8f52
Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
DMM: Fix for movable bytes near end of address space

To prevent overflow near 4GB memory address, the rounding down of
memory addresses needs to be propagated to the memory hotplug logic.
Checking if a given pfn is part of physical ram allows us to do this.
Also while walking through system ram, we need to take care of
overflow at high memory address.

Change-Id: Id962cf93906888783a807fe89f2be4ba91b2c5d6
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
net: usb: Add debug support to the driver

Add debugfs file to rmnet usb data  driver to dynamically
display driver statistics

Change-Id: I9a20df04414002e4e44529fff321ce39ae1a2be1
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
msm: gpio-v2: Fix lockdep warning

In similar fashion as b5eee2f (ARM: mxc: Add missing lockdep
annotation, 2011-04-04) add a lock class so that lockdep knows
the gpio irqs are always locked correctly with respect to the
descriptor lock class.

=============================================
[ INFO: possible recursive locking detected ]
3.0.21-g51ce160-00020-g8eb5789-dirty #2894
---------------------------------------------
swapper/1 is trying to acquire lock:
 (&irq_desc_lock_class){-.....}, at: [<c01ceaf0>] __irq_get_desc_lock+0x74/0x8c

but task is already holding lock:
 (&irq_desc_lock_class){-.....}, at: [<c01ceaf0>] __irq_get_desc_lock+0x74/0x8c

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&irq_desc_lock_class);
  lock(&irq_desc_lock_class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by swapper/1:
 #0:  (&__lockdep_no_validate__){+.+.+.}, at: device_attach+0x18/0xa4
 #1:  (&__lockdep_no_validate__){+.+.+.}, at: device_attach+0x18/0xa4
 #2:  (&irq_desc_lock_class){-.....}, at: __irq_get_desc_lock+0x74/0x8c

Change-Id: Icc0058370de4db17ae4fadb66f5fe970c37ecc6c
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: camera: Fix for HFR option Issue on 8MP sensor

Update 8MP mt9e013 aptina camera driver structures to
use proper sensor settings for diferrent FPS
options in HFR(High Frame Rate) mode.

Change-Id: I3d6ae28ed0c9401af4bd9716e3971bf9eccc5438
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
gpu: ion: Fix fragmentation debug message cond.

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when the amount of space
available in the heap is equal to the requested size.

Change-Id: Iaaf8cd6742aeffab7bcb4806e485326fb9690945
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Fix fragmentation message log condition

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when it should.

Change-Id: I6537171db0a47ba072d182e9bb3125cac5513ff9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: kgsl: Improve the notification timing of idle events

Use the ringbuffer read and write pointers to determine if the
GPU is almost done processing a command sequence.

Change-Id: I0d131a7df71aca02d644a5b95b99749ced2f0b0e
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: usbaudio: Add support for USB headset detection

 - During bootup, create a file system storing the
   information about usb device state and name, and
   broadcast the message to userspace whenever the
   device is plugged or unplugged.

 - Register the device at USB sound card initialization
   for creating file system and toggle the state in that
   filesystem when USB is plugged/unplugged. This will
   also send a message to user space informing it about
   state change.

Change-Id: Icd78273bb765a26bbc70725afebe8955de8f7315
Signed-off-by: Harmandeep Singh <hsingh@codeaurora.org>
net: usb: Block open call on QMI channels when device not connected

RMNET control driver returns error if modem device is not connected
and blocks otherwise when open gets called on QMI channels. QMUX daemon
bails out if open returns error during boot up and calls open later
on-demand as a request from its clients. This increases the overall
time to establish a data call.

Change-Id: I1ef00256893812c36c7596bf75ff5f9745bf61cd
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
USB: OTG: msm: Set charger type and state before notifying to PMIC

Fix the bug where charger type and state are set after notifying to PMIC
in B_IDLE and B_PERIPHERAL otg states.

Change-Id: Ia5f7b62b61bb3d8c239690c5e37f74c60a383096
CRs-Fixed: 353711
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
msm: hsic_sysmon: Add system monitor HSIC bridge

This driver is used to communicate with the system monitor
interface of an external modem device connected via HSIC. A simple
API consisting of open/close/read/write functions is provided to
send and receive data to and from a remote system monitor.

CRs-fixed: 349727
Change-Id: I84a81ec1cdb3dae705200907f8805da70afe58ee
Signed-off-by: Jack Pham <jackp@codeaurora.org>
defconfig: 8960: Enable HSIC system monitor bridge

This enables the HSIC system monitor bridge driver.

Change-Id: I307edeaa284d0c134858bda275941576d2697d4e
Signed-off-by: Jack Pham <jackp@codeaurora.org>