qpnp: pwm: Remove LUT mode dependency of PWM driver

Some low cost Qualcomm pmic chipsets such as PM8110 do not
have LUT slice in their PWM module. In the existing PWM driver
design, it does not probe if LUT base address is not provided
in device tree. PMICs that do not support LUT mode do not have
LUT base address populated, which is perfectly fine.

Thus, remove the requirement to always have LUT base address
present and check if LUT mode is supported during operations that
involve LUT mode.

CRs-Fixed: 490081
Change-Id: Ie705172b21d13120cf96781840c3cc6ef4160851
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>

Conflicts:
	drivers/platform/msm/qpnp-pwm.c
msm: ipa: change release producer RM API to always return success

A bug fix in RM, which caused the producer to remain in
"release in progress" state when releasing producer.
The fix is to move to release state directly without
moving to "release in progress" state.

Change-Id: I588780898b7b234bbc3233f661f7bb90e34ce598
Signed-off-by: Vladislav Mordohovich <vmordoho@codeaurora.org>
qpnp: pwm: Add delay to disable/enable pwm

Need some time to ensure the pwm disable/enable.
If not, sometimes pwm is not enabled correctly.

Bug: 9772457
Change-Id: Ia5fd03b8395c2126744776ecfda33670acfb4596
Signed-off-by: sungjin.yun <sungjin.yun@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
usb: gadget: Fix race condition in connect/disconnect

This commit fixes race condition in fast connect/disconnect
of USB cable. This race condition can also be reproduced in
USB composition change. Thus this commit also adds support
for USB composition change for BAMtoBAM compositions.

CRs-fixed: 463705
Change-Id: I21abaff6a64bb405ce2d698605aff8e0050ef8d6
Signed-off-by: Anna Perel <aperel@codeaurora.org>
Signed-off-by: Bar Weiner <bweiner@codeaurora.org>
msm: sps: free the interrupt for satellite mode

When BAM is registered in satellite mode on apps side, we do not
need to disable BAM HW when apps side does not use that BAM any
more. But we still should free the interrupt. This is addressed
in this change.

Change-Id: I955ea1a341036efa82f0ecc0f45cad5ec41651ae
Signed-off-by: Yan He <yanhe@codeaurora.org>
msm: sps: Fix error case handling in probe function

Fix possible NULL pointer dereference in the probe
function by adding proper error case handling for
clk errors.

CRs-fixed: 583991
Change-Id: Ief54cc28487e5559a893fa2f4c57148e76bd1acb
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
msm: sps: enable SPS for APQ8084

Add the support for new BAM HW features and LPAE.

1. Replace data types of physical addresses of descriptor
   and data with phys_addr_t.
2. Replace sps_transfer_one() function u32 addr argument
   to phys_addr_t addr.
3. Add new MSB registers address support for LPAE.
4. Add support for two new PIPE level ERROR IRQs which
   can be enable or disable by client.
5. Add support to read the BAM PIPEs attributed to
   specific EE.
6. Add the option for BAM Clients to specify whether
   enable or disable some HW features of their BAMs.

Change-Id: If41e3d5e7e8333d7076d924dbae06caa126a1694
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
msm: sps: add OCIMEM for pipe memory

BAM uses pipe memory for BAM-to-BAM connnections. OCIMEM is one of
memory types for pipe memory. Add the support for OCIMEM in this
change.

Change-Id: Ifc6fe537060d2c4120a03222cb419f463c7b4ab0
Signed-off-by: Yan He <yanhe@codeaurora.org>
msm: sps: Add probe deferral support in sps driver

Add probe deferral support in sps driver.

Change-Id: If65d2ebbcdece256fdfa000097ac25874c9a5000
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
msm: usbaudio: Add check for NULL before dereferencing

kzalloc() and usb_ifnum_to_if() both APIs can return NULL. Current
code is not checking return value and derefencing which may crash
device if it is set to NULL. Fix this by checking return value
against NULL and handling the same.

CRs-Fixed: 562273
Change-Id: I0d2c910f43321e94fc447b19ae3e3207727e24f3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
ALSA: pcm: check for integer overflow during multiplication

Channel info data structure is parsed from userspace and if
user does not set the no. of channels correctly, it could lead
to security vulnerability if we don't check for overflow when the
no. of channels is multiplied with pcm bit width. Add a condition
to check for overflow during multiplication.

CRs-fixed: 537818
Change-Id: Ib9631b6e45d77b39be2c27343d4aee3e9244d8cc
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>