CHROMIUM: Input: elan_i2c - Fine tune the reset timing and fetch data when IAP finish.

Adjust the wait timing from 200ms to 300ms when reset TP and remove the buffer
comparition when fetch the data after TP reset.

Beside, because the firmware take care of initialization flow after IAP finish,
remove initialization flow from driver. This change will redouce the communiction
between the driver and firmware, and can cut down the risk about the I2C fail.

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
BUG=chrome-os-partner:27458
TEST=on chromebook with Elan touchpad, boot and touchpad works.

Original-Change-Id: I7a96331864020b7d7c464253a8290ff5df8c309b
Reviewed-on: https://chromium-review.googlesource.com/194512
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>

(cherry picked from commit 70741d4c5ff4ff2e27483e5f26dc0e6eb8a210da)
Signed-off-by: Benson Leung <bleung@chromium.org>

Change-Id: I9c878fea55c38339d93993fc4f76717334210acf
Reviewed-on: https://chromium-review.googlesource.com/203975
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
CHROMIUM: Input: elan_i2c - check (x,y) over max(x,y) or not before report to OS

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
BUG=chrome-os-partner:27907
TEST=on chromebook with Elan touchpad, boot and touchpad works.

Original-Change-Id: Iad9bbc68caa043f925fa055fda407633c023069c
Reviewed-on: https://chromium-review.googlesource.com/198633
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>

(cherry picked from commit 69d1a6d3526ae93f7c931e08392de896d072f670)
Signed-off-by: Benson Leung <bleung@chromium.org>

Change-Id: Iaf7d67cc2d1f3c83a2ca32b9d16fa08e5f4f958d
Reviewed-on: https://chromium-review.googlesource.com/203976
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
CHROMIUM: Input: elan_i2c - Do slower init ops asynchronously.

elan_initialize takes a few hundred milliseconds.  Call it
asynchronously to save boot time.  This saves 200+ ms during Big's
boot.

BUG=chrome-os-partner:26883
TEST=boot on rambi and nyan, use touchpad measure boot time.

Original-Change-Id: I2f5ea6291add761d5799f405357d7aa5ee4a39de
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199505
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Charles Mooney <charliemooney@chromium.org>

(cherry picked from commit f3c640231d864503461106934a40fc860d9de9e7)
Signed-off-by: Benson Leung <bleung@chromium.org>

Change-Id: I9ba7575dcabbf13d138acb665939a9534318190d
Reviewed-on: https://chromium-review.googlesource.com/203977
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
BACKPORT: ALSA: hda - Fix runtime PM check

The device can support runtime PM no matter whether it support
signal wakeup or not. For some chips like Haswell which doesnot
support PME by default, this patch let haswell Display HD-A controller
enter runtime suspend, and bring more power saving whith power-well
feature enabled.

BUG=chromium:327049
TEST=Test on peppy with remove /lib/firmware/peppy_alsa.fw
     and system will not panic.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit c67e2228b799ea586f4f6ba7006ce61431f8dde6)
Signed-off-by: Kevin Cheng <kevin.cheng@intel.com>

Change-Id: I38ef2693581a8a6d7bfbc832b6d60d40ae3fd747
Reviewed-on: https://chromium-review.googlesource.com/204172
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Kevin Cheng <kevin.cheng@intel.com>
Commit-Queue: Kevin Cheng <kevin.cheng@intel.com>
Merge branch 'chromeos-3.8' of https://chromium.googlesource.com/chromiumos/third_party/kernel into chromeos-3.8
CHROMIUM: config: remove CONFIG_KDS from i386 and x86_64 common configs

It is only needed for Exynos5 config.

BUG=none
TEST=build kernel for Link

Change-Id: I1a22bcc0fc23a8054c5ab9dcafeb231aec870300
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204420
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
CHROMIUM: ALSA: hda/ca0132 - Modify keyboard mic name and chmap

Analog mic-in2 is used as the keyboard mic on Pixel. Modify
the device name to better reflect it's usage and set channel
map {FC, NA} to note only the 1st channel should be used for
the mono keyboard noise channel.

BUG=chromium:370368
TEST='arecord -l' and 'amixer -c0 contents' to verify device
name and channel map changed accordingly.

Change-Id: I17b5ec37ab2d2a85705feb90c72b71cb304640f7
Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204313
Reviewed-by: Dylan Reid <dgreid@chromium.org>
drm: Make sure we limit the disabled plane search to crtc

This patch fixes a small bug in the primary plane disable helper where
it intended to search planes attached to the current crtc, but it ended
up searching the entire plane list. This resulted in failure when there
was another crtc with an active plane.

BUG=chromium:336809
TEST=Tested on snow & peppy

Change-Id: I96f39cdef71260bd7f87c0f7eb1b0c9f309ced62
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/201499
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Merge branch 'chromeos-3.8' of https://chromium.googlesource.com/chromiumos/third_party/kernel into chromeos-3.8
drm/exynos: Add a hack to appease userspace & atomic helpers

This patch adds a small hack to the plane initialization of the
exynos planes such that the "default window" has a possible_crtcs
of 0 and an overlay plane type. This ensures that userspace will
not select the plane for cursor use, but allows the planes to be
included in the drm layer plane loops which disable planes.

This will be removed once we no longer use the primary plane helpers
and properly implement it ourselves.

BUG=chromium:336809
TEST=Tested on snow & peppy

Change-Id: I0f22326935572617259e7f3b6a0e5c6bafd492b2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/201700
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Revert "UPSTREAM: drm: add atomic fxns"

This reverts commit f00d233ca55617368ff908e545777b72365a2bb3.

There's a new version, it'll be better to roll this back and add
the new one.

BUG=chromium:336809
TEST=Tested on snow & peppy

Signed-off-by: Sean Paul <seanpaul@chromium.org>

Conflicts:
	drivers/gpu/drm/Makefile
	drivers/gpu/drm/cirrus/cirrus_drv.c
	drivers/gpu/drm/exynos/exynos_drm_connector.c
	drivers/gpu/drm/exynos/exynos_drm_drv.c
	drivers/gpu/drm/exynos/exynos_drm_plane.c
	drivers/gpu/drm/i915/i915_drv.c
	drivers/gpu/drm/mgag200/mgag200_drv.c
	drivers/gpu/drm/radeon/radeon_drv.c
	drivers/gpu/drm/shmobile/shmob_drm_drv.c

Change-Id: I631a1feb87025a7af8e8c39f413cd3852c83c61c
Reviewed-on: https://chromium-review.googlesource.com/201701
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Sean Paul <seanpaul@chromium.org>
BACKPORT-PARTIAL: DRM: Armada: Add Armada DRM driver

This patch adds support for the pair of LCD controllers on the Marvell
Armada 510 SoCs.  This driver supports:
- multiple contiguous scanout buffers for video and graphics
- shm backed cacheable buffer objects for X pixmaps for Vivante GPU
acceleration
- dual lcd0 and lcd1 crt operation
- video overlay on each LCD crt via DRM planes
- page flipping of the main scanout buffers
- DRM prime for buffer export/import

This driver is trivial to extend to other Armada SoCs.

Included in this commit is the core driver with no output support; output
support is platform and encoder driver dependent.

Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

BUG=chromium:336809
TEST=Tested on snow & peppy

(cherry picked from commit 96f60e37dc66091bde8d5de136ff6fda09f2d799)
[seanpaul stripped out armada, just kept drm core changes]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I45a4fe4482da27a30a33d8efad64e8df9010bfa5
Reviewed-on: https://chromium-review.googlesource.com/201702
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Add plane helpers to manage kds sync

These helpers will allow us to have per-plane synchronization, while also
moving away from the exynos_drm_crtc abstraction.

BUG=chromium:336809
TEST=Tested on snow

Change-Id: I21b485bb6dd47e7468c380a73962ad0e4bdbf335
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202110
drm/exynos: Remove exynos_drm_manager & exynos_drm_crtc

Using the new exynos_plane_helper funcs, we can implement fimd/mixer/vidi
as proper drm_crtc's with primary plane.

BUG=chromium:336809
TEST=Tested on snow & peach_pit

Change-Id: I2f4786df62afeadecefa7d0869b2d741f6fab190
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202111
drm/exynos: Remove unused exynos_drm_overlay struct

BUG=None
TEST=Compiles

Change-Id: Id4d00d58246d91295e26bef18cbb3ffa6da21dfa
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204831
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Remove dp_dev link from fimd

BUG=None
TEST=Tested on snow

Change-Id: Ib4b74882f7f67c4262cf272e48f0c79890b797d7
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204832
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Remove the suspend/resume functions in exynos_dp_core

They're not used any longer

BUG=chromium:336809
TEST=Tested on snow

Change-Id: Ibd18174bffdadc8689ddcbc34d55470f3e1f2e54
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204833
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Remove unused private members

BUG=None
TEST=Compiles

Change-Id: I44c2016e03a2797f4364a8d4751c091b747deaae
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204834
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Store pointers to crtcs in dev_private

Store pointers to the various crtcs in exynos_drm_private
so we can access them easily at the driver level.

BUG=chromium:336809
TEST=Tested on snow

Change-Id: I74a74079a896bf9d82fa24bf640d35972e82e203
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204835
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drm/exynos: Move possible_clone setup in drm_drv

Move this into drm_dev so we can delete exynos_drm_encoder
without losing functionality.

BUG=chromium:336809
TEST=Tested on snow

Change-Id: Ib8b30b103611b8b7d85879ca4c7f8a7541a3c6f5
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204836
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>