USB: ehci-msm-hsic: Don't mark all IRQs as wakeup capable

Some HSIC core interrupts might not be capable of waking up system
from suspend (or XO shutdown) if they are not routed to MPM.
Marking such IRQs as wakeup capable may prevent system from entering
suspend.

Change-Id: Iace7214f7d847f2dc210a9021da08157cfb5bd15
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/usb/host/ehci-msm-hsic.c
qseecom:  Fix failure to release qseecom handle

qseecom_release() returns a failure, if it is unable to find
app_id of zero, associated with the handle in the app list.

There exists scenarios where the handle may not have the
app_id initialized and remain to be 0.  In these scenarios,
once the uninitialized zero app_id is not found in the list,
it returns a failure.

Fix to this is look for non-zero valid app_id in the app_list when
releasing the handle.

Change-Id: If0bf918a6397d8d5f925abde895b096dab76a9bb
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: Fix correct topology for qseecom bus scaling.

Currently, bus scaling topology for qseecom is incorrect.
 -Added the correct topology paths for accessing Crypto
  Engine which is controlled by QSEE.
 -Removed setting the clock frequency of DFAB. This is
  done by the bus driver.
 -Removed references to the dfab clock instance defined
  in clocks file.

Change-Id: Ib6953ea3bf5721d458bfe2aa06c54be329a8fdb9
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: Fix correct topology for qseecom bus scaling. - change mako board file

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qseecom: Remove extra call to disable clock.

Currently the qseecom driver calls qsee_disable_clock_vote() in
the release function. This reduces the reference count during
disabling of the clock and results in turning off the bus clocks
inconsistently.
This change fixes the inconsistency.

Change-Id: I33aa90744a65a3e1a9aba0c368de99ef61a35073
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "USB: ehci-msm-hsic: Don't mark all IRQs as wakeup capable"

This reverts commit a70eecf706c0b72b9d52710fc034e5ddfec35d2a.
qseecom:Fix race condition while voting for clocks

In the current functionality, if DFAB clock is already on and a
request is made to turn on SFPB clock, the DFAB clock is turned
off and SFPB clock is turned on and vice-versa.

The above situation can lead to unexpected errors. The current fix
makes sure that clocks that are on are not voted to be off without
explicit request.

Change-Id: I6c3230e23b105c049cdb0aace579b8a176328c84
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qseecom: Enable clocks for the Crypto Engine used by Trustzone.

All interactions with secure applications on TZ by non-secure
apps on HLOS need the crypto clocks on.
Without this, simple operations as loading secure apps in
Trust zone fail.

Change-Id: I37097cb401508f7582de014e502f3709170ca6b2
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qseecom: Add kernel space client support

Add support for kernel space client:
    - add support for starting secure app by kernel client
    - add support for shutting down secure app by kernel client
    - add support for sending command to secure app loaded by
      kernel space client(s)

The above is needed for allowing kernel modules to communicate
with app running in secure domain.

Change-Id: I3ae3a7648714eb7d7f4801b2f8e7cd94b5c64bdf
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qseecom: Add support for loading commonlib image

Load the common library image on secure domain during
initialization of the driver.

All secure app loaded on the secure domain (TZ) is currently
refactored to not include all secure libraries. The libraries
are now a part of separate image.  This is used by all secure app.
This common lib image needs to be  loaded before any secure app
can be loaded.

This patch adds support for handling this new change based off
the QSEE version running on secure domain.  The change is to
load the common library image before loading any secure app.

Change-Id: I1c7692b612ea4c7bddbca1af07ddf32a073d70a8
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qseecom: Add clk management

The CE clock was initialized to run at max of 100 MHz.  This
was done during the probe call. Running the CE clk at 100 MHz
always, is causing a power regression.

Fix is to enable the clk and set it to run at the nominal level
of 50 MHz.  Further more, add clk gating to ensure CE clks are only
bumped up to the max of 100 MHz when client request for high bandwidth.

CRs-Fixed: 416759
Change-Id: I311f6b29e9129a04c3ec7e2a8f893fa08a518bbd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "qseecom: Add clk management"

This reverts commit 18bd4ca95d8de1f434ce9cf46ae54b0a361df6e3.
Revert "qseecom: Add support for loading commonlib image"

This reverts commit 119ddbb37544952e48b799a172fcbcbabf9241be.