Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'asoc-4.17' into asoc-4.18 to get adau17x1 changes so further patches can be applied.

+72 -26
+20 -6
sound/soc/codecs/adau17x1.c
··· 502 502 } 503 503 504 504 if (adau->sigmadsp) { 505 - ret = adau17x1_setup_firmware(adau, params_rate(params)); 505 + ret = adau17x1_setup_firmware(component, params_rate(params)); 506 506 if (ret < 0) 507 507 return ret; 508 508 } ··· 835 835 } 836 836 EXPORT_SYMBOL_GPL(adau17x1_volatile_register); 837 837 838 - int adau17x1_setup_firmware(struct adau *adau, unsigned int rate) 838 + int adau17x1_setup_firmware(struct snd_soc_component *component, 839 + unsigned int rate) 839 840 { 840 841 int ret; 841 - int dspsr; 842 + int dspsr, dsp_run; 843 + struct adau *adau = snd_soc_component_get_drvdata(component); 844 + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 845 + 846 + snd_soc_dapm_mutex_lock(dapm); 842 847 843 848 ret = regmap_read(adau->regmap, ADAU17X1_DSP_SAMPLING_RATE, &dspsr); 844 849 if (ret) 845 - return ret; 850 + goto err; 851 + 852 + ret = regmap_read(adau->regmap, ADAU17X1_DSP_RUN, &dsp_run); 853 + if (ret) 854 + goto err; 846 855 847 856 regmap_write(adau->regmap, ADAU17X1_DSP_ENABLE, 1); 848 857 regmap_write(adau->regmap, ADAU17X1_DSP_SAMPLING_RATE, 0xf); 858 + regmap_write(adau->regmap, ADAU17X1_DSP_RUN, 0); 849 859 850 860 ret = sigmadsp_setup(adau->sigmadsp, rate); 851 861 if (ret) { 852 862 regmap_write(adau->regmap, ADAU17X1_DSP_ENABLE, 0); 853 - return ret; 863 + goto err; 854 864 } 855 865 regmap_write(adau->regmap, ADAU17X1_DSP_SAMPLING_RATE, dspsr); 866 + regmap_write(adau->regmap, ADAU17X1_DSP_RUN, dsp_run); 856 867 857 - return 0; 868 + err: 869 + snd_soc_dapm_mutex_unlock(dapm); 870 + 871 + return ret; 858 872 } 859 873 EXPORT_SYMBOL_GPL(adau17x1_setup_firmware); 860 874
+2 -1
sound/soc/codecs/adau17x1.h
··· 68 68 69 69 extern const struct snd_soc_dai_ops adau17x1_dai_ops; 70 70 71 - int adau17x1_setup_firmware(struct adau *adau, unsigned int rate); 71 + int adau17x1_setup_firmware(struct snd_soc_component *component, 72 + unsigned int rate); 72 73 bool adau17x1_has_dsp(struct adau *adau); 73 74 74 75 #define ADAU17X1_CLOCK_CONTROL 0x4000
+7
sound/soc/fsl/fsl_esai.c
··· 144 144 145 145 psr = ratio <= 256 * maxfp ? ESAI_xCCR_xPSR_BYPASS : ESAI_xCCR_xPSR_DIV8; 146 146 147 + /* Do not loop-search if PM (1 ~ 256) alone can serve the ratio */ 148 + if (ratio <= 256) { 149 + pm = ratio; 150 + fp = 1; 151 + goto out; 152 + } 153 + 147 154 /* Set the max fluctuation -- 0.1% of the max devisor */ 148 155 savesub = (psr ? 1 : 8) * 256 * maxfp / 1000; 149 156
+11 -3
sound/soc/fsl/fsl_ssi.c
··· 217 217 * @dai_fmt: DAI configuration this device is currently used with 218 218 * @streams: Mask of current active streams: BIT(TX) and BIT(RX) 219 219 * @i2s_net: I2S and Network mode configurations of SCR register 220 + * (this is the initial settings based on the DAI format) 220 221 * @synchronous: Use synchronous mode - both of TX and RX use STCK and SFCK 221 222 * @use_dma: DMA is used or FIQ with stream filter 222 223 * @use_dual_fifo: DMA with support for dual FIFO mode ··· 830 829 } 831 830 832 831 if (!fsl_ssi_is_ac97(ssi)) { 832 + /* 833 + * Keep the ssi->i2s_net intact while having a local variable 834 + * to override settings for special use cases. Otherwise, the 835 + * ssi->i2s_net will lose the settings for regular use cases. 836 + */ 837 + u8 i2s_net = ssi->i2s_net; 838 + 833 839 /* Normal + Network mode to send 16-bit data in 32-bit frames */ 834 840 if (fsl_ssi_is_i2s_cbm_cfs(ssi) && sample_size == 16) 835 - ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; 841 + i2s_net = SSI_SCR_I2S_MODE_NORMAL | SSI_SCR_NET; 836 842 837 843 /* Use Normal mode to send mono data at 1st slot of 2 slots */ 838 844 if (channels == 1) 839 - ssi->i2s_net = SSI_SCR_I2S_MODE_NORMAL; 845 + i2s_net = SSI_SCR_I2S_MODE_NORMAL; 840 846 841 847 regmap_update_bits(regs, REG_SSI_SCR, 842 - SSI_SCR_I2S_NET_MASK, ssi->i2s_net); 848 + SSI_SCR_I2S_NET_MASK, i2s_net); 843 849 } 844 850 845 851 /* In synchronous mode, the SSI uses STCCR for capture */
+13 -9
sound/soc/intel/Kconfig
··· 72 72 for Baytrail Chromebooks but this option is now deprecated and is 73 73 not recommended, use SND_SST_ATOM_HIFI2_PLATFORM instead. 74 74 75 + config SND_SST_ATOM_HIFI2_PLATFORM 76 + tristate 77 + select SND_SOC_COMPRESS 78 + 75 79 config SND_SST_ATOM_HIFI2_PLATFORM_PCI 76 - tristate "PCI HiFi2 (Medfield, Merrifield) Platforms" 80 + tristate "PCI HiFi2 (Merrifield) Platforms" 77 81 depends on X86 && PCI 78 82 select SND_SST_IPC_PCI 79 - select SND_SOC_COMPRESS 83 + select SND_SST_ATOM_HIFI2_PLATFORM 80 84 help 81 - If you have a Intel Medfield or Merrifield/Edison platform, then 85 + If you have a Intel Merrifield/Edison platform, then 82 86 enable this option by saying Y or m. Distros will typically not 83 - enable this option: Medfield devices are not available to 84 - developers and while Merrifield/Edison can run a mainline kernel with 85 - limited functionality it will require a firmware file which 86 - is not in the standard firmware tree 87 + enable this option: while Merrifield/Edison can run a mainline 88 + kernel with limited functionality it will require a firmware file 89 + which is not in the standard firmware tree 87 90 88 - config SND_SST_ATOM_HIFI2_PLATFORM 91 + config SND_SST_ATOM_HIFI2_PLATFORM_ACPI 89 92 tristate "ACPI HiFi2 (Baytrail, Cherrytrail) Platforms" 93 + default ACPI 90 94 depends on X86 && ACPI 91 95 select SND_SST_IPC_ACPI 92 - select SND_SOC_COMPRESS 96 + select SND_SST_ATOM_HIFI2_PLATFORM 93 97 select SND_SOC_ACPI_INTEL_MATCH 94 98 select IOSF_MBI 95 99 help
+11 -3
sound/soc/omap/omap-dmic.c
··· 281 281 static int omap_dmic_select_fclk(struct omap_dmic *dmic, int clk_id, 282 282 unsigned int freq) 283 283 { 284 - struct clk *parent_clk; 284 + struct clk *parent_clk, *mux; 285 285 char *parent_clk_name; 286 286 int ret = 0; 287 287 ··· 329 329 return -ENODEV; 330 330 } 331 331 332 + mux = clk_get_parent(dmic->fclk); 333 + if (IS_ERR(mux)) { 334 + dev_err(dmic->dev, "can't get fck mux parent\n"); 335 + clk_put(parent_clk); 336 + return -ENODEV; 337 + } 338 + 332 339 mutex_lock(&dmic->mutex); 333 340 if (dmic->active) { 334 341 /* disable clock while reparenting */ 335 342 pm_runtime_put_sync(dmic->dev); 336 - ret = clk_set_parent(dmic->fclk, parent_clk); 343 + ret = clk_set_parent(mux, parent_clk); 337 344 pm_runtime_get_sync(dmic->dev); 338 345 } else { 339 - ret = clk_set_parent(dmic->fclk, parent_clk); 346 + ret = clk_set_parent(mux, parent_clk); 340 347 } 341 348 mutex_unlock(&dmic->mutex); 342 349 ··· 356 349 dmic->fclk_freq = freq; 357 350 358 351 err_busy: 352 + clk_put(mux); 359 353 clk_put(parent_clk); 360 354 361 355 return ret;
+2 -2
sound/soc/sh/rcar/core.c
··· 1573 1573 return ret; 1574 1574 } 1575 1575 1576 - static int rsnd_suspend(struct device *dev) 1576 + static int __maybe_unused rsnd_suspend(struct device *dev) 1577 1577 { 1578 1578 struct rsnd_priv *priv = dev_get_drvdata(dev); 1579 1579 ··· 1582 1582 return 0; 1583 1583 } 1584 1584 1585 - static int rsnd_resume(struct device *dev) 1585 + static int __maybe_unused rsnd_resume(struct device *dev) 1586 1586 { 1587 1587 struct rsnd_priv *priv = dev_get_drvdata(dev); 1588 1588
+6 -2
sound/soc/soc-topology.c
··· 1325 1325 ec->hdr.name); 1326 1326 1327 1327 kc[i].name = kstrdup(ec->hdr.name, GFP_KERNEL); 1328 - if (kc[i].name == NULL) 1328 + if (kc[i].name == NULL) { 1329 + kfree(se); 1329 1330 goto err_se; 1331 + } 1330 1332 kc[i].private_value = (long)se; 1331 1333 kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1332 1334 kc[i].access = ec->hdr.access; ··· 1444 1442 be->hdr.name, be->hdr.access); 1445 1443 1446 1444 kc[i].name = kstrdup(be->hdr.name, GFP_KERNEL); 1447 - if (kc[i].name == NULL) 1445 + if (kc[i].name == NULL) { 1446 + kfree(sbe); 1448 1447 goto err; 1448 + } 1449 1449 kc[i].private_value = (long)sbe; 1450 1450 kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1451 1451 kc[i].access = be->hdr.access;