BACKPORT: Bluetooth: Fix calling request callback more than once

In certain circumstances, such as an HCI driver using __hci_cmd_sync_ev
with HCI_EV_CMD_COMPLETE as the expected completion event there is the
chance that hci_event_packet will call hci_req_cmd_complete twice (once
for the explicitly looked after event and another time in the actual
handler of cmd_complete).

In the case of __hci_cmd_sync_ev this introduces a race where the first
call wakes up the blocking __hci_cmd_sync_ev and lets it complete.
However, by the time that a second __hci_cmd_sync_ev call is already in
progress the second hci_req_cmd_complete call (from the previous
operation) will wake up the blocking function prematurely and cause it
to fail, as witnessed by the following log:

[  639.232195] hci_rx_work: hci0 Event packet
[  639.232201] hci_req_cmd_complete: opcode 0xfc8e status 0x00
[  639.232205] hci_sent_cmd_data: hci0 opcode 0xfc8e
[  639.232210] hci_req_sync_complete: hci0 result 0x00
[  639.232220] hci_cmd_complete_evt: hci0 opcode 0xfc8e
[  639.232225] hci_req_cmd_complete: opcode 0xfc8e status 0x00
[  639.232228] __hci_cmd_sync_ev: hci0 end: err 0
[  639.232234] __hci_cmd_sync_ev: hci0
[  639.232238] hci_req_add_ev: hci0 opcode 0xfc8e plen 250
[  639.232242] hci_prepare_cmd: skb len 253
[  639.232246] hci_req_run: length 1
[  639.232250] hci_sent_cmd_data: hci0 opcode 0xfc8e
[  639.232255] hci_req_sync_complete: hci0 result 0x00
[  639.232266] hci_cmd_work: hci0 cmd_cnt 1 cmd queued 1
[  639.232271] __hci_cmd_sync_ev: hci0 end: err 0
[  639.232276] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-61)

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
(cherry picked from commit 53e21fbc288218a423959f878c86471a0e323a9a)

BUG=chrome-os-partner:24603
TEST=tested multiple iteration of FW patch loading

Change-Id: Id41640e68269e5e258c5f83b9bac985b4c903f8e
Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Previous-Reviewed-on: https://chromium-review.googlesource.com/180544
(cherry picked from commit a74cf6cac5fa11a805c3045d164b46b1a274bcd1)
Reviewed-on: https://chromium-review.googlesource.com/189517
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: Bluetooth: Enable autosuspend for Intel Bluetooth device

This patch enables autosuspend for Intel Bluetooth device.

After btusb is loaded for Intel Bluetooth device, the power/control
attribute contains "on" value by default which disables the autosuspend.
Based on the USB PM document(Documentation/usb/power-management.txt),
kernel disabled the autosuspend for all devices other than hub by default.

"The USB specification states that all USB devices must support power
management.  Nevertheless, the sad fact is that many devices do not
support it very well.  You can suspend them all right, but when you
try to resume them they disconnect themselves from the USB bus or
they stop working entirely.  This seems to be especially prevalent
among printers and scanners, but plenty of other types of device have
the same deficiency.

For this reason, by default the kernel disables autosuspend (the
power/control attribute is initialized to "on") for all devices other
than hubs.  Hubs, at least, appear to be reasonably well-behaved in
this regard."

This document also described how the driver can enables the autosuspend
by using an USB api.

"Drivers can enable autosuspend for their devices by calling

	usb_enable_autosuspend(struct usb_device *udev);

in their probe() routine, if they know that the device is capable of
suspending and resuming correctly.  This is exactly equivalent to
writing "auto" to the device's power/control attribute."

For Intel Bluetooth device, the autosuspend needs to be enabled so the
device can transit to LPM(Low Power Mode) and ULPM(Ultra LPM) states after
receiving suspend message from the host.

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(cherry picked from commit d2bee8fb6e18f6116aada39851918473761f7ab1)

BUG=chrome-os-partner:24603
TEST=verified that the autosuspend feature is enabled and Intel BT
transit to LPM/ULPM

Change-Id: I78192053b2fcca9f15e948b60ff62c876053181c
Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
(cherry picked from commit 5199c205e0a7451b031157a827cc2257ef368d61)
Reviewed-on: https://chromium-review.googlesource.com/189580
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
CHROMIUM: DPTF Kernel Driver Update

Trace and logging updates, bug fixes, and code cleanup.

BUG=chrome-os-partner:25110,chrome-os-partner:26133
TEST=Manually tested
CQ-DEPEND=CL:189551

Change-Id: Ieaf8a0dd97bb8eb086d85308a038914c09d62564
Signed-off-by: Brad Geltz <brad.geltz@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/187524
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Duncan Laurie <dlaurie@chromium.org>
(cherry picked from commit ec5a6e0e623d0eda15ae55a2136d413862b70d5b)
Reviewed-on: https://chromium-review.googlesource.com/189534
Tested-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
CHROMIUM: DPTF Kernel Driver Update

Fix for O2 optimization issue.

Added version number of 8.0.8 to kernel modules.

BUG=chrome-os-partner:25110
TEST=Manually tested
CQ-DEPEND=CL:189414

Change-Id: I618b01334d975048a5dc02e91591eead1eeab3d9
Signed-off-by: Brad Geltz <brad.geltz@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/188605
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Duncan Laurie <dlaurie@chromium.org>
(cherry picked from commit 82d7fb14fb691daf17faf5586aeee86295f6db46)
Reviewed-on: https://chromium-review.googlesource.com/189552
Tested-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Enable atmel 540s trackpad for atmel_mxt_ts driver

The Atmel 540s chip has an additional object in Atmel's object protocol
that was not used by previous ChromeOS devices.  This object T100 needs
to be supported if we are to use 540s touchpads in the future.  This CL
adds support to the atmel_mxt_ts drive for the T100 object and its
related parameters so that 540s touchpads will work.

BUG=chrome-os-partner:24559
TEST=Run evtest on new trackpad. Check the pointer moving and that
input events are arriving as expected.  This patched driver was also
tested on a Spring to make sure that the old Atmel pads that don't use
the new T100 format still work.

Change-Id: I4c4512b2b3c1f334196ad672cb17f7db16d293ee
Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.com>
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180151
Reviewed-by: Wonjoon Lee <woojoo.lee@samsung.com>
Tested-by: Wonjoon Lee <woojoo.lee@samsung.com>
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/188876
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189536
Revert: Remove Work in Progress LPE driver and Rambi platform driver.

This patch is a squash of following revert commits:

Revert "CHROMIUM: ASoC: max98090 - Fix dmic table entries for 19.2MHz sysclk."

This reverts commit 6f5a1d310042d870ac0b9b25de0f58f51cc200d2.

Revert "CHROMIUM: ALSA: ASoC: max98090: dt and regulator support"

This reverts commit 8a270d1f18bff50a58c683f1e59a429a883753d1.

Revert "CHROMIUM: SOUND: Support probing MAX98090 via ACPI ID"

This reverts commit 6518b74afeeacb69d8587667a09b7eec9390eff5.

Revert "CHROMIUM: [MUST_REVERT] LPE: Remove request_irq call from max98090 codec"

This reverts commit 8a41bc4d727b6f221b30426bc23175e210e90705.

Revert "CHROMIUM: ALSA: ASoC: max98090: Shudown codec for hw_params."

This reverts commit 8b43460031a8c4ef146faed2e6dcac9eec207d62.

Revert "CHROMIUM: ALSA: ASoC: max98090: Shutdown codec when changing to/from dmic."

This reverts commit 671d3d899d518cd4b86de64e257de4bd473373ce.

Revert "CHROMIUM: ASoC: mid-x86: rambi: Invert mic jack GPIO"

This reverts commit 25165b6a950e5765569d428a13e088d57dfba612.

Revert "CHROMIUM: SoC: mid-x86: rambi: hp/mic jack as event device"

This reverts commit b8d8c2c37e9c19d52a86a4c405b6d030d616b570.

Revert "CHROMIUM: ASoC: mid-x86: rambi: Fix max98090 master clock setting"

This reverts commit e2b4cc974a017bb92ae1233408cd58ccf702ccbd.

Revert "LPE: Enable jack detection for the Rambi platform"

This reverts commit 9d43848ce2d86cc4eee1ece7adfc478bd95ce8c0.

Revert "CHROMIUM: intel_sst: adjust the character length of the firmware path"

This reverts commit 9afc2c7a9f92d513d86f5a415ccee957fd253def.

Revert "CHROMIUM: rambi audio: load firmware from firmware/intel"

This reverts commit b1c1c4f67a99578355fe4ea95d7004e0a74f96ff.

Revert "CHROMIUM: SoC: mid-x86: rambi: Enable mic bias generation for headset mic"

This reverts commit 98ac6a401ead84e321c1aa4c43d069d7c7259af6.

Revert "CHROMIUM: ASoC: mid-x86: rambi: Use (virtual) input pin IN34 for headset mic"

This reverts commit 23ecd7b60f55dbad57d973d6c9ebc9a4d508ea0f.

Revert "CHROMIUM: LPE: Eliminate non-portable virt_to_phys in sst_pcm_new"

This reverts commit dc4eed8676b114aa632fd2670366fe1f33e21b2d.

Revert "CHROMIUM: Fix warnings in intel_sst_ and intel_mid_dma"

This reverts commit 7520c522ac8169d35ed7292d81934ef493c8d2b9.

Revert "CHROMIUM: LPE: Make audio driver fw ipc address-passing 64-bit safe"

This reverts commit 8fa87c6ff120ba57bdd11db20be401638c0685fc.

Revert "CHROMIUM: LPE: Make all sst firmware ipc structures packed"

This reverts commit 3f0075453e9e64f31e2f7257fa5e05c59db9f557.

Revert "CHROMIUM: LPE: Add a Maxim 98090-codec choice to the audio driver"

This reverts commit 63ce89046e46535d42472143e5dd037c5f997f18.

Revert "CHROMIUM: LPE: Force firmware-loading to use 4-byte writes"

This reverts commit e21f0419f06ea11be6c48586e71101415bd8d5a9.

Revert "CHROMIUM: ASoC: mid-x86: Use rt5640-aic1 also for capture on byt_bl_rt5642"

This reverts commit 800cd9fced62f96a5c882a5cfbf5f154d2ba75fe.

Revert "CHROMIUM: ASoC: mid-x86: Use I2S BCLK as a codec master clock on byt_bl_rt5642"

This reverts commit ca6a4f4b063752d558c09564483f5f479259e04e.

Revert "CHROMIUM: ASoC: mid-x86: Fix select statement for rt5640 driver"

This reverts commit ee4c30c73a77de019a57197b90d92132b0c85750.

Revert "CHROMIUM: BYT_LPE : Enabled playback with RT5642"

This reverts commit bd617e322bf09cc9cb9b81b35cf116c08b56c0b8.

Revert "CHROMIUM: ASoC: mid-x86: Codec selection and machine driver update for BYT"

This reverts commit 93b01e0aaa06bf6cb9ce474000768402dd8fe7a6.

Revert "CHROMIUM: BYT_LPE: Added machine driver source file for RT5642 codec as the base"

This reverts commit 22e032fb0ccbbd45fc8a367f2fa9c553f2d3a873.

Revert "CHROMIUM: LPE: Extract standalone platform-data for Baytrail audio codec"

This reverts commit 4baede473218cd0c1c8b2331aed492922745fb24.

Revert "CHROMIUM: x86: Add BYT RT564x related registrations"

This reverts commit 312af3b91c0c5b24991be73e7f3c44a15bb5d065.

Revert "CHROMIUM: dmaengine: mid_dma: Add mid_dma changes from LPE commit"

This reverts commit 602fc69137e0cac46d8df895f7439859dd74f65e.

Revert "CHROMIUM: BYT_LPE_FEATURE: Ported LPE audio driver codes from kernel 3.8"

This reverts commit 6acaac472514e654f7d03b5d63faefeefb2a19ee.

Revert CHROMIUM: SoC: mid-x86: rambi: hp/mic jack as event device

Revert CHROMIUM: ASoC: mid-x86: rambi: Invert mic jack GPIO

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Iaf30a586fbe8dc19589e031cc19854d2c267777a
Reviewed-on: https://chromium-review.googlesource.com/189301
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 95786589c13c1ad0e6fe2c82c7b1b5b98ad838a4)
Reviewed-on: https://chromium-review.googlesource.com/190174
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
UPSTREAM: ASoC: Rename mid-x86 directory to intel

We have other Intel platforms coming having the Smart Sound Technology (SST)
so rename the mid-x86 directory to intel as originally directory name
reflected only Intel MID platform.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 784cbf8ab4641c874806a938b9c863c91d70fbe5)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I0e67157c8adcfb046b9376b7935e8c035642ce3a
Reviewed-on: https://chromium-review.googlesource.com/189302
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 18ee76656256528ef0a2a53909b4f8589824ac82)
Reviewed-on: https://chromium-review.googlesource.com/190175
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
UPSTREAM: ASoC: intel: Don't set unused struct snd_pcm_hardware fields

The ASoC core assumes that the PCM component of the ASoC card transparently
moves data around and does not impose any restrictions on the memory layout or
the transfer speed. It ignores all fields from the snd_pcm_hardware struct for
the PCM driver that are related to this. Setting these fields in the PCM driver
might suggest otherwise though, so rather not set them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from c098284a4bfb81b86331aadd08b482233c21fa2c)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I6f82064cc1ffb8329dc555f2f5efce5d4666704f
Reviewed-on: https://chromium-review.googlesource.com/189303
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 5a5c403bf02eaa6064e780ba0ce5aca8e3924aab)
Reviewed-on: https://chromium-review.googlesource.com/190176
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add a mfld prefix to Intel SST drivers.

Resent with correct email for Mark.

In order to differentiate the different Intel SST audio core drivers we
need to rename the current drivers with a mfld prefix. This also includes
renaming in the Makefile and Kconfig

Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from a355d67817eccdbe869020f8f5a3123f21f8106f
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I8e9fdbcb9aa6216ca07abbe82dc2b6f5af57d3a7
Reviewed-on: https://chromium-review.googlesource.com/189304
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit e5a59aa0b33b66fbd119eac774434061d7ee46da)
Reviewed-on: https://chromium-review.googlesource.com/190177
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add Intel SST audio DSP low level shim driver.

Add support for Intel Smart Sound Technology (SST) audio DSPs.
This driver provides the low level IO, reset, boot and IRQ management
for Intel audio DSPs. These files make up  the low level part of the SST
audio driver stack and will be used by many Intel SST cores like
Haswell, Broadwell and Baytrail.

SST DSPs expose a memory mapped region (shim) for config and control.
The shim layout is mostly shared without much modification across cores
and this driver provides a uniform API to access the shim and to enable
basic shim functions. It also provides functionality to abstract some shim
functions for cores with different shim features.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 790aff62291eade029755713fb41c1143d4ddbc7
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Ib79908234a0808706a3be97465fd4649c394f059
Reviewed-on: https://chromium-review.googlesource.com/189305
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 51498c92e8bcaf1df64686e3337bfee472bcdddd)
Reviewed-on: https://chromium-review.googlesource.com/190178
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add common SST driver loader on ACPI systems

Most of the SST devices will be exposed as ACPI devices. It makes sense to
avoid duplication of the driver enumeration logic and concentrate the functionality
into a single ACPI SST enumeration file.

Idea of this loader is to parse data we get from ACPI and to be able to load
needed other SST drivers and ASoC machine driver runtime based on single
ACPI ID what BIOS gives to us.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from c2f8783fa2d053a61059f6b784c917129fb3064b
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Ifa36d60a69d957e0fe4b4ea0b64ddd8816df8f71
Reviewed-on: https://chromium-review.googlesource.com/189306
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 992e1286e1a96ac876f313136dec019d9efc1e38)
Reviewed-on: https://chromium-review.googlesource.com/190179
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add Intel SST audio DSP Firmware loader.

Provide services for Intel SST drivers to load SST modular firmware.

SST Firmware can be made up of several modules. These modules can exist
within any of the compatible SST memory blocks. Provide a generic memory
block and firmware module manager that can be used with any SST firmware
and core.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 30020472c354fbe4352b4b4d59bbc9a30aacf5c3
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I3e05380a759b797312350de3f5bafdb477638490
Reviewed-on: https://chromium-review.googlesource.com/189307
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 0b49d63409f8d3a2413a9512ee46a9d4a6b9297d)
Reviewed-on: https://chromium-review.googlesource.com/190190
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add build support for Intel SST DSP core.

This adds kernel build support for Intel SST core audio.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from ddfa40b1586f8c7c6bb8bb9dd398cf656c98e6ee
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I4eff5aeb0c9311ad6f1df64f179933762aeec8d6
Reviewed-on: https://chromium-review.googlesource.com/189308
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit e29c99884a63601414843c642e20b26cbe2eb55d)
Reviewed-on: https://chromium-review.googlesource.com/190191
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add GFP_KERNEL flag to firmware DMA buffer.

Add GFP_KERNEL when allocating firmware DMA buffer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 2280e90efae92060f6fa717fb1afa9861bd2b520
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I2ca21303f11dcc86decad61ad9eabbafcef5ccb4
Reviewed-on: https://chromium-review.googlesource.com/189309
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 06396ad4ec7f9ddd0e48a1bde1019d6aa8bdd347)
Reviewed-on: https://chromium-review.googlesource.com/190192
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add trace support for generic SST IPC messages.

Provide a trace mechanism for debugging generic SST IPC messages.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from f869c98328337f9906944c7a105912a4088e3c9b
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Benson Leung <bleung@chromium.org>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I3860bbebc41b28fb31c29f17c18c27d7189813d3
Reviewed-on: https://chromium-review.googlesource.com/189521
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 37b61b7d4d4742d0517ee391311fe382449f50fe)
Reviewed-on: https://chromium-review.googlesource.com/190193
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Rename SST trace event header to be less generic.

The Intel audio DSP SST trace event header has been renamed from sst.h
to intel-sst.h in order to avoid any confusion with any future
Samoa Standard Time drivers ;)

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

(cherry picked from b47bd099fbb3412e34e8915c7a06bc3dbe73bc01
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Signed-off-by: Benson Leung <bleung@chromium.org>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Id435ccc3d43f14b5ef45b6e02543caae2716021a
Reviewed-on: https://chromium-review.googlesource.com/189310
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit a5b6ca61068b252201c538443b5db59864a1d181)
Reviewed-on: https://chromium-review.googlesource.com/190194
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add Intel Baytrail SST PCM platform driver

This adds the Baytrail SST DSP PCM platform driver. It registers itself with
the ALSA SoC layer and uses Intel Baytrail SST DSP IPC for DSP control.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from aef1311a7d7e77408611cdf143d32bb1709527b6
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I40e033cac344cebd92a88df4e7b4195b4e11b9d4
Reviewed-on: https://chromium-review.googlesource.com/189325
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 4504beeb074467a8ac82eb47224b2b1400243a3b)
Reviewed-on: https://chromium-review.googlesource.com/190195
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Add machine driver for Baytrail SST with RT5640 codec

Add machine driver for Baytrail SST DSP platform with RT5640 audio codec.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 6439c8ad1edcca1051936de9f624c5ab9ebe03f7
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Ic04308984536e6974d61480b5083a574d4a3ecaa
Reviewed-on: https://chromium-review.googlesource.com/189326
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 86b8222309046e1e08dee961478b7bfe0ef4b198)
Reviewed-on: https://chromium-review.googlesource.com/190196
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: Move extended fw base and size fields in struct sst_pdata

Move fw_base and fw_size fields in struct sst_pdata under ACPI data for
clarifying that these are not related to firmware file but for platform
specific extended firmware area reserved by the BIOS.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from 0c49a8c9f9fafdf4345259b9b50513905afcf860
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: I6507716ee62cd50f3a60acb552ff75d32d2e3939
Reviewed-on: https://chromium-review.googlesource.com/189311
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit 6c615c01e61fdbb2fd4e578e6bb8226afd5e6902)
Reviewed-on: https://chromium-review.googlesource.com/190197
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
BACKPORT: ASoC: Intel: sst-acpi: Request firmware before SST platform driver probing

We originally thought to request SST audio DSP firmware during the SST
platform driver initialization. However plain request_firmware doesn't
work in driver probe paths if userspace is not ready to handle it. For
instance when drivers are built-in.

Implementing asynchronous firmware request in SST platform driver
initialization complicates code needlessly since it anyway will fail if
firmware is missing.

This is more simple to handle by requesting firmware asynchronously in
sst_acpi_probe() and register SST platform only after firmware is loaded.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from e5161d7987f14338ad0a3cf376b9bb6838416183
 in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>

BUG=chrome-os-partner:25090
TEST=With entire patch series applied, and coreboot change to switch
LPE to acpi mode, check that audio playback and record work correctly.

Change-Id: Id854aee301d937c16d08aba07933abce61aa452d
Reviewed-on: https://chromium-review.googlesource.com/189312
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
(cherry picked from commit ad76d3ed8b036ab3140f1536b55df7935d648101)
Reviewed-on: https://chromium-review.googlesource.com/190198
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>