Commit graph

60 commits

Author SHA1 Message Date
Liam Girdwood af94aa558b ASoC: Intel: Add Baytrail suspend/resume support
Add suspend and resume support to Baytrail SST DSP. This is implemented by
unloading firmware modules and putting DSP into reset prior suspend and
restarting DSP again in normal boot state after resume.

Context restore for running streams is implemented by scheduling a work from
sst_byt_pcm_trigger() that will allocate a stream with existing parameters
and start it from last known buffer position before suspend.

[Jarkko: Squashed together 5 WIP patches from Liam and 1 from me]

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:18 +01:00
Liam Girdwood 609a13e5c9 ASoC: Intel: Allow Rx/Tx message list can be cleared prior to suspend
Suspend/resume requires reloading FW to boot state so we need to also make
sure that the driver matches the FW state at boot.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula 800be5900b ASoC: Intel: Move Baytrail extended fw address saving to sst_byt_boot()
We have to save the physical address of extended firmware block in the
beginning of mailbox every time when we boot the DSP firmware since that
mailbox address is re-used after DSP firmware is running. Otherwise DSP
firmware will get bogus extended firmware block address during next DSP
boot.

Currently this is not problem but becomes when DSP runtime rebooting is
implemented. Prepare for that by moving extended firmware address saving
from sst_byt_init() to sst_byt_boot().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula a6686ed553 ASoC: Intel: Pass stream start position to sst_byt_stream_start()
Stream start position will be needed in resume code. Prepare for it by
adding start offset argument to sst_byt_stream_start().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula 65ee9e8fb6 ASoC: Intel: Simplify Baytrail stream control IPC construction
Baytrail ADSP stream IPC simplifies a little by moving IPC_IA_START_STREAM
construction and sending directly into sst_byt_stream_start() from
sst_byt_stream_operations(). This is because IPC_IA_START_STREAM is only
stream IPC with extra message data so this move saves a few code lines.

Main motivation for this is to prepare for passing stream start position
to sst_byt_stream_start() which will be needed in resume code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula c83649e3cd ASoC: Intel: Sample Baytrail DSP DMA pointer only after each period
This is for preparing suspend/resume support but can give also more
safeguard against concurrent timestamp structure access between DSP firmware
and host.

Now DSP DMA pointer is sampled in each pcm pointer callback in
sst_byt_pcm_pointer() but that is unneeded since DSP updates the timestamp
period basis and can potentially be racy if sst_byt_pcm_pointer() is called
when DSP is updating the timestamp.

By taking DSP DMA pointer only after period elapsed IPC messages in
byt_notify_pointer() and returning stored hw pointer in
sst_byt_pcm_pointer() there is less risk for concurrent access.

The same stored hw pointer can be also used in suspend/resume code for
restarting the stream at the same position.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Mark Brown b9d4cf74b9 ASoC: Intel: Build Medfield compressed ops
Since commit 4b68b4e1c5 (ASoC: Intel: split the pcm and compress to
different files) the compressed ops haven't been built causing link
failures on allyesconfig and making the driver unbuildable.  Add the
object to the Makefile to fix that.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by Vinod Koul <vinod.koul@intel.com>
2014-05-09 10:28:42 +01:00
Vinod Koul 0cac6fc3eb ASoC: Intel: rename pcm dias to media dai
this is for further updates to driver which supports DPCM :)

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 6f46c0d33e ASoC: Intel: remove unused sst-mfld platform dais
With DPCM we have media dai used and no seperate headset and speaker dai so
remove the speaker dai
The vibra is no longer supported thru audio, so remove

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 4b68b4e1c5 ASoC: Intel: split the pcm and compress to different files
For manging them and adding support for more platforms
Code move only

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 4496ffab7d ASoC: Intel: mark sst_set_stream_status as non static
as this will be used in compressed split file in subsequent patch

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul e11fd7c3ac ASoc: Intel: rename sst-mfld-platform.c
to sst-mfld-platform-pcm.c so that we can split pcm and compress to different
files for upcoming changes to support more platforms

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 300f53bf19 ASoC: Intel: remove FSF snail mail address
As this address can move

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 2b4c78df05 ASoC: Intel: move component registration blob
to the place near it is used

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:24:54 +01:00
Liam Girdwood 555f8a80c3 ASoC: Intel: Add support to unload/reload firmware modules.
Add some SST API calls to unload and reload firmware modules. This can be used
by PM code to restore state and also allow modular FW to unload and release
memory blocks.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:20:58 +01:00
Christian Engelmayer dd1b94bf49 ASoC: Intel: Fix a self assignment in sst_mem_block_alloc_scratch()
Remove a self assignment in sst_mem_block_alloc_scratch(). When calculating
buffer sizes there is no need for statements without effect. Detected by
Coverity: CID 1195249.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-15 12:12:34 +01:00
Christian Engelmayer f3046f86b8 ASoC: Intel: Fix incorrect sizeof() in sst_hsw_stream_get_volume()
Fix an incorrect sizeof() usage in sst_hsw_stream_get_volume(). sst_dsp_read()
is called to read into a variable of type u32, but is passed sizeof(u32 *) for
argument 'size_t bytes'. Detected by Coverity: CID 1195260.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-15 12:12:34 +01:00
Lars-Peter Clausen 546d4dd3bb ASoC: mfld_machine: Fix compile error
Fixes: 115f3f8 ("ASoC: mfld_machine: Convert to table based DAPM and control setup")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-21 19:33:36 +00:00
Lars-Peter Clausen 43b956349d ASoC: mfld_machine: Convert to table based DAPM and control setup
Use table based setup to register the controls and DAPM widgets and routes.
This on one hand makes the code a bit cleaner and on the other hand
the board level DAPM elements get registered in the card's DAPM context rather
than in the CODEC's DAPM context.

The mfld_machine driver is a bit special in that it directly writes to one of
the CODEC registers from one of the control handlers. Previous to this patch it
was able to get a pointer to the CODEC from the control, since the control was
registered with the CODEC. This won't be possible anymore once the control is
registered with the card. Since there are already global variables in the driver
accessed in the same function the patch adds a global variable that holds a
pointer to the CODEC and uses that.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-21 18:04:20 +00:00
Mark Brown 234bf1f0f0 ASoC: Updates for v3.15
Quite a busy release for ASoC this time, more on janitorial work than
 exciting new features but welcome nontheless:
 
  - Lots of cleanups from Takashi for enumerations; the original API for
    these was error prone so he's refactored lots of code to use more
    modern APIs which avoid issues.
  - Elimination of the ASoC level wrappers for I2C and SPI moving us
    closer to converting to regmap completely and avoiding some
    randconfig hassle.
  - Provide both manually and transparently locked DAPM APIs rather than
    a mix of the two fixing some concurrency issues.
  - Start converting CODEC drivers to use separate bus interface drivers
    rather than having them all in one file helping avoid dependency
    issues.
  - DPCM support for Intel Haswell and Bay Trail platforms.
  - Lots of work on improvements for simple-card, DaVinci and the Renesas
    rcar drivers.
  - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the
    CSR SiRF SoC.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTIOhJAAoJELSic+t+oim90CoP/3CVTm9cWv1qhPSU6jjn6RJG
 /djmhntJfHd/GXo+0TiiwNK9WmZjFrJUr+5ofkDTCqSzFz1Suc90B6oHxY4dFbgF
 IyIpTexGwTLv3H6yDjadYAfmGDSsE9sM2dkID9oXy6aEzjNby/a1VEiBnRgx16X1
 YGvMVK8AGFn/AyC/zOV6EcKJxUjdDogqZ5wkR2XHzwDoYjl9ufxK9BnSIygYABOW
 ABAjyrZf3xx97AH82BB6iqcZMh5GxGNTvI3hQd/vjx0r7RFUDNLqmF2cPZAMTRW/
 bXWxVmtNHie1+lCldyMFm8pV/Pv09zuqDAQKbPY2TeHj2zF8CM548NlkFHqwHlp0
 S9K5E1N+/2wcXMjQa1wBELohUdl6dVh1OFOAz7M8o0TJdSOZyR6PJ9r0NprP8NgS
 67FBU+ZqnWIK159m9rKkFfPhnaDuDzk+rpwyK0fQxQgpdGGjLyv7OK3GhS30oTnA
 Z2GjEyUySM1BcEEWAtfUD5fHbjN28e1Icn53q5q4JK4gvx4DXBy08uY/vumvjXjO
 8oum3q3RjRvqIhzMrJoVgs+c8RHwS/bZQhlu9Q3qNTsDNDyMnaZWHFAnP8RDqHjv
 ojZiMJkJdpqceZ3z1k5ZG8GWJ2JaZBikSbeNk2Ltg17/0nackq2r8ekrIoEUPVk2
 ph4DJNC2s1qCFtx7tzQj
 =C5oo
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15' into asoc-intel

ASoC: Updates for v3.15

Quite a busy release for ASoC this time, more on janitorial work than
exciting new features but welcome nontheless:

 - Lots of cleanups from Takashi for enumerations; the original API for
   these was error prone so he's refactored lots of code to use more
   modern APIs which avoid issues.
 - Elimination of the ASoC level wrappers for I2C and SPI moving us
   closer to converting to regmap completely and avoiding some
   randconfig hassle.
 - Provide both manually and transparently locked DAPM APIs rather than
   a mix of the two fixing some concurrency issues.
 - Start converting CODEC drivers to use separate bus interface drivers
   rather than having them all in one file helping avoid dependency
   issues.
 - DPCM support for Intel Haswell and Bay Trail platforms.
 - Lots of work on improvements for simple-card, DaVinci and the Renesas
   rcar drivers.
 - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the
   CSR SiRF SoC.

Conflicts:
	sound/soc/intel/Kconfig
2014-03-13 14:16:35 +00:00
Stephen Warren f410d5c953 ASoC: Intel: don't select RT5640 if !I2C
The rt5640 driver won't compile without I2C enabled. Hence, the Intel
Haswell and Baytrail+RT5640 ASoC drivers must also depend on I2C, since
these select RT5640.

This solves:
sound/soc/codecs/rt5640.c:2220:1: warning: data definition has no type or storage class [enabled by default]
sound/soc/codecs/rt5640.c:2220:1: error: type defaults to ‘int’ in declaration of ‘module_i2c_driver’ [-Werror=implicit-int]
sound/soc/codecs/rt5640.c:2220:1: warning: parameter names (without types) in function declaration [enabled by default]
sound/soc/codecs/rt5640.c:2210:26: warning: ‘rt5640_i2c_driver’ defined but not used [-Wunused-variable]

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13 09:45:09 +00:00
Mark Brown a4b12990b6 Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next 2014-03-12 23:04:35 +00:00
Liam Girdwood a8282136a1 ASoC: Intel: Clean up indentation for Haswell machine driver/Kconfig
Clean up some indentation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:51:05 +08:00
Liam Girdwood dd6646bcfa ASoC: Intel: Use .dai_fmt for setting Haswell BE format.
Update the Haswell driver to use .dai_fmt in DAI link to set the
format.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:51:05 +08:00
Liam Girdwood f69f41e1a2 ASoC: Intel: Check Haswell IPC process_reply/notification return value.
Check the return value for error when processing replies and notifications.

The patch 2298124358: "ASoC: Intel: Add Haswell/Broadwell IPC" from
> Feb 20, 2014, leads to the following imaginary static checker warning:
>
> 	sound/soc/intel/sst-haswell-ipc.c:898 hsw_irq_thread()
> 	warn: this is always true.
>
> sound/soc/intel/sst-haswell-ipc.c
>    895                  /* Handle Immediate reply from DSP Core */
>    896                  handled = hsw_process_reply(hsw, ipcx);
>                                   ^^^^^^^^^^^^^^^^^
> Returns 1 on success/error and -EIO on error.
>
>    897
>    898                  if (handled) {
>    899                          /* clear DONE bit - tell DSP we have completed */
>    900                          sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX,
>    901                                  SST_IPCX_DONE, 0);
>    902
>    903                          /* unmask Done interrupt */
>    904                          sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX,
>    905                                  SST_IMRX_DONE, 0);
>    906                  }
>

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:51:05 +08:00
Dan Carpenter 9202c37739 ASoC: Baytrail: fix error handling in sst_byt_dsp_init()
Calling "kfree(byt)" is a double free because that was allocated with
devm_kzalloc().  There were a couple places which leak "byt->msg".  That
memory is allocated in msg_empty_list_init().

Fixes: f7d01fd675 ('ASoC: Intel: Add Intel Baytrail SST DSP IPC support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 12:22:21 +08:00
Jarkko Nikula a6cf8f7b53 ASoC: Intel: Baytrail: Fix implicit declaration of function 'memcpy_fromio'
Some kernel configurations can cause following build error:

sound/soc/intel/sst-baytrail-ipc.c: In function ‘sst_byt_get_dsp_position’:
sound/soc/intel/sst-baytrail-ipc.c:744:2: error: implicit declaration of function ‘memcpy_fromio’ [-Werror=implicit-function-declaration]
  memcpy_fromio(&fw_tstamp,
  ^
cc1: some warnings being treated as errors

Fix this by including <linux/io.h> explicitly.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 23:47:13 +09:00
Jarkko Nikula 95c40d4b0e ASoC: Intel: byt-rt5640: Use init time DAI format
Setting static DAI format has been supported in the soc-core quite some time
now so there is no need to set it runtime in machine driver.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwoood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:49:08 +09:00
Jarkko Nikula 52be4776ca ASoC: Intel: byt-rt5640: Update internal mic and speaker kcontrol names
Use more sensible kcontrol names than "Int Mic" and "Ext Spk". Speakers
especially are usually integrated devices in sales models.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Liam Girdwoood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:49:04 +09:00
Dan Carpenter 31d632f955 ASoC: intel: incorrect sizeof()
This should be sizeof(pos) instead of sizeof(&pos).  Most likely they
are both 8 bytes though so it doesn't often make a difference in real
life.

Fixes: 2298124358 ('ASoC: Intel: Add Haswell/Broadwell IPC')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:45:57 +09:00
Dan Carpenter f9da9e434d ASoC: intel: restore IRQs on error
This should be spin_unlock_irqrestore() instead of spin_unlock()

Fixes: 2298124358 ('ASoC: Intel: Add Haswell/Broadwell IPC')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:45:43 +09:00
Dan Carpenter 951e9bb1fa ASoC: Intel: sst-firmware: missing curly braces (harmless)
There were some curly braces intended here, but the code actually
works the same either way so it's not a bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:45:39 +09:00
Jarkko Nikula 5069e5c93c ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware
I swear I tested missing firmware in commit e5161d7987 ("ASoC: Intel:
sst-acpi: Request firmware before SST platform driver probing").

Unfortunately same wasn't done in commit 6dda27cbbd ("ASoC: Intel:
sst-acpi: Add support for multiple machine drivers per platform") which
will cause NULL pointer dereference in sst_acpi_fw_cb() when printing the
error since sst_acpi->mach is not set.

Fix this obvious error by setting the sst_acpi->mach in sst_acpi_probe().

Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
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>
2014-02-26 08:45:35 +09:00
Jarkko Nikula 20df8d03a7 ASoC: Intel: Add build support for Baytrail SST
Enable build support for Baytrail SST DSP platform and byt-rt5640 machine
drivers.

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>
2014-02-25 13:44:44 +09:00
Jarkko Nikula e029861214 ASoC: Intel: Add Baytrail SST and byt-rt5640 machine driver probing
Add Baytrail SST descriptor with the byt-rt5640 machine driver to sst-acpi
loader.

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>
2014-02-25 13:44:41 +09:00
Jarkko Nikula 6439c8ad1e 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>
2014-02-25 13:44:39 +09:00
Jarkko Nikula aef1311a7d 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>
2014-02-25 13:44:36 +09:00
Jarkko Nikula f7d01fd675 ASoC: Intel: Add Intel Baytrail SST DSP IPC support
Add support for Baytrail SST DSP IPC. This provides mechanism to communicate
with the DSP firmware.

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>
2014-02-25 13:44:34 +09:00
Jarkko Nikula f746966377 ASoC: Intel: Add Intel Baytrail SST DSP support
This adds basic functionality for Baytrail SST DSP initialization and
firmware loading.

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>
2014-02-25 13:44:31 +09:00
Jarkko Nikula 6ef20de726 ASoC: Intel: Add Baytrail SST ID and Baytrail specific register bits
While the SHIM register addresses in Baytrail are the same than Haswell and
Broadwell their register size is 64-bit and some bits are different.

This patch adds the SST device ID for Baytrail and Baytrail specific
SHIM bit definitions.

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>
2014-02-25 13:44:27 +09:00
Liam Girdwood 90931b9eae ASoC: Intel: Add Haswell Machine support
Add support for Haswell based machines with SST DSP audio.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22 11:22:27 +09:00
Liam Girdwood 5e4482fcb1 ASoC: Intel: Add build support for Haswell ADSP
Build the Haswell/Broadwell PCM, IPC and DSP drivers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22 11:22:26 +09:00
Liam Girdwood d37797705d ASoC: Intel: Add Haswell and Broadwell PCM platform driver
Add the Haswell and Broadwell PCM DSP platform driver. This driver uses
the IPC driver for communication with the SST DSP.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22 11:22:25 +09:00
Liam Girdwood 2298124358 ASoC: Intel: Add Haswell/Broadwell IPC
Add support for Haswell and Broadwell DSP IPC. This is used by the DSP
platform PCM driver to configure the DSP for audio operations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22 11:22:25 +09:00
Liam Girdwood 1e42c3e426 ASoC: Intel: Add support for Haswell/Broadwell DSP
Add support for low level differentiation functions for Haswell and Broadwell
SST DSPs. This includes suppoprt for DSP boot and reset, DSP firmware module
parsing and DSP memory block map initialisation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-22 11:22:21 +09:00
Charles Keepax 121df681da ASoC: mfld_machine: Update locking around use of DAPM pin API
The pin updates in this driver look like they are intended to be done
atomically, update to do so.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20 19:22:58 +09:00
Liam Girdwood afd954900a ASoC: Intel: Fix build for sst-dsp.c on PPC architecture
Disable build on non X86 architectures except for compile testing. This fixes
the following build errors on PPC and adds an option for testing the build on other
architectures as suggested by Mark Brown :-

sound/soc/intel/sst-dsp.c: In function 'sst_dsp_outbox_write':
sound/soc/intel/sst-dsp.c:218:2: error: implicit declaration of function 'memcpy_toio' [-Werror=implicit-function-declaration]
  memcpy_toio(sst->mailbox.out_base, message, bytes);
  ^
sound/soc/intel/sst-dsp.c: In function 'sst_dsp_outbox_read':
sound/soc/intel/sst-dsp.c:231:2: error: implicit declaration of function 'memcpy_fromio' [-Werror=implicit-function-declaration]
  memcpy_fromio(message, sst->mailbox.out_base, bytes);
  ^

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20 01:54:45 +09:00
Jarkko Nikula 6dda27cbbd ASoC: Intel: sst-acpi: Add support for multiple machine drivers per platform
Initial implementation of this driver focused only matching SST ACPI ID
with single machine driver and same firmware file per platform. It was known
restriction to be improved incrementally.

This patch is now changing this that SST ACPI ID refers purely to platform
specific data which refers to machine drivers on this platform, not vice
versa.

Matching machine driver is found by looking at ACPI ID which would best
match with the driver. Typically this would be the ACPI ID of audio codec
but is not tied to it.

This patch also changes that DSP firmware name is machine not platform
specific.

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>
2014-02-20 01:42:07 +09:00
Liam Girdwood 7bcd84878e ASoC: Intel: Fix sparse warnings for firmware loader
Sparse gives us the following warnings on sst-firmware.c

  CHECK   sound/soc/intel/sst-firmware.c
sound/soc/intel/sst-firmware.c:39:34: warning: incorrect type in argument 1 (different address spaces)
sound/soc/intel/sst-firmware.c:39:34:    expected void volatile [noderef] <asn:2>*dst
sound/soc/intel/sst-firmware.c:39:34:    got void *
sound/soc/intel/sst-firmware.c:417:36: warning: incorrect type in argument 1 (different address spaces)
sound/soc/intel/sst-firmware.c:417:36:    expected void *dest
sound/soc/intel/sst-firmware.c:417:36:    got void [noderef] <asn:2>*
sound/soc/intel/sst-firmware.c:430:5: warning: symbol 'sst_block_module_remove' was not declared. Should it be static?

and

  CC [M]  sound/soc/intel/sst-dsp.o
sound/soc/intel/sst-dsp-priv.h:271:53: warning: incorrect type in argument 3 (different address spaces)
sound/soc/intel/sst-dsp-priv.h:271:53:    expected void *src
sound/soc/intel/sst-dsp-priv.h:271:53:    got void [noderef] <asn:2>*
sound/soc/intel/sst-dsp-priv.h:271:53: warning: incorrect type in argument 3 (different address spaces)
sound/soc/intel/sst-dsp-priv.h:271:53:    expected void *src
sound/soc/intel/sst-dsp-priv.h:271:53:    got void [noderef] <asn:2>*
sound/soc/intel/sst-dsp-priv.h:271:53: warning: incorrect type in argument 3 (different address spaces)
sound/soc/intel/sst-dsp-priv.h:271:53:    expected void *src
sound/soc/intel/sst-dsp-priv.h:271:53:    got void [noderef] <asn:2>*

This patch removes these warnings

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20 00:08:24 +09:00
Jarkko Nikula e5161d7987 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>
2014-02-19 21:20:42 +09:00