usb: usb_bam: hsic consumer request not necessarily resume the hsic core

When hsic consumer is requested, the hsic bam driver vote for resume
the hsic core. In this case hsic core resume is activated and we have
a flag (hsic_host_dev_resumed_from_cons_request) to know if resume
happened in this scenario or not.

However, if hsic core was already resumed when the hsic consumer request
arrived, for example since other driver voted for resume before that, then
no resume will happen and therefore the flag will remain set to true.
Therefore, on the next resume, we will consider the resume as resume
after consumer request and we will prevent from doing necessary operations
such as calling to ipa_resume. Therefore when the consumer is released
we will set this flag back to false so we will know that the next resume
that will happen is since of other resume scenario.

Change-Id: Ied21c2d6c7b299a79bf43a093440cab8123a0407
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
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>
usb: usb_bam: Don't wait for consumer request on connect pipes

On certain compositions, ECM for instance, consumer is not requested
on pipe connection and thus the part of the handshake that waits
for consumer request causes a timeout and a delay of 10 seconds
before network connection can be established.
In a revisited design for IPA-USB resource handshake,
USB shall not wait for USB_CONS resource, thus avoiding the
delay on ECM compositions.

CRs-fixed: 499480
Change-Id: I2a7e44289c13b5e2f8f69c9c26f5af4b6eba510c
Signed-off-by: Lena Salman <esalman@codeaurora.org>

Conflicts:
	drivers/platform/msm/usb_bam.c
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>
msm: qpnp-power-on: Add finer control of PMIC power off type

Modify the qpnp_pon_system_pwr_off() function so that different
types of PMIC reset may be requested.  In particular, add support
so that both warm and hard reset may be used.  Warm reset
maintains the hardware state of some PMIC peripherals.  Hard
reset resets all PMIC peripherals.

Change-Id: Ibe1491acfe90364e96b776d26e158522dfea9c2b
CRs-Fixed: 507850
Signed-off-by: David Collins <collinsd@codeaurora.org>
qpnp: pwm: Add support for additional pwm sizes

The existing pwm driver only supports 6 and 9bit pwm modes. It is
a limitation to the pwm use-cases and some of the LPG channels
do not even support these PWM bit modes. Thus, add the support
for the rest of the available bit modes.

Change-Id: I09ad379358c230c2e9fbe2715bdce9cc145dd8af
Signed-off-by: Jay Chokshi <jchokshi@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