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,6 +627,7 @@ static unsigned int loopback_jiffies_timer_pos_update
78 cable->streams[SNDRV_PCM_STREAM_CAPTURE];
84 running = cable->running ^ cable->pause;
85 @@ -843,7 +863,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm,
86 snd_iprintf(buffer, " irq_pos:\t\t%u\n", dpcm->irq_pos);
87 snd_iprintf(buffer, " period_frac:\t%u\n", dpcm->period_size_frac);
89 - dpcm->last_jiffies, jiffies);
90 + dpcm->last_jiffies, cycles_to_jiffies());
91 snd_iprintf(buffer, " timer_expires:\t%lu\n", dpcm->timer.expires);
94 diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
96 --- a/sound/soc/codecs/Kconfig
98 @@ -89,6 +89,7 @@ config SND_SOC_ALL_CODECS
106 @@ -766,6 +767,9 @@ config SND_SOC_DMIC
116 @@ -1029,6 +1033,9 @@ config SND_SOC_RK3328
126 diff --git a/sound/soc/codecs/bt-sco.c b/sound/soc/codecs/bt-sco.c
128 --- a/sound/soc/codecs/bt-sco.c
129 +++ b/sound/soc/codecs/bt-sco.c
130 @@ -26,14 +26,14 @@ static struct snd_soc_dai_driver bt_sco_dai[] = {
134 - .channels_max = 1,
142 - .channels_max = 1,
147 @@ -43,14 +43,14 @@ static struct snd_soc_dai_driver bt_sco_dai[] = {
151 - .channels_max = 1,
159 - .channels_max = 1,
164 diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
166 --- a/sound/soc/rockchip/Kconfig
168 @@ -7,6 +7,22 @@ config SND_SOC_ROCKCHIP
191 @@ -16,6 +32,15 @@ config SND_SOC_ROCKCHIP_I2S
193 8 channels each for play and record.
202 + 8 channels each for play and record.
207 @@ -34,6 +59,21 @@ config SND_SOC_ROCKCHIP_SPDIF
229 @@ -45,6 +85,13 @@ config SND_SOC_ROCKCHIP_MAX98090
243 @@ -54,6 +101,14 @@ config SND_SOC_ROCKCHIP_RT5645
253 + boards using built-in HDMI or external HDMI.
258 diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile
260 --- a/sound/soc/rockchip/Makefile
262 @@ -5,7 +5,8 @@ snd-soc-rockchip-pcm-objs := rockchip_pcm.o
263 snd-soc-rockchip-pdm-objs := rockchip_pdm.o
264 snd-soc-rockchip-spdif-objs := rockchip_spdif.o
266 -obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o snd-soc-rockchip-pcm.o
267 +obj-$(CONFIG_SND_SOC_ROCKCHIP) += snd-soc-rockchip-pcm.o
268 +obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o
269 obj-$(CONFIG_SND_SOC_ROCKCHIP_PDM) += snd-soc-rockchip-pdm.o
270 obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o
272 diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
274 --- a/sound/soc/rockchip/rockchip_i2s.c
276 @@ -15,11 +15,11 @@
285 -#include "rockchip_pcm.h"
287 #define DRV_NAME "rockchip-i2s"
289 @@ -40,6 +40,9 @@ struct rk_i2s_dev {
299 @@ -49,6 +52,8 @@ struct rk_i2s_dev {
308 @@ -92,6 +97,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
312 + spin_lock(&i2s->lock);
314 regmap_update_bits(i2s->regmap, I2S_DMACR,
316 @@ -132,6 +138,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
320 + spin_unlock(&i2s->lock);
324 @@ -139,6 +146,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
328 + spin_lock(&i2s->lock);
330 regmap_update_bits(i2s->regmap, I2S_DMACR,
332 @@ -179,6 +187,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
336 + spin_unlock(&i2s->lock);
340 @@ -207,13 +216,27 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
342 regmap_update_bits(i2s->regmap, I2S_CKR, mask, val);
344 - mask = I2S_CKR_CKP_MASK;
348 - val = I2S_CKR_CKP_NEG;
359 - val = I2S_CKR_CKP_POS;
370 ret = -EINVAL;
371 @@ -287,11 +310,11 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
373 if (i2s->is_master_mode) {
374 mclk_rate = clk_get_rate(i2s->mclk);
375 - bclk_rate = 2 * 32 * params_rate(params);
376 - if (bclk_rate == 0 || mclk_rate % bclk_rate)
377 + bclk_rate = i2s->bclk_ratio * params_rate(params);
379 return -EINVAL;
381 - div_bclk = mclk_rate / bclk_rate;
384 regmap_update_bits(i2s->regmap, I2S_CKR,
386 @@ -422,6 +445,16 @@ static int rockchip_i2s_trigger(struct snd_pcm_substream *substream,
395 + i2s->bclk_ratio = ratio;
403 @@ -442,14 +475,16 @@ static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai)
407 - dai->capture_dma_data = &i2s->capture_dma_data;
408 - dai->playback_dma_data = &i2s->playback_dma_data;
410 + i2s->has_playback ? &i2s->playback_dma_data : NULL,
411 + i2s->has_capture ? &i2s->capture_dma_data : NULL);
422 @@ -457,28 +492,6 @@ static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = {
426 - .playback = {
427 - .stream_name = "Playback",
428 - .channels_min = 2,
429 - .channels_max = 8,
430 - .rates = SNDRV_PCM_RATE_8000_192000,
431 - .formats = (SNDRV_PCM_FMTBIT_S8 |
432 - SNDRV_PCM_FMTBIT_S16_LE |
433 - SNDRV_PCM_FMTBIT_S20_3LE |
434 - SNDRV_PCM_FMTBIT_S24_LE |
435 - SNDRV_PCM_FMTBIT_S32_LE),
436 - },
437 - .capture = {
438 - .stream_name = "Capture",
439 - .channels_min = 2,
440 - .channels_max = 2,
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 - },
451 @@ -575,7 +588,7 @@ static const struct rk_i2s_pins rk3399_i2s_pins = {
455 -static const struct of_device_id rockchip_i2s_match[] = {
457 { .compatible = "rockchip,rk3066-i2s", },
458 { .compatible = "rockchip,rk3188-i2s", },
459 { .compatible = "rockchip,rk3288-i2s", },
460 @@ -583,21 +596,90 @@ static const struct of_device_id rockchip_i2s_match[] = {
467 + struct device_node *node = i2s->dev->of_node;
473 + of_property_for_each_string(node, "dma-names", dma_names, dma_name) {
475 + i2s->has_playback = true;
477 + i2s->has_capture = true;
480 + dai = devm_kmemdup(i2s->dev, &rockchip_i2s_dai,
483 + return -ENOMEM;
485 + if (i2s->has_playback) {
486 + dai->playback.stream_name = "Playback";
487 + dai->playback.channels_min = 2;
488 + dai->playback.channels_max = 8;
489 + dai->playback.rates = SNDRV_PCM_RATE_8000_192000;
490 + dai->playback.formats = SNDRV_PCM_FMTBIT_S8 |
496 + i2s->playback_dma_data.addr = res->start + I2S_TXDR;
497 + i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
498 + i2s->playback_dma_data.maxburst = 8;
500 + if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) {
502 + dai->playback.channels_max = val;
506 + if (i2s->has_capture) {
507 + dai->capture.stream_name = "Capture";
508 + dai->capture.channels_min = 2;
509 + dai->capture.channels_max = 8;
510 + dai->capture.rates = SNDRV_PCM_RATE_8000_192000;
511 + dai->capture.formats = SNDRV_PCM_FMTBIT_S8 |
517 + i2s->capture_dma_data.addr = res->start + I2S_RXDR;
518 + i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
519 + i2s->capture_dma_data.maxburst = 8;
521 + if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
523 + dai->capture.channels_max = val;
535 struct device_node *node = pdev->dev.of_node;
538 - struct snd_soc_dai_driver *soc_dai;
543 - int val;
545 i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
547 return -ENOMEM;
549 + spin_lock_init(&i2s->lock);
550 i2s->dev = &pdev->dev;
552 i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
553 @@ -609,50 +691,40 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
554 i2s->pins = of_id->data;
557 - /* try to prepare related clocks */
558 - i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk");
559 - if (IS_ERR(i2s->hclk)) {
560 - dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n");
561 - return PTR_ERR(i2s->hclk);
562 - }
563 - ret = clk_prepare_enable(i2s->hclk);
564 - if (ret) {
565 - dev_err(i2s->dev, "hclock enable failed %d\n", ret);
566 - return ret;
567 - }
568 -
569 - i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk");
570 - if (IS_ERR(i2s->mclk)) {
571 - dev_err(&pdev->dev, "Can't retrieve i2s master clock\n");
572 - ret = PTR_ERR(i2s->mclk);
573 - goto err_clk;
574 - }
575 -
577 - if (IS_ERR(regs)) {
578 - ret = PTR_ERR(regs);
579 - goto err_clk;
580 - }
584 i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
586 if (IS_ERR(i2s->regmap)) {
587 dev_err(&pdev->dev,
589 - ret = PTR_ERR(i2s->regmap);
590 - goto err_clk;
591 + return PTR_ERR(i2s->regmap);
594 - i2s->playback_dma_data.addr = res->start + I2S_TXDR;
595 - i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
596 - i2s->playback_dma_data.maxburst = 4;
597 -
598 - i2s->capture_dma_data.addr = res->start + I2S_RXDR;
599 - i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
600 - i2s->capture_dma_data.maxburst = 4;
601 + i2s->bclk_ratio = 64;
603 dev_set_drvdata(&pdev->dev, i2s);
605 + i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk");
606 + if (IS_ERR(i2s->mclk)) {
607 + dev_err(&pdev->dev, "Can't retrieve i2s master clock\n");
608 + return PTR_ERR(i2s->mclk);
612 + i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk");
613 + if (IS_ERR(i2s->hclk)) {
614 + dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n");
615 + return PTR_ERR(i2s->hclk);
617 + ret = clk_prepare_enable(i2s->hclk);
619 + dev_err(i2s->dev, "hclock enable failed %d\n", ret);
623 pm_runtime_enable(&pdev->dev);
624 if (!pm_runtime_enabled(&pdev->dev)) {
625 ret = i2s_runtime_resume(&pdev->dev);
626 @@ -660,33 +732,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
630 - soc_dai = devm_kmemdup(&pdev->dev, &rockchip_i2s_dai,
631 - sizeof(*soc_dai), GFP_KERNEL);
632 - if (!soc_dai) {
633 - ret = -ENOMEM;
637 - }
638 -
639 - if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) {
640 - if (val >= 2 && val <= 8)
641 - soc_dai->playback.channels_max = val;
642 - }
643 -
644 - if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
645 - if (val >= 2 && val <= 8)
646 - soc_dai->capture.channels_max = val;
647 - }
649 ret = devm_snd_soc_register_component(&pdev->dev,
651 - soc_dai, 1);
655 dev_err(&pdev->dev, "Could not register DAI\n");
659 - ret = rockchip_pcm_platform_register(&pdev->dev);
660 + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
662 dev_err(&pdev->dev, "Could not register PCM\n");
664 @@ -699,8 +758,9 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
665 i2s_runtime_suspend(&pdev->dev);
667 pm_runtime_disable(&pdev->dev);
668 -err_clk:
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) {