~ubuntu-audio-dev/alsa-driver/tiwai-trunk2

« back to all changes in this revision

Viewing changes to soc/intel/skylake/skl-pcm.c

  • Committer: Canonistack server
  • Date: 2016-05-16 13:04:41 UTC
  • Revision ID: david.henningsson@canonical.com-20160516130441-xmcvo5v7n0mupdei
Test run of 623 machines: 3 failing with 3 errors and 0 warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        .rate_min =             8000,
52
52
        .rate_max =             48000,
53
53
        .channels_min =         1,
54
 
        .channels_max =         HDA_QUAD,
 
54
        .channels_max =         8,
55
55
        .buffer_bytes_max =     AZX_MAX_BUF_SIZE,
56
56
        .period_bytes_min =     128,
57
57
        .period_bytes_max =     AZX_MAX_BUF_SIZE / 2,
213
213
        struct skl_sst *ctx = skl->skl_sst;
214
214
        struct skl_module_cfg *mconfig;
215
215
 
216
 
        if ((dai->playback_active > 1) || (dai->capture_active > 1))
 
216
        if (dai->playback_widget->power || dai->capture_widget->power)
217
217
                return 0;
218
218
 
219
219
        mconfig = skl_tplg_be_get_cpr_module(dai, substream->stream);
402
402
        struct skl_module_cfg *mconfig;
403
403
        struct hdac_ext_bus *ebus = get_bus_ctx(substream);
404
404
        struct hdac_ext_stream *stream = get_hdac_ext_stream(substream);
 
405
        struct snd_soc_dapm_widget *w;
405
406
        int ret;
406
407
 
407
408
        mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
408
409
        if (!mconfig)
409
410
                return -EIO;
410
411
 
 
412
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 
413
                w = dai->playback_widget;
 
414
        else
 
415
                w = dai->capture_widget;
 
416
 
411
417
        switch (cmd) {
412
418
        case SNDRV_PCM_TRIGGER_RESUME:
413
 
                skl_pcm_prepare(substream, dai);
414
 
                /*
415
 
                 * enable DMA Resume enable bit for the stream, set the dpib
416
 
                 * & lpib position to resune before starting the DMA
417
 
                 */
418
 
                snd_hdac_ext_stream_drsm_enable(ebus, true,
419
 
                                        hdac_stream(stream)->index);
420
 
                snd_hdac_ext_stream_set_dpibr(ebus, stream, stream->dpib);
421
 
                snd_hdac_ext_stream_set_lpib(stream, stream->lpib);
 
419
                if (!w->ignore_suspend) {
 
420
                        skl_pcm_prepare(substream, dai);
 
421
                        /*
 
422
                         * enable DMA Resume enable bit for the stream, set the
 
423
                         * dpib & lpib position to resume before starting the
 
424
                         * DMA
 
425
                         */
 
426
                        snd_hdac_ext_stream_drsm_enable(ebus, true,
 
427
                                                hdac_stream(stream)->index);
 
428
                        snd_hdac_ext_stream_set_dpibr(ebus, stream,
 
429
                                                        stream->dpib);
 
430
                        snd_hdac_ext_stream_set_lpib(stream, stream->lpib);
 
431
                }
422
432
 
423
433
        case SNDRV_PCM_TRIGGER_START:
424
434
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
448
458
                        return ret;
449
459
 
450
460
                ret = skl_decoupled_trigger(substream, cmd);
451
 
                if (cmd == SNDRV_PCM_TRIGGER_SUSPEND) {
 
461
                if ((cmd == SNDRV_PCM_TRIGGER_SUSPEND) && !w->ignore_suspend) {
452
462
                        /* save the dpib and lpib positions */
453
463
                        stream->dpib = readl(ebus->bus.remap_addr +
454
464
                                        AZX_REG_VS_SDXDPIB_XBASE +
523
533
        if (!link)
524
534
                return -EINVAL;
525
535
 
526
 
        snd_hdac_ext_bus_link_power_up(link);
527
536
        snd_hdac_ext_link_stream_reset(link_dev);
528
537
 
529
538
        snd_hdac_ext_link_stream_setup(link_dev, format_val);
682
691
        .playback = {
683
692
                .stream_name = "HDMI1 Playback",
684
693
                .channels_min = HDA_STEREO,
685
 
                .channels_max = HDA_STEREO,
 
694
                .channels_max = 8,
686
695
                .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
687
696
                        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
688
697
                        SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
697
706
        .playback = {
698
707
                .stream_name = "HDMI2 Playback",
699
708
                .channels_min = HDA_STEREO,
700
 
                .channels_max = HDA_STEREO,
 
709
                .channels_max = 8,
701
710
                .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
702
711
                        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
703
712
                        SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
712
721
        .playback = {
713
722
                .stream_name = "HDMI3 Playback",
714
723
                .channels_min = HDA_STEREO,
715
 
                .channels_max = HDA_STEREO,
 
724
                .channels_max = 8,
716
725
                .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
717
726
                        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
718
727
                        SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
760
769
        },
761
770
},
762
771
{
 
772
        .name = "SSP2 Pin",
 
773
        .ops = &skl_be_ssp_dai_ops,
 
774
        .playback = {
 
775
                .stream_name = "ssp2 Tx",
 
776
                .channels_min = HDA_STEREO,
 
777
                .channels_max = HDA_STEREO,
 
778
                .rates = SNDRV_PCM_RATE_48000,
 
779
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
780
        },
 
781
        .capture = {
 
782
                .stream_name = "ssp2 Rx",
 
783
                .channels_min = HDA_STEREO,
 
784
                .channels_max = HDA_STEREO,
 
785
                .rates = SNDRV_PCM_RATE_48000,
 
786
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
787
        },
 
788
},
 
789
{
 
790
        .name = "SSP3 Pin",
 
791
        .ops = &skl_be_ssp_dai_ops,
 
792
        .playback = {
 
793
                .stream_name = "ssp3 Tx",
 
794
                .channels_min = HDA_STEREO,
 
795
                .channels_max = HDA_STEREO,
 
796
                .rates = SNDRV_PCM_RATE_48000,
 
797
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
798
        },
 
799
        .capture = {
 
800
                .stream_name = "ssp3 Rx",
 
801
                .channels_min = HDA_STEREO,
 
802
                .channels_max = HDA_STEREO,
 
803
                .rates = SNDRV_PCM_RATE_48000,
 
804
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
805
        },
 
806
},
 
807
{
 
808
        .name = "SSP4 Pin",
 
809
        .ops = &skl_be_ssp_dai_ops,
 
810
        .playback = {
 
811
                .stream_name = "ssp4 Tx",
 
812
                .channels_min = HDA_STEREO,
 
813
                .channels_max = HDA_STEREO,
 
814
                .rates = SNDRV_PCM_RATE_48000,
 
815
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
816
        },
 
817
        .capture = {
 
818
                .stream_name = "ssp4 Rx",
 
819
                .channels_min = HDA_STEREO,
 
820
                .channels_max = HDA_STEREO,
 
821
                .rates = SNDRV_PCM_RATE_48000,
 
822
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
823
        },
 
824
},
 
825
{
 
826
        .name = "SSP5 Pin",
 
827
        .ops = &skl_be_ssp_dai_ops,
 
828
        .playback = {
 
829
                .stream_name = "ssp5 Tx",
 
830
                .channels_min = HDA_STEREO,
 
831
                .channels_max = HDA_STEREO,
 
832
                .rates = SNDRV_PCM_RATE_48000,
 
833
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
834
        },
 
835
        .capture = {
 
836
                .stream_name = "ssp5 Rx",
 
837
                .channels_min = HDA_STEREO,
 
838
                .channels_max = HDA_STEREO,
 
839
                .rates = SNDRV_PCM_RATE_48000,
 
840
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
 
841
        },
 
842
},
 
843
{
763
844
        .name = "iDisp1 Pin",
764
845
        .ops = &skl_link_dai_ops,
765
846
        .playback = {
766
847
                .stream_name = "iDisp1 Tx",
767
848
                .channels_min = HDA_STEREO,
768
 
                .channels_max = HDA_STEREO,
 
849
                .channels_max = 8,
769
850
                .rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000,
770
851
                .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE |
771
852
                        SNDRV_PCM_FMTBIT_S24_LE,
777
858
        .playback = {
778
859
                .stream_name = "iDisp2 Tx",
779
860
                .channels_min = HDA_STEREO,
780
 
                .channels_max = HDA_STEREO,
 
861
                .channels_max = 8,
781
862
                .rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|
782
863
                        SNDRV_PCM_RATE_48000,
783
864
                .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE |
790
871
        .playback = {
791
872
                .stream_name = "iDisp3 Tx",
792
873
                .channels_min = HDA_STEREO,
793
 
                .channels_max = HDA_STEREO,
 
874
                .channels_max = 8,
794
875
                .rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|
795
876
                        SNDRV_PCM_RATE_48000,
796
877
                .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE |