msm: ipa: Send state changed event from IPA RM

In case that producer is granted synchronously, notify all
registered clients. This change is required as there was an IPA RM
client which didn't get the notification when required.

Change-Id: If400c5d4c48ae856a39277cfd1bdc4c27bf67372
Signed-off-by: Vladislav Mordohovich <vmordoho@codeaurora.org>
msm: ipa: Change the value of HOLB timer

Change the value of HOLB timer from 0xff to 0x1ff.
This change is needed for TCP good bi-directional throughput.

Change-Id: Ib8e147fdda901e0bfc21c57c3853340ae3f68c20
Signed-off-by: Vladislav Mordohovich <vmordoho@codeaurora.org>
msm: ipa: Adding debugfs stats to IPA RM

Adding statistical information regarding IPA RM

Change-Id: I03c3e95f5cf7e7568fbe7778965ea1b2b80a96fe
Signed-off-by: Vladislav Mordohovich <vmordoho@codeaurora.org>
msm: ipa: Bug fix in RM add_dependency

Fixing a minor bug in the RM at add_dependency

Change-Id: Icb6a53cd6b4bdbd590adea52725f7df688e0a2f0
Signed-off-by: Vladislav Mordohovich <vmordoho@codeaurora.org>
msm: ipa: a2_service: race condition fix

This issue is a rare race condition which appears after ~3 hours of
testing and causes a kernel crash.

Fixes the issue reported in droidbug-60712.

Change-Id: Id6d313088f7873ef3f47edeb25c54528691ece5b
Signed-off-by: Gidon Studinski <gidons@codeaurora.org>
msm: ipa: Move ipv4 RT rules to use system memory

Moving ipv4 routing rules in IPA-HW to use DDR memory.
By default ipv4 routing rules will reside in DDR memory.

Change-Id: I69c559ca90b638e38af872a3858f3fcb6e61d0b0
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
msm: ipa: wwan: release producer only when no outstanding packets

release WWAN_PROD only after getting WRITE_DONE
event for the last packet to make sure that there
is no outstanding packets when releasing WWAN_PROD.
This is fix for potential bug that A2 may go to
power collapse while there are packets pending in BAM

Change-Id: I6ae08fb149f4309866b693f37744e090581f5816
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
msm: ipa: use smem_alloc2 to allocate SMEM pipe mem

smem_alloc used previously assumes modem will alloc the
item before IPA driver is initialized. smem_alloc2 will
alloc the item if not already allocated.

Change-Id: I4bd1e8d85a325180e58507b300984db882d8e18d
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
qpnp: pwm: Add Keypad Backlight Lookup Table support

The Keypad Backlight Lookup Table (KPDBL_LUT) is similar to
a generic LUT found in PM8941 pmic with a minor differences such
as 8 bit LUT entry, and less LUT entries than generic LUT. Add
support for KPDBL_LUT to the PWM driver.

CRs-Fixed: 503480, 505751
Change-Id: Ice7b18e4b7681480e07bf25f4c258cfcbe58cb4d
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>

Conflicts:
	drivers/platform/msm/qpnp-pwm.c
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>
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>