video: tegra: nvmap: Change function declaration order.

Change function declaration order to avoid multiple
CONFIG_TEGRA_NVMAP #ifdef's.

Change-Id: Icb10380f8da4b8037b90e787f961a28e8528814f
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/103990
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
video: tegra: nvmap: Clean up carveout to iovmm conversion.

Clean up carveout to iovmm conversion code.
Fixed bug in converting iovmm requests to carveout.

Change-Id: I35a5238c955d0478f0e1a295e501bae9ee52b0a8
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/103991
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
video: tegra: nvmap: Fix debug allocations data shown.

Debug allocations data for iovmm has carvout allocations
also and vice versa. Fixed it to show only iovmm for iovmm
and carveout for carveout.
Add missing "FLAGS" print for iovmm allocations.

Change-Id: I0fd271be24d0d2d3924ca473fd32476776fdcf84
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/104246
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
arm: tegra: ahci/sata: Add SATA driver

Upgrade the Tegra 3 SATA driver to support kernel 3.1.

The driver supports runtime_pm when doing power-gating during idle.

A new CONFIG_TEGRA_SATA_IDLE_POWERGATE is provided to enable/disable
power-gating during idle.

When sata clocks (sata, sata-oob and pll_e clocks) are in the
core_dvfs_table[] table, CONFIG_TEGRA_SATA_IDLE_POWERGATE must not
be enabled.

Currently, sata clocks are in the core_dvfs_table[]. Those clocks
will not be in that table in the future. By then,
CONFIG_TEGRA_SATA_IDLE_POWERGATE can then be enabled.

Change-Id: I15b585713bfd891f8827fd028b21bf3e5c2b80d9
Signed-off-by: Yen Lin <yelin@nvidia.com>
Reviewed-on: http://git-master/r/89614
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Revert "Revert "arm: tegra3: change min_rate for clocks""

This reverts commit 18ed77b122dd1fbb9a6a5373da36ab32d0f0cee1.
The noisy audio playback on Tegra3 with secure-OS issue is fixed by
updating TL's SDK to 1.08. Change min_rate for clocks back to 12Mhz.

Bug 939415

Change-Id: Ib0daf98faa85cc7cbc1dbfd4bf458427f914d830
Signed-off-by: Hunk Lin <hulin@nvidia.com>
Reviewed-on: http://git-master/r/104317
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Arm: Tegra3: clocks: Disabled SSCCENTER bit for plle

Disabled SSCCENTRE bit for plle as per golden register
(value provided by syseng)

Bug 942384 978870

Change-Id: I3c2f8e8e220015b58f0c8bcbaac4e9998a5b6dcd
Reviewed-on: http://git-master/r/98381
Signed-off-by: Mohit Kataria <mkataria@nvidia.com>
Reviewed-on: http://git-master/r/102408
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
ARM: tegra: cardhu: Remove tegra_gpio_enb/disable

Removing tegra_gpio_enable and disable calls
from board files as they are supported through
set direction calls in the driver

Bug 984439

Change-Id: I51b17389dbb17b0e94e1635ec6d68acd01c743b4
Signed-off-by: Ashwini Ghuge <aghuge@nvidia.com>
Reviewed-on: http://git-master/r/102529
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
arm: tegra: kai: configure gpio direction for bluesleep

Bug 986813

Change-Id: Iaca0465041af3442da8e052e3efec1efa60d0d79
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: http://git-master/r/103632
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
ASoC: resolve compilation time warnings

Bug 949219

Change-Id: If7b4dd928cc5a808fd1a674bcc5f31c9a396a043
Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com>
Reviewed-on: http://git-master/r/103772
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
video: tegra: host: Merge waitchk and relocation

Job pinning and relocation already maps the gather buffers to
kernel memory. Move waitchk to be done at the same time so that we
do not need to re-map the memory to patch expired waits.

Bug 965206

Change-Id: I23634b501a45de080200e57d3debf267b39fea38
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/104415
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
video: tegra: host: Replace nvmap structs with own

Replace usage of nvmap_pinarray_elem with own nvhost_reloc and
nvhost_reloc_shift structs.

Bug 965206

Change-Id: I90618d8a34d79156d8880d9925dadbf416353811
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/104450
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
spi: tegra: fix fifo_depth to 32.

Slink controller have the fifo depth of 32 words in
rx and tx side. But some of places it was taken the
value as 4. Fixing this to 32 words.

Change-Id: I262127c59241ce75d4385464c21ee733a48b1475
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/104463
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
spi: tegra: use devm_* for resource allocation

Using of devm_* function for resource allocation does not require
to free resource on code and hence it reduces code sizes.

Change-Id: Id6f0ba3cde2f351d5668ed28b098e5a829716a30
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/104464
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
spi: tegra: use functions to avoid duplicated code

The dma allocation method for receive and transmit is
same and so instead of duplicating the same code for
rx and tx, making the function to have common code and
using the function for dma allocation.
This reduces duplicated code.

Change-Id: Ibe15eec896bc581bda8c68572eb1425c3bf6a7b2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/104465
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
arm: tegra: cardhu: remove unused pinmux setting

Remove unsued pinmux for pn544 nfc which was introduced in
http://git-master/r/#change,62746

Bug 978207

Change-Id: I7724e9c17c8c5717e07fbc9e091f26f6e81cb422
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: http://git-master/r/104468
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
arm: tegra: p1852: Instantiated TDM mode driver

Instantiated TDM mode driver.
Changed clock values for TDM mode.

Bug 948478

Change-Id: I64fb6c6f3ff0d573494656ae04f29323a41da50a
Signed-off-by: Bob Johnston <bjohnston@nvidia.com>
Reviewed-on: http://git-master/r/103895
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
ASoC: Tegra: Add support for AVP rendering

Add alsa controls to specify which alsa device is used by AVP to render
audio. Also add support for disabling DMA interrupt when AVP renders
audio. Also add couple of alsa controls to query DMA channel ID and
DMA buffer physical address.

Bug 968814
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>

Change-Id: If593329db72bf00d97f7433f5c54e13500281253
Reviewed-on: http://git-master/r/97916
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
video: tegra: nvmap: Remove nvhost specific APIs

Remove nvmap_pin_array() and nvmap_patch_word() and their utility
functions.

Bug 965206

Change-Id: I217a427934b0b99b5252b33ab3ac4eaaa8c7e076
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/104451
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
video: tegra: host: Throttle lower priority jobs

Implement per channel counter for jobs in each priority level. If
there are jobs active with higher priority than the one being
submitted, throttle.

Bug 926690

Change-Id: I5fed341e3f248325873b31d1c53bf57bf0a78074
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/104939
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
video: tegra: host: Dump sync queue in debug dump

Dump contents of sync queue when debug dump is requested, either
because of a stuck sync point, or when the debugfs entry is accessed.

Exclude FIFO from normal debugfs dump. Dumping FIFO is invasive and
actually changes how the channel behaves. It's safe to dump only when
system is in fault condition.

Change-Id: I12c68e8186acd7bd17e4ab52b2589f765396ed17
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/104970
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>