CHROMIUM: zram: fix compilation error due to API change

The return type of the release function pointer in block_device_operations
changed from int to void. This updates the code to reflect that.

BUG=chrome-os-partner:24166
TEST=build 3.10 kernel

Change-Id: Id3eac83c82491d120cee2caeacb8d07b36c9f446
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181651
CHROMIUM: config: Change config files to build zram module

This configures zram to be built as a module for all configurations.

BUG=chrome-os-partner:24166
TEST=See that rambi boots and that 'find / -name "zram*"' discovers files

Change-Id: I198c6161c5a793cf59de638b0341ae7b7d0e6168
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181686
CHROMIUM: ARM: dts: tegra124: add hdmi interrupt name

The HDMI (DC1) interrupt should be named "dc".  Add it.

BUG=None
TEST=HDMI now probes.

Change-Id: I63f34adf9af6783000c4738dd055d7b1cdb3dabe
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181300
Reviewed-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Andrew Chew <achew@nvidia.com>
CHROMIUM: misc: Add tegra throughput driver

This driver is used to have userspace hint the kernel about
current 3D throughput. The info can be used by host1x driver
to adjust the 3D clock more effiective.

BUG=none
TEST=emerged kernel for nyan (T124 Norrin) and made sure kernel boots.

Change-Id: I56e5539bc08df3f1579d68c5543e871c658dcbdd
Signed-off-by: Mark Zhang <markz@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/180128
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: thermal: cut the spaces when user sets policy

Setting policy results in invalid value error.
	% echo "step_wise" > policy
	% echo: write error: Invalid argument

Need clean up of the buffer which "echo" may add based on the arguments, before
comparing aganist list of governor names.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verfied. echo "step_wise" > policy, it run ok.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Tested-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit 42a5bf507d7f7ecbf606eb392dd9d2e4d009c36b)

Change-Id: I9daff419f3fd37ea241672b8bd8ced39c3f59b14
Reviewed-on: https://chromium-review.googlesource.com/181861
Tested-by: Wei Ni <wni.nvidia@gmail.com>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: ARM: dts: nyan: Add display regulators/gpios

Add regulators and gpios for panel and HDMI.

BUG=None
TEST=Verified display comes up and login screen appears.

Change-Id: I2b48b7ee0f5fa748b164424f79c97e632ca3b3e1
Signed-off-by: Mark Zhang <markz@nvidia.com>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181563
UPSTREAM: thermal: hwmon: move hwmon support to single file

In order to improve code organization, this patch
moves the hwmon sysfs support to a file named
thermal_hwmon. This helps to add extra support
for hwmon without scrambling the code.

In order to do this move, the hwmon list head is now
using its own locking. Before, the list used
the global thermal locking. Also, some minor changes
in the code were required, as recommended by checkpatch.pl.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 0dd88793aacd7c91b9724be7b618bb3f7c25befe)

Change-Id: Iff6da8206200d842d9d7a56a2f2d613439977561
Reviewed-on: https://chromium-review.googlesource.com/181440
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
UPSTREAM: drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional

When registering a new thermal_device, the thermal framework
will always add a hwmon sysfs interface.

This patch adds a flag to make this behavior optional. Now
when registering a new thermal device, the caller can
optionally inform if hwmon interface is desirable. This can
be done by means of passing a thermal_zone_params.no_hwmon == true.

In order to keep same behavior as of today, all current
calls will by default create the hwmon interface.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-acpi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: Zhang Rui <rui.zhang@intel.com>
Suggested-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit ccba4ffd9eff6120a20cc7656458ac554aec4b0c)

Change-Id: I9295a73eedb0b9165fb7ed8412cddb7f8cc559ac
Reviewed-on: https://chromium-review.googlesource.com/181441
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
CHROMIUM: iommu/tegra124: smmu: Fix high bit ptc flush

We should flush the PTC_FLUSH_1 even when the value is zero.
Since PTC_FLUSH_1 only exists in Tegra124, add a flag to
struct smmu_platform_data to indicate whether or not the
larger physical address space is supported.

This patch fixes an issue that the X server can't come up and
the log shows it's caused by a "mmu fault".

BUG=chrome-os-partner:24830
TEST=Built kernel and UI comes up

Change-Id: I36208df4ee006742671a8714557725046b693e55
Signed-off-by: Mark Zhang <markz@nvidia.com>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181740
Reviewed-by: Dylan Reid <dgreid@chromium.org>
CHROMIUM: config: Change config files to match wireless-3.8

This change removes some of the configs that don't exist in wireless-3.8 and
turns on some configs that were left out. ATH9K_RATE_CONTROL is set in the
config files for the 3.8 kernel, so this adds it back. This also turns the
EXPERIMENTAL config back on since that is needed for some of the wireless-3.8
configs.

BUG=None
TEST=emerge-rambi chromeos-kernel-3_10

Change-Id: I0afd2b6c9068e423729d28fc6b669cfdcf1fa424
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181685
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
CHROMIUM: ARM: dts: nyan: TPM is powered in suspend

Add "powered-while-suspended" to the TPM to indicate to the kernel
that the TPM does not need its state saved across suspend/resume.

BUG=None
TEST=LP0 suspend/resume on Nyan and see that the TPM no longer causes
long pauses during suspend.

Change-Id: I2f0e55a19192512b59f3709270b36ad0cb0aad5d
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182092
Reviewed-by: Dylan Reid <dgreid@chromium.org>
CHROMIUM: HACK: ARM: dts: nyan: Enable VDD_GPU all the time

According to the Tegra124 TRM, we ought to be able to power off
the GPU rail, but we've observed hangs during the GPU power-up
sequence if we do so.  Make VDD_GPU always-on for now until we
find a real solution.

BUG=None
TEST=Verified display working (with other dependencies)

Change-Id: I8016c340c08c4a3816a52aca6ac8285dfa74d170
Signed-off-by: Mark Zhang <markz@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/180291
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: thermal: thermal_core: allow binding with limits on bind_params

When registering a thermal zone device using platform information
via bind_params, the thermal framework will always perform the
cdev binding using the lowest and highest limits (THERMAL_NO_LIMIT).

This patch changes the data structures so that it is possible
to inform what are the desired limits for each trip point
inside a bind_param. The way the binding is performed is also
changed so that it uses the new data structure.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit a8892d83894bcbd2717846cfa85955152b73453f)

Change-Id: I71035ac366118b2a2b81afcfd9a0313fd5f55e29
Reviewed-on: https://chromium-review.googlesource.com/181442
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
UPSTREAM: drivers: thermal: add check when unregistering cpu cooling

This patch avoids NULL pointer accesses while unregistering
cpu cooling devices, in case a NULL pointer is received.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 50e66c7ed8a1cd7e933628f9f5cf2617394adf5a)

Change-Id: Ieb670b63ecaf5b03a98e01dde0f2d6aa1479e3fc
Reviewed-on: https://chromium-review.googlesource.com/181443
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
UPSTREAM: thermal: allow registering without .get_temp

This patch changes the thermal core driver to allow
registration of thermal zones without the .get_temp callback.

The idea behind this change is to allow lazy registration
of sensor callbacks.

The thermal zone will be disabled whenever the ops
does not contain a .get_temp callback. The sysfs interface
will be returning -EINVAL on any temperature read operation.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 81bd4e1cebed5efb85bd94a15342ee4d6965a416)

Change-Id: I68a1eac2f4755de73ffbf25eed0a0031af22233f
Reviewed-on: https://chromium-review.googlesource.com/181444
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Wei Ni <wni.nvidia@gmail.com>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
UPSTREAM: thermal: introduce device tree parser

This patch introduces a device tree bindings for
describing the hardware thermal behavior and limits.
Also a parser to read and interpret the data and feed
it in the thermal framework is presented.

This patch introduces a thermal data parser for device
tree. The parsed data is used to build thermal zones
and thermal binding parameters. The output data
can then be used to deploy thermal policies.

This patch adds also documentation regarding this
API and how to define tree nodes to use
this infrastructure.

Note that, in order to be able to have control
on the sensor registration on the DT thermal zone,
it was required to allow changing the thermal zone
.get_temp callback. For this reason, this patch
also removes the 'const' modifier from the .ops
field of thermal zone devices.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 4e5e4705bf69ea450f58fc709ac5888f321a9299)

Change-Id: I0b389b4a034de3409ad250bf0f36e56185a5b3f4
Reviewed-on: https://chromium-review.googlesource.com/181445
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
UPSTREAM: ACPI / thermal: remove const from thermal_zone_device_ops declaration

The following commit introduced the requirement to not declare
thermal_zone_device_ops structs as const in order to allow
changing the .get_temp callback.

commit 4e5e4705bf69ea450f58fc709ac5888f321a9299
Author: Eduardo Valentin <eduardo.valentin@ti.com>
Date:   Wed Jul 3 15:35:39 2013 -0400

    thermal: introduce device tree parser

Modify acpi_thermal_zone_ops to follow the new requirement.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit ec9c9c2ec1d164f3c5f3c9ac41f43de40040e43c)

Change-Id: If0b74cc2995a1da585e5c038ec4103f555653e1d
Reviewed-on: https://chromium-review.googlesource.com/182057
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
UPSTREAM: thermal: core: introduce thermal_of_cooling_device_register

This patch adds a new API to allow registering cooling devices
in the thermal framework derived from device tree nodes.

This API links the cooling device with the device tree node
so that binding with thermal zones is possible, given
that thermal zones are pointing to cooling device
device tree nodes.

Cherry picked from:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

BUG=None
TEST=Verified. Build and boot up system.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit a116b5d44f144586ef03a93f14ddc63f4a85e906)

Change-Id: I759f297c311d546444df66029d7f2262c115cb86
Reviewed-on: https://chromium-review.googlesource.com/181446
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
CHROMIUM: hwmon: lm90: expose to thermal fw via DT nodes

This patch adds to lm90 temperature sensor the possibility
to expose itself as thermal zone device, registered on the
thermal framework.

The thermal zone is built only if a device tree node
describing a thermal zone for this sensor is present
inside the lm90 DT node. Otherwise, the driver behavior
will be the same.

BUG=None
TEST=Verified. Build and boot up system.

Change-Id: Id356b94d7e8f4b49ec15e46b17a1fa2ff0cbf8cf
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/181447
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>