CHROMIUM: Input: elan_i2c - Add structure point checking

We add checking structure point is null or not before calling
input sub-system in elan_isr() to avoid excepted kernl panic.

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

Change-Id: I987151e41b985ee2b93b6468f40a73bf822143f9
Reviewed-on: https://chromium-review.googlesource.com/191666
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
(cherry picked from commit 109129a524d5c660e1746823ab14246be4390a8c)
Reviewed-on: https://chromium-review.googlesource.com/193800
Commit-Queue: Benson Leung <bleung@chromium.org>
drm/i915/vlv: assert and de-assert sideband reset on resume

This is a bit like the CMN reset de-assert we do in DPIO_CTL, except
that it resets the whole common lane section of the PHY.  This is
required on machines where the BIOS doesn't do this for us on resume to
properly re-calibrate and get the PHY ready to transmit data.

Without this patch, such machines won't resume correctly much of the time,
with the symptom being a 'port ready' timeout and/or a link training
failure.

BUG=chrome-os-partner:25517
TEST=by hand on glimmer: suspend/resume a few times, with and without HDMI plugged in

Change-Id: I3ee3e683db7638ee06ede982f957ebd3d2dfe934
Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Stphane Marchesin <marcheu@chromium.org>
Previous-Reviewed-on: https://chromium-review.googlesource.com/194325
(cherry picked from commit 93d59b7f49a1e0ca75f2e116013df8a1f262dbd0)
Reviewed-on: https://chromium-review.googlesource.com/194430
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
CHROMIUM: ASoC: Byt-max98090: Switch Max98090 codec to use 25mhz MCLK.

This will fix the pll unlock issue which is the root cause for audio
playback failure.
This requests corresponding coreboot change to use 25MHz.

BUG=chrome-os-partner:26948
TEST=Manual: Check that playback is never silent

Change-Id: I2d07c7477d2843e8ecdf0400408a055774a2fae2
Signed-off-by: yang fang <yang.a.fang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/193360
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 60b723c6dc68ec4ef8f7f2787f85b4d0206c82ad)
Reviewed-on: https://chromium-review.googlesource.com/194440
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
CHROMIUM: ASoC: max98090 - Add corrected DMIC settings

BUG=chrome-os-partner:27888
TEST=Record audio from DMIC on rambi and listen for noise.

Change-Id: I7dd9fc7ef4a5547bd37d82b8b433834f116d32e1
Signed-off-by: Ralph Birt <ralph.birt@maximintegrated.com>
Reviewed-on: https://chromium-review.googlesource.com/194443
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
(cherry picked from commit c0f21eea220db00b9b15bfef208bca67d4eb8077)
Reviewed-on: https://chromium-review.googlesource.com/195041
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Revert "BACKPORT: ASoC: BYT-max98090: Enable the PLL interrupt source."

This reverts commit b9e82584475159c80655a63fa008e665281cc182.

The workaround has been shown to actively break basic audio
functionality on EVT3. Clock change in firmware is proving to
be sufficient in fixing the root cause. To avoid the risk of it
breaking on future hardware revisions, disable workaround
interrupt.

BUG=chrome-os-partner:27870
TEST=Manual: Check that playback and record always work on rambi.

Change-Id: I7e9f0a9a25dccd551afeaa863f952d8a05b5f20a
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/194451
Reviewed-by: Jim Bride <jim.bride@intel.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
(cherry picked from commit 9676ecc43ce7bb548c16f8604057b76aa5a2640b)
Reviewed-on: https://chromium-review.googlesource.com/195355
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
CHROMIUM: LPE: Fix audio crash due to negative address offset

There were occasional LPE crash during reboot testing:

[   11.883364] BUG: unable to handle kernel paging request at ffffc90121700000
[   11.883380] IP: [<ffffffffc024d8bc>] sst_module_insert_fixed_block+0x24f/0x26d [snd_soc_sst_dsp]
[   11.883397] PGD 7800b067 PUD 0
[   11.883405] Oops: 0002 [#1] SMP
[   11.886418] gsmi: Log Shutdown Reason 0x03

The virtual address, ffffc90121700000, was out of range. The virtual
address is calculated by adding LPE base address with an offset:

sst_memcpy32(dsp->addr.lpe + data->offset, data->data, data->size);

The offset is calculated in sst_byt_parse_module, by subtraction of
two virtual addresses dsp->addr.fw_ext and dsp->addr.lpe:

block_data.offset = block->ram_offset + (dsp->addr.fw_ext - dsp->addr.lpe);

These virtual addresses are assigned by kernel from ioremap:

sst->addr.lpe = ioremap(pdata->lpe_base, pdata->lpe_size);
sst->addr.fw_ext = ioremap(pdata->fw_base, pdata->fw_size);

In current driver code, offset is defined as unsigned int32:

struct sst_module_data {
...
	u32 offset;		/* offset in FW file */
};

Most of the time kernel assigned virtual addresses with addr.fw_ext
greater than addr.lpe. But sometimes it was the other way round.

Fix the problem by declaring offset as signed int32_t.

BUG=chrome-os-partner:28168
TEST=Test reboot on Rambi.

Change-Id: I050dd8d61e7249a94b4316d3f552459938147c9c
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/195626
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
(cherry picked from commit efbd4ee43769df064881552cadf7289f177ddc04)
Reviewed-on: https://chromium-review.googlesource.com/196703
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>