CHROMIUM: dt: peach: remove wakeup-source property from cros-ec-spi

This property is copied from the cros-ec-i2c node of Snow but the spi
driver does not use this property so remove it.

BUG=chrome-os-partner:20220
TEST=Boot on Peach. Suspend system and wake up with any key press

Change-Id: I3f731b7bf04c1109d5dde79f469f611d6b24e396
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/58736
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
mfd: cros-ec-spi: set wakeup capability

Set the device as wakeup capable and register the wakeup source.

Note: Though it makes more sense to have the SPI framework do this,
(either via device tree or by board_info)
this change is as per an existing mail chain:
https://lkml.org/lkml/2009/8/27/291

BUG=chrome-os-partner:20220
TEST=Boot on Peach. Suspend system and wake up with any key press

Change-Id: I08c4a6b126f0ea42450fa5b0721ee1215b4daacd
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/58735
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
UPSTREAM: regulator: wm8994: Convert to module_platform_driver()

The regulators can only be used to supply the CODEC so we don't need to
worry about users that still need fudges for init ordering issues.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit 0565021655dd0e4dd0f26ab4c0273e88a6ddc666)

Change-Id: Ie359e3484cd6278d0e328b227d2d4a98cf2ff5d8
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59226
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: regulator: wm8994: Provide default init data

Almost all systems use the regulators on the WM8994 series devices to
provide DCVDD and AVDD1 so if no init data is supplied then set up the
supplies for the user. This simplifies integration of the device into
systems, especially when device tree is supported.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit e3d27775fcf5e78cca346d298e8e7f4afeefc5c1)

Change-Id: I137dd1c6e27962dac9f1c4f68142e598d4ae0261
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59227
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: regulator: wm8994: Use GPIO parsed from DT when registering regulators

Ensure the regulators are registered with a GPIO parsed from the device
tree when available.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit 3ea9389656ddf8beb1b5b52b8db6333fa4a7c00e)

Change-Id: Id1ac34c3ecd3f0b8097115d0c69533a68a477888
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59228
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: mfd: wm8994: Use devm_regulator_bulk_get API

devm_regulator_bulk_get is device managed and saves some cleanup
and exit code.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(cherry picked from commit f1c68e4dd455eeaf30647a52595a7daf62fc5492)

Change-Id: I3e66280ec13ac7ad7177616760ee9c83d827df8f
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59229
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: mfd: wm8994: Don't use system PM operations

For realistic systems the power management is controlled entirely via
runtime PM - if the device is not runtime suspended then the suspend
will abort without doing anything as functionality such as accessory
detection or audio bypass will require the device to be enabled while
if the device is runtime suspended it is already in the lowest power
state. This means that system suspend is redundant and can be removed
which avoids issues with attempting to double disable the regulators.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(cherry picked from commit 6394678e6e563b196122e911daa911973f9cf7ab)

Change-Id: I66b437bfc774c3a77b29d0e2cce378c683648864
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59230
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: mfd: wm8994: Add device ID data to WM8994 OF device IDs

We can actually read this back from the device but we use this when
registered using standard I2C board data registration so make sure
it's there for OF too.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(cherry picked from commit 39aa3b5a59ab1baff809821ed1db9682a8245656)

Change-Id: I0dc4cb5a8edaac46753657a9aff25e2b12e72970
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59231
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: mfd: wm8994: Add some OF properties

Add properties for some of the more important bits of platform data and
fill out the binding document.

Not all of the current platform data is suitable for the sort of fixed
configuration that is done using DT, some of it should have runtime
mechanisms added instead and some is unlikely to ever be used in practical
systems.

BUG=chrome-os-partner:20316
TEST=Build tested

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(cherry picked from commit 20fb277250816d6c3ff326552be0fea4173fd8ca)

Change-Id: I89627bd1c8a60c5da39f3c50c9c93f0567efe480
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59232
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: fs: bio: check bs null in error path

smatch error:
fs/bio.c:365 bio_alloc_bioset() error: we previously assumed 'bs' could be null (see line 329)
Added a check for if bs is null before freeing resources that may have been
assigned to bs.

BUG=chromium:237705
TEST=FEATURES=test emerge-$B chromeos-kernel-next

Change-Id: I1f1e30a1d095d5341584b5fec34e527c727c3f69
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59069
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
CHROMIUM: arch: efi: checked for null efuse_word in error path

smatch errors:
drivers/net/wireless-3.4/rtlwifi/efuse.c:358 read_efuse() error: potential null dereference 'efuse_word'.  (kmalloc returns null)
drivers/net/wireless-3.4/rtlwifi/efuse.c:358 read_efuse() error: we previously assumed 'efuse_word' could be null (see line 266)

Added a check for a null efuse_word in error path

BUG=chromium:237705
TEST=FEATURES=test emerge-$B chromeos-kernel-next

Change-Id: I628e196151d7ed6f3cc525562e09ecb960dc1d19
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59073
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
CHROMIUM: drivers: mfd: changed compare to >= of array size

smatch error:
drivers/mfd/cros_ec_dev.c:72 ec_get_version() error: buffer overflow 'current_image_name' 4 <= 4

Changed compare in ec_get_version of current_iomage_name array size from > to >=.

BUG=chromium:237705
TEST=FEATURES=test emerge-$B chromeos-kernel-next

Change-Id: I7c9037017fb945c693e740b77e6f116cd9841d16
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59120
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
CHROMIUM: chromeos: check: updated smatch white list

These additions come from reviewing errors that I would
try to fix and after further study found they didn't need
fixing.

BUG=chromium:237705
TEST=FEATURES=test emerge-$B chromeos-kernel-next ;with tweaks to cros-kernel2_src_test for kernel-next

Change-Id: I18b9edb72aad1dabb6fc55550d4fdc6b06ace53f
Signed-off-by: Paul Taysom <taysom@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59126
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
cpufreq: exynos5420: use CCF to set PLL rate

Instead of configuring the PLL manually, use clk_set_rate() to change
the PLL rate in the cpufreq driver.

BUG=chrome-os-partner:19581
TEST=Boot on peach-pit; can change CPU frequencies.

Change-Id: Ib0ee5042707baca9398e935a84836269d774210c
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58927
Reviewed-by: Doug Anderson <dianders@chromium.org>
clk: exynos5420: Add gating for ADC clock

This patch adds gating clock for ADC available on EXYNOS5420

BUG=chrome-os-partner:20310
TEST=Once the dts support is added for ADC and thermistor for peach
	Boot on peach and then check the sysfile system like bellow:
	cat /sys/class/hwmon/hwmon1/device/temp1_input
	cat /sys/class/hwmon/hwmon2/device/temp1_input
	cat /sys/class/hwmon/hwmon3/device/temp1_input
	cat /sys/class/hwmon/hwmon4/device/temp1_input

Change-Id: Ifaece5a03c4f6a48859162587f77948b7015e7a0
Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59154
Tested-by: naveen krishna chatradhi <naveen@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
ARM: dts: exynos5420: add ADC device tree node

Add device tree node for ADC in exynos5420.dtsi

BUG=chrome-os-partner:20310
TEST=Once the dts support is added for ADC and thermistor for pit
	Boot on pit and then check the sysfile system like bellow:
	cat /sys/class/hwmon/hwmon1/device/temp1_input
	cat /sys/class/hwmon/hwmon2/device/temp1_input
	cat /sys/class/hwmon/hwmon3/device/temp1_input
	cat /sys/class/hwmon/hwmon4/device/temp1_input

Change-Id: I80da9181b3c6f4632fd20a9f58954a21d7299cbd
Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59153
arm: dts: Add thermistors devices for exynos5420-peach-pit

This patch adds 4 thermistor device nodes connected to ADC channels
3, 4, 5 and 6 respectively on pit.

BUG=chrome-os-partner:20310
TEST=Once the dts support is added for ADC and thermistor for pit
	Boot on pit and then check the sysfile system like bellow:
	cat /sys/class/hwmon/hwmon1/device/temp1_input
	cat /sys/class/hwmon/hwmon2/device/temp1_input
	cat /sys/class/hwmon/hwmon3/device/temp1_input
	cat /sys/class/hwmon/hwmon4/device/temp1_input

Change-Id: I76be5475565a227dc7cc8fe41316741eff531793
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59224
CHROMIUM: trace: add back legacy tracing_enabled attribute

Turns out that ureadahead expects the old attribute to enable
tracing. While we should fix ureadahead, it's convenient to temporarily
add back the old one here in the kernel while that happens.

BUG=chromium:248268
TEST=boot, make sure ureadahead pack files are generated. Bug to add
ureadahead testcases filed at http://crbug.com/251867

Change-Id: I30af7e53dff48733dcbb26e94e2a96bae186d388
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59286
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
CHROMIUM: input: mouse - Fix trackpoint re-probe on resume.

During suspend, power may be cut to the trackpoint. If so, the
trackpoint will automatically begin its power-on diagnostics upon being
re-powered. If trackpoint_reconnect is called before the diagnostics
complete, the probe ID command will be lost, and reconnect will fail.
This will lead to re-probe, which takes several seconds on Stout due to
the trackpoint / trackpad pass-through design.

The fix here is to make a second attempt if the initial commands on
reconnect fail, which should give the trackpoint enough time to come out
of power-on diagnostics.

TEST=suspend/resume test for 3000 iterations without re-enumeration.
BUG=chromium:250764

Change-Id: I1ff8d3accdde86184864915d540b870ed33feee4
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49228
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59102
CHROMIUM: net: cdc_ncm: temporarily ignore Huawei modems

BUG=chrome-os-partner:20334
TEST=Tested various Huawei PPP dongles on Link and verified that the
devices are not associated with the cdc_ncm driver.

Change-Id: I983a16825e934c3789a5aff7e3446345422caaac
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59377
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>