diff options
-rw-r--r-- | include/sound/soc-dai.h | 3 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index ae9a227d35d3..d8acf0ca77be 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -105,6 +105,8 @@ int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | |||
105 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | 105 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, |
106 | int pll_id, int source, unsigned int freq_in, unsigned int freq_out); | 106 | int pll_id, int source, unsigned int freq_in, unsigned int freq_out); |
107 | 107 | ||
108 | int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio); | ||
109 | |||
108 | /* Digital Audio interface formatting */ | 110 | /* Digital Audio interface formatting */ |
109 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 111 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
110 | 112 | ||
@@ -131,6 +133,7 @@ struct snd_soc_dai_ops { | |||
131 | int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source, | 133 | int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source, |
132 | unsigned int freq_in, unsigned int freq_out); | 134 | unsigned int freq_in, unsigned int freq_out); |
133 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | 135 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); |
136 | int (*set_bclk_ratio)(struct snd_soc_dai *dai, unsigned int ratio); | ||
134 | 137 | ||
135 | /* | 138 | /* |
136 | * DAI format configuration | 139 | * DAI format configuration |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1a38be0d0ca8..09e47c1434a7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3576,6 +3576,22 @@ int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, | |||
3576 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll); | 3576 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll); |
3577 | 3577 | ||
3578 | /** | 3578 | /** |
3579 | * snd_soc_dai_set_bclk_ratio - configure BCLK to sample rate ratio. | ||
3580 | * @dai: DAI | ||
3581 | * @ratio Ratio of BCLK to Sample rate. | ||
3582 | * | ||
3583 | * Configures the DAI for a preset BCLK to sample rate ratio. | ||
3584 | */ | ||
3585 | int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) | ||
3586 | { | ||
3587 | if (dai->driver && dai->driver->ops->set_bclk_ratio) | ||
3588 | return dai->driver->ops->set_bclk_ratio(dai, ratio); | ||
3589 | else | ||
3590 | return -EINVAL; | ||
3591 | } | ||
3592 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_bclk_ratio); | ||
3593 | |||
3594 | /** | ||
3579 | * snd_soc_dai_set_fmt - configure DAI hardware audio format. | 3595 | * snd_soc_dai_set_fmt - configure DAI hardware audio format. |
3580 | * @dai: DAI | 3596 | * @dai: DAI |
3581 | * @fmt: SND_SOC_DAIFMT_ format value. | 3597 | * @fmt: SND_SOC_DAIFMT_ format value. |