Commit graph

380 commits

Author SHA1 Message Date
Mark Brown
f36795a60d Merge remote-tracking branches 'asoc/topic/gpiod-flags', 'asoc/topic/gtm601', 'asoc/topic/intel', 'asoc/topic/lm3857' and 'asoc/topic/max98090' into asoc-next 2015-06-05 18:54:55 +01:00
Mark Brown
f3b368d3b9 Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next 2015-06-05 18:54:46 +01:00
Subhransu S. Prusty
859c34bd3c ASoC: Intel: Allocate for the mailbox with max size
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>
2015-06-02 20:48:08 +01:00
Jie Yang
edd8ed496b ASoC: Intel: handle haswell pcm suspend including runtime modules freeing
It needs free pcm runtime modules before unloading firmware, here
add hsw_pcm_suspend() to handle this procedure:
suspends firmware ==> frees runtime modules ==> unloads firmware.

This fixes the broadwell module unload failed issue.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02 15:34:12 +01:00
Jie Yang
2dbc80caf7 ASoC: Intel: check and clear runtime module pointer
Add check runtime module pointers before freeing them, and clear
them to NULL after freed.

With this implemented, we can avoid NULL pointer dereference or
double free errors.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02 15:34:11 +01:00
Jie Yang
6e5132f79a ASoC: intel: Revert "ASoC: Intel: fix broadwell module removing failed issue"
This reverts commit 01f202c7b4.

We shouldn't leave the device as suspended state after module freed,
it is not good to do runtime suspend at driver free, here revert
this fixing, and replace it with the procedure:
suspends firmware ==> frees runtime modules ==> unloads firmware.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02 15:34:07 +01:00
Jie Yang
a209d322dc ASoC: intel: Revert "ASoC: Intel: remove unused function hsw_pcm_free_modules()"
This reverts commit 506c148ee5.

We still need this hsw_pcm_free_modules(), we plan to remove the
runtime modules at both fw_unload(D0->D3) and snd_soc_sst_haswell_pcm
module removing.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02 15:34:00 +01:00
Jie Yang
616268292b ASoC: Intel: don't need compress offload for broadwell
We don't need compress offload feature for broadwell broadwell machine,
here remove the non exist dependency.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02 11:58:45 +01:00
Liam Girdwood
01f202c7b4 ASoC: Intel: fix broadwell module removing failed issue
In haswell-pcm module unloading, we can't free runtime modules
directly, for they may be already freed in runtime suspend.

Here add executing suspend call to unload runtime modules, only
for status not equal to RPM_SUSPEND, to fix broadwell module
removing failed issue.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-28 20:27:00 +01:00
Jie Yang
506c148ee5 ASoC: Intel: remove unused function hsw_pcm_free_modules()
Remove the unused function hsw_pcm_free_modules() to fix the
compling warning:

sound/soc/intel/haswell/sst-haswell-pcm.c:923:13:
 warning: 'sw_pcm_free_modules' defined but not used
 [-Wunused-function]
 static void hsw_pcm_free_modules(struct hsw_priv_data *pdata)

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-28 16:05:05 +01:00
Subhransu S. Prusty
d0e72cc0ac ASoC: Intel: Initialize max mailbox size for haswell
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:35 +01:00
Subhransu S. Prusty
f99b26f0b4 ASoC: Intel: Initialize max mailbox size for baytrail
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:32 +01:00
Subhransu S. Prusty
1925e21961 ASoC: Intel: Allow to configure max size for mailbox data
Mailbox size can be different for different platforms. So allow the drivers
to configure the size.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:29 +01:00
Subhransu S. Prusty
a63faa58bd ASoC: Intel: Remove the direct register reference from common ipc
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:26 +01:00
Subhransu S. Prusty
40fea92107 ASoC: Intel: Move the busy check to ops for HSW
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:23 +01:00
Subhransu S. Prusty
2709bdbc4d ASoC: Intel: Move the busy check to ops for Baytrail
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:20 +01:00
Subhransu S. Prusty
6022d330a5 ASoC: Intel: Create an ops to check for DSP busy
Created an ops to check if DSP busy, to avoid using platform
specific registers in common IPC.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22 19:24:10 +01:00
Vinod Koul
83f125e2a1 ASoC: Intel: add support for configuring TDM slots for SSP
With this machines can now configure TDM settings for SSP port using
set_tdm_slot API

Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 19:50:22 +01:00
Vinod Koul
0b44e34549 ASoC: intel: add support for specifying PCM format
With this machines can configure the PCM format applied on SSP port using
the set_fmt API

Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 19:50:22 +01:00
Vinod Koul
711bc9476b ASoC: Intel: load hw_defaults in hw_params of ssp be
We have the SSP defaults now and we need to load then in hw_params callback
of BE SSP DAI ops.

Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 19:50:22 +01:00
Vinod Koul
5749d70edc ASoC: Intel: use local values for ssp configuration
So right now SSP configuration is statically coded in the driver. While we
would like to keep this configuration intact for the users who are using
these defaults, we need to provide a way for users to program it.
So create a local value in driver structure which is populate with default
value for now

Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 19:50:22 +01:00
Vinod Koul
1f2d86f1c0 ASoC: Intel: add frame and data polarity to ssp config
The current ssp configuration was not configuring the frame sync polarity
and data polarity. Some codecs do need these different so add them in ssp
configuration now

Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 19:50:22 +01:00
Fang, Yang A
673c4f896a ASoC: Intel: Enabled button jack for BSW platform with rt5650 codec
rt5650 codec supports 4 buttons detections so enabled it

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06 11:58:29 +01:00
Mark Brown
292d2497cd Merge branch 'topic/rt5645' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2015-05-06 11:58:24 +01:00
Fang, Yang A
26f63c692f ASoC: Intel: Fixed kbuild warnings
fix following sparse warnings: (new ones prefixed by >>)

>> sound/soc/intel/boards/cht_bsw_max98090_ti.c:168:37: sparse:
>> incorrect type in argument 2 (different base types)
   sound/soc/intel/boards/cht_bsw_max98090_ti.c:168:37:    expected
unsigned int [unsigned] val
   sound/soc/intel/boards/cht_bsw_max98090_ti.c:168:37:    got
restricted snd_pcm_format_t [usertype] <noident>

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-05 12:17:58 +01:00
Fang, Yang A
c4ba51ba1c ASoC: Intel: Support rt5650 codec for Cherrytrail & Braswell
rt5650 and rt5645 are similar codec so reuse the cht_bsw_rt5645 driver

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-04 18:13:59 +01:00
Fang, Yang A
17119a4657 ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_max98090_ti
Add machine driver for two Intel Cherryview-based platforms, Cherrytrail
and Braswell. This machine driver will support max98090 codec as primary
codec. it can also support TI jack detect chip as aux device if platform
supports it.

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-04 13:18:03 +01:00
Fang, Yang A
cde7fbfc8a ASoC: Intel: Add support max98090 in sst driver
Added entry in sst driver to support max98090 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-05-04 13:15:48 +01:00
Bard Liao
6e747d5311 ASoC: rt5645: Adds push button support for rt5650
rt5650 support headset button detection. Currently, the button detection
is only implemented for rt5650 codec. The button detection configuration
register's default value is different from rt5645.
And we didn't touch the register in the driver, so we will get the wrong
value when we dump the registers. We will fix it in another patch.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-29 12:18:52 +01:00
Fang, Yang A
044d9601a9 ASoC: Intel: Add support rt5650 in sst driver
Added entry in sst driver to support rt5650 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-04-27 15:43:43 +01:00
Vinod Koul
8c359a9f36 ASoC: intel - use SNDRV_CTL_ELEM_ID_NAME_MAXLEN
we have defined SNDRV_CTL_ELEM_ID_NAME_MAXLEN as size of name array so use
this define instead of numeric value

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 15:43:43 +01:00
Jin Yao
3228723b0c ASoC: Intel: Remove invalid kfree of devm allocated data
kbuild robot reports following warning:
"sound/soc/intel/haswell/sst-haswell-ipc.c:2204:1-6:
 WARNING: invalid free of devm_ allocated data"

As julia explains to me, the memory allocated with devm_kalloc
is freed automatically on failure of a probe function. So this
kfree should be removed otherwise the double free will be got in
error handler path.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27 15:43:43 +01:00
Vinod Koul
8faf141a99 ASoC: Intel: fix the makefile for atom code
The tom code should be using SND_SST_MFLD_PLATFORM and not the baytrail one.
So fix it now

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-23 10:32:48 +01:00
Wei Yongjun
d09a6b4a14 ASoC: Intel: sst_byt: remove kfree for memory allocated with devm_kzalloc
It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-17 14:34:55 +01:00
Jin Yao
ac98b4c015 ASoC: Intel: Remove invalid kfree of devm allocated data
kbuild robot reports following warning:
"sound/soc/intel/haswell/sst-haswell-ipc.c:2204:1-6:
 WARNING: invalid free of devm_ allocated data"

As julia explains to me, the memory allocated with devm_kalloc
is freed automatically on failure of a probe function. So this
kfree should be removed otherwise the double free will be got in
error handler path.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-15 17:08:08 +01:00
Mark Brown
aab0bb17ef Merge remote-tracking branch 'asoc/topic/intel' into asoc-next 2015-04-12 19:48:33 +01:00
Mark Brown
89a88dd3d6 ASoC: Changes for v4.1
A selection of changes for v4.1 so far.  The main things are:
 
  - Move of jack registration to the card where it belongs.
  - Support for DAPM routes specified by both the machine driver and DT.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJU960DAAoJECTWi3JdVIfQkKIH/RDvxRn8dvKOPF5U9Uix3chH
 JWKkzqfsMP0EpmQTzCQPp0ShAyYcWSbYsopicynPxUem5vS4Z8+UmOgEEgkj59pK
 USbF6v1jCQXA6BcbKyUcRRBD9FtRkfVDc7mYbRs2CcwQz2CGCgee41cvPM+2BT+z
 QdNC9UJARSweGvE1IUJSfpfYOly+BJ2s0/28RaQ0PGt+I0auoYx7IMFgMSDjv2p6
 PY0kyQiwm3Kyj2uNXPZ5gEuPxlw/t8n4fbQNrBYAvxzN+EF5NrGdKE3N7MI1xRV/
 EkFhzy+uM3X9c37tb2lT2fgPFlBc9rgPuLPSyoQ6nxa5ghCqAlgRhzpxRem8hhU=
 =VlCw
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v4.1' into asoc-next

ASoC: Changes for v4.1

A selection of changes for v4.1 so far.  The main things are:

 - Move of jack registration to the card where it belongs.
 - Support for DAPM routes specified by both the machine driver and DT.

# gpg: Signature made Thu 05 Mar 2015 01:10:27 GMT using RSA key ID 5D5487D0
# gpg: WARNING: digest algorithm MD5 is deprecated
# gpg: please see https://gnupg.org/faq/weak-digest-algos.html for more information
# gpg: Oops: keyid_from_fingerprint: no pubkey
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
2015-04-12 19:48:29 +01:00
Mark Brown
a55ede1661 Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2015-04-12 19:48:20 +01:00
kbuild test robot
a5e5e12bd4 ASoC: Intel: fix array_size.cocci warnings
sound/soc/intel/haswell/sst-haswell-ipc.c:646:28-29: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

CC: Jie Yang <yang.jie@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-12 19:47:15 +01:00
Jin Yao
0e7921e958 ASoC: Intel: Use the generic IPC/mailbox APIs in Broadwell
Use the generic IPC/mailbox APIs to replace the original processing
code for Broadwell platform.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-10 19:00:48 +01:00
Jin Yao
48cec59b6f ASoC: Intel: Use the generic IPC/mailbox APIs in Baytrail
Use the generic IPC/mailbox APIs to replace the original processing
code for Baytrail platform.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-10 19:00:45 +01:00
Jin Yao
a33c1ec5cf ASoC: Intel: Refactor common IPC/mailbox code into generic APIs
Currently in Intel SST driver, some similar IPC/mailbox processing
code are used in different platforms (e.g. in baytrail/broadwell).

This patch extracts the common code and creates new files
(sst-ipc.c/sst-ipc.h) to contain the common code and provide the generic
APIs for IPC/mailbox processing.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-10 19:00:37 +01:00
Dan Carpenter
75afbd052b ASoC: Intel: do cast earlier in sst_cdev_tstamp()
My static checker complains about these because it looks like the
multiply can overflow and then we cast to a larger data type.  I don't
think this is a problem, but it's also harmless to do the cast earlier
so let's silence the static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-09 10:58:06 +01:00
Sudip Mukherjee
1f544fd8ff ASoC: Intel: remove unused functions
these functions were never called by anyone.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08 17:47:23 +01:00
Jie Yang
8e64aedf80 ASoC: Intel: Fix a buffer overflow issue
0day robot reported a buffer overflow issue:

...
sound/soc/intel/haswell/sst-haswell-pcm.c:1107 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
sound/soc/intel/haswell/sst-haswell-pcm.c:1109 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
...

Fix it by initializing the index(i) to correct value.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08 11:17:51 +01:00
kbuild test robot
f34c4bc7e5 ASoC: Intel: read_shim_data() can be static
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06 20:10:43 +01:00
Jie Yang
b97169da06 ASoC: Intel: create atom folder and move atom platform files in
Restructure the sound/soc/intel/ directory: create atom folder, and move
sst atom platform files here.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06 17:49:45 +01:00
Jie Yang
66a6fd9846 ASoC: Intel: create baytrail folder and move baytrail platform files in
Restructure the sound/soc/intel/ directory: create baytrail folder, and move
sst baytrail platform files here.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06 17:49:45 +01:00
Jie Yang
e56c72d5f2 ASoC: Intel: create boards folder and move sst boards files in
Restructure the sound/soc/intel/ directory: create boards folder, and move
sst boards files here.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06 17:49:45 +01:00
Jie Yang
ba57f68235 ASoC: Intel: create haswell folder and move haswell platform files in
Restructure the sound/soc/intel/ directory: create haswell folder, and
move haswell platform files here.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06 17:49:45 +01:00