Skip to content

Commit

Permalink
Merge branch 'asoc-4.19' into asoc-4.20 for rcar dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Sep 3, 2018
2 parents 2e66d52 + 4d230d1 commit d47f958
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
4 changes: 3 additions & 1 deletion sound/soc/qcom/qdsp6/q6routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,10 @@ static int msm_routing_probe(struct snd_soc_component *c)
{
int i;

for (i = 0; i < MAX_SESSIONS; i++)
for (i = 0; i < MAX_SESSIONS; i++) {
routing_data->sessions[i].port_id = -1;
routing_data->sessions[i].fedai_id = -1;
}

return 0;
}
Expand Down
11 changes: 11 additions & 0 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,12 +955,23 @@ static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
rsnd_dai_stream_quit(io);
}

static int rsnd_soc_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);

return rsnd_dai_call(prepare, io, priv);
}

static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
.startup = rsnd_soc_dai_startup,
.shutdown = rsnd_soc_dai_shutdown,
.trigger = rsnd_soc_dai_trigger,
.set_fmt = rsnd_soc_dai_set_fmt,
.set_tdm_slot = rsnd_soc_set_dai_tdm_slot,
.prepare = rsnd_soc_dai_prepare,
};

void rsnd_parse_connect_common(struct rsnd_dai *rdai,
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/sh/rcar/rsnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ struct rsnd_mod_ops {
int (*nolock_stop)(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv);
int (*prepare)(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv);
};

struct rsnd_dai_stream;
Expand Down Expand Up @@ -330,6 +333,7 @@ struct rsnd_mod {
* H 0: fallback
* H 0: hw_params
* H 0: pointer
* H 0: prepare
*/
#define __rsnd_mod_shift_nolock_start 0
#define __rsnd_mod_shift_nolock_stop 0
Expand All @@ -344,6 +348,7 @@ struct rsnd_mod {
#define __rsnd_mod_shift_fallback 28 /* always called */
#define __rsnd_mod_shift_hw_params 28 /* always called */
#define __rsnd_mod_shift_pointer 28 /* always called */
#define __rsnd_mod_shift_prepare 28 /* always called */

#define __rsnd_mod_add_probe 0
#define __rsnd_mod_add_remove 0
Expand All @@ -358,6 +363,7 @@ struct rsnd_mod {
#define __rsnd_mod_add_fallback 0
#define __rsnd_mod_add_hw_params 0
#define __rsnd_mod_add_pointer 0
#define __rsnd_mod_add_prepare 0

#define __rsnd_mod_call_probe 0
#define __rsnd_mod_call_remove 0
Expand All @@ -372,6 +378,7 @@ struct rsnd_mod {
#define __rsnd_mod_call_pointer 0
#define __rsnd_mod_call_nolock_start 0
#define __rsnd_mod_call_nolock_stop 1
#define __rsnd_mod_call_prepare 0

#define rsnd_mod_to_priv(mod) ((mod)->priv)
#define rsnd_mod_name(mod) ((mod)->ops->name)
Expand Down
16 changes: 10 additions & 6 deletions sound/soc/sh/rcar/ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
if (rsnd_ssi_is_multi_slave(mod, io))
return 0;

if (ssi->usrcnt > 1) {
if (ssi->rate) {
if (ssi->rate != rate) {
dev_err(dev, "SSI parent/child should use same rate\n");
return -EINVAL;
Expand Down Expand Up @@ -464,7 +464,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
struct rsnd_priv *priv)
{
struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
int ret;

if (!rsnd_ssi_is_run_mods(mod, io))
return 0;
Expand All @@ -473,10 +472,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,

rsnd_mod_power_on(mod);

ret = rsnd_ssi_master_clk_start(mod, io);
if (ret < 0)
return ret;

rsnd_ssi_config_init(mod, io);

rsnd_ssi_register_setup(mod);
Expand Down Expand Up @@ -872,6 +867,13 @@ static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
return 0;
}

static int rsnd_ssi_prepare(struct rsnd_mod *mod,
struct rsnd_dai_stream *io,
struct rsnd_priv *priv)
{
return rsnd_ssi_master_clk_start(mod, io);
}

static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
.name = SSI_NAME,
.probe = rsnd_ssi_common_probe,
Expand All @@ -884,6 +886,7 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
.pointer = rsnd_ssi_pio_pointer,
.pcm_new = rsnd_ssi_pcm_new,
.hw_params = rsnd_ssi_hw_params,
.prepare = rsnd_ssi_prepare,
};

static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
Expand Down Expand Up @@ -959,6 +962,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
.pcm_new = rsnd_ssi_pcm_new,
.fallback = rsnd_ssi_fallback,
.hw_params = rsnd_ssi_hw_params,
.prepare = rsnd_ssi_prepare,
};

int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
Expand Down

0 comments on commit d47f958

Please sign in to comment.