diff options
| author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-03-20 00:54:59 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2019-03-21 10:51:03 -0400 |
| commit | e59289cda8dec0153fa396864c8ba8092ec3b80d (patch) | |
| tree | c819d352f0ce0b92c8bf2ee53887ac53e13da3d5 /include/sound | |
| parent | 0580dde59438686d60762b6da9229ebec693b94f (diff) | |
ASoC: simple_card_utils: share common priv for simple-card/audio-graph
Historically, simple-card/simple-scu-card/audio-graph/audio-graph-scu
are similar but different generic sound card.
simple-scu-card which was for DPCM was merged into simple-card, and
audio-graph-scu which was for DPCM was merged into audio-graph.
simple-card is for non OF graph sound card, and
audio-graph is for OF graph sound card.
And, small detail difference (= function parameter, naming, etc)
between simple-card/audio-graph has been unified.
So today, the difference between simple-card/audio-graph are
just using OF graph style, or not.
In other words, there should no difference other than OF graph sytle.
simple-card/audio-graph are using own priv today , but we can merge it.
This patch merge it at simple_card_utils.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/simple_card_utils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 0199ad0bbcd0..c0161ec17572 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h | |||
| @@ -37,6 +37,29 @@ struct asoc_simple_jack { | |||
| 37 | struct snd_soc_jack_gpio gpio; | 37 | struct snd_soc_jack_gpio gpio; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | struct asoc_simple_priv { | ||
| 41 | struct snd_soc_card snd_card; | ||
| 42 | struct simple_dai_props { | ||
| 43 | struct asoc_simple_dai *cpu_dai; | ||
| 44 | struct asoc_simple_dai *codec_dai; | ||
| 45 | struct snd_soc_dai_link_component codecs; /* single codec */ | ||
| 46 | struct snd_soc_dai_link_component platforms; | ||
| 47 | struct asoc_simple_card_data adata; | ||
| 48 | struct snd_soc_codec_conf *codec_conf; | ||
| 49 | unsigned int mclk_fs; | ||
| 50 | } *dai_props; | ||
| 51 | struct asoc_simple_jack hp_jack; | ||
| 52 | struct asoc_simple_jack mic_jack; | ||
| 53 | struct snd_soc_dai_link *dai_link; | ||
| 54 | struct asoc_simple_dai *dais; | ||
| 55 | struct snd_soc_codec_conf *codec_conf; | ||
| 56 | struct gpio_desc *pa_gpio; | ||
| 57 | }; | ||
| 58 | #define simple_priv_to_card(priv) (&(priv)->snd_card) | ||
| 59 | #define simple_priv_to_props(priv, i) ((priv)->dai_props + (i)) | ||
| 60 | #define simple_priv_to_dev(priv) (simple_priv_to_card(priv)->dev) | ||
| 61 | #define simple_priv_to_link(priv, i) (simple_priv_to_card(priv)->dai_link + (i)) | ||
| 62 | |||
| 40 | int asoc_simple_card_parse_daifmt(struct device *dev, | 63 | int asoc_simple_card_parse_daifmt(struct device *dev, |
| 41 | struct device_node *node, | 64 | struct device_node *node, |
| 42 | struct device_node *codec, | 65 | struct device_node *codec, |
