Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 7e406355c5001d6e8e6100e4062df41b41f80ab8
- Author: Marcus Cooper <[email protected]>
- Date: Sun Mar 20 18:54:29 2016 +0100
- hacking 22nd Mar 2016
- diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
- index 54d76cb..b609f75 100644
- --- a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
- +++ b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
- @@ -74,6 +74,12 @@
- };
- };
- + pcm5102: pcm510x {
- + compatible = "ti,pcm510x";
- + pcm510x,format = "i2s";
- + #sound-dai-cells = <0>;
- + };
- +
- sound_i2s {
- compatible = "simple-audio-card";
- simple-audio-card,format = "i2s";
- @@ -98,6 +104,7 @@
- };
- simple-audio-card,codec {
- + // sound-dai = <&pcm5102>;
- sound-dai = <&ext_codec>;
- };
- };
- diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
- index de8230c..be2cafc 100644
- --- a/sound/soc/codecs/uda1380.c
- +++ b/sound/soc/codecs/uda1380.c
- @@ -664,13 +664,13 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = UDA1380_RATES,
- - .formats = SNDRV_PCM_FMTBIT_S16_LE,},
- + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
- .capture = {
- .stream_name = "Capture",
- .channels_min = 1,
- .channels_max = 2,
- .rates = UDA1380_RATES,
- - .formats = SNDRV_PCM_FMTBIT_S16_LE,},
- + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
- .ops = &uda1380_dai_ops,
- },
- { /* playback only - dual interface */
- @@ -680,8 +680,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = UDA1380_RATES,
- - .formats = SNDRV_PCM_FMTBIT_S16_LE,
- - },
- + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
- .ops = &uda1380_dai_ops_playback,
- },
- { /* capture only - dual interface*/
- @@ -691,8 +690,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = UDA1380_RATES,
- - .formats = SNDRV_PCM_FMTBIT_S16_LE,
- - },
- + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
- .ops = &uda1380_dai_ops_capture,
- },
- };
- diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
- index 66c5618..c1a4a40c 100644
- --- a/sound/soc/sunxi/sun4i-codec.c
- +++ b/sound/soc/sunxi/sun4i-codec.c
- @@ -499,6 +499,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = {
- SNDRV_PCM_RATE_96000 |
- SNDRV_PCM_RATE_192000,
- .formats = SNDRV_PCM_FMTBIT_S16_LE |
- + SNDRV_PCM_FMTBIT_S24_LE |
- SNDRV_PCM_FMTBIT_S32_LE,
- .sig_bits = 24,
- },
- diff --git a/sound/soc/sunxi/sun4i-dai.c b/sound/soc/sunxi/sun4i-dai.c
- index cc6f697..ddec2b0 100644
- --- a/sound/soc/sunxi/sun4i-dai.c
- +++ b/sound/soc/sunxi/sun4i-dai.c
- @@ -134,10 +134,8 @@ static int sun4i_dai_params_to_sr(struct snd_pcm_hw_params *params)
- ret = 1;
- break;
- case 24:
- - ret = 2;
- - break;
- case 32:
- - ret = 3;
- + ret = 2;
- break;
- }
- @@ -147,7 +145,7 @@ static int sun4i_dai_params_to_sr(struct snd_pcm_hw_params *params)
- static u8 sun4i_dai_params_to_wss(struct snd_pcm_hw_params *params)
- {
- int ret = -EINVAL;
- - switch (params_width(params)) {
- + switch (snd_soc_params_to_frame_size(params)) {
- case 16:
- ret = 0;
- break;
- @@ -259,7 +257,7 @@ static int sun4i_dai_set_clk_rate(struct sun4i_dai *sdai,
- break;
- }
- - if (bclk_div <= 0 && mclk_div <= 0)
- + if ((bclk_div < 0) || (mclk_div < 0))
- return -EINVAL;
- printk("%s +%d\n", __func__, __LINE__);
- @@ -312,6 +310,10 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
- case 16:
- width = DMA_SLAVE_BUSWIDTH_2_BYTES;
- break;
- + case 24:
- + case 32:
- + width = DMA_SLAVE_BUSWIDTH_4_BYTES;
- + break;
- default:
- return -EINVAL;
- }
- @@ -329,7 +331,7 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
- if (wss < 0)
- return -EINVAL;
- - printk("%s +%d\n", __func__, __LINE__);
- + printk("%s wss returned is %d based on a width of %d\n", __func__, wss, snd_soc_params_to_frame_size(params));
- regmap_update_bits(sdai->regmap, SUN4I_DAI_FMT0_REG,
- SUN4I_DAI_FMT0_WSS_MASK | SUN4I_DAI_FMT0_SR_MASK,
- @@ -338,7 +340,7 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
- printk("%s +%d\n", __func__, __LINE__);
- return sun4i_dai_set_clk_rate(sdai, params_rate(params),
- - params_width(params));
- + snd_soc_params_to_frame_size(params));
- }
- static int sun4i_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
- @@ -553,10 +555,8 @@ static int sun4i_dai_dai_probe(struct snd_soc_dai *dai)
- #define SUN4I_RATES SNDRV_PCM_RATE_8000_192000
- -#define SUN4I_FORMATS (SNDRV_PCM_FORMAT_S16_LE | \
- - SNDRV_PCM_FORMAT_S20_3LE | \
- - SNDRV_PCM_FORMAT_S24_LE | \
- - SNDRV_PCM_FORMAT_S32_LE)
- +#define SUN4I_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
- + SNDRV_PCM_FMTBIT_S24_LE)
- static struct snd_soc_dai_driver sun4i_dai_dai = {
- .probe = sun4i_dai_dai_probe,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement