]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Mon, 28 Oct 2019 11:43:29 +0000 (12:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 28 Oct 2019 11:43:34 +0000 (12:43 +0100)
Back-merge the development process for catching up the HD-audio fix
(and apply a new one on top of that).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
1  2 
sound/firewire/bebob/bebob_stream.c
sound/pci/hda/hda_intel.c
sound/soc/sof/intel/Kconfig

index 7ac0d9f495c47ca2a5d423ff9981c9457853334d,6c1497d9f52bac0e62b0cfce5bb0e59c64c70d31..f7f0db5aa811224975b9f52d12d093720517d505
@@@ -252,8 -252,7 +252,7 @@@ end
        return err;
  }
  
- static unsigned int
- map_data_channels(struct snd_bebob *bebob, struct amdtp_stream *s)
+ static int map_data_channels(struct snd_bebob *bebob, struct amdtp_stream *s)
  {
        unsigned int sec, sections, ch, channels;
        unsigned int pcm, midi, location;
@@@ -554,9 -553,7 +553,9 @@@ static int keep_resources(struct snd_be
        return cmp_connection_reserve(conn, amdtp_stream_get_max_payload(stream));
  }
  
 -int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate)
 +int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
 +                                  unsigned int frames_per_period,
 +                                  unsigned int frames_per_buffer)
  {
        unsigned int curr_rate;
        int err;
                        cmp_connection_release(&bebob->out_conn);
                        return err;
                }
 +
 +              err = amdtp_domain_set_events_per_period(&bebob->domain,
 +                                      frames_per_period, frames_per_buffer);
 +              if (err < 0) {
 +                      cmp_connection_release(&bebob->out_conn);
 +                      cmp_connection_release(&bebob->in_conn);
 +                      return err;
 +              }
        }
  
        return 0;
@@@ -658,15 -647,7 +657,15 @@@ int snd_bebob_stream_start_duplex(struc
                if (err < 0)
                        goto error;
  
 -              err = amdtp_domain_start(&bebob->domain);
 +              // The device postpones start of transmission mostly for 1 sec
 +              // after receives packets firstly. For safe, IR context starts
 +              // 1.5 sec (=12000 cycles) later. This is within 2.0 sec
 +              // (=CALLBACK_TIMEOUT).
 +              // Furthermore, some devices transfer isoc packets with
 +              // discontinuous counter in the beginning of packet streaming.
 +              // The delay has an effect to avoid detection of this
 +              // discontinuity.
 +              err = amdtp_domain_start(&bebob->domain, 12000);
                if (err < 0)
                        goto error;
  
index ca462dd39a486153640bab9f3264447d61d94b6f,cf53fbd872ee34526d277bd4f479c1a5024b32b6..2a9d87ff2e1ce0f8ff280626f949ccf732e0d1d7
@@@ -46,7 -46,7 +46,7 @@@
  #include <sound/initval.h>
  #include <sound/hdaudio.h>
  #include <sound/hda_i915.h>
 -#include <sound/intel-nhlt.h>
 +#include <sound/intel-dsp-config.h>
  #include <linux/vgaarb.h>
  #include <linux/vga_switcheroo.h>
  #include <linux/firmware.h>
@@@ -124,7 -124,7 +124,7 @@@ static char *patch[SNDRV_CARDS]
  static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =
                                        CONFIG_SND_HDA_INPUT_BEEP_MODE};
  #endif
 -static bool dmic_detect = IS_ENABLED(CONFIG_SND_HDA_INTEL_DETECT_DMIC);
 +static bool dsp_driver = 1;
  
  module_param_array(index, int, NULL, 0444);
  MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
@@@ -159,9 -159,8 +159,9 @@@ module_param_array(beep_mode, bool, NUL
  MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
                            "(0=off, 1=on) (default=1).");
  #endif
 -module_param(dmic_detect, bool, 0444);
 -MODULE_PARM_DESC(dmic_detect, "DMIC detect on SKL+ platforms");
 +module_param(dsp_driver, bool, 0444);
 +MODULE_PARM_DESC(dsp_driver, "Allow DSP driver selection (bypass this driver) "
 +                           "(0=off, 1=on) (default=1)");
  
  #ifdef CONFIG_PM
  static int param_set_xint(const char *val, const struct kernel_param *kp);
@@@ -1281,17 -1280,11 +1281,17 @@@ static void init_vga_switcheroo(struct 
  {
        struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
        struct pci_dev *p = get_bound_vga(chip->pci);
 +      struct pci_dev *parent;
        if (p) {
                dev_info(chip->card->dev,
                         "Handle vga_switcheroo audio client\n");
                hda->use_vga_switcheroo = 1;
 -              chip->bus.keep_power = 1; /* cleared in either gpu_bound op or codec probe */
 +
 +              /* cleared in either gpu_bound op or codec probe, or when its
 +               * upstream port has _PR3 (i.e. dGPU).
 +               */
 +              parent = pci_upstream_bridge(p);
 +              chip->bus.keep_power = parent ? !pci_pr3_present(parent) : 1;
                chip->driver_caps |= AZX_DCAPS_PM_RUNTIME;
                pci_dev_put(p);
        }
@@@ -1355,9 -1348,9 +1355,9 @@@ static int azx_free(struct azx *chip
        }
  
        if (bus->chip_init) {
-               azx_stop_chip(chip);
                azx_clear_irq_pending(chip);
                azx_stop_all_streams(chip);
+               azx_stop_chip(chip);
        }
  
        if (bus->irq >= 0)
@@@ -2027,6 -2020,25 +2027,6 @@@ static const struct hda_controller_ops 
        .position_check = azx_position_check,
  };
  
 -static int azx_check_dmic(struct pci_dev *pci, struct azx *chip)
 -{
 -      struct nhlt_acpi_table *nhlt;
 -      int ret = 0;
 -
 -      if (chip->driver_type == AZX_DRIVER_SKL &&
 -          pci->class != 0x040300) {
 -              nhlt = intel_nhlt_init(&pci->dev);
 -              if (nhlt) {
 -                      if (intel_nhlt_get_dmic_geo(&pci->dev, nhlt)) {
 -                              ret = -ENODEV;
 -                              dev_info(&pci->dev, "Digital mics found on Skylake+ platform, aborting probe\n");
 -                      }
 -                      intel_nhlt_free(nhlt);
 -              }
 -      }
 -      return ret;
 -}
 -
  static int azx_probe(struct pci_dev *pci,
                     const struct pci_device_id *pci_id)
  {
                return -ENOENT;
        }
  
 +      /*
 +       * stop probe if another Intel's DSP driver should be activated
 +       */
 +      if (dsp_driver) {
 +              err = snd_intel_dsp_driver_probe(pci);
 +              if (err != SND_INTEL_DSP_DRIVER_ANY &&
 +                  err != SND_INTEL_DSP_DRIVER_LEGACY)
 +                      return -ENODEV;
 +      }
 +
        err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
                           0, &card);
        if (err < 0) {
        card->private_data = chip;
        hda = container_of(chip, struct hda_intel, chip);
  
 -      /*
 -       * stop probe if digital microphones detected on Skylake+ platform
 -       * with the DSP enabled. This is an opt-in behavior defined at build
 -       * time or at run-time with a module parameter
 -       */
 -      if (dmic_detect) {
 -              err = azx_check_dmic(pci, chip);
 -              if (err < 0)
 -                      goto out_free;
 -      }
 -
        pci_set_drvdata(pci, card);
  
        err = register_vga_switcheroo(chip);
@@@ -2386,6 -2399,12 +2386,12 @@@ static const struct pci_device_id azx_i
        /* Icelake */
        { PCI_DEVICE(0x8086, 0x34c8),
          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
+       /* Jasperlake */
+       { PCI_DEVICE(0x8086, 0x38c8),
+         .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
+       /* Tigerlake */
+       { PCI_DEVICE(0x8086, 0xa0c8),
+         .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
        /* Elkhart Lake */
        { PCI_DEVICE(0x8086, 0x4b55),
          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
index 806dfa0e5eaed19e1b0add40b595029448b4dce9,d62f51d33be148531916c887e6aa046328f5c2dc..05f4aed13af9f0068a8ff362bfd8ca6a1837a9b7
@@@ -36,7 -36,7 +36,7 @@@ config SND_SOC_SOF_INTEL_PC
  config SND_SOC_SOF_INTEL_HIFI_EP_IPC
        tristate
        help
 -          This option is not user-selectable but automagically handled by
 +        This option is not user-selectable but automagically handled by
          'select' statements at a higher level
  
  config SND_SOC_SOF_INTEL_ATOM_HIFI_EP
@@@ -217,31 -217,31 +217,31 @@@ config SND_SOC_SOF_COMETLAKE_H_SUPPOR
  config SND_SOC_SOF_TIGERLAKE_SUPPORT
        bool "SOF support for Tigerlake"
        help
 -          This adds support for Sound Open Firmware for Intel(R) platforms
 -          using the Tigerlake processors.
 -          Say Y if you have such a device.
 -          If unsure select "N".
 +        This adds support for Sound Open Firmware for Intel(R) platforms
 +        using the Tigerlake processors.
 +        Say Y if you have such a device.
 +        If unsure select "N".
  
  config SND_SOC_SOF_TIGERLAKE
        tristate
        select SND_SOC_SOF_HDA_COMMON
        help
 -          This option is not user-selectable but automagically handled by
 +        This option is not user-selectable but automagically handled by
          'select' statements at a higher level
  
  config SND_SOC_SOF_ELKHARTLAKE_SUPPORT
        bool "SOF support for ElkhartLake"
        help
 -          This adds support for Sound Open Firmware for Intel(R) platforms
 -          using the ElkhartLake processors.
 -          Say Y if you have such a device.
 -          If unsure select "N".
 +        This adds support for Sound Open Firmware for Intel(R) platforms
 +        using the ElkhartLake processors.
 +        Say Y if you have such a device.
 +        If unsure select "N".
  
  config SND_SOC_SOF_ELKHARTLAKE
        tristate
        select SND_SOC_SOF_HDA_COMMON
        help
 -          This option is not user-selectable but automagically handled by
 +        This option is not user-selectable but automagically handled by
          'select' statements at a higher level
  
  config SND_SOC_SOF_HDA_COMMON
@@@ -273,6 -273,16 +273,16 @@@ config SND_SOC_SOF_HDA_AUDIO_CODE
          Say Y if you want to enable HDAudio codecs with SOF.
          If unsure select "N".
  
+ config SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1
+       bool "SOF enable DMI Link L1"
+       help
+         This option enables DMI L1 for both playback and capture
+         and disables known workarounds for specific HDaudio platforms.
+         Only use to look into power optimizations on platforms not
+         affected by DMI L1 issues. This option is not recommended.
+         Say Y if you want to enable DMI Link L1
+         If unsure, select "N".
  endif ## SND_SOC_SOF_HDA_COMMON
  
  config SND_SOC_SOF_HDA_LINK_BASELINE
@@@ -286,7 -296,7 +296,7 @@@ config SND_SOC_SOF_HD
        tristate
        select SND_HDA_EXT_CORE if SND_SOC_SOF_HDA_LINK
        select SND_SOC_HDAC_HDA if SND_SOC_SOF_HDA_AUDIO_CODEC
 -      select SND_INTEL_NHLT if ACPI
 +      select SND_INTEL_DSP_CONFIG
        help
          This option is not user-selectable but automagically handled by
          'select' statements at a higher level