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>
usb: gadget: mbim: Send zero-length packets

If control packet size is a multiple of 64b and is smaller than 4kb,
send after it a zero-length packet to the host.

CRs-Fixed: 352523
Change-Id: I44a97cacf7d92d66c91f81405802f7d1cf5f5285
Signed-off-by: Anna Perel <aperel@codeaurora.org>
msm: kgsl: Change name of vmalloc allocator

Change the vmalloc allocation name to something more appropriate since
we do not allocate memory using vmalloc for userspace driver. We
directly allocate physical pages and map that to user address space. The
name is changed to page_alloc instead of vmalloc. Add sysfs files to
track memory usage via both vmalloc and page_alloc.

Change-Id: I239087435f4599b62b7da71ecea0a5878cda5037
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@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>
Revert "power: pm8921-charger: remove set_usb_power_supply_type"

This reverts commit 70f6cdc262dc3e2bb3fb8ac1c56a216f0600d441.

Allow customized charger drivers to leverage the USB power supply
type information.

Change-Id: Idc6893a87164a147c93e4f07573c3541dfa2685f
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Revert "USB: OTG: remove pm8921_set_usb_power_supply_type"

This reverts commit 34b874562012c3453da20059094992140ca1ea61.

Revert the removal of the set_usb_power_supply_type to allow
customized charger drivers to leverage off of the information
provided by the usb driver.

Change-Id: I3629202ac65793a8c5819d4371048c212030ae47
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
power: pm8921-charger: Correct USB online reporting

When a USB charger is first connected to the device
the USB driver determines the maximum available charge
current. If the USB driver determines that a wall charger
is connected there is a possiblity of the USB power
supply type to falsely be reported as online.

Fix this by only reporting the USB online state if the
targeted maximum USB current is less than 500 mA. This
means that there was no wall charger ever connected and
AICL will not be utilized.

Change-Id: I0b14da273fbc2a94fe49250fa800a2136c3f09a2
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm_fb: Provide IOCTL to configure QSEED tables

Provide sub-operation for MSMFB_MDP_PP IOCTL to configure QSEED tables.
QSEED is used for smoothing, sharpening and scaling of content on video
pipes in MDP.

Change-Id: I069d9c793553cb4c400973690ebd7f8d3bcc1c68
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
msm: bam_dmux: pin rx workqueue to core 0

Pin the receive workqueue so that it always runs on core 0.  Do this to
eliminate a race condition caused by the workqueue moving between cores in
the middle of a downlink data transfer.  If hit, the race condition will
cause the TCP/IP framework to process packets out of order for a short time
which could cause performance degradation due to unnecessary
retransmissions.

CRs-Fixed: 346788
Change-Id: If1588cc5fd24f6d4af441a1728cfbb801a7d7c5b
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
msm: Enable msm_adc for 7x27a/8x25

The msm_adc interface is used to read the HKADC from the
remote processor. It uses the DALRPC layer to communicate
to the remote HKADC driver.

Add support to read PMIC Thermistor from the HKADC to support
thermal clients on the apps. PMIC temperature is one of the
thermal nodes used for performing thermal mitigation.

Change-Id: I9d9e8178e19daf5d830588281855dd8a40de1f0d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
defconfig: msm7627a: Enable msm_adc interface

msm_adc interface is used to request ADC requests from
the remote processor over DALRPC.

Change-Id: I6fdd0bc91acb4c5716bbf9153c09efd0e4c26efb
Signed-off-by: Siddartha Mohanadoss <smohanad@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>
ASoC: MSM: add cpu and codec dais for Ultrasound

Ultrasound needs decimators to be running at 96k or 192k. The signals
from those decimators  need to sent to slimbus ports which belong to
afe slimbus port which is exclusively reserved for ultrasound.

CRs-Fixed: 347464
Change-Id: I50c1f79a972acc6d363108ae2a8679f9851e8b45
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
mach: msm: remove msm_mpm_pin enum from mpm.h

Value of MSM_MPM_PIN_* in msm_mpm_pin enum may be target
dependent so it's not good to keep them in generic mpm.h
file. So let's remove it from mpm.h and let client of these
APIs to pass their own interrupt number to these APIs.

Change-Id: I5360648ab10c7256ee4a6067bfb83314b311137b
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>