History

Merge tag 'sound-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai: "This update contains a slightly hight amount of changes due to the pending ASoC fixes: - ALSA timer core got a couple of fixes for races between read and ioctl, leading to potential read of uninitialized kmalloced memory - ASoC core fixed the de-registration pattern for use-after-free bug - The rewrite of probe code in ASoC Intel Skylake for i915 component - ASoC R-snd got a series of fixes for SSI - ASoC simple-card, atmel, da7213, and rt286 trivial fixes - HD-audio ALC269 quirk and rearrangement of quirk table" * tag 'sound-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT ALSA: timer: Fix race between read and ioctl ALSA: hda/realtek - Reorder ALC269 ASUS quirk entries ALSA: hda/realtek: Fix mic and headset jack sense on Asus X705UD ASoC: rsnd: fixup parent_clk_name of AUDIO_CLKOUTx ASoC: Intel: Skylake: Fix to parse consecutive string tkns in manifest ASoC: Intel: Skylake: Fix IPC rx_list corruption ASoC: rsnd: SSI PIO adjust to 24bit mode MAINTAINERS: Update email address for patches to Wolfson parts ASoC: Fix use-after-free at card unregistration ASoC: simple-card: fix mic jack initialization ASoC: rsnd: don't call free_irq() on Parent SSI ASoC: atmel-classd: sync regcache when resuming ASoC: rsnd: don't use PDTA bit for 24bit on SSI ASoC: da7213: Fix incorrect usage of bitwise '&' operator for SRM check rt286: add Thinkpad Helix 2 to force_combo_jack_table ASoC: Intel: Skylake: Move i915 registration to worker thread

Linus Torvalds committed 9 years ago

Commit 39e4edf2 parents 6107cc5 ba3021b20 files · +216 −96Browse files

Unified · Split

20 files
  1. MAINTAINERS +1 −1
  2. sound/core/timer.c +5 −2
  3. sound/pci/hda/patch_realtek.c +6 −5
  4. sound/soc/atmel/atmel-classd.c +9 −0
  5. sound/soc/codecs/da7213.c +1 −1
  6. sound/soc/codecs/rt286.c +7 −0
  7. sound/soc/generic/simple-card.c +1 −1
  8. sound/soc/intel/skylake/skl-sst-ipc.c +5 −0
  9. sound/soc/intel/skylake/skl-topology.c +1 −1
  10. sound/soc/intel/skylake/skl.c +88 −74
  11. sound/soc/intel/skylake/skl.h +3 −1
  12. sound/soc/sh/rcar/adg.c +4 −2
  13. sound/soc/sh/rcar/cmd.c +1 −0
  14. sound/soc/sh/rcar/core.c +51 −0
  15. sound/soc/sh/rcar/gen.c +1 −0
  16. sound/soc/sh/rcar/rsnd.h +2 −0
  17. sound/soc/sh/rcar/src.c +10 −2
  18. sound/soc/sh/rcar/ssi.c +15 −3
  19. sound/soc/sh/rcar/ssiu.c +2 −1
  20. sound/soc/soc-core.c +3 −2
MAINTAINERS+1−1
@@ -13861,7 +13861,7 @@ S: Odd fixes · 13860 unmodified lines
1386113861 F: drivers/net/wireless/wl3501*
1386213862
1386313863 WOLFSON MICROELECTRONICS DRIVERS
13864−L: patches@opensource.wolfsonmicro.com
13864+L: patches@opensource.cirrus.com
1386513865 T: git https://github.com/CirrusLogic/linux-drivers.git
1386613866 W: https://github.com/CirrusLogic/linux-drivers/wiki
1386713867 S: Supported
sound/core/timer.c+5−2
@@ -1618,6 +1618,7 @@ static int snd_timer_user_tselect(struct file *file, · 1617 unmodified lines
16181618 if (err < 0)
16191619 goto __err;
16201620
1621+ tu->qhead = tu->qtail = tu->qused = 0;
16211622 kfree(tu->queue);
16221623 tu->queue = NULL;
16231624 kfree(tu->tqueue);
@@ -1959,6 +1960,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, · 335 unmodified lines
19591960
19601961 tu = file->private_data;
19611962 unit = tu->tread ? sizeof(struct snd_timer_tread) : sizeof(struct snd_timer_read);
1963+ mutex_lock(&tu->ioctl_lock);
19621964 spin_lock_irq(&tu->qlock);
19631965 while ((long)count - result >= unit) {
19641966 while (!tu->qused) {
@@ -1974,7 +1976,9 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, · 9 unmodified lines
19741976 add_wait_queue(&tu->qchange_sleep, &wait);
19751977
19761978 spin_unlock_irq(&tu->qlock);
1979+ mutex_unlock(&tu->ioctl_lock);
19771980 schedule();
1981+ mutex_lock(&tu->ioctl_lock);
19781982 spin_lock_irq(&tu->qlock);
19791983
19801984 remove_wait_queue(&tu->qchange_sleep, &wait);
@@ -1994,7 +1998,6 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, · 13 unmodified lines
19941998 tu->qused--;
19951999 spin_unlock_irq(&tu->qlock);
19962000
1997− mutex_lock(&tu->ioctl_lock);
19982001 if (tu->tread) {
19992002 if (copy_to_user(buffer, &tu->tqueue[qhead],
20002003 sizeof(struct snd_timer_tread)))
@@ -2004,7 +2007,6 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, · 3 unmodified lines
20042007 sizeof(struct snd_timer_read)))
20052008 err = -EFAULT;
20062009 }
2007− mutex_unlock(&tu->ioctl_lock);
20082010
20092011 spin_lock_irq(&tu->qlock);
20102012 if (err < 0)
@@ -2014,6 +2016,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, · 3 unmodified lines
20142016 }
20152017 _error:
20162018 spin_unlock_irq(&tu->qlock);
2019+ mutex_unlock(&tu->ioctl_lock);
20172020 return result > 0 ? result : err;
20182021 }
20192022
sound/pci/hda/patch_realtek.c+6−5
@@ -5854,7 +5854,11 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 5853 unmodified lines
58545854 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
58555855 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
58565856 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
5857+ SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
58575858 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
5859+ SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5860+ SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
5861+ SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
58585862 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
58595863 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
58605864 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
@@ -5862,13 +5866,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 1 unmodified line
58625866 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
58635867 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
58645868 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
5869+ SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
58655870 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
5866− SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
58675871 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5868− SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5869− SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5870− SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
5871− SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
5872+ SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
58725873 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
58735874 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
58745875 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
sound/soc/atmel/atmel-classd.c+9−0
@@ -301,6 +301,14 @@ static int atmel_classd_codec_probe(struct snd_soc_codec *codec) · 300 unmodified lines
301301 return 0;
302302 }
303303
304+static int atmel_classd_codec_resume(struct snd_soc_codec *codec)
305+{
306+ struct snd_soc_card *card = snd_soc_codec_get_drvdata(codec);
307+ struct atmel_classd *dd = snd_soc_card_get_drvdata(card);
308+
309+ return regcache_sync(dd->regmap);
310+}
311+
304312 static struct regmap *atmel_classd_codec_get_remap(struct device *dev)
305313 {
306314 return dev_get_regmap(dev, NULL);
@@ -308,6 +316,7 @@ static struct regmap *atmel_classd_codec_get_remap(struct device *dev) · 1 unmodified line
308316
309317 static struct snd_soc_codec_driver soc_codec_dev_classd = {
310318 .probe = atmel_classd_codec_probe,
319+ .resume = atmel_classd_codec_resume,
311320 .get_regmap = atmel_classd_codec_get_remap,
312321 .component_driver = {
313322 .controls = atmel_classd_snd_controls,
sound/soc/codecs/da7213.c+1−1
@@ -772,7 +772,7 @@ static int da7213_dai_event(struct snd_soc_dapm_widget *w, · 771 unmodified lines
772772 ++i;
773773 msleep(50);
774774 }
775− } while ((i < DA7213_SRM_CHECK_RETRIES) & (!srm_lock));
775+ } while ((i < DA7213_SRM_CHECK_RETRIES) && (!srm_lock));
776776
777777 if (!srm_lock)
778778 dev_warn(codec->dev, "SRM failed to lock\n");
sound/soc/codecs/rt286.c+7−0
@@ -1108,6 +1108,13 @@ static const struct dmi_system_id force_combo_jack_table[] = { · 1107 unmodified lines
11081108 DMI_MATCH(DMI_PRODUCT_NAME, "Kabylake Client platform")
11091109 }
11101110 },
1111+ {
1112+ .ident = "Thinkpad Helix 2nd",
1113+ .matches = {
1114+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1115+ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Helix 2nd")
1116+ }
1117+ },
11111118
11121119 { }
11131120 };
sound/soc/generic/simple-card.c+1−1
@@ -202,7 +202,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd) · 201 unmodified lines
202202 if (ret < 0)
203203 return ret;
204204
205− ret = asoc_simple_card_init_mic(rtd->card, &priv->hp_jack, PREFIX);
205+ ret = asoc_simple_card_init_mic(rtd->card, &priv->mic_jack, PREFIX);
206206 if (ret < 0)
207207 return ret;
208208
sound/soc/intel/skylake/skl-sst-ipc.c+5−0
@@ -413,8 +413,11 @@ static void skl_ipc_process_reply(struct sst_generic_ipc *ipc, · 412 unmodified lines
413413 u32 reply = header.primary & IPC_GLB_REPLY_STATUS_MASK;
414414 u64 *ipc_header = (u64 *)(&header);
415415 struct skl_sst *skl = container_of(ipc, struct skl_sst, ipc);
416+ unsigned long flags;
416417
418+ spin_lock_irqsave(&ipc->dsp->spinlock, flags);
417419 msg = skl_ipc_reply_get_msg(ipc, *ipc_header);
420+ spin_unlock_irqrestore(&ipc->dsp->spinlock, flags);
418421 if (msg == NULL) {
419422 dev_dbg(ipc->dev, "ipc: rx list is empty\n");
420423 return;
@@ -456,8 +459,10 @@ static void skl_ipc_process_reply(struct sst_generic_ipc *ipc, · 35 unmodified lines
456459 }
457460 }
458461
462+ spin_lock_irqsave(&ipc->dsp->spinlock, flags);
459463 list_del(&msg->list);
460464 sst_ipc_tx_msg_reply_complete(ipc, msg);
465+ spin_unlock_irqrestore(&ipc->dsp->spinlock, flags);
461466 }
462467
463468 irqreturn_t skl_dsp_irq_thread_handler(int irq, void *context)
sound/soc/intel/skylake/skl-topology.c+1−1
@@ -2502,7 +2502,7 @@ static int skl_tplg_get_manifest_tkn(struct device *dev, · 2501 unmodified lines
25022502
25032503 if (ret < 0)
25042504 return ret;
2505− tkn_count += ret;
2505+ tkn_count = ret;
25062506
25072507 tuple_size += tkn_count *
25082508 sizeof(struct snd_soc_tplg_vendor_string_elem);
sound/soc/intel/skylake/skl.c+88−74
@@ -410,7 +410,7 @@ static int skl_free(struct hdac_ext_bus *ebus) · 409 unmodified lines
410410 struct skl *skl = ebus_to_skl(ebus);
411411 struct hdac_bus *bus = ebus_to_hbus(ebus);
412412
413− skl->init_failed = 1; /* to be sure */
413+ skl->init_done = 0; /* to be sure */
414414
415415 snd_hdac_ext_stop_streams(ebus);
416416
@@ -428,8 +428,10 @@ static int skl_free(struct hdac_ext_bus *ebus) · 11 unmodified lines
428428
429429 snd_hdac_ext_bus_exit(ebus);
430430
431+ cancel_work_sync(&skl->probe_work);
431432 if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
432433 snd_hdac_i915_exit(&ebus->bus);
434+
433435 return 0;
434436 }
435437
@@ -566,6 +568,84 @@ static const struct hdac_bus_ops bus_core_ops = { · 130 unmodified lines
566568 .get_response = snd_hdac_bus_get_response,
567569 };
568570
571+static int skl_i915_init(struct hdac_bus *bus)
572+{
573+ int err;
574+
575+ /*
576+ * The HDMI codec is in GPU so we need to ensure that it is powered
577+ * up and ready for probe
578+ */
579+ err = snd_hdac_i915_init(bus);
580+ if (err < 0)
581+ return err;
582+
583+ err = snd_hdac_display_power(bus, true);
584+ if (err < 0)
585+ dev_err(bus->dev, "Cannot turn on display power on i915\n");
586+
587+ return err;
588+}
589+
590+static void skl_probe_work(struct work_struct *work)
591+{
592+ struct skl *skl = container_of(work, struct skl, probe_work);
593+ struct hdac_ext_bus *ebus = &skl->ebus;
594+ struct hdac_bus *bus = ebus_to_hbus(ebus);
595+ struct hdac_ext_link *hlink = NULL;
596+ int err;
597+
598+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
599+ err = skl_i915_init(bus);
600+ if (err < 0)
601+ return;
602+ }
603+
604+ err = skl_init_chip(bus, true);
605+ if (err < 0) {
606+ dev_err(bus->dev, "Init chip failed with err: %d\n", err);
607+ goto out_err;
608+ }
609+
610+ /* codec detection */
611+ if (!bus->codec_mask)
612+ dev_info(bus->dev, "no hda codecs found!\n");
613+
614+ /* create codec instances */
615+ err = skl_codec_create(ebus);
616+ if (err < 0)
617+ goto out_err;
618+
619+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
620+ err = snd_hdac_display_power(bus, false);
621+ if (err < 0) {
622+ dev_err(bus->dev, "Cannot turn off display power on i915\n");
623+ return;
624+ }
625+ }
626+
627+ /* register platform dai and controls */
628+ err = skl_platform_register(bus->dev);
629+ if (err < 0)
630+ return;
631+ /*
632+ * we are done probing so decrement link counts
633+ */
634+ list_for_each_entry(hlink, &ebus->hlink_list, list)
635+ snd_hdac_ext_bus_link_put(ebus, hlink);
636+
637+ /* configure PM */
638+ pm_runtime_put_noidle(bus->dev);
639+ pm_runtime_allow(bus->dev);
640+ skl->init_done = 1;
641+
642+ return;
643+
644+out_err:
645+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
646+ err = snd_hdac_display_power(bus, false);
647+}
648+
569649 /*
570650 * constructor
571651 */
@@ -593,6 +673,7 @@ static int skl_create(struct pci_dev *pci, · 21 unmodified lines
593673 snd_hdac_ext_bus_init(ebus, &pci->dev, &bus_core_ops, io_ops);
594674 ebus->bus.use_posbuf = 1;
595675 skl->pci = pci;
676+ INIT_WORK(&skl->probe_work, skl_probe_work);
596677
597678 ebus->bus.bdl_pos_adj = 0;
598679
@@ -601,27 +682,6 @@ static int skl_create(struct pci_dev *pci, · 2 unmodified lines
601682 return 0;
602683 }
603684
604−static int skl_i915_init(struct hdac_bus *bus)
605−{
606− int err;
607−
608− /*
609− * The HDMI codec is in GPU so we need to ensure that it is powered
610− * up and ready for probe
611− */
612− err = snd_hdac_i915_init(bus);
613− if (err < 0)
614− return err;
615−
616− err = snd_hdac_display_power(bus, true);
617− if (err < 0) {
618− dev_err(bus->dev, "Cannot turn on display power on i915\n");
619− return err;
620− }
621−
622− return err;
623−}
624−
625685 static int skl_first_init(struct hdac_ext_bus *ebus)
626686 {
627687 struct skl *skl = ebus_to_skl(ebus);
@@ -684,20 +744,7 @@ static int skl_first_init(struct hdac_ext_bus *ebus) · 56 unmodified lines
684744 /* initialize chip */
685745 skl_init_pci(skl);
686746
687− if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
688− err = skl_i915_init(bus);
689− if (err < 0)
690− return err;
691− }
692−
693− skl_init_chip(bus, true);
694−
695− /* codec detection */
696− if (!bus->codec_mask) {
697− dev_info(bus->dev, "no hda codecs found!\n");
698− }
699−
700− return 0;
747+ return skl_init_chip(bus, true);
701748 }
702749
703750 static int skl_probe(struct pci_dev *pci,
@@ -706,7 +753,6 @@ static int skl_probe(struct pci_dev *pci, · 2 unmodified lines
706753 struct skl *skl;
707754 struct hdac_ext_bus *ebus = NULL;
708755 struct hdac_bus *bus = NULL;
709− struct hdac_ext_link *hlink = NULL;
710756 int err;
711757
712758 /* we use ext core ops, so provide NULL for ops here */
@@ -729,7 +775,7 @@ static int skl_probe(struct pci_dev *pci, · 16 unmodified lines
729775
730776 if (skl->nhlt == NULL) {
731777 err = -ENODEV;
732− goto out_display_power_off;
778+ goto out_free;
733779 }
734780
735781 err = skl_nhlt_create_sysfs(skl);
@@ -760,56 +806,24 @@ static int skl_probe(struct pci_dev *pci, · 24 unmodified lines
760806 if (bus->mlcap)
761807 snd_hdac_ext_bus_get_ml_capabilities(ebus);
762808
809+ snd_hdac_bus_stop_chip(bus);
810+
763811 /* create device for soc dmic */
764812 err = skl_dmic_device_register(skl);
765813 if (err < 0)
766814 goto out_dsp_free;
767815
768− /* register platform dai and controls */
769− err = skl_platform_register(bus->dev);
770− if (err < 0)
771− goto out_dmic_free;
772−
773− /* create codec instances */
774− err = skl_codec_create(ebus);
775− if (err < 0)
776− goto out_unregister;
777−
778− if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
779− err = snd_hdac_display_power(bus, false);
780− if (err < 0) {
781− dev_err(bus->dev, "Cannot turn off display power on i915\n");
782− return err;
783− }
784− }
785−
786− /*
787− * we are done probling so decrement link counts
788− */
789− list_for_each_entry(hlink, &ebus->hlink_list, list)
790− snd_hdac_ext_bus_link_put(ebus, hlink);
791−
792− /* configure PM */
793− pm_runtime_put_noidle(bus->dev);
794− pm_runtime_allow(bus->dev);
816+ schedule_work(&skl->probe_work);
795817
796818 return 0;
797819
798−out_unregister:
799− skl_platform_unregister(bus->dev);
800−out_dmic_free:
801− skl_dmic_device_unregister(skl);
802820 out_dsp_free:
803821 skl_free_dsp(skl);
804822 out_mach_free:
805823 skl_machine_device_unregister(skl);
806824 out_nhlt_free:
807825 skl_nhlt_free(skl->nhlt);
808−out_display_power_off:
809− if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
810− snd_hdac_display_power(bus, false);
811826 out_free:
812− skl->init_failed = 1;
813827 skl_free(ebus);
814828
815829 return err;
@@ -828,7 +842,7 @@ static void skl_shutdown(struct pci_dev *pci) · 12 unmodified lines
828842
829843 skl = ebus_to_skl(ebus);
830844
831− if (skl->init_failed)
845+ if (!skl->init_done)
832846 return;
833847
834848 snd_hdac_ext_stop_streams(ebus);
sound/soc/intel/skylake/skl.h+3−1
@@ -46,7 +46,7 @@ struct skl { · 45 unmodified lines
4646 struct hdac_ext_bus ebus;
4747 struct pci_dev *pci;
4848
49− unsigned int init_failed:1; /* delayed init failed */
49+ unsigned int init_done:1; /* delayed init status */
5050 struct platform_device *dmic_dev;
5151 struct platform_device *i2s_dev;
5252 struct snd_soc_platform *platform;
@@ -64,6 +64,8 @@ struct skl { · 11 unmodified lines
6464 const struct firmware *tplg;
6565
6666 int supend_active;
67+
68+ struct work_struct probe_work;
6769 };
6870
6971 #define skl_to_ebus(s) (&(s)->ebus)
sound/soc/sh/rcar/adg.c+4−2
@@ -507,7 +507,8 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv, · 506 unmodified lines
507507 rbga = rbgx;
508508 adg->rbga_rate_for_441khz = rate / div;
509509 ckr |= brg_table[i] << 20;
510− if (req_441kHz_rate)
510+ if (req_441kHz_rate &&
511+ !(adg_mode_flags(adg) & AUDIO_OUT_48))
511512 parent_clk_name = __clk_get_name(clk);
512513 }
513514 }
@@ -522,7 +523,8 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv, · 8 unmodified lines
522523 rbgb = rbgx;
523524 adg->rbgb_rate_for_48khz = rate / div;
524525 ckr |= brg_table[i] << 16;
525− if (req_48kHz_rate)
526+ if (req_48kHz_rate &&
527+ (adg_mode_flags(adg) & AUDIO_OUT_48))
526528 parent_clk_name = __clk_get_name(clk);
527529 }
528530 }
sound/soc/sh/rcar/cmd.c+1−0
@@ -89,6 +89,7 @@ static int rsnd_cmd_init(struct rsnd_mod *mod, · 88 unmodified lines
8989 dev_dbg(dev, "ctu/mix path = 0x%08x", data);
9090
9191 rsnd_mod_write(mod, CMD_ROUTE_SLCT, data);
92+ rsnd_mod_write(mod, CMD_BUSIF_MODE, rsnd_get_busif_shift(io, mod) | 1);
9293 rsnd_mod_write(mod, CMD_BUSIF_DALIGN, rsnd_get_dalign(mod, io));
9394
9495 rsnd_adg_set_cmd_timsel_gen2(mod, io);
sound/soc/sh/rcar/core.c+51−0
@@ -343,6 +343,57 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io) · 342 unmodified lines
343343 return 0x76543210;
344344 }
345345
346+u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod)
347+{
348+ enum rsnd_mod_type playback_mods[] = {
349+ RSND_MOD_SRC,
350+ RSND_MOD_CMD,
351+ RSND_MOD_SSIU,
352+ };
353+ enum rsnd_mod_type capture_mods[] = {
354+ RSND_MOD_CMD,
355+ RSND_MOD_SRC,
356+ RSND_MOD_SSIU,
357+ };
358+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
359+ struct rsnd_mod *tmod = NULL;
360+ enum rsnd_mod_type *mods =
361+ rsnd_io_is_play(io) ?
362+ playback_mods : capture_mods;
363+ int i;
364+
365+ /*
366+ * This is needed for 24bit data
367+ * We need to shift 8bit
368+ *
369+ * Linux 24bit data is located as 0x00******
370+ * HW 24bit data is located as 0x******00
371+ *
372+ */
373+ switch (runtime->sample_bits) {
374+ case 16:
375+ return 0;
376+ case 32:
377+ break;
378+ }
379+
380+ for (i = 0; i < ARRAY_SIZE(playback_mods); i++) {
381+ tmod = rsnd_io_to_mod(io, mods[i]);
382+ if (tmod)
383+ break;
384+ }
385+
386+ if (tmod != mod)
387+ return 0;
388+
389+ if (rsnd_io_is_play(io))
390+ return (0 << 20) | /* shift to Left */
391+ (8 << 16); /* 8bit */
392+ else
393+ return (1 << 20) | /* shift to Right */
394+ (8 << 16); /* 8bit */
395+}
396+
346397 /*
347398 * rsnd_dai functions
348399 */
sound/soc/sh/rcar/gen.c+1−0
@@ -236,6 +236,7 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv) · 235 unmodified lines
236236 RSND_GEN_M_REG(SRC_ROUTE_MODE0, 0xc, 0x20),
237237 RSND_GEN_M_REG(SRC_CTRL, 0x10, 0x20),
238238 RSND_GEN_M_REG(SRC_INT_ENABLE0, 0x18, 0x20),
239+ RSND_GEN_M_REG(CMD_BUSIF_MODE, 0x184, 0x20),
239240 RSND_GEN_M_REG(CMD_BUSIF_DALIGN,0x188, 0x20),
240241 RSND_GEN_M_REG(CMD_ROUTE_SLCT, 0x18c, 0x20),
241242 RSND_GEN_M_REG(CMD_CTRL, 0x190, 0x20),
sound/soc/sh/rcar/rsnd.h+2−0
@@ -73,6 +73,7 @@ enum rsnd_reg { · 72 unmodified lines
7373 RSND_REG_SCU_SYS_INT_EN0,
7474 RSND_REG_SCU_SYS_INT_EN1,
7575 RSND_REG_CMD_CTRL,
76+ RSND_REG_CMD_BUSIF_MODE,
7677 RSND_REG_CMD_BUSIF_DALIGN,
7778 RSND_REG_CMD_ROUTE_SLCT,
7879 RSND_REG_CMDOUT_TIMSEL,
@@ -204,6 +205,7 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, · 125 unmodified lines
204205 u32 mask, u32 data);
205206 u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
206207 u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
208+u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod);
207209
208210 /*
209211 * R-Car DMA
sound/soc/sh/rcar/src.c+10−2
@@ -190,11 +190,13 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, · 189 unmodified lines
190190 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
191191 struct device *dev = rsnd_priv_to_dev(priv);
192192 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
193+ int is_play = rsnd_io_is_play(io);
193194 int use_src = 0;
194195 u32 fin, fout;
195196 u32 ifscr, fsrate, adinr;
196197 u32 cr, route;
197198 u32 bsdsr, bsisr;
199+ u32 i_busif, o_busif, tmp;
198200 uint ratio;
199201
200202 if (!runtime)
@@ -270,6 +272,11 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, · 69 unmodified lines
270272 break;
271273 }
272274
275+ /* BUSIF_MODE */
276+ tmp = rsnd_get_busif_shift(io, mod);
277+ i_busif = ( is_play ? tmp : 0) | 1;
278+ o_busif = (!is_play ? tmp : 0) | 1;
279+
273280 rsnd_mod_write(mod, SRC_ROUTE_MODE0, route);
274281
275282 rsnd_mod_write(mod, SRC_SRCIR, 1); /* initialize */
@@ -281,8 +288,9 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, · 5 unmodified lines
281288 rsnd_mod_write(mod, SRC_BSISR, bsisr);
282289 rsnd_mod_write(mod, SRC_SRCIR, 0); /* cancel initialize */
283290
284− rsnd_mod_write(mod, SRC_I_BUSIF_MODE, 1);
285− rsnd_mod_write(mod, SRC_O_BUSIF_MODE, 1);
291+ rsnd_mod_write(mod, SRC_I_BUSIF_MODE, i_busif);
292+ rsnd_mod_write(mod, SRC_O_BUSIF_MODE, o_busif);
293+
286294 rsnd_mod_write(mod, SRC_BUSIF_DALIGN, rsnd_get_dalign(mod, io));
287295
288296 rsnd_adg_set_src_timesel_gen2(mod, io, fin, fout);
sound/soc/sh/rcar/ssi.c+15−3
@@ -302,7 +302,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, · 301 unmodified lines
302302 * always use 32bit system word.
303303 * see also rsnd_ssi_master_clk_enable()
304304 */
305− cr_own = FORCE | SWL_32 | PDTA;
305+ cr_own = FORCE | SWL_32;
306306
307307 if (rdai->bit_clk_inv)
308308 cr_own |= SCKP;
@@ -550,6 +550,13 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, · 241 unmodified lines
550550 struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
551551 u32 *buf = (u32 *)(runtime->dma_area +
552552 rsnd_dai_pointer_offset(io, 0));
553+ int shift = 0;
554+
555+ switch (runtime->sample_bits) {
556+ case 32:
557+ shift = 8;
558+ break;
559+ }
553560
554561 /*
555562 * 8/16/32 data can be assesse to TDR/RDR register
@@ -557,9 +564,9 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, · 1 unmodified line
557564 * see rsnd_ssi_init()
558565 */
559566 if (rsnd_io_is_play(io))
560− rsnd_mod_write(mod, SSITDR, *buf);
567+ rsnd_mod_write(mod, SSITDR, (*buf) << shift);
561568 else
562− *buf = rsnd_mod_read(mod, SSIRDR);
569+ *buf = (rsnd_mod_read(mod, SSIRDR) >> shift);
563570
564571 elapsed = rsnd_dai_pointer_update(io, sizeof(*buf));
565572 }
@@ -709,6 +716,11 @@ static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, · 143 unmodified lines
709716 struct rsnd_priv *priv)
710717 {
711718 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
719+ struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io);
720+
721+ /* Do nothing for SSI parent mod */
722+ if (ssi_parent_mod == mod)
723+ return 0;
712724
713725 /* PIO will request IRQ again */
714726 free_irq(ssi->irq, mod);
sound/soc/sh/rcar/ssiu.c+2−1
@@ -144,7 +144,8 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, · 143 unmodified lines
144144 (rsnd_io_is_play(io) ?
145145 rsnd_runtime_channel_after_ctu(io) :
146146 rsnd_runtime_channel_original(io)));
147− rsnd_mod_write(mod, SSI_BUSIF_MODE, 1);
147+ rsnd_mod_write(mod, SSI_BUSIF_MODE,
148+ rsnd_get_busif_shift(io, mod) | 1);
148149 rsnd_mod_write(mod, SSI_BUSIF_DALIGN,
149150 rsnd_get_dalign(mod, io));
150151 }
sound/soc/soc-core.c+3−2
@@ -2286,6 +2286,9 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) · 2285 unmodified lines
22862286 list_for_each_entry(rtd, &card->rtd_list, list)
22872287 flush_delayed_work(&rtd->delayed_work);
22882288
2289+ /* free the ALSA card at first; this syncs with pending operations */
2290+ snd_card_free(card->snd_card);
2291+
22892292 /* remove and free each DAI */
22902293 soc_remove_dai_links(card);
22912294 soc_remove_pcm_runtimes(card);
@@ -2300,9 +2303,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) · 8 unmodified lines
23002303 if (card->remove)
23012304 card->remove(card);
23022305
2303− snd_card_free(card->snd_card);
23042306 return 0;
2305−
23062307 }
23072308
23082309 /* removes a socdev */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t