arm: tegra: medcom-wide: Update to the new sx8634 driver

Change-Id: Ic518689b9214c9054bec8e238d037966d662d733
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/747
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
input: Rework the SX8634 driver to make an MFD driver

Beside the touch controller the SX8634 also provides a GPIO controller
and PWMs. To properly support these we first rewrite the current input
driver to an MFD driver with a single sub device for the touch
controller.

Because of this the platform data struct needs to be changed a bit and
the platforms using it will need an update.

Change-Id: I314dea03b77963ce53a9557903f463e233f10103
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
video: backlight: Add a backlight driver for the SX8634

This driver allow controlling backlights using the PWM outputs of the
SX8634. This feature of the SX8634 wasn't implemented using the PWM API
because the SX8634 doesn't allow to set the frequency, only the duty.
Moreover the SX8634 provides features, like the logarithmic curve, that
only make sense when driving LEDs.

Change-Id: If7a1aa8399dee52aa37efa95d6e72b7f65ff5db7
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/748
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: medcom-wide: Add the touchbar backlights

The 2 touchbar have a backlight that can be controlled using a PWM
output of the touch controller.

Change-Id: Ied71ed42730d97034be3a79aaf2f48c8933036ae
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/749
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: tamonten ng: Enable USB hotplug in the defconfig

Hotplugging USB devices should be possible with the default config.

Change-Id: Ieefbe187c6e6f033780212815fe5c4f14e41227d
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/744
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: Add UBI support to medcom-wide platform.

Enable the modules to use UBI filesystem. This is required in preparation to
boot from NAND flash.

Change-Id: Icd6b9c8ddf2781b787ba3d6045324cece8b3067f
Signed-off-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/766
Reviewed-by: Dirk Leber <dirk.leber@avionic-design.de>
arm: tegra: tamonten: Disable temperature alert IRQ.

With or without IRQ, initialization works properly and the sensor is
accessible via sysfs interfaces. But if an IRQ is set, the sensor is not
available for libsensors in user-spaces, so tools using libsensors don't
get any data.

To workaround this, disable the IRQ for now, until we know the reason.

Change-Id: I0ff3418250b792d7a005d9f3abb8f978b636ebdd
Signed-off-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/772
Reviewed-by: Dirk Leber <dirk.leber@avionic-design.de>
staging: Backport zram driver from kernel 3.12.

zRAM increases performance by avoiding paging on disk and instead uses a
compressed block device in RAM in which paging takes place until it is
necessary to use the swap space on the hard disk drive. Since using RAM
is faster than using disks, zram allows Linux to make more use of RAM
when swapping/paging is required, especially on older computers with
less RAM installed.

Even though the cost of RAM hardware is relatively low, this feature
still offers advantages for netbooks and other lower-powered laptops,
virtualization and in the case of embedded devices, especially those
that use flash memories that have a limited lifespan, dependent on
write-use and thus wear out quickly when used as a swap device.

Also zRAM is used on Android and ChromeOS for a while now, see:
http://www.chromestory.com/2013/03/google-enabling-zram-for-chrome-os-by-default

Change-Id: Ic52139e12e9c78d175f178f1403efb2c29d72914
Signed-off-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/767
Reviewed-by: Dirk Leber <dirk.leber@avionic-design.de>
arm: tegra: medcom-wide: Update defconfig after zram backport.

With the backport of zRAM, we need to update the defconfig, because some
config entries have been changed.

Change-Id: Ice696b06fb6d308a52af01b10bd6acb9ebb08ecc
Signed-off-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/768
Reviewed-by: Dirk Leber <dirk.leber@avionic-design.de>
arm: tegra: dvfs: Clamp the clock rate passed to tegra_dvfs_set_rate()

When a DVFS controlled clock is enabled, tegra_dvfs_set_rate() is
called with the current clock's rate. But when adjusting a clock
maximum rate, its current rate isn't changed. So it might happen that
tegra_dvfs_set_rate() is called with a rate outside of the clock's
allowed range.

Fix this problem by clamping the rate passed to tegra_dvfs_set_rate()
to the currently allowed range.

This fix allow the Tamonten NG to boot properly without requiring a
maximum EDP limit of 1300 mV.

Change-Id: If8e744a8ca935e95463aa47a12a80667ff4be0db
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/742
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
mfd: tps6586x: add version detection

Use the VERSIONCRC to determine the exact device version. According to
the datasheet this register can be used as device identifier. The
identification is needed since some tps6586x regulators use a different
voltage table.

Based on a patch from Stefan Agner <stefan@agner.ch> that was extended
to also support the TPS658640.

Change-Id: I8d81b78027eaaf2aa16125db1f4e929fd136640c
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/777
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
regulator: tps6586x: add and use correct voltage table

Depending on the regulator version, the voltage table might be
different. Use version specific regulator tables in order to select
correct voltage table. For the following regulator versions different
voltage tables are now used:

  * TPS658623: Use correct voltage table for SM2
  * TPS658643: New voltage table for SM2
  * TPS658640: New voltage table for SM2

Base on a patch from Stefan Agner <stefan@agner.ch> that was extended
to also support the TPS658640.

Change-Id: I55338a251e20208c89054e540ded4b738fbaade4
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/778
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: tamonten: Use the ad7461 driver for the temperature sensor

The nct1008 driver is incomplete and doesn't implement the hwmon
interface. However the nct1008 is register compatible with the AD7461
which have an hwmon driver.

This also revert commit 56e18b6f2543547cd9c8900ea80a289b8ea823a4 that
just disabled the IRQ. This was in fact a missunderstanding as the
configuration tested with the IRQ disabled was in fact using the LM90
driver.

In current mainline the AD7461 driver has been dropped in favor of the
LM90. We still use the AD7461 driver here because the LM90 driver is
not configurable via platform data.

Change-Id: I609614d4b955410e2a0ef2f29030ca9e9d4cacf3
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Tested-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/781
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: medcom-wide: Reflect com-tamonten changes

I the past few weeks we have heavily modified the com-tamonten infrastructure,
so that many features now depend on com-tamonten and can be dropped from the
defconfig.

Change-Id: I02f58c74cf72bb6a360a9eff67f75aca63737e84
Signed-off-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/764
Reviewed-by: Dirk Leber <dirk.leber@avionic-design.de>
arm: tegra: tamonten ng: Add the AVP device

The AVP device is required to use the hardware accelerated video
decoding.

Change-Id: I928d0f365b8852fe549d4028477fc7afef6c1776
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/784
Reviewed-by: Hendrik Lippek <hendrik.lippek@avionic-design.de>
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: tamonten: Let COM_TAMONTEN select the ADT7461 driver

The Tamonten COM has an NCT1008 temperature sensor that can be used
with the ADT7461 driver. To keep the platform specific defconfig
simpler, we simply add the driver as dependency to the COM.

Change-Id: I2df1df1e225d2e06562e652a729adf53e0fadcf1
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/782
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>
arm: tegra: tamonten ng: Set the proper current limit for the CPU rail

The regulator on the Tamonten NG can only safely output up to 2A.

Change-Id: Ia18b3605f4a950271545d49c3a95bbe7a7fe7f3d
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Reviewed-on: http://review.adnet.avionic-design.de/743
Reviewed-by: Hendrik Lippek <hendrik.lippek@avionic-design.de>
Reviewed-by: Soeren Grunewald <soeren.grunewald@avionic-design.de>