Commit Graph

49 Commits

Author SHA1 Message Date
Mark Brown 09269e4eef Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2015-03-04 20:42:39 +00:00
Vinod Koul de251d773b ASoC: Intel: reset the DSP while suspending
The manual recommends that we reset the DSP when we suspend so add that in
runtime suspend handler

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-24 00:39:00 +09:00
Vinod Koul a825ac7678 ASoC: Intel: save and restore the CSR register
The IPC driver saved only IMR register, we need to save the CSR as well, so
add it

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-24 00:38:38 +09:00
Mengdong Lin 7bd345c9e8 ASoC: Intel: set initial runtime PM status to active for ACPI-enumerated ADSP
The ADSP on Braswell/Baytrail is an ACPI device. This patch sets its initial
runtime PM status to active. Otherwise, its initial status is suspended and
runtime_suspend ops will not be called after probe and thus cannot further
trigger ACPI _PS3 (D3) method to put the device into low power D3cold state.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-14 13:49:46 +09:00
Mark Brown 6e685ea6aa Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/imx', 'asoc/topic/intel', 'asoc/topic/jz4740' and 'asoc/topic/max98357a' into asoc-next 2015-02-09 15:10:19 +08:00
Mark Brown 0cee4db21e Merge remote-tracking branches 'asoc/fix/ac97', 'asoc/fix/atmel', 'asoc/fix/intel', 'asoc/fix/rt286', 'asoc/fix/rt5640', 'asoc/fix/samsung', 'asoc/fix/sgtl5000', 'asoc/fix/sta32x', 'asoc/fix/tlv320aic3x' and 'asoc/fix/wm8731' into asoc-linus 2015-02-09 15:09:49 +08:00
Christian Engelmayer 279e17ae81 ASoC: Intel: sst: Fix firmware name size handling
Function sst_acpi_probe() uses plain strcpy for setting member firmware_name
of a struct intel_sst_drv from member firmware of a struct sst_machines.
Thereby the destination array has got a length of 20 byte while the source may
hold 32 byte. Since eg. commit 64b9c90b86 ("ASoC: Intel: Fix BYTCR firmware
name") increased strings from "fw_sst_0f28.bin" to "intel/fw_sst_0f28.bin"
there is an actual possibility that the 20 byte array at the end of struct
intel_sst_drv is overrun.

Thus increase the size of the destination and use the same define for both
structs. Detected by Coverity CID 1260087.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-02-08 11:08:27 +08:00
Kevin Strasser 5c2b06369d ASoC: Intel: fix sst firmware path for cht-bsw-rt5672
All sst firmware is provided under the intel directory of the linux-firmware
tree. By default this directory structure is kept when installing on a target
system. Change the path to expect a default linux-firmware installation.

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-05 20:16:21 +00:00
Kevin Strasser e948262ad0 ASoC: Intel: fix sst firmware path
All sst firmware is provided under the intel directory of the linux-firmware
tree. By default this directory structure is kept when installing on a target
system. Change the path to expect a default linux-firmware installation.

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-05 18:12:39 +00:00
Fang, Yang A 842aaa0cbf ASoC: Intel: Add support rt5645 in sst driver
Added entry in sst driver to support rt5645 codec
for intel Braswell platform.

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 19:05:48 +00:00
Markus Elfring 4e3461d34f ASoC: Intel: Delete an unnecessary check before the function call "release_firmware"
The release_firmware() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-05 19:03:34 +00:00
Mark Brown bf85139278 Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/intel' and 'asoc/topic/omap' into asoc-next 2014-12-24 12:56:42 +00:00
Wei Yongjun 5129ad6e4e ASoC: Intel: fix sparse non static symbol warnings
Fixes the following sparse warnings:

sound/soc/intel/sst/sst_acpi.c:248:5: warning:
 symbol 'sst_acpi_probe' was not declared. Should it be static?
sound/soc/intel/sst/sst_acpi.c:335:5: warning:
 symbol 'sst_acpi_remove' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-22 17:58:23 +00:00
Jarkko Nikula 64b9c90b86 ASoC: Intel: Fix BYTCR firmware name
BYTCR DSP firmware is in intel/ subdirectory. See linux-firmware.git
commit d562a3b63632 ("linux-firmware: add sst audio firmware for baytrail
platforms").

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-22 15:08:00 +00:00
Wolfram Sang 676ebf6887 ASoC: intel: sst: drop owner assignment from platform_drivers
This platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-22 11:54:33 +00:00
Kevin Strasser de5f644e3c ASoC: Intel: fix possible acpi enumeration panic
A crash can occur on some platforms where adsp is enumerated but codec is not
matched. Define codec_id as a pointer intead of an array so that it gets
initialized to NULL for the terminating element of sst_acpi_bytcr[] and
sst_acpi_chv[].

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-16 11:52:09 +00:00
Wei Yongjun f5d40b400f ASoC: Intel: fix return value check in sst_acpi_probe()
In case of error, the function platform_device_register_data()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-15 18:21:40 +00:00
kbuild test robot 14cd792312 ASoC: Intel: chv_platform_data can be static
sound/soc/intel/sst/sst_acpi.c:135:26: sparse: symbol 'chv_platform_data' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-21 23:17:58 +00:00
Mengdong Lin bd01fdc3aa ASoC: Intel: add support for Cherrytrail and Braswell in SST driver
This patch add ACPI device ID and platform data for two Cherryview-based
platforms, Cherrytrail and Braswell. Also reuse mfld driver ops in sst driver.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-21 19:23:01 +00:00
kbuild test robot 1a28fc190c ASoC: Intel: byt_rvp_platform_data can be static
sound/soc/intel/sst/sst_acpi.c:124:26: sparse: symbol 'byt_rvp_platform_data' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-21 15:59:57 +00:00
Vinod Koul 92a6e2a227 ASoC: Intel: cleanup runtime_pm initialization
For ACPI we missed to pm_runtime_enable() call which is required to tell PM
core that runtime on this device is enabled now. Since this is common to
both PCI and APCI move it out. Also for ACPI we do not require
pm_runtime_allow() call, so remove that

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-19 10:56:46 +00:00
Mengdong Lin eb826a35d2 ASoC: Intel: add missing ACPI device table
The ACPI device table will generate the driver module alias for
Intel audio devices enumerated from ACPI.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-17 10:57:12 +00:00
Vinod Koul 336cfbb05e ASoC: Intel: mrfld- add ACPI module
Add the last ACPI module support which also uses core module like the PCI
part

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-14 11:07:43 +00:00
Vinod Koul 9b105fe447 ASoC: Intel: mrfld - remove non static definition
sst_save_shim64() is defined as static in code but header is non static.
Since this is not used other than file where defined remove non static
definition

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06 16:08:13 +00:00
Vinod Koul b0d94acd63 ASoC: Intel: mrfld - add shim save restore
In ACPI platform we need to save few registers of Shim on suspend and
restore them on resume, so add handlers to do this

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06 12:36:18 +00:00
Vinod Koul f533a035e4 ASoC: Intel: mrfld - create separate module for pci part
Now the SST_IPC will support both ACPI and PCI, separate into core module
and PCI module. This also move probe function into PCI module and exports
the required symbols from core module

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06 12:36:17 +00:00
Subhransu S. Prusty 7fb73c74ff ASoC: Intel: more probe modularization for sst
Move the PCI BAR and resource initialization to a separate routine

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 16:57:33 +00:00
Subhransu S. Prusty 250454d8fe ASoC: Intel: modularize driver probe and remove
The driver probe which initializes driver and remove which cleans up can be
shared with APCI as well, so move them to common init_context and
cleanup_context routines which can be used by ACPI as well

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 16:57:32 +00:00
Subhransu S. Prusty 2559d9928f ASoC: Intel: move the driver context allocation to routine
This will be used by ACPI code as well, so moving to common routine helps

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 16:57:32 +00:00
Subhransu S. Prusty 54adc0ad64 ASoC: Intel: move the lock and wq initialization to routine
This will be used by ACPI code as well, so moving to common routine helps

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 16:57:27 +00:00
Subhransu S. Prusty 7e73e4d805 ASoC: Intel: move the driver wq init to a routine
This will be used by ACPI code as well, so moving to common routine helps

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 16:57:25 +00:00
Vinod Koul 7adab122a5 ASoC: Intel: sst - add compressed ops handling
This patch add low level IPC handling for compressed stream operations

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:52:43 +00:00
Fang, Yang A 5794b7ec62 ASoC: Intel: use correct firmware name
The firmware name was used worngly, so fix it up

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:51:14 +00:00
Vinod Koul 6e9b05607f ASoC: Intel: sst: load firmware using async callback
We would like the DSP firmware to be available in driver as soon as possible. So
use the async callback in driver to probe to load the firmware as soon as
usermode is up

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:50:38 +00:00
Mythri P K 45f31bfcda ASoC: Intel: use lock when changing SST state.
SST state change should be done under sst_lock

Signed-off-by: Mythri P K <mythri.p.k@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:47:44 +00:00
Vinod Koul d62f2a08b9 ASoC: Intel: sst: add runtime power management handling
This patch adds the runtime pm handlers, the driver already has code for
get/put for runtime pm and only these handlers being missing.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:46:45 +00:00
Subhransu S. Prusty 1a6db0bd26 ASoC: Intel: mrfld: Fix runtime pm calls in sst_open_pcm_stream
It's already done in open/close.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31 12:29:50 +00:00
Subhransu S. Prusty 39581031a9 ASoC: Intel: mrfld: Replace pci_id with unique device id
In order to support both ACPI and PCI devices we need to use a genric device
id in driver, so change all pci_id instances to device_id

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-27 18:02:38 +00:00
Vinod Koul 33c1256f1c ASoC: intel: explain why block not found isn't error always
The IPC blocking can be error when we don't find block or a short message,
explain that by adding a comment about this scenario

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-21 23:58:59 +01:00
Vinod Koul dee2ce696e ASoC: intel: fix the kernldoc comment
copypaste error on function sst_get_num_channel caused the comment to be
wrong, so fix it here

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-21 23:58:59 +01:00
Vinod Koul 790b4075b3 ASoC: intel: log an error on double free
the stream context should be freed only once on stream cleanup. If we ever
hit a chance that stream context is getting double freed, though not an
cause of panic as memory allocator can deal with this, we should still log
this to help in finding issues and debugging

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-21 23:58:59 +01:00
Vinod Koul b3baaa47cc ASoC: intel: use __iowrite32_copy for 32 bit copy
The driver was using own method to do 32bit copy, turns out we have a kernel
API so use that instead

Tested-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-21 23:58:59 +01:00
Vinod Koul 0fbc7d7320 ASoC: Intel: sst: Add makefile and kconfig changes
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:35 +01:00
Vinod Koul 60dc8dbacb ASoC: Intel: sst: Add some helper functions
This patch adds helper functions like wait, creating ipc headers, shim
wrappers.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00
Vinod Koul 3d9ff34622 ASoC: Intel: sst: add stream operations
This patch adds pcm and compressed stream control operations.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00
Vinod Koul ea12aa4acd ASoC: Intel: sst: Add IPC handling
This patch adds APIs to post IPCs and process reply messages.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00
Vinod Koul cc547054d3 ASoC: Intel: sst - add pcm ops handling
This patch adds low level IPC handling for pcm stream operations

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00
Vinod Koul 9012c9544e ASoC: Intel: mrfld - Add DSP load and management
This patch contains all dsp controlling functions like firmware download,
setting/resetting dsp cores, etc.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00
Vinod Koul 163d2089d2 ASoC: Intel: mrfld - add the dsp sst driver
The SST driver is the missing piece in our driver stack not upstreamed,
so push it now :) This driver currently supports PCI device on Merrifield.
Future updates will bring support for ACPI device as well as future update
to PCI devices as well

In subsequent patches support is added for DSP loading using memcpy,
pcm operations and compressed ops.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:20:34 +01:00