msm: audio: qdsp6v2: Fix seek issue in tunnel player

- Seeking to 0 position during tunnel playback, music stream
  jumps to incorrect postion.
- Initial buffer after seek to new position is corrupted as
  flush ioctl is not synchronous. Ioctl FLUSH is posting
  CMD_FLUSH to DSP, but WRITE_DONE to user space are posted
  even before it receives FLUSH ack from DSP.
- Fix is to wait for FLUSH ack from DSP, then post the
  WRITE_DONE events to user space, which will ensure FLUSH
  is completely handled.

CRs-Fixed: 425420
Change-Id: Ieca3353dba3a67af39a2967659034f073acf5277
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
USB: ci13xxx_udc: Fix possible NULL pointer dereference

Don't access dev->platform_data before checking dev against NULL.

CRs-fixed: 440043
Change-Id: Ia891720b926d26a46a044e688b64ac4e3cda73e2
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
board: msm9625: Add MSM USB HSIC HOST sysfs

Add AUXDATA to create "msm_hsic_host" sysfs node for
existing userspace needs.

Change-Id: I50ccdd2aa55aff4b3833e97ad89aaa69742850d4
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Asoc:msm8974:Add analog microphones support

Liquid platform contains additional two analog microphones for
ultrasound purpose.

Change-Id: I1a7771767d6f42da97812237864bf87385f9c458
Signed-off-by: Tanya Finkel <tfinkel@codeaurora.org>
video: msm: Add revision check to calibration API

Add ability to check MDP revision to the calibration config API. Allows
calibration tool to check specific MDP revision for proper tuning.

Change-Id: I926ed21704507cb390c283e5c4383dcf7fbf8030
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
ASoC: msm: Add support to fix up the channels for HDMI

For the use case of Playback over HDMI device, the number of
channels supported varies with the sink capabilities.

Add support to fix the channels based on the sink capabilites
configured by userspace

Change-Id: Ie6bfb96deb437ff5e2cbeef339f4f66e86c39a9c
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
ASoC: msm: Add channel map control to set channel map of pcm driver

In the usecase of multi channel playback, channel map varies from
one compressed format to another. Add channel map control to set
the desired channel map for multi channel playback

Change-Id: I61d79cc1ffce3a8f6d4d059003b934f54b86837f
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
ASoC: msm: Set channel map and CA of HDMI from EDID

For the Multi channel HDMI playback, the channel map and channel
allocation are known fromt he sink capabilities parsed from the
EDID in the userspace
Add controls to set the channel allocaion and channel map of AFE
and ADM accordingly from the EDID values

Change-Id: Ibeb26651e773b8dc74c1c66d9cd80bf7341b5217
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
arm/dt: msm: 8974: set micbias2 cap mode

On FLUID, micbias2 has an external bypass capacitor.
Without setting to cap mode, high pitch noise is heard
during audio capture from microphone biased by micbias2.

Change-Id: Iec3d2990549daa6da231ada1557383a30e6ac076
CRs-fixed: 433362
Signed-off-by: Patrick Lai <plai@codeaurora.org>
power: qpnp-bms: Prevent SoC from rising during discharge

In a previous patch, scale_soc_while_chg was made to not be called when
catch_up_sec equals zero to prevent a kernel divide by zero bug.

However, this caused SoC to increase at times with multiple calls to
calculate_state_of_charge in quick succession.

Fix this by always calling scale_soc_while_chg and skip calculations only
when catch_up_sec is equal to zero.

Change-Id: I4b2a0e2aa9c5325b946111f99d95ccf6340bba96
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
power: qpnp-bms: implement BMS reset

Sometimes during testing it is convenient to force the BMS to take a new
OCV, essentially restarting the BMS soc calculation in order to test
short portions of the battery profile.

Implement a BMS_reset module parameter, which sets OCV to the
instantaneous VBAT and resets the coulomb counter whenever a 'Y' is
written to it.

Furthermore, in the bms reset mode, keep UUC constant at 3%, and do not
run adjusting algorithms until a 'N' is written to the module parameter.

Note that this feature should only be used with a fake battery, as it
maintains a constant voltage and gives us near true OCV estimates.
Also, the adjusting is disabled due to this reason. If adjusting were
allowed, we will end up adjusting higher failing the test cases for which
this feature is designed.

Change-Id: I65c47bc4e86e543abfa6f9e461fa0e0a58a4316f
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
ASoC: msm: qdsp6: add check for maximum COPPs allowed

There is maximum number of COPPs ASM session can be routed
to even though there are far more number of AFE ports.
Add the check to make sure caller is not routing to more
than ADM can actually support.

Change-Id: Iee97dd7e5d21820c87244a422fa252c2228185f9
Signed-off-by: Patrick Lai <plai@codeaurora.org>
crypto: msm:  Fix address for PIPE KEYs

PIPE KEY address are incorrect. This patch fixes these
incorrrect addresses.

Change-Id: I3e5069da6e2c99f24f706bef8a53e605b95d707b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
msm: sps: check the result of memory allocation

Check the result of memory allocation request before use it, to avoid NULL
pointer dereference.

Change-Id: I56376b4f503d3c7134ae3ab73fccd5b0b3a40290
Signed-off-by: Yan He <yanhe@codeaurora.org>
usb: usb_bam: Add support to disable BAM clock gating

USB may incorrectly send a ZLT when BAM clock gating is enabled.
This change is a software workaround, which will allow disabling
clock gating for a specific BAM.

CRs-Fixed: 420811
Change-Id: I865e396f5596b9cda57c1d1e27f57308c88acebe
Signed-off-by: Amit Blay <ablay@codeaurora.org>
arm/dt: 9625: Disable USB BAM clock gating

USB may incorrectly send a ZLT when BAM clock gating is
enabled. This change disables the clock gating for the USB BAM.

CRs-Fixed: 420811
Change-Id: Ife7e0c475341063d18e6b5bfa64a0e943b2158e5
Signed-off-by: Amit Blay <ablay@codeaurora.org>
arm/dt: 8974: add blk-size to csr DT node

Add blk-size parameter to CSR DT node to configure the block
size for tmc-etr to usb transfers.

Change-Id: I75ee0fb5aaf4efb1befa670f70e38485c1b682e3
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
arm/dt: 9625: add blk-size to csr DT node

Add blk-size parameter to CSR DT node to configure the block size
for tmc-etr to usb transfers.

Change-Id: Ib8bc3190c347e2b5f704f0859fd1b0f9c33af114
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: read block size for tmc-etr to usb transfers from DT

Reading block size to use for tmc-etr to usb transfers from DT
allows the flexibility to configure a different block size per
target.

Change-Id: I5b52db194ebb6fab7d3a02e8fb031bd9936fddd8
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
msm: 8064: Add board and device support for FSM8064 EP

Femto development platform (FDP) is based on APQ8064. These changes
add fsm8064_ep board support to the 8064 generic bsp.

Change-Id: Iea442949d628eb061042cd085838240330004932
Acked-by: Kaushik Sikdar <ksikdar@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>