Arm: tegra: usb: set run bit after disabling PMC

Set run bit soon after disabling the PMC so that
the delay in releasing the pmc_lock is avoided.
Also add delay in phy_restore_end so that the resume
will driven for minimum of 20ms.

Bug 1264731
Bug 1382457
Bug 1438066

Change-Id: If4d53359d8a3f33898ed0663cbdf7d4c8310bcf9
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-on: http://git-master/r/309449
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/354696
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
soc: tegra: rt5640: set DAI link for E1569-ERS

Set DAI link properly for E1569-ERS rt5640 codec

Bug 1432502
Bug 1432488

Change-Id: I5c91d0cc842fccb45175180da3a86e4651bd2534
Signed-off-by: Yong Goo Yi <yyi@nvidia.com>
Reviewed-on: http://git-master/r/353677
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
ASoC:Tegra: Fix DAM num to a specific DAP

DAM should fix to a specific DAP, otherwise voice call cannot be
ended normally.

Change-Id: I60553e903a2f425bc9e9e1c245f77dfd5d3058b4
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/351993
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>
ASoC:Tegra:dual mic support

In order to use dual mic to support nvoice, DAMs should be removed
form UL and playback should use channle0 of DAM in DL to make SRC
not channel1 again.

Bug 1431667

Change-Id: I88d53d315a2d0a6aa74e414861af54061763d2ac
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/352587
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
ARM:Tegra: fix bt voice call lost

The bit-size is miss and voice call will be lost with the setting.

Bug 1428578

Change-Id: I8d118c1f3b446d62fb86e7f3340f8db75d66caf9
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/353684
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>
ASoC:Tegra: Add BT-SCO initialize function

The initialize function for BT-SCO should be add, otherwise ther DL
audio path will be broken by BT Tone.

Bug 1428578

Change-Id: I3870b0134871a7ad95b704adabae5de836d3545d
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/353694
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
usb: gadget: tegra: Add callback to boost_enable

Cancel PM QoS request upon enabled to disabled
transition.

Change-Id: Iaf28d2d0daca312996e2cb1a1280769d814fd066
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/280232
(cherry picked from commit 9a25a04c42ed0feeb1aff1dcf696b54e122a8c65)
Reviewed-on: http://git-master/r/353766
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
input: cfboost: Add module parameter callback

Cancel PM QoS request upon frequency changing to zero.

Change-Id: Ie6bba1eb3f3177751449d53d9237e021140edf82
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/280744
(cherry picked from commit 8623a52d17f0e0788d393fbc4e8a9b2987ae492d)
Reviewed-on: http://git-master/r/298656
(cherry picked from commit ad5110686a0596cf8a1b1373b14d37e8b83284b9)
Reviewed-on: http://git-master/r/353767
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
ARM: tegra11: add INT_RTC as a wakeup source

Required for suspend_sanity test.

Change-Id: I6a4e24ad7a65e4e8b8c49ca4854e1c06933e218c
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/289201
(cherry picked from commit c7a04b51ad17196ab8cfc49e90c3c60a37aa6461)
Reviewed-on: http://git-master/r/353768
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
ARM: Tegra: Fix comment about clock switch

Upon turning off PLLs CPU is switched to CLKM.

Change-Id: I72d3cd6a6a103ef954b03453f5bcc0131a9737f2
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/304351
(cherry picked from commit 5528184cfee750a3e64e62f3d0054537e40fa329)
Reviewed-on: http://git-master/r/353769
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
icera: cdc-acm: fix message lost in modem logging

When CPU freq is too low (e.g. 51MHz), AP may fail
to receive all the modem log under some cases (e.g.
3G call) when modem generates a lot of log.

Boosting CPU freq to 696MHz can fix issue.

Bug 1432121

Change-Id: I92f7be137ee205b9936129242ab723d343e31046
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/351425
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
xhci: tegra: Reset EMC bandwidth before elpg

xhci fw informs driver the changes to maximum bandwidth requirement
by MBOX_CMD_SET_BW mailbox command. Driver should reset the required
bandwidth to 0 before going to elpg.

Bug 1371282

Change-Id: Ic7cdd4d95335a02bce6b017d9d5af101bd4b1365
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: http://git-master/r/304734
(cherry picked from commit f21d0ee5e1cadd578ad962df02f90a38adf16369)
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: http://git-master/r/354846
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
usb: gadget: tegra: remove spin_unlock/lock pair

Remove the extra spin unlock/lock pain while building
dtd, as data corruption seems to happen by swapping
of dtd when multiple gadget functions are loaded.
This changes will make build dtd as part of Critical
section, there by swapping of dtd's doesnt occur.

Bug 1380570

Change-Id: I69ffc92a294cba13e79e2a02382b0c8f6b8cb28d
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/334929
(cherry picked from commit 1716e1b6e87ce0765eaab4c0fb62007735b33ee8)
Reviewed-on: http://git-master/r/354900
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
video: tegra: host: Fix race in gr3d scaling

The scaling code used cancel_work_sync() while holding a mutex. As the work
itself uses the same mutex, we risk causing a deadlock.

This patch refactors the code so that the mutex is not hold while calling
cancel_work_sync().

Bug 1371500

Change-Id: I3aa0de168cebcc1d8d1843813caee5e82fe3df06
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/280730
(cherry picked from commit 763125fba1c9a8a67a9968c8502c17465665eb35)
Reviewed-on: http://git-master/r/354208
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Gabby Lee <galee@nvidia.com>
Reviewed-by: Min-wuk Lee <mlee@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
ARM: Tegra: Utilize burst policy for LP1 wakeup

Running SCLK from CLKS makes LP1 wakeup latencies horrible.
However, we can utilize IRQ bursting to switch automatically
to CLKM upon LP1 wakeup IRQ. This maintains low power for LP1
but improves wakeup latencies significantly.

Bug 1381343

Change-Id: I9a3fcd81999d1b593bf242bfa7ef8505f9848d43
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/298749
(cherry picked from commit 39d6266e1ed04512809badb263a6d9b4346a49e4)
Reviewed-on: http://git-master/r/298744
(cherry picked from commit 12a25b041874515a7076b30f1462a12756d75d16)
(cherry picked from commit b90f85660ac259da9190cce156763fb05caa5f82)
Reviewed-on: http://git-master/r/353758
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
soc: codecs: rt5639: Implement i2c shutdown

i2c shutdown implementation for rt5639
No i2c transaction should happen after
shutdown

Bug 1431674

(cherry-pick from d17a5403140a45e43cb21cffe6cf391a2e3abe62)
Reviewed-on: http://git-master/r/188216/

Change-Id: Iadc18d8e84a10b2735503c99c4b7003e275e4242
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/353242
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>
arm: tegra: tn7c: set MDM_RST default to HIGH

set MDM_RST default to HIGH, so that Bruce module
can be enumerated eariler.

bug 1439737

Change-Id: Ie3b8fae666a3665bb7b5aa57272269f4a475b6e6
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/355495
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Steve Lin <stlin@nvidia.com>
arm: tegra: TN7C: reduce fb0 framebuffer size

Since TN7C works with 800x1280 resolution,
reduce the fb0 framebuffer size to save memory.

bug 1431165

Change-Id: I0eaddc50dbe95d8fdc9205020e3aa8d4e0005826
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/355563
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Danny Song <dsong@nvidia.com>
USB: cdc-acm: fix data reordering issue

There is a race condition between acm_tty_unthrottle and
acm_process_read_urb; new data can be added to the tty buffer
before the data queued when throttled.

Bug 1436086

Change-Id: I76364cc69fb718e34ae646497591ddc8a717e6e1
Signed-off-by: Yu-An Shih <yshih@nvidia.com>
Reviewed-on: http://git-master/r/353617
(cherry picked from commit 381e5c6d0bc2f3a5eb266b5a54d83d491cbac20d)
(cherry picked from commit ee96ff10770213e6376027556efe8a5959f61320)
Reviewed-on: http://git-master/r/355823
Reviewed-by: Gray Lei <glei@nvidia.com>
Tested-by: Gray Lei <glei@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Martin Chi <mchi@nvidia.com>
ARM:tegra:TN7C: fix typo in INA current setting

there is a typo in INA230 current setting.

Change-Id: Ie4d32cee3dc2dcb5dc565bc2a42484de80414a4e
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: http://git-master/r/354057
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>