aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/skylake
diff options
context:
space:
mode:
authorJeeja KP <jeeja.kp@intel.com>2016-02-05 01:49:09 -0500
committerMark Brown <broonie@kernel.org>2016-02-08 11:44:17 -0500
commitc5a76a246989c8155d372142089ccfc9dc022388 (patch)
tree41299e3136ddd5a1f0115e383c931fa48ebcaa2e /sound/soc/intel/skylake
parentcc6a4044bdeeb7a7769b7aedf9afe9e1464aadf0 (diff)
ASoC: Intel: Skylake: Add shutdown callback
While going to shutdown, we need to bring HW to clean state. This is done by cleaning up stream descriptor registers. This cleanup is already done by decoupling of stream and stopping the chip, so invoke these from shutdown handler. Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake')
-rw-r--r--sound/soc/intel/skylake/skl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 092705e73db4..06f4b2c13423 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -634,6 +634,31 @@ out_free:
634 return err; 634 return err;
635} 635}
636 636
637static void skl_shutdown(struct pci_dev *pci)
638{
639 struct hdac_ext_bus *ebus = pci_get_drvdata(pci);
640 struct hdac_bus *bus = ebus_to_hbus(ebus);
641 struct hdac_stream *s;
642 struct hdac_ext_stream *stream;
643 struct skl *skl;
644
645 if (ebus == NULL)
646 return;
647
648 skl = ebus_to_skl(ebus);
649
650 if (skl->init_failed)
651 return;
652
653 snd_hdac_ext_stop_streams(ebus);
654 list_for_each_entry(s, &bus->stream_list, list) {
655 stream = stream_to_hdac_ext_stream(s);
656 snd_hdac_ext_stream_decouple(ebus, stream, false);
657 }
658
659 snd_hdac_bus_stop_chip(bus);
660}
661
637static void skl_remove(struct pci_dev *pci) 662static void skl_remove(struct pci_dev *pci)
638{ 663{
639 struct hdac_ext_bus *ebus = pci_get_drvdata(pci); 664 struct hdac_ext_bus *ebus = pci_get_drvdata(pci);
@@ -677,6 +702,7 @@ static struct pci_driver skl_driver = {
677 .id_table = skl_ids, 702 .id_table = skl_ids,
678 .probe = skl_probe, 703 .probe = skl_probe,
679 .remove = skl_remove, 704 .remove = skl_remove,
705 .shutdown = skl_shutdown,
680 .driver = { 706 .driver = {
681 .pm = &skl_pm, 707 .pm = &skl_pm,
682 }, 708 },