HACK: CHROMIUM: ARM: dts: big: disable sdhci UHS modes

Disable UHS and HS200 modes for the sdhci controllers on Big.

BUG=chrome-os-partner:25578
TEST=Check /sys/kernel/debug/mmc*/ios and see that no UHS modes are
in use.

Change-Id: I4d13cf8ce0c6ece28e6e2c429a86cf924b049cb4
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185430
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Katie Roberts-Hoffman <katierh@chromium.org>
BACKPORT 3.11: ALSA: hda - Avoid choose same converter for unused pins

For Intel Haswell HDMI codecs, the pins choose converter 0 by default.
This would cause conflict when playing audio on unused pins,the pin with
physical device connected would get audio data too.
i.e. Pin 0/1/2 default choose converter 0, pin 1 has HDMI monitor connected.
when play audio on Pin 0 or pin 2, pin 1 could get audio data too.

This patch configure unused pins to choose different converter.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 7ef166b831237e67b2ea83ce0c933c46ddd6eb26)
Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Ib634ac128e88e3831dd7070d5638677296e535ae
Reviewed-on: https://chromium-review.googlesource.com/176256
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT 3.12: ALSA: hda - add flags and routines to get devices selection info for DP1.2 MST

This patch adds flags and routines to get device list & selection info on
a pin.

To support Display Port 1.2 multi-stream transport (MST) over single DP port,
a pin can support multiple devices. Please refer to HD-A spec Document Change
Notificaton HDA040-A.

A display audio codec can set flag "dp_mst" in its patch, indicating its pins
can support MST. But at runtime, a pin may not be multi-streaming capable and
report the device list is empty, depending on Gfx driver configuration.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit f1aa06847506d5b88f5eb41fae6a24a7128097e7)
Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: I6b7346a67fc7fccfb98cb15cb13447443280dfa1
Reviewed-on: https://chromium-review.googlesource.com/177815
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT 3.12: ALSA: hda - Haswell codec exposes device list/select info on pins

This patch is only to allow codec proc file to expose devices list/select info
for Haswell codec pins.

Since Haswell Gfx driver cannot support DP1.2 MST now, so all pins' device list
is empty, meaning no pin is multi-streaming capaple.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5dc989bdd968f369fec47d25343868ff9702953a)
Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: I59b0a0715f5f06389e9ba523516c07016e7da220
Reviewed-on: https://chromium-review.googlesource.com/176257
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT 3.12: ALSA: hda - define is_haswell() to check if a display audio codec is Haswell

To apply Haswell specific fixings, this patch defines is_haswell() to check
whether a display audio codec is Haswell, to avoid explicitly checking Haswell
vendor ID everywhere.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit fb87fa3a79823c15e70d4fc7653bde59f8556ca1)
Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Iaa3dbebd87924b63202cea5f5561c2c23fa89c1f
Reviewed-on: https://chromium-review.googlesource.com/176258
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT: ALSA : hda - not use assigned converters for all unused pins

BIOS can mark a pin as "no physical connection" if the port is used by an
integrated display which is not audio capable. And audio driver will overlook
such pins.

On Haswell, such a disconneted pin will keep muted and connected to the 1st
converter by default. But if the 1st convertor is assigned to a connected pin
for audio streaming. The muted disconnected pin can make the connected pin
no sound output.

So this patch avoids using assigned converters for all unused pins for Haswell,
including the disconected pins.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit f82d7d16aee5eb4c2315ba11a90f2f3c662d45b8)
(cherry picked from sound repo at
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)

Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Iff69da4b6f9ab9d9f9693f078a9ae90075e86244
Reviewed-on: https://chromium-review.googlesource.com/176259
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT: ALSA: hda - add codec ID for Valleyview2 display codec

This patch adds codec ID (0x80862882) and module alias for
Valleyview2 display codec.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit cc1a95d9f6423ced191b6f264e9657d98844ea0d)
(cherry picked from sound repo at
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)

Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Id6de6bfa84f757b30f34dc640516cb57749febe7
Reviewed-on: https://chromium-review.googlesource.com/176290
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
BACKPORT: ALSA: hda - not choose assigned converters for unused pins of Valleyview

For Valleyview display codec, if an unused pin chooses an assgined converter
selected by a used pin, playback on the unused pin can also give sound to the
output device of the used pin. It's because data flows from the same convertor
to the display port of the used pin. This issue is same as Haswell.

So this patch avoids using assinged convertors for unused pins.
The related function haswell_config_cvts() is renamed for code reuse.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 023838542dc8a4eac9650f98942671078a4ce73d)
(cherry picked from sound repo at
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)

Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Ieb57a2e51e4ef0898da77f57ebf2546a5a2b287c
Reviewed-on: https://chromium-review.googlesource.com/176291
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: drm/i915/vlv: enable HDA display audio for Valleyview2

This patch defines HD-Audio configuration registers and enables display audio
from HDA controller for Valleyview2.

v2: fix missing offset VLV_DISPLAY_BASE
v3: rename patch from 'enable HDMI audio' to 'enable HDA display audio', since
    it's for both HDMI and DP audio
v4: use enc_to_dig_port() to get port number, instead of using Haswell specific
    function intel_ddi_get_encoder_port()

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 9ca2fe731b3f12afbc97cf0050dfa4184bd2234c)
(cherry picked from drm-intel repo at
git://people.freedesktop.org/~danvet/drm-intel)
Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: Iab3294bf34c38107dab4ddef850b16613a7a09a3
Reviewed-on: https://chromium-review.googlesource.com/176292
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ALSA: hda - rename function not_share_unassigned_cvt()

The function name not_share_unassigned_cvt() is opposite to what it does.
This patch renames it to intel_not_share_assigned_cvt(), and addes comments
to explain why some Intel display codecs need this workaround.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 300016b960661b4df63690177b22ba5426ff5706)
(cherry picked from sound repo at
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)

Signed-off-by: James Ausmus <james.ausmus@intel.com>

BUG=chrome-os-partner:24908
TEST=manual; With entire series applied, HDMI audio on Rambi works

Change-Id: I8f41acd8153dfa0025e9a6387973ae34afe8fc62
Reviewed-on: https://chromium-review.googlesource.com/176293
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
CHROMIUM: ARM: dts: nyan: Add big rev1+ support

Currently coreboot points to a single compatible string
based on board ID resistors. Thus we should pad the big
dts with addition revisions we expect to boot.

BUG=None
TEST=build kernel and verify rev1 is included in dtb

Change-Id: I82a2b4b1c888835c7de46e8ff87731b41c92a5bc
Reviewed-on: https://chromium-review.googlesource.com/185607
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Katie Roberts-Hoffman <katierh@chromium.org>
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
CHROMIUM: arm: powergate: Added polling for {un}powergate operation

We have to poll and check the status of the power domains after
toggling the the powergating/unpowergating operation to ensure
that the PMC has done its work. The same check is also needed
when removing the clamp.

This patch solves the problem of pause/play and seek operation while
media file playback on Chrome broswer.

BUG=None
TEST=Tested media file playback on Chrome Browser.

Change-Id: I56061591b180552c719c9640d082414c841e3b91
Signed-off-by: Tushar Khinvasara <tkhinvasara@nvidia.com>
Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/184311
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: ARM: dts: Tegra124: Rev0: Add panel timings

Add panel timings dt properties to nyan rev0, so that we can make
arch/arm/mach-tegra/board-venice-panel.c more generic, while allowing for
different panel settings per specific platform.

BUG=chrome-os-partner:25632
TEST=(with patch to arch/arm/mach-tegra/board-venice-panel.c), booted to
ChromeOS desktop on nyan rev0 (venice2).

Change-Id: I2135fba0bd86fc95026d946a3bdad5c6c728c2a2
Signed-off-by: Andrew Chew <achew@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/185702
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: ARM: dts: Tegra124: Rev1: Add panel timings

Add panel timings dt properties to nyan rev1, so that we can make
arch/arm/mach-tegra/board-venice-panel.c more generic, while allowing for
different panel settings per specific platform.

BUG=chrome-os-partner:25632
TEST=(with patch to arch/arm/mach-tegra/board-venice-panel.c), booted to
ChromeOS desktop on nyan rev1 (norrin).

Signed-off-by: Andrew Chew <achew@nvidia.com>

Change-Id: Ia6927cf4ecd1a8893f62ce466c06d41c34df4383
Reviewed-on: https://chromium-review.googlesource.com/185703
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Chew <achew@nvidia.com>
Commit-Queue: Andrew Chew <achew@nvidia.com>
CHROMIUM: thermal: tegra: bind gpu cold cdev with the soc-therm

Bind the gpu_cold cooling device with the soc-therm thermal zone,
so that this cooling device can work.

BUG=None
TEST=Verfied. Check the soc-therm thermal zone in sysfs, the
gpu_cold bound with it.

Change-Id: I6fb85e400d35c63cfa7d735ee06143cb42f63655
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/178258
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
CHROMIUM: thermal: tegra: bind gpu scaling cdev with the soc-therm

Bind the gpu_scaling cooling device with the soc-therm GPU thermal zone,
so that this cooling device can work.

BUG=None
TEST=Verfied. Check the soc-therm GPU thermal zaon in sysfs, the
gpu_scaling bound with it.

Change-Id: I8c537ae84afb3a956fdb4970ad09d7f1e37237d6
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/179995
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
CHROMIUM: ARM: dts: nyan: wp-gpio is active low for Big's SD card.

Indicate that Big's write protect is inverted.

BUG=chrome-os-partner:25606
TEST=Boot Norrin and check that wp switch on card still works.

Change-Id: Ia08b71485149e695f50cc9d109e322c7996b71b3
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185672
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: ARM: tegra: fix DEBUG_LL combined with LPAE

The DEBUG_LL UART address is mapped as an MMU section, hence, the
virtual address must be section-aligned. Sections are 1MB without LPAE
and 2MB with LPAE. Tegra's virtual address was only aligned to 1MB, and
hence the mapping was set up incorrectly with LPAE enabled, thus causing
a hang early during boot. Fix this by picking a different virtual address
that is aligned to 2MB.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
(cherry picked from commit 354935a9e804878ec64a86ad8b7f091d544dcb54)

BUG=None
TEST=earlyprintk now works on Nyan with LPAE enabled.

Change-Id: Ibbdda4d5b297c1429a0906d3ecdd162b0bb69456
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185727
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
UPSTREAM: net: usbnet: fix SG initialisation

Commit 60e453a940ac ("USBNET: fix handling padding packet")
added an extra SG entry in case padding is necessary, but
failed to update the initialisation of the list. This can
cause list traversal to fall off the end of the list,
resulting in an oops.

Fixes: 60e453a940ac ("USBNET: fix handling padding packet")
Reported-by: Thomas Kear <thomas@kear.co.nz>
Cc: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fdc3452cd2c7b2bfe0f378f92123f4f9a98fa2bd)
Cherry-picked from torvalds/linux.git/master with no conflicts

BUG=chromium:341981
TEST=None

Change-Id: I57389cefd38b2337acc5ee494e82985c284bcf1a
Reviewed-on: https://chromium-review.googlesource.com/185442
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
Tested-by: Julius Werner <jwerner@chromium.org>
CHROMIUM: config: enable CONFIG_NF_NAT_* for all

BUG=chromium:341542, chromium:298183, chromium:337931
TEST=`emerge-x86-alex chromeos-kernel-3_10` works and has nf_nat.o, etc.
TEST=`emerge-stumpy chromeos-kernel-3_10` works and has nf_nat.o, etc.
TEST=`emerge-daisy chromeos-kernel-3_10` works and has nf_nat.o, etc.

Change-Id: I95b8d5e4a21c9a93ce6682db8b61032ef263d253
Signed-off-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185508
Reviewed-by: Olof Johansson <olofj@chromium.org>