Lines Matching +full:diff +full:- +full:channels
1 diff --git a/sound/Makefile b/sound/Makefile
3 --- a/sound/Makefile
5 @@ -5,7 +5,8 @@
6 obj-$(CONFIG_SOUND) += soundcore.o
7 obj-$(CONFIG_DMASOUND) += oss/dmasound/
8 obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \
9 - firewire/ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/ hda/ x86/ xen/
12 obj-$(CONFIG_SND_AOA) += aoa/
15 diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
17 --- a/sound/drivers/aloop.c
19 @@ -37,6 +37,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}");
24 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
26 static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
27 @@ -44,6 +45,8 @@ static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
36 @@ -163,6 +166,22 @@ struct loopback_pcm {
58 if (dpcm->pcm_rate_shift == NO_PITCH) {
59 @@ -387,7 +406,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
60 err = loopback_check_format(cable, substream->stream);
63 - dpcm->last_jiffies = jiffies;
64 + dpcm->last_jiffies = cycles_to_jiffies();
65 dpcm->pcm_rate_shift = 0;
66 dpcm->last_drift = 0;
67 spin_lock(&cable->lock);
68 @@ -419,7 +438,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
71 spin_lock(&cable->lock);
72 - dpcm->last_jiffies = jiffies;
73 + dpcm->last_jiffies = cycles_to_jiffies();
74 cable->pause &= ~stream;
75 err = cable->ops->start(dpcm);
76 spin_unlock(&cable->lock);
77 @@ -608,15 +627,16 @@ static unsigned int loopback_jiffies_timer_pos_update
78 cable->streams[SNDRV_PCM_STREAM_CAPTURE];
83 running = cable->running ^ cable->pause;
85 - delta_play = jiffies - dpcm_play->last_jiffies;
86 + delta_play = cur_jiffies - dpcm_play->last_jiffies;
87 dpcm_play->last_jiffies += delta_play;
91 - delta_capt = jiffies - dpcm_capt->last_jiffies;
92 + delta_capt = cur_jiffies - dpcm_capt->last_jiffies;
93 dpcm_capt->last_jiffies += delta_capt;
96 @@ -842,7 +862,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm,
97 snd_iprintf(buffer, " irq_pos:\t\t%u\n", dpcm->irq_pos);
98 snd_iprintf(buffer, " period_frac:\t%u\n", dpcm->period_size_frac);
100 - dpcm->last_jiffies, jiffies);
101 + dpcm->last_jiffies, cycles_to_jiffies());
102 snd_iprintf(buffer, " timer_expires:\t%lu\n", dpcm->timer.expires);
105 diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
107 --- a/sound/soc/codecs/Kconfig
109 @@ -89,6 +89,7 @@ config SND_SOC_ALL_CODECS
117 @@ -761,6 +762,9 @@ config SND_SOC_DMIC
127 @@ -1024,6 +1028,9 @@ config SND_SOC_RK3328
137 diff --git a/sound/soc/codecs/bt-sco.c b/sound/soc/codecs/bt-sco.c
139 --- a/sound/soc/codecs/bt-sco.c
140 +++ b/sound/soc/codecs/bt-sco.c
141 @@ -26,14 +26,14 @@ static struct snd_soc_dai_driver bt_sco_dai[] = {
145 - .channels_max = 1,
153 - .channels_max = 1,
158 @@ -43,14 +43,14 @@ static struct snd_soc_dai_driver bt_sco_dai[] = {
162 - .channels_max = 1,
170 - .channels_max = 1,
175 diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
177 --- a/sound/soc/rockchip/Kconfig
179 @@ -7,6 +7,22 @@ config SND_SOC_ROCKCHIP
202 @@ -16,6 +32,15 @@ config SND_SOC_ROCKCHIP_I2S
204 8 channels each for play and record.
213 + 8 channels each for play and record.
218 @@ -34,6 +59,21 @@ config SND_SOC_ROCKCHIP_SPDIF
240 @@ -45,6 +85,13 @@ config SND_SOC_ROCKCHIP_MAX98090
254 @@ -54,6 +101,14 @@ config SND_SOC_ROCKCHIP_RT5645
264 + boards using built-in HDMI or external HDMI.
269 diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile
271 --- a/sound/soc/rockchip/Makefile
273 @@ -5,7 +5,8 @@ snd-soc-rockchip-pcm-objs := rockchip_pcm.o
274 snd-soc-rockchip-pdm-objs := rockchip_pdm.o
275 snd-soc-rockchip-spdif-objs := rockchip_spdif.o
277 -obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o snd-soc-rockchip-pcm.o
278 +obj-$(CONFIG_SND_SOC_ROCKCHIP) += snd-soc-rockchip-pcm.o
279 +obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o
280 obj-$(CONFIG_SND_SOC_ROCKCHIP_PDM) += snd-soc-rockchip-pdm.o
281 obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o
283 diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
285 --- a/sound/soc/rockchip/rockchip_i2s.c
287 @@ -15,11 +15,11 @@
296 -#include "rockchip_pcm.h"
298 #define DRV_NAME "rockchip-i2s"
300 @@ -40,6 +40,9 @@ struct rk_i2s_dev {
310 @@ -49,6 +52,8 @@ struct rk_i2s_dev {
319 @@ -92,6 +97,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
323 + spin_lock(&i2s->lock);
325 regmap_update_bits(i2s->regmap, I2S_DMACR,
327 @@ -132,6 +138,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
331 + spin_unlock(&i2s->lock);
335 @@ -139,6 +146,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
339 + spin_lock(&i2s->lock);
341 regmap_update_bits(i2s->regmap, I2S_DMACR,
343 @@ -179,6 +187,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
347 + spin_unlock(&i2s->lock);
351 @@ -207,13 +216,27 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
353 regmap_update_bits(i2s->regmap, I2S_CKR, mask, val);
355 - mask = I2S_CKR_CKP_MASK;
359 - val = I2S_CKR_CKP_NEG;
370 - val = I2S_CKR_CKP_POS;
381 ret = -EINVAL;
382 @@ -287,11 +310,11 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
384 if (i2s->is_master_mode) {
385 mclk_rate = clk_get_rate(i2s->mclk);
386 - bclk_rate = 2 * 32 * params_rate(params);
387 - if (bclk_rate == 0 || mclk_rate % bclk_rate)
388 + bclk_rate = i2s->bclk_ratio * params_rate(params);
390 return -EINVAL;
392 - div_bclk = mclk_rate / bclk_rate;
395 regmap_update_bits(i2s->regmap, I2S_CKR,
397 @@ -422,6 +445,16 @@ static int rockchip_i2s_trigger(struct snd_pcm_substream *substream,
406 + i2s->bclk_ratio = ratio;
414 @@ -442,14 +475,16 @@ static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai)
418 - dai->capture_dma_data = &i2s->capture_dma_data;
419 - dai->playback_dma_data = &i2s->playback_dma_data;
421 + i2s->has_playback ? &i2s->playback_dma_data : NULL,
422 + i2s->has_capture ? &i2s->capture_dma_data : NULL);
433 @@ -457,28 +492,6 @@ static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = {
437 - .playback = {
438 - .stream_name = "Playback",
439 - .channels_min = 2,
440 - .channels_max = 8,
441 - .rates = SNDRV_PCM_RATE_8000_192000,
442 - .formats = (SNDRV_PCM_FMTBIT_S8 |
443 - SNDRV_PCM_FMTBIT_S16_LE |
444 - SNDRV_PCM_FMTBIT_S20_3LE |
445 - SNDRV_PCM_FMTBIT_S24_LE |
446 - SNDRV_PCM_FMTBIT_S32_LE),
447 - },
448 - .capture = {
449 - .stream_name = "Capture",
450 - .channels_min = 2,
451 - .channels_max = 2,
452 - .rates = SNDRV_PCM_RATE_8000_192000,
453 - .formats = (SNDRV_PCM_FMTBIT_S8 |
454 - SNDRV_PCM_FMTBIT_S16_LE |
455 - SNDRV_PCM_FMTBIT_S20_3LE |
456 - SNDRV_PCM_FMTBIT_S24_LE |
457 - SNDRV_PCM_FMTBIT_S32_LE),
458 - },
462 @@ -575,7 +588,7 @@ static const struct rk_i2s_pins rk3399_i2s_pins = {
466 -static const struct of_device_id rockchip_i2s_match[] = {
468 { .compatible = "rockchip,rk3066-i2s", },
469 { .compatible = "rockchip,rk3188-i2s", },
470 { .compatible = "rockchip,rk3288-i2s", },
471 @@ -583,21 +596,90 @@ static const struct of_device_id rockchip_i2s_match[] = {
478 + struct device_node *node = i2s->dev->of_node;
484 + of_property_for_each_string(node, "dma-names", dma_names, dma_name) {
486 + i2s->has_playback = true;
488 + i2s->has_capture = true;
491 + dai = devm_kmemdup(i2s->dev, &rockchip_i2s_dai,
494 + return -ENOMEM;
496 + if (i2s->has_playback) {
497 + dai->playback.stream_name = "Playback";
498 + dai->playback.channels_min = 2;
499 + dai->playback.channels_max = 8;
500 + dai->playback.rates = SNDRV_PCM_RATE_8000_192000;
501 + dai->playback.formats = SNDRV_PCM_FMTBIT_S8 |
507 + i2s->playback_dma_data.addr = res->start + I2S_TXDR;
508 + i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
509 + i2s->playback_dma_data.maxburst = 8;
511 + if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) {
513 + dai->playback.channels_max = val;
517 + if (i2s->has_capture) {
518 + dai->capture.stream_name = "Capture";
519 + dai->capture.channels_min = 2;
520 + dai->capture.channels_max = 8;
521 + dai->capture.rates = SNDRV_PCM_RATE_8000_192000;
522 + dai->capture.formats = SNDRV_PCM_FMTBIT_S8 |
528 + i2s->capture_dma_data.addr = res->start + I2S_RXDR;
529 + i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
530 + i2s->capture_dma_data.maxburst = 8;
532 + if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
534 + dai->capture.channels_max = val;
546 struct device_node *node = pdev->dev.of_node;
549 - struct snd_soc_dai_driver *soc_dai;
554 - int val;
556 i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
558 return -ENOMEM;
560 + spin_lock_init(&i2s->lock);
561 i2s->dev = &pdev->dev;
563 i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
564 @@ -609,26 +691,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
565 i2s->pins = of_id->data;
568 - /* try to prepare related clocks */
569 - i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk");
570 - if (IS_ERR(i2s->hclk)) {
571 - dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n");
572 - return PTR_ERR(i2s->hclk);
573 - }
574 - ret = clk_prepare_enable(i2s->hclk);
575 - if (ret) {
576 - dev_err(i2s->dev, "hclock enable failed %d\n", ret);
577 - return ret;
578 - }
579 -
580 - i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk");
581 - if (IS_ERR(i2s->mclk)) {
582 - dev_err(&pdev->dev, "Can't retrieve i2s master clock\n");
583 - return PTR_ERR(i2s->mclk);
584 - }
585 -
586 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
587 - regs = devm_ioremap_resource(&pdev->dev, res);
592 @@ -640,16 +703,28 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
593 return PTR_ERR(i2s->regmap);
596 - i2s->playback_dma_data.addr = res->start + I2S_TXDR;
597 - i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
598 - i2s->playback_dma_data.maxburst = 4;
599 -
600 - i2s->capture_dma_data.addr = res->start + I2S_RXDR;
601 - i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
602 - i2s->capture_dma_data.maxburst = 4;
603 + i2s->bclk_ratio = 64;
605 dev_set_drvdata(&pdev->dev, i2s);
607 + i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk");
608 + if (IS_ERR(i2s->mclk)) {
609 + dev_err(&pdev->dev, "Can't retrieve i2s master clock\n");
610 + return PTR_ERR(i2s->mclk);
614 + i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk");
615 + if (IS_ERR(i2s->hclk)) {
616 + dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n");
617 + return PTR_ERR(i2s->hclk);
619 + ret = clk_prepare_enable(i2s->hclk);
621 + dev_err(i2s->dev, "hclock enable failed %d\n", ret);
625 pm_runtime_enable(&pdev->dev);
626 if (!pm_runtime_enabled(&pdev->dev)) {
627 ret = i2s_runtime_resume(&pdev->dev);
628 @@ -657,33 +732,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
632 - soc_dai = devm_kmemdup(&pdev->dev, &rockchip_i2s_dai,
633 - sizeof(*soc_dai), GFP_KERNEL);
634 - if (!soc_dai) {
635 - ret = -ENOMEM;
639 - }
640 -
641 - if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) {
642 - if (val >= 2 && val <= 8)
643 - soc_dai->playback.channels_max = val;
644 - }
645 -
646 - if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
647 - if (val >= 2 && val <= 8)
648 - soc_dai->capture.channels_max = val;
649 - }
651 ret = devm_snd_soc_register_component(&pdev->dev,
653 - soc_dai, 1);
657 dev_err(&pdev->dev, "Could not register DAI\n");
661 - ret = rockchip_pcm_platform_register(&pdev->dev);
662 + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
664 dev_err(&pdev->dev, "Could not register PCM\n");
666 @@ -697,6 +759,8 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
668 pm_runtime_disable(&pdev->dev);
670 + clk_disable_unprepare(i2s->hclk);
675 diff --git a/sound/soc/rockchip/rockchip_i2s.h b/sound/soc/rockchip/rockchip_i2s.h
677 --- a/sound/soc/rockchip/rockchip_i2s.h
679 @@ -88,15 +88,17 @@
683 -#define I2S_CKR_CKP_NEG (0 << I2S_CKR_CKP_SHIFT)
684 -#define I2S_CKR_CKP_POS (1 << I2S_CKR_CKP_SHIFT)
690 -#define I2S_CKR_RLP_OPPSITE (1 << I2S_CKR_RLP_SHIFT)
695 -#define I2S_CKR_TLP_OPPSITE (1 << I2S_CKR_TLP_SHIFT)
699 #define I2S_CKR_MDIV(x) ((x - 1) << I2S_CKR_MDIV_SHIFT)
701 diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
703 --- a/sound/soc/rockchip/rockchip_pdm.c
705 @@ -20,6 +20,7 @@
713 @@ -149,7 +150,7 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream,
717 - unsigned int clk_src, clk_out = 0;
722 @@ -441,9 +442,10 @@ static bool rockchip_pdm_precious_reg(struct device *dev, unsigned int reg)
726 - {0x04, 0x78000017},
727 - {0x08, 0x0bb8ea60},
728 - {0x18, 0x0000001f},
736 @@ -460,7 +462,7 @@ static const struct regmap_config rockchip_pdm_regmap_config = {
740 -static const struct of_device_id rockchip_pdm_match[] = {
744 { .compatible = "rockchip,px30-pdm",
745 @@ -473,8 +475,36 @@ static const struct of_device_id rockchip_pdm_match[] = {
754 + cnt = of_count_phandle_with_args(node, "rockchip,path-map",
759 + ret = of_property_read_u32_array(node, "rockchip,path-map",
766 + return -EINVAL;
771 + regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, msk, val);
778 + struct device_node *node = pdev->dev.of_node;
782 @@ -495,8 +525,7 @@ static int rockchip_pdm_probe(struct platform_device *pdev)
783 return PTR_ERR(pdm->reset);
786 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
787 - regs = devm_ioremap_resource(&pdev->dev, res);
792 @@ -541,6 +570,11 @@ static int rockchip_pdm_probe(struct platform_device *pdev)
798 + if (ret != 0 && ret != -ENOENT)
801 ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
803 dev_err(&pdev->dev, "could not register pcm: %d\n", ret);
804 diff --git a/sound/soc/rockchip/rockchip_pdm.h b/sound/soc/rockchip/rockchip_pdm.h
806 --- a/sound/soc/rockchip/rockchip_pdm.h
808 @@ -41,6 +41,8 @@
815 #define PDM_VDW(X) ((X - 1) << 0)
817 @@ -51,6 +53,9 @@
827 @@ -66,6 +71,7 @@
835 diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
837 --- a/sound/soc/rockchip/rockchip_spdif.c
839 @@ -41,7 +41,7 @@ struct rk_spdif_dev {
843 -static const struct of_device_id rk_spdif_match[] = {
845 { .compatible = "rockchip,rk3066-spdif",
847 { .compatible = "rockchip,rk3188-spdif",
848 @@ -138,8 +138,7 @@ static int rk_spdif_hw_params(struct snd_pcm_substream *substream,
850 ret = regmap_update_bits(spdif->regmap, SPDIF_CFGR,
852 - SDPIF_CFGR_VDW_MASK,
853 - val);
858 @@ -155,31 +154,26 @@ static int rk_spdif_trigger(struct snd_pcm_substream *substream,
861 ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR,
862 - SPDIF_DMACR_TDE_ENABLE |
863 - SPDIF_DMACR_TDL_MASK,
864 - SPDIF_DMACR_TDE_ENABLE |
865 - SPDIF_DMACR_TDL(16));
872 ret = regmap_update_bits(spdif->regmap, SPDIF_XFER,
873 - SPDIF_XFER_TXS_START,
874 - SPDIF_XFER_TXS_START);
880 ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR,
881 - SPDIF_DMACR_TDE_ENABLE,
882 - SPDIF_DMACR_TDE_DISABLE);
888 ret = regmap_update_bits(spdif->regmap, SPDIF_XFER,
889 - SPDIF_XFER_TXS_START,
890 - SPDIF_XFER_TXS_STOP);
894 ret = -EINVAL;
895 @@ -247,6 +241,7 @@ static bool rk_spdif_rd_reg(struct device *dev, unsigned int reg)
903 @@ -258,6 +253,7 @@ static bool rk_spdif_volatile_reg(struct device *dev, unsigned int reg)
911 @@ -291,7 +287,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
914 dev_err(&pdev->dev,
915 - "rockchip_spdif missing 'rockchip,grf' \n");
920 @@ -313,8 +309,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
921 if (IS_ERR(spdif->mclk))
922 return PTR_ERR(spdif->mclk);
924 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
925 - regs = devm_ioremap_resource(&pdev->dev, res);
930 diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
932 --- a/sound/usb/quirks.c
934 @@ -1523,6 +1523,9 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
944 @@ -1838,6 +1841,9 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
947 switch (chip->usb_id) {