1
0
Fork 0
Commit Graph

181 Commits (redonkable)

Author SHA1 Message Date
Daniel Mack e9be4ffd4f
ASoC: simple-card: set cpu dai clk in hw_params
The simple-card driver currently accepts a clock node in the cpu dai
sub-node and only uses it as an alternative to the
'system-clock-frequency' property to get the current frequency.

This patch adds another use of the passed clock node. If mclk-fs is
specified, the clocks in cpu and codec dai sub-nodes will be set to
the calculated rate (stream rate * mclk_fs) in hw_params.

This allows platforms to pass tuneable clocks as phandle that will
automatically be set to the right rates.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01 11:27:26 +01:00
Takashi Iwai 2661112fcc ASoC: simple-card: Remove superfluous snd_soc_jack_free_gpios() call
Since jack gpios are managed via devres, we don't have to call
snd_jack_free_gpios() at release any longer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-22 13:38:43 +01:00
Mark Brown f459768c6c Merge remote-tracking branches 'asoc/topic/msm8916', 'asoc/topic/mtk', 'asoc/topic/nau8824', 'asoc/topic/nau8825' and 'asoc/topic/of-graph' into asoc-next 2017-07-03 16:15:12 +01:00
Mark Brown 85ee1f42fa Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next 2017-07-03 16:15:04 +01:00
Kuninori Morimoto fa2760dd36 ASoC: simple-card: use asoc_simple_card_of_parse_widgets()
Current simple card driver is supporting widgets on DT,
other simple/audio card drivers will support it.
Encapsulation is one of simple card util's purpose.
Let's use asoc_simple_card_of_parse_widgets

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 17:58:39 +01:00
Kuninori Morimoto 1fdb5d258e ASoC: simple-card: use asoc_simple_card_of_parse_routing()
Current simple/audio scu card drivers are supporting same
routing on DT, but, doesn't use same function for it.
Encapsulation is one of simple card util's purpose.
Let's use asoc_simple_card_of_parse_routing

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-15 18:15:00 +01:00
Kuninori Morimoto b93d2cf8c0 ASoC: simple-card: use asoc_simple_card_of_parse_tdm()
Current simple card drivers are using asoc_simple_dai's tx_slot_mask,
rx_slot_mask, slots, slot_width directly to parse TDM.
Encapsulation is one of simple card util's purpose.
Let's use asoc_simple_card_of_parse_tdm for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-14 11:00:10 +01:00
Kuninori Morimoto 3ab50c4f98 ASoC: simple-card: use asoc_simple_card_clk_xxx()
Current simple-card-utils sets asoc_simple_dai::clk via
asoc_simple_card_parse_clk().
Current simple card drivers are using it directly for
clk_enable/disable.
Encapsulation is one of simple card util's purpose.
Let's use asoc_simple_card_clk_enable/disable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13 21:57:51 +01:00
Mark Brown 03cf603a49 Merge branch 'topic/rcar' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-of-graph 2017-06-13 21:57:18 +01:00
Kuninori Morimoto d2fdcc285f ASoC: simple-card: remove duplicate parameter from asoc_simple_card_parse_of()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:26:34 +01:00
Kuninori Morimoto 8e16638256 ASoC: simple-card-utils: share same dev_dbg() for sysclk
Let's share same debug message for sysclk

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:08 +01:00
Kuninori Morimoto 4579771ebb ASoC: simple-card-utils: share same dev_dbg() for Dai Name
Let's share same debug message for DAI Name

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:08 +01:00
Kuninori Morimoto aaad9c131b ASoC: simple-card-utils: share same dev_dbg() for DAI format
Let's share same debug message for DAI format

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:07 +01:00
Julian Scheel 7ac45d1635 ASoC: simple-card: Fix misleading error message
In case cpu could not be found the error message would always refer to
/codec/ not being found in DT. Fix this by catching the cpu node not found
case explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 17:43:21 +01:00
Stefan Agner f746aa5e86 ASoC: simple-card: fix mic jack initialization
Initialize asoc_simple_card_init_mic with the correct struct
asoc_simple_jack.

Fixes: 9eac361877 ("ASoC: simple-card: add new asoc_simple_jack and use it")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:34:04 +01:00
Kuninori Morimoto c6d112e442 ASoC: simple-card: tidyup return method from probe()
Current return method from probe() is very confusable.
This patch tidyup it to normal return method

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:26:48 +01:00
Mark Brown ae17a14f14 Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/simple', 'asoc/topic/sirf' and 'asoc/topic/ssm4567' into asoc-next 2017-04-30 22:16:26 +09:00
Kuninori Morimoto 5be509576c ASoC: simple-card: add new simple_priv_to_card() macro
Current simple card driver is directly calling priv->snd_card
everywhere, but it makes unreadable code.
Let's use simple_priv_to_card() macro for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:37 +00:00
Kuninori Morimoto dcee9bfe89 ASoC: simple-card: use defined dev on probe()
Current asoc_simple_card_probe() already has dev definition,
but some place doesn't use it. Let's fix this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:36 +00:00
Kuninori Morimoto e984fd61e8 ASoC: simple-card: use devm_get_clk_from_child()
Current simple-card-utils is getting clk by of_clk_get(), but didn't call
clk_free(). Now we can use devm_get_clk_from_child() for this purpose.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 17:46:33 +00:00
Julia Lawall 9b6fdef62b ASoC: constify snd_soc_ops structures
Check for snd_soc_ops structures that are only stored in the ops field of a
snd_soc_dai_link structure.  This field is declared const, so snd_soc_ops
structures that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_soc_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_dai_link e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i, e;
position p;
@@
struct snd_soc_dai_link e[] = { ..., { .ops = &i@p, }, ..., };

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_soc_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_soc_ops i = { ... };
// </smpl>

The effect on the layout of the .o files is shown by the following output
of the size command, first before then after the transformation:

   text    data     bss     dec     hex filename
   4500     696       0    5196    144c sound/soc/generic/simple-card.o
   4564     632       0    5196    144c sound/soc/generic/simple-card.o

   text    data     bss     dec     hex filename
   3018     608       0    3626     e2a sound/soc/generic/simple-scu-card.o
   3074     544       0    3618     e22 sound/soc/generic/simple-scu-card.o

   text    data     bss     dec     hex filename
   4148    2448     768    7364    1cc4 sound/soc/intel/boards/bdw-rt5677.o
   4212    2384     768    7364    1cc4 sound/soc/intel/boards/bdw-rt5677.o

   text    data     bss     dec     hex filename
   5403    4628     384   10415    28af sound/soc/intel/boards/bxt_da7219_max98357a.o
   5531    4516     384   10431    28bf sound/soc/intel/boards/bxt_da7219_max98357a.o

   text    data     bss     dec     hex filename
   5275    4496     384   10155    27ab sound/soc/intel/boards/bxt_rt298.o
   5403    4368     384   10155    27ab sound/soc/intel/boards/bxt_rt298.o

   text    data     bss     dec     hex filename
  10017    2344      48   12409    3079 sound/soc/intel/boards/bytcr_rt5640.o
  10145    2232      48   12425    3089 sound/soc/intel/boards/bytcr_rt5640.o

   text    data     bss     dec     hex filename
   3719    2356       0    6075    17bb sound/soc/intel/boards/bytcr_rt5651.o
   3847    2244       0    6091    17cb sound/soc/intel/boards/bytcr_rt5651.o

   text    data     bss     dec     hex filename
   3598    2392       0    5990    1766 sound/soc/intel/boards/cht_bsw_max98090_ti.o
   3726    2280       0    6006    1776 sound/soc/intel/boards/cht_bsw_max98090_ti.o

   text    data     bss     dec     hex filename
   5343    3624      16    8983    2317 sound/soc/intel/boards/cht_bsw_rt5645.o
   5471    3496      16    8983    2317 sound/soc/intel/boards/cht_bsw_rt5645.o

   text    data     bss     dec     hex filename
   4662    2592     384    7638    1dd6 sound/soc/intel/boards/cht_bsw_rt5672.o
   4790    2464     384    7638    1dd6 sound/soc/intel/boards/cht_bsw_rt5672.o

   text    data     bss     dec     hex filename
   1595    2528       0    4123    101b sound/soc/intel/boards/haswell.o
   1659    2472       0    4131    1023 sound/soc/intel/boards/haswell.o

   text    data     bss     dec     hex filename
   6272    4760     416   11448    2cb8 sound/soc/intel/boards/skl_nau88l25_max98357a.o
   6464    4568     416   11448    2cb8 sound/soc/intel/boards/skl_nau88l25_max98357a.o

   text    data     bss     dec     hex filename
   7075    4888     416   12379    305b sound/soc/intel/boards/skl_nau88l25_ssm4567.o
   7267    4696     416   12379    305b sound/soc/intel/boards/skl_nau88l25_ssm4567.o

   text    data     bss     dec     hex filename
   5659    4496     384   10539    292b sound/soc/intel/boards/skl_rt286.o
   5787    4368     384   10539    292b sound/soc/intel/boards/skl_rt286.o

   text    data     bss     dec     hex filename
   1721    2048       0    3769     eb9 sound/soc/kirkwood/armada-370-db.o
   1769    1976       0    3745     ea1 sound/soc/kirkwood/armada-370-db.o

   text    data     bss     dec     hex filename
   1363    1792       0    3155     c53 sound/soc/mxs/mxs-sgtl5000.o
   1427    1728       0    3155     c53 sound/soc/mxs/mxs-sgtl5000.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24 18:34:55 +01:00
Nikita Yushchenko 899a247cf6 ASoC: simple-card: add support for aux devices
Add device tree property to define auxiliary devices to be added to
simle-audio-card.

Together with proper audio routing definition, this allows to use
simple-card in setups where separate amplifier chip is connected to
codec's output.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-26 09:04:14 -07:00
Kuninori Morimoto b0133d9c4d ASoC: simple-card: use kzalloc() for dai_props / dai_link
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

Now, simple card needs to 2 type of buffer for dai_props and dai_link.
But, these used different style for buffer allocation.
This patch make these same style as other simple card family.
(= use kzalloc() for both)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto 2c86dda74c ASoC: simple-card: code sync: rename num_link to num
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch renames num_link to num

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto 0a6c7f2f78 ASoC: simple-card: code sync: use tag
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch uses tag on asoc_simple_card_probe

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto 387f5823f4 ASoC: simple-card: code sync: tidyup white line
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch tidyups white line

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto a1dbfd0013 ASoC: simple-card: is GPL v2
It is indicating that this driver is GPL v2 on top of C code.
Let's fixup it on MODULE_LICENSE()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto c9a23ead02 ASoC: simple-card: code sync: use simple_priv_to_props() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto 7e3353ddd2 ASoC: simple-card: code sync: tidyup simple_priv_to_xxx() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto f93b646d51 ASoC: simple-card: tidyup mclk-fs of_property_read_u32() usage
of_property_read_u32() do nothing in error case.
Let's tidyup useless usage.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto a03b0545c2 ASoC: simple-card: call of_node_put() for dai_link
We need to call of_node_put() if we used of_get_child_by_name(),
but missing it for "dai-link" loop.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto 885fc0595a ASoC: simple-card: use asoc_simple_card_clean_reference()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto 16f1de6f36 ASoC: simple-card: use asoc_simple_card_canonicalize_cpu()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto c958374f1c ASoC: simple-card: use asoc_simple_card_canonicalize_dailink()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto d8cb9354c8 ASoC: simple-card: use asoc_simple_card_init_dai()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto c3b19c8dd0 ASoC: simple-card: remove asoc_simple_card_sub_parse_of()
asoc_simple_card_sub_parse_of() is no longer needed. Let's cleanup

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:35:51 +01:00
Kuninori Morimoto 44c16af1fa ASoC: simple-card: use asoc_simple_card_parse_dai()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:35:51 +01:00
Kuninori Morimoto 28abd99b6e ASoC: simple-card: use asoc_simple_card_parse_clk()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-05 12:31:37 +01:00
Kuninori Morimoto 3527d85b85 ASoC: simple-card: use asoc_simple_card_parse_card_name()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-16 13:03:04 +01:00
Kuninori Morimoto 2e8d1c7d54 ASoC: simple-card: use asoc_simple_card_parse_dailink_name()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-16 13:03:01 +01:00
Kuninori Morimoto cecdef3656 ASoC: simple-card: use asoc_simple_card_parse_daifmt()
We can use simpel utils asoc_simple_card_parse_daifmt().
Let's use it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-01 17:34:02 +02:00
Kuninori Morimoto 9eac361877 ASoC: simple-card: add new asoc_simple_jack and use it
Current simple-card supports snd_soc_jack/pin/gpio.
These code are very similar, but driver has verbosity code.
So, this patch adds new snd_soc_jack and cleanups code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 19:12:30 +01:00
Kuninori Morimoto 548563fa3e ASoC: simple-card: use common PREFIX for each DT property
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 13:24:54 +01:00
Kuninori Morimoto 5fb9cb1651 ASoC: simple-card: platform also uses asoc_simple_card_sub_parse_of()
In current simple-card, platform is handled as special case,
but, the code is not readable.
This patch makes platform to use asoc_simple_card_sub_parse_of()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 17:16:19 +01:00
Peter Ujfalusi 7c3767115a ASoC: simple-card: Add pm callbacks to platform driver
Set snd_soc_pm_ops for the pm ops to make sure that the ASoC level of PM
operations are going to happen. This is needed to get suspend/resume
working correctly when the audio is using simple-card.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-09 16:24:16 +01:00
Aaro Koskinen ee43a1a0cd ASoC: simple-card: don't fail if sysclk setting is not supported
Commit e22579713a ("ASoC: simple card: set cpu-dai sysclk
with mclk-fs") added sysclk / SND_SOC_CLOCK_OUT setting, that makes
asoc_simple_card_hw_params fail if the operation is not supported,
although the intention clearly was to ignore ENOTSUPP. Fix it.

The patch fixes audio playback on Kirkwood / OpenRD client,
where the following errors are seen:

	asoc-simple-card sound: ASoC: machine hw_params failed: -524
	alsa-lib: /alsa-lib-1.0.28/src/pcm/pcm_hw.c:327:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed (-524): Unknown error 524

Fixes: e22579713a ("ASoC: simple card: set cpu-dai sysclk with mclk-fs")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-27 20:27:09 +00:00
Mengdong Lin 1a497983a5 ASoC: Change the PCM runtime array to a list
Currently the number of DAI links is statically defined by the machine
driver at build time using an array. This makes it difficult to shrink/
grow the number of DAI links at runtime in order to reflect any changes
in topology.

We can change the DAI link array in the core to a list so that PCMs and
FE DAI links can be added and deleted at runtime to reflect changes in
use case and DSP topology. The machine driver can still register DAI links
as an array.

As the 1st step, this patch change the PCM runtime array to a list. A new
PCM runtime is added to the list when a DAI link is bound successfully.

Later patches will further implement the DAI link list.

More:
- define snd_soc_new/free_pcm_runtime() to create/free a runtime.
- define soc_add_pcm_runtime() to add a runtime to the rtd list.
- define soc_remove_pcm_runtimes() to clean up the runtime list.

- traverse the rtd list to probe the link components and dais.

- Add a field "num" to PCM runtime struct, used to specify the device
  number when creating the pcm device, and for a soc card to access
  its dai_props array.

- The following 3rd party machine/platform drivers iterate the rtd list
  to check the runtimes:
  sound/soc/intel/atom/sst-mfld-platform-pcm.c
  sound/soc/intel/boards/cht_bsw_rt5645.c
  sound/soc/intel/boards/cht_bsw_rt5672.c
  sound/soc/intel/boards/cht_bsw_max98090_ti.c

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-18 18:32:24 +00:00
Jyri Sarha 6131084a0b ASoC: simple-card: Add tdm slot mask support to simple-card
Adds DT binding for explicitly choosing a tdm mask for DAI and uses it
in simple-card. The API for snd_soc_of_parse_tdm_slot() has also been
changed.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 18:00:30 +01:00
Arnaud Pouliquen e22579713a ASoC: simple card: set cpu-dai sysclk with mclk-fs
Allows to request a specific mclk frequency per cpu_dai.
To support some codecs with mclk provided by the cpu_dai, the
mclk rate must be set depending on frame rate.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 12:52:56 +01:00
Arnaud Pouliquen 85a4bfd895 ASoC: simple card: Add mclk-fs property in dai-link
Add mclk-fs ratio property per dai-link sub node. This will
allow to manage several codecs with different ratio.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 12:35:54 +01:00
Jun Nie e0ae225b7e ASoC: simple-card: support platform in dts parse
Support platform in dts parse so that dma pcm component
can be added in dts.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-04 14:59:04 +01:00
Mark Brown e3438187d2 Merge remote-tracking branches 'asoc/topic/rt5641', 'asoc/topic/rt5677' and 'asoc/topic/sh-cleanup' into asoc-next 2015-04-12 19:49:17 +01:00
Lars-Peter Clausen 1efb53a220 ASoC: simple-card: Remove support for setting differing DAI formats
Having to set different formats on the CPU side and the CODEC side of a DAI
link is usually indication that something is terribly wrong and in most
cases is a result of a broken driver that implements a set_fmt() callback
which does not follow the specification. In the past this feature has been
used to work around broken drivers, rather than fixing them. We don't really
want to encourage this, so remove support for setting different formats on
both ends of the link.

Along the way switch to static DAI format setup by setting the the dai_fmt
field of the snd_soc_dai_link rather than calling snd_soc_dai_fmt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-26 18:35:48 -07:00
Mark Brown 256fca9247 Merge remote-tracking branches 'asoc/topic/jack', 'asoc/topic/max98357a', 'asoc/topic/omap' and 'asoc/topic/rt286' into asoc-next 2015-03-05 01:07:23 +00:00
Lars-Peter Clausen 386669fcec ASoC: simple-card: Register jacks at the card level
The jacks are card level elements so use snd_soc_card_jack_new() instead of
snd_soc_jack_new() to register them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:09:51 +00:00
Vishal Thanki 31f3032c1a ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
Make sure devm_kzalloc() succeeds.

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-03 14:25:16 +00:00
Mark Brown 1bf9f29a05 Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/sta32x', 'asoc/topic/tdm-slot', 'asoc/topic/tegra' and 'asoc/topic/tlv320aic3x' into asoc-next 2015-02-09 15:10:29 +08:00
Mark Brown cb6bfd3de4 Merge remote-tracking branches 'asoc/topic/rx51', 'asoc/topic/samsung', 'asoc/topic/sh', 'asoc/topic/simple' and 'asoc/topic/sta32x' into asoc-next 2015-02-04 20:57:18 +00:00
Jyri Sarha f9911803e8 ASoC: simple-card: Enable and disable DAI clocks as needed
Call clk_prepare_enable() and clk_disable_unprepare() for cpu dai
clock and codec dai clock in dai statup and shutdown callbacks. This
to make sure the related clock are enabled when the audio device is
used.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:45:52 +00:00
Geert Uytterhoeven 7ddfdb5c5a ASoC: simple-card: Fix crash in asoc_simple_card_unref()
If asoc_simple_card_probe() fails, asoc_simple_card_unref() may be
called before dev_set_drvdata(), causing a NULL pointer dereference in
asoc_simple_card_unref():

    Unable to handle kernel NULL pointer dereference at virtual address 000000d4
    ...
    PC is at asoc_simple_card_unref+0x14/0x48
    LR is at asoc_simple_card_probe+0x3d4/0x40c

This typically happens because asoc_simple_card_parse_of() returns
-EPROBE_DEFER, but other failure modes are possible.
devm_snd_soc_register_card()/snd_soc_register_card() may fail either
before or after dev_set_drvdata().

Pass a snd_soc_card pointer instead of a platform_device pointer to
asoc_simple_card_unref() to fix this.

Note that if CONFIG_OF_DYNAMIC=n, of_node_put() is a dummy, and gcc may
optimize away the loop over card->dai_link, never actually dereferencing
card, and thus avoiding the crash...

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: e512e001da ("ASoC: simple-card: Fix the reference count of device nodes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-01-14 17:16:37 +00:00
Linus Torvalds e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Jean-Francois Moine 7195d920bd ASoC: simple-card: Remove useless function argument
The device node pointer 'cpu' is not used in the function
asoc_simple_card_parse_daifmt().

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-25 13:49:33 +00:00
Jean-Francois Moine 0099c76285 ASoC: simple-card: Remove useless casts
There is no need to cast the cpu_of_node or codec_of_node of the
dai_links when calling of_put_node.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 19:02:02 +00:00
Jianqun 4476159f0b ASoC: simple-card: add "invert" property for detect GPIOs
Since hardware may invert detect GPIO of headphone or mic, add one
property to support software invert.

Signed-off-by: Jianqun <jay.xu@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-03 12:26:15 +00:00
Kuninori Morimoto 1b5721b243 ASoC: simple-card: add asoc_simple_card_parse_daifmt()
Current daifmt setting method in simple-card driver is
placed to many places, and using un-readable/confusable method.
This patch adds new asoc_simple_card_parse_daifmt()
and tidyup code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-28 16:35:51 +00:00
Wolfram Sang ffd35fa74f ASoC: generic: drop owner assignment from platform_drivers
A 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>
2014-10-20 16:22:08 +02:00
Fabio Estevam 84d4cbe9a6 ASoC: simple-card: Delete unneeded test before of_node_put
of_node_put() supports NULL as its argument, so the initial test is not
necessary.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20 12:22:40 +01:00
Geert Uytterhoeven 2dbab9784d ASoC: simple-card: Initialize headphone and mic GPIO numbers
The uninitialized default of 0 for gpio_hp_det and gpio_mic_det doesn't
play well with asm-generic's gpio_is_valid():

	static inline bool gpio_is_valid(int number)
	{
		return number >= 0 && number < ARCH_NR_GPIOS;
	}

Hence on r8a7740/armadillo-legacy:

	sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec
	sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones
	sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Mic Jack

After that the kernel log is spammed ca. 7 times per second with:

	sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones

Initialize the GPIO numbers with a negative number (-ENOENT) to fix this.

Fixes: 3fe240326c ("ASoC: simple-card: Add mic and hp detect gpios.")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-07 18:24:01 +01:00
Dylan Reid 3fe240326c ASoC: simple-card: Add mic and hp detect gpios.
Allow Headphone and Microphone jack detect gpios to be specified in
device tree.  This will allow a few systems including rk3288_max98090
to use simple-card instead of having their own board file.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-02 16:53:40 +01:00
Mark Brown 04a0b8ef6b Linux 3.17-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUDOW+AAoJEHm+PkMAQRiGOXYH/00TPKm8PdM5cXXG2YYYv9eT
 W99K7KD2i0/qiVtlGgjjvB7fO3K0HcZusTd2jmVd8IWntXvauq7Zpw5YZkjwu4KX
 Y1HCwwCd2aw0FoqgrJhNP3+j5Cr1BD/HLtbffjCe+A3tppOIis4Bwt2wJOoYlXpS
 hU9Jxxc4lcRo8YKbffouDo7PIneWeJy8N+WGpUR5BfJIEK0ZZtCUqn3/3WLX4FYu
 fE6uiF/bACTpKXU/mo4dDbhZp439H/QdwQc9B0F8+8CBDMXKaNHrPV7kN36T2SWa
 fD4boikTsi/yh9Ks1fvHbvNq2N0ihoMnja+vLRyvjAcAQv2fKG3OZtYgFWSdghU=
 =Xknd
 -----END PGP SIGNATURE-----

Merge tag 'v3.17-rc4' into asoc-simple

Linux 3.17-rc4
2014-10-02 16:53:35 +01:00
Kuninori Morimoto 9810f5370b ASoC: simple-card: tidyup get dai_link/dai_props from priv
It can get dai_link/dai_props pointer from priv + index

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-12 15:00:58 +01:00
Kuninori Morimoto f531913f01 ASoC: simple-card: tidyup use priv in parameter
priv has many information about simple-card driver.
Using it becomes easy to extend feature.
This patch gets dev from priv as 1st step

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-12 14:59:48 +01:00
Arnd Bergmann 88a60e552f ASoC: simple-card: fix regression in clock rate lookup
Commit 7c7b9cf53d ("ASoC: simple-card: fixup cpu_dai_name
clear case") changed the way that "sound-dai" properties are handled,
which leads to the clock frequency not being picked up from the
node that the phandle points to, as correctly identified by gcc
with this warning:

sound/soc/generic/simple-card.c: In function 'asoc_simple_card_sub_parse_of':
sound/soc/generic/simple-card.c:165:7: warning: 'node' may be used uninitialized in this function [-Wmaybe-uninitialized]

This restores the previous behavior by using the node from
of_parse_phandle_with_args() that was previously being
returned from of_parse_phandle().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10 11:56:42 +01:00
Xiubo Li 0dd4fc3c2f ASoC: simple-card: Adjust the comments of simple card.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10 11:52:37 +01:00
Xiubo Li 2080437d37 ASoC: simple-card: Merge single and muti DAI link(s) code.
This patch will split the DT node into old style and new style:
The new style will merge the single DAI link and muti DAI links code
together, the new style will be easier to add muti DAI links from old
single DAI link DTs.

This patch will maintian compatibility with the old DTs.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-09 12:59:49 +01:00
Kuninori Morimoto 7c7b9cf53d ASoC: simple-card: fixup cpu_dai_name clear case
f687d900d3
(ASoC: simple-card: cpu_dai_name creates confusion when DT case)
cleared cpu_dai_name for caring fmt_single_name case,
and
179949bc04
(ASoC: simple-card: remove dai_link->cpu_dai_name when DT)
cared multi dai-link case.
but, cpu_dai_name matching is required when fmt_multiple_name was used

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-03 13:53:44 +01:00
Xiubo Li e3c4a28b61 ASoC: simple-card: Fix bug of wrong decrement DT node's refcount
DAI links's cpu_of_node's and codec_of_node's refcounts shouldn't
be decremented immediately at the end of the probe() fucntion.
Because we will still use them before the audio card is removed.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01 17:48:07 +01:00
Kuninori Morimoto a44a750e52 ASoC: simple-card: use common for_each_child_of_node() for loop
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-29 12:51:02 +01:00
Kuninori Morimoto a5960bd598 ASoC: simple-card: dai_link->init should be cared when multi DAI
6a91a17bd7
(ASoC: simple-card: Handle many DAI links)
added multi DAI support on simple-card.
This means priv->dai_link might be pointer of multi DAI.
dai_link->init is needed for all DAI.
This patch cares it for all DAIs on DT/non-DT

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-29 12:51:02 +01:00
Kuninori Morimoto 179949bc04 ASoC: simple-card: remove dai_link->cpu_dai_name when DT
f687d900d3
(ASoC: simple-card: cpu_dai_name creates confusion when DT case)
removed dai_link->cpu_dai_name when DT case,
since it uses DT phand in soc_bind_dai_link().
This binding will fail if it has cpu_dai_name.

6a91a17bd7
(ASoC: simple-card: Handle many DAI links)
added multi DAI link support to simple-card driver.
Then, removing cpu_dai_name was cared only single DAI.
But, it is needed in all DT cases.
This patch moves it to asoc_simple_card_dai_link_of()
so that care about all DAIs.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-29 12:51:01 +01:00
Kuninori Morimoto 2d82eeb026 ASoC: simple-card: use asoc_simple_xxx prefix
simple-card driver is using asoc_simple_xxx() prefix.
simple_card_dai_link_of() should be
asoc_simple_card_dai_link_of().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-29 12:49:34 +01:00
Xiubo Li 8ea2134886 ASoC: simple-card: Fix the compile warning.
sound/soc/generic/simple-card.c: In function simple_card_dai_link_of:
sound/soc/generic/simple-card.c:198:10: warning: passing argument 3 of
asoc_simple_card_sub_parse_of from incompatible pointer type [enabled by default]
          &dai_link->cpu_dai_name);
          ^
sound/soc/generic/simple-card.c:112:1: note: expected const struct device_node **
but argument is of type struct device_node **
 asoc_simple_card_sub_parse_of(struct device_node *np,
 ^
sound/soc/generic/simple-card.c:229:10: warning: passing argument 3 of
asoc_simple_card_sub_parse_of from incompatible pointer type [enabled by default]
          &dai_link->codec_dai_name);
          ^
sound/soc/generic/simple-card.c:112:1: note: expected const struct device_node **
but argument is of type struct device_node **
 asoc_simple_card_sub_parse_of(struct device_node *np,
 ^

Since the asoc_simple_card_sub_parse_of() is used in simple-card module only,
and the third argument is just used to get the node ponters address, so there is
no need it must to be 'const' type.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-18 11:42:05 -05:00
Jyri Sarha c7099eb1c1 ASoC: simple-card: Make u32 DT parameter handling 64-bit proof
Passing unsigned int pointers as u32 ponters may be dangerous on 64-bit
system.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21 11:06:53 +01:00
Andrew Lunn 2942a0e285 ASoC: simple-card: Support setting mclk via a fixed factor
Some platforms require that the codecs mclk is a fixed multiplication
factor of the audio stream rate. Add a optional property to the
binding to hold this factor and implement a hw_params() function to
make use of it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 14:29:30 +01:00
Jyri Sarha 648722155d ASoC: simple-card: is_top_level_node parameter to simple_card_dai_link_of()
Restore correct parsing of dai-link subnodes with more explicit
implementation for applying the "simple-audio-card,"-prefix to
dai-link property and subnode names.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 18:23:49 +01:00
Nicolin Chen 781cbebed7 ASoC: simple-card: Improve coding style
Improve indentation and space.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Nicolin Chen 966b806360 ASoC: simple-card: Simplify error msg in simple_card_dai_link_of()
It would look better to use prop instead.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Nicolin Chen 50e6c718a1 ASoC: simple-card: Drop node->name checking
The current simple-card driver limits the DT node name to "sound".
Any of other names is forbidden while actually we should allow DT
to pass other node names.

And if this function is being called, the node must already have
the compatible "simple-audio-card" in DTB. So there should be no
need to check the name here.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Jyri Sarha b3ca11ff59 ASoC: simple-card: Move dai-link level properties away from dai subnodes
The properties like format, bitclock-master, frame-master,
bitclock-inversion, and frame-inversion should be common to the dais
connected with a dai-link. For bitclock-master and frame-master
properties to be unambiguous they need to indicate the mastering dai
node with a phandle.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:14:27 +01:00
Jyri Sarha 389cb8348c ASoC: core: Update snd_soc_of_parse_daifmt() interface
Adds struct device_node **bitclkmaster and struct device_node **framemaster
function parameters. With the new syntax bitclock-master and frame-master
properties can explicitly indicate the dai-link bit-clock and frame masters
with a phandle. This patch also makes the minimal changes to simple-card
for it to work with the updated snd_soc_of_parse_daifmt(). Simple-card appears
to be the only user of snd_soc_of_parse_daifmt() for now.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:14:27 +01:00
Jean-Francois Moine 6a91a17bd7 ASoC: simple-card: Handle many DAI links
Some simple audio cards may have many DAI links.
This patch extends the simple-card driver for handling such cards.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-25 18:09:20 +00:00
Jean-Francois Moine cf7dc23cbf ASoC: simple-card: dynamically allocate the DAI link and properties
The DAI link array and the properties (fmt, sysclk slots) are
hard-coded for a single CPU / CODEC link.

This patch dynamically allocates the DAI link array and the
properties with the aim of supporting many DAI links.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-25 18:09:20 +00:00
Nicolin Chen 46c39cae29 ASoC: simple-card: overwrite cpu_dai->fmt with codec_dai->fmt
The current simple-card driver separates the daimft for cpu_dai and codec_dai.
So we might get different values for them (0x4003 and 0x1003 for example):

asoc-simple-card sound-cs42888.12: cpu : 2024000.esai / 4003 / 132000000
asoc-simple-card sound-cs42888.12: codec : cs42888 / 1003 / 24576000
asoc-simple-card sound-cs42888.12: cs42888 <-> 2024000.esai mapping ok

This is not allowed at all as we need to keep the DAIFMT settings identical
for both the ends of the link.

Thus this patch fixes it by overwriting the cpu_dai->fmt with codec_dai->fmt
since we defined the DAIFMT_MASTER basing on CODEC at the first place while
the other bits are same.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18 23:44:40 +00:00
Jean-Francois Moine c56c4d74c6 ASoC: simple-card: Simplify code
The global DAI format is used only in the function
asoc_simple_card_parse_of(). So, move it from the private data
to the stack.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-17 16:24:56 +00:00
Jean-Francois Moine e512e001da ASoC: simple-card: Fix the reference count of device nodes
The reference count of some device nodes is not correctly reset
at end of card probe.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-14 19:56:55 +00:00
Kuninori Morimoto 12ffa6fc19 ASoC: simple-card: card name can be option
snd_card.name is now option on DT case.
non-DT case can follow same style,
and it is understandable from platform point of view.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 07:53:35 +00:00
Kuninori Morimoto 81985bd63f ASoC: simple-card: tidyup cpu/codec dai_fmt settings for non-DT
30d0341e7d
(ASoC: simple-card: simplify the daifmt code)
simplify cpu/codec dai_fmt which consists from
dai specific format + common format.
But, it didn't care about non-DT case.
This patch fixes it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-05 14:10:47 +08:00
Kuninori Morimoto f687d900d3 ASoC: simple-card: cpu_dai_name creates confusion when DT case
Basically, soc_bind_dai_link() checks
cpu_dai->dev->of_node and dai_link->cpu_of_node in DT case.
But after that it will check
cpu_dai->name and dai_link->cpu_dai_name too.

On the other hand, snd_soc_dai :: name is created by
fmt_single_name() or fmt_multiple_name().

There is no confusion if dai name is created by fmt_multiple_name(),
since cpu_dai->name is same as dai_link->cpu_dai_name.
but, if dai name is created by fmt_single_name(), CPU DAI never match.

Thus, simple-card not set dai_link->cpu_dai_name if DT case
to skip naming match on soc_bind_dai_link()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-28 14:25:25 +09:00
Xiubo Li 6ff62eedce ASoC: simple-card: add slot information parsing supports
For some CPU/CODEC DAI devices the slot information maybe needed. This
patch adds the slot information parsing for simple-card driver.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23 14:26:37 +09:00
Xiubo Li 9d681f5bfc ASoC: simple-card: add off-codec widgets supports.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-10 13:33:40 +00:00