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

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

Pull sound fixes from Takashi Iwai:
"This became a relative big update as it includes the collected ASoC
fixes. There are a few fixes in ASoC core side, mostly for DAPM and
the new topology API. The rest are various ASoC driver-specific
fixes, as well as the usual HD-audio and USB-audio quirks"

* tag 'sound-4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits)
ALSA: hda - Fix MacBook Pro 5,2 quirk
ALSA: hda - Fix race between PM ops and HDA init/probe
ALSA: usb-audio: add dB range mapping for some devices
ALSA: hda - Apply a fixup to Dell Vostro 5480
ALSA: hda - Add pin quirk for the headset mic jack detection on Dell laptop
ALSA: hda - Apply fixup for another Toshiba Satellite S50D
ALSA: fireworks: add support for AudioFire2 quirk
ALSA: hda - Fix the headset mic that will not work on Dell desktop machine
ALSA: hda - fix cs4210_spdif_automute()
ASoC: pcm1681: Fix setting de-emphasis sampling rate selection
ASoC: ssm4567: Keep TDM_BCLKS in ssm4567_set_dai_fmt
ASoC: sgtl5000: Fix up define for SGTL5000_SMALL_POP
ASoC: dapm: Don't add prefix to widget stream name
ASoC: rt5645: Check if codec is initialized in workqueue handler
ASoC: Intel: Get correct usage_count value to load firmware
ASoC: topology: Fix to add dapm mixer info
ASoC: zx: spdif: Fix devm_ioremap_resource return value check
ASoC: zx: i2s: Fix devm_ioremap_resource return value check
ASoC: mediatek: Use platform_of_node for machine drivers
ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
...

+164 -69
+2
Documentation/devicetree/bindings/sound/mt8173-max98090.txt
··· 3 3 Required properties: 4 4 - compatible : "mediatek,mt8173-max98090" 5 5 - mediatek,audio-codec: the phandle of the MAX98090 audio codec 6 + - mediatek,platform: the phandle of MT8173 ASoC platform 6 7 7 8 Example: 8 9 9 10 sound { 10 11 compatible = "mediatek,mt8173-max98090"; 11 12 mediatek,audio-codec = <&max98090>; 13 + mediatek,platform = <&afe>; 12 14 }; 13 15
+2
Documentation/devicetree/bindings/sound/mt8173-rt5650-rt5676.txt
··· 3 3 Required properties: 4 4 - compatible : "mediatek,mt8173-rt5650-rt5676" 5 5 - mediatek,audio-codec: the phandles of rt5650 and rt5676 codecs 6 + - mediatek,platform: the phandle of MT8173 ASoC platform 6 7 7 8 Example: 8 9 9 10 sound { 10 11 compatible = "mediatek,mt8173-rt5650-rt5676"; 11 12 mediatek,audio-codec = <&rt5650 &rt5676>; 13 + mediatek,platform = <&afe>; 12 14 }; 13 15
+2 -2
include/uapi/sound/asoc.h
··· 110 110 111 111 /* 112 112 * Block Header. 113 - * This header preceeds all object and object arrays below. 113 + * This header precedes all object and object arrays below. 114 114 */ 115 115 struct snd_soc_tplg_hdr { 116 116 __le32 magic; /* magic number */ ··· 222 222 /* 223 223 * Manifest. List totals for each payload type. Not used in parsing, but will 224 224 * be passed to the component driver before any other objects in order for any 225 - * global componnent resource allocations. 225 + * global component resource allocations. 226 226 * 227 227 * File block representation for manifest :- 228 228 * +-----------------------------------+----+
+2
sound/firewire/fireworks/fireworks.c
··· 248 248 err = get_hardware_info(efw); 249 249 if (err < 0) 250 250 goto error; 251 + if (entry->model_id == MODEL_ECHO_AUDIOFIRE_2) 252 + efw->is_af2 = true; 251 253 if (entry->model_id == MODEL_ECHO_AUDIOFIRE_9) 252 254 efw->is_af9 = true; 253 255
+1
sound/firewire/fireworks/fireworks.h
··· 70 70 bool resp_addr_changable; 71 71 72 72 /* for quirks */ 73 + bool is_af2; 73 74 bool is_af9; 74 75 u32 firmware_version; 75 76
+3
sound/firewire/fireworks/fireworks_stream.c
··· 172 172 efw->tx_stream.flags |= CIP_DBC_IS_END_EVENT; 173 173 /* Fireworks reset dbc at bus reset. */ 174 174 efw->tx_stream.flags |= CIP_SKIP_DBC_ZERO_CHECK; 175 + /* AudioFire2 starts packets with non-zero dbc. */ 176 + if (efw->is_af2) 177 + efw->tx_stream.flags |= CIP_SKIP_INIT_DBC_CHECK; 175 178 /* AudioFire9 always reports wrong dbs. */ 176 179 if (efw->is_af9) 177 180 efw->tx_stream.flags |= CIP_WRONG_DBS;
+3 -3
sound/pci/hda/hda_intel.c
··· 867 867 868 868 chip = card->private_data; 869 869 hda = container_of(chip, struct hda_intel, chip); 870 - if (chip->disabled || hda->init_failed) 870 + if (chip->disabled || hda->init_failed || !chip->running) 871 871 return 0; 872 872 873 873 bus = azx_bus(chip); ··· 902 902 903 903 chip = card->private_data; 904 904 hda = container_of(chip, struct hda_intel, chip); 905 - if (chip->disabled || hda->init_failed) 905 + if (chip->disabled || hda->init_failed || !chip->running) 906 906 return 0; 907 907 908 908 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL ··· 1027 1027 return 0; 1028 1028 1029 1029 if (!power_save_controller || !azx_has_pm_runtime(chip) || 1030 - azx_bus(chip)->codec_powered) 1030 + azx_bus(chip)->codec_powered || !chip->running) 1031 1031 return -EBUSY; 1032 1032 1033 1033 return 0;
+1 -3
sound/pci/hda/patch_cirrus.c
··· 999 999 1000 1000 spec->spdif_present = spdif_present; 1001 1001 /* SPDIF TX on/off */ 1002 - if (spdif_present) 1003 - snd_hda_set_pin_ctl(codec, spdif_pin, 1004 - spdif_present ? PIN_OUT : 0); 1002 + snd_hda_set_pin_ctl(codec, spdif_pin, spdif_present ? PIN_OUT : 0); 1005 1003 1006 1004 cs_automute(codec); 1007 1005 }
+35 -5
sound/pci/hda/patch_realtek.c
··· 2222 2222 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), 2223 2223 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 2224 2224 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 2225 - SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), 2225 + SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), 2226 2226 2227 2227 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2228 2228 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), ··· 5185 5185 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5186 5186 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5187 5187 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), 5188 + SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), 5188 5189 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 5189 5190 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5190 5191 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), ··· 5399 5398 {0x19, 0x411111f0}, \ 5400 5399 {0x1a, 0x411111f0}, \ 5401 5400 {0x1b, 0x411111f0}, \ 5402 - {0x1d, 0x40700001}, \ 5403 - {0x1e, 0x411111f0}, \ 5404 5401 {0x21, 0x02211020} 5405 5402 5406 5403 #define ALC282_STANDARD_PINS \ ··· 5472 5473 {0x1e, 0x411111f0}, 5473 5474 {0x21, 0x0221103f}), 5474 5475 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5476 + {0x12, 0x40000000}, 5477 + {0x14, 0x90170150}, 5478 + {0x17, 0x411111f0}, 5479 + {0x18, 0x411111f0}, 5480 + {0x19, 0x411111f0}, 5481 + {0x1a, 0x411111f0}, 5482 + {0x1b, 0x02011020}, 5483 + {0x1d, 0x4054c029}, 5484 + {0x1e, 0x411111f0}, 5485 + {0x21, 0x0221105f}), 5486 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5487 + {0x12, 0x40000000}, 5488 + {0x14, 0x90170110}, 5489 + {0x17, 0x411111f0}, 5490 + {0x18, 0x411111f0}, 5491 + {0x19, 0x411111f0}, 5492 + {0x1a, 0x411111f0}, 5493 + {0x1b, 0x01014020}, 5494 + {0x1d, 0x4054c029}, 5495 + {0x1e, 0x411111f0}, 5496 + {0x21, 0x0221101f}), 5497 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5475 5498 {0x12, 0x90a60160}, 5476 5499 {0x14, 0x90170120}, 5477 5500 {0x17, 0x90170140}, ··· 5555 5534 {0x21, 0x02211030}), 5556 5535 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5557 5536 ALC256_STANDARD_PINS, 5558 - {0x13, 0x40000000}), 5537 + {0x13, 0x40000000}, 5538 + {0x1d, 0x40700001}, 5539 + {0x1e, 0x411111f0}), 5559 5540 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5560 5541 ALC256_STANDARD_PINS, 5561 - {0x13, 0x411111f0}), 5542 + {0x13, 0x411111f0}, 5543 + {0x1d, 0x40700001}, 5544 + {0x1e, 0x411111f0}), 5545 + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5546 + ALC256_STANDARD_PINS, 5547 + {0x13, 0x411111f0}, 5548 + {0x1d, 0x4077992d}, 5549 + {0x1e, 0x411111ff}), 5562 5550 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, 5563 5551 {0x12, 0x90a60130}, 5564 5552 {0x13, 0x40000000},
+2 -1
sound/pci/hda/patch_sigmatel.c
··· 2920 2920 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x148a, 2921 2921 "HP Mini", STAC_92HD83XXX_HP_LED), 2922 2922 SND_PCI_QUIRK_VENDOR(PCI_VENDOR_ID_HP, "HP", STAC_92HD83XXX_HP), 2923 - SND_PCI_QUIRK(PCI_VENDOR_ID_TOSHIBA, 0xfa91, 2923 + /* match both for 0xfa91 and 0xfa93 */ 2924 + SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_TOSHIBA, 0xfffd, 0xfa91, 2924 2925 "Toshiba Satellite S50D", STAC_92HD83XXX_GPIO10_EAPD), 2925 2926 {} /* terminator */ 2926 2927 };
+1 -1
sound/soc/codecs/pcm1681.c
··· 102 102 103 103 if (val != -1) { 104 104 regmap_update_bits(priv->regmap, PCM1681_DEEMPH_CONTROL, 105 - PCM1681_DEEMPH_RATE_MASK, val); 105 + PCM1681_DEEMPH_RATE_MASK, val << 3); 106 106 enable = 1; 107 107 } else 108 108 enable = 0;
+3
sound/soc/codecs/rt5645.c
··· 2943 2943 { 2944 2944 int val, btn_type, gpio_state = 0, report = 0; 2945 2945 2946 + if (!rt5645->codec) 2947 + return -EINVAL; 2948 + 2946 2949 switch (rt5645->pdata.jd_mode) { 2947 2950 case 0: /* Not using rt5645 JD */ 2948 2951 if (rt5645->gpiod_hp_det) {
+1 -1
sound/soc/codecs/sgtl5000.h
··· 275 275 #define SGTL5000_BIAS_CTRL_MASK 0x000e 276 276 #define SGTL5000_BIAS_CTRL_SHIFT 1 277 277 #define SGTL5000_BIAS_CTRL_WIDTH 3 278 - #define SGTL5000_SMALL_POP 0 278 + #define SGTL5000_SMALL_POP 1 279 279 280 280 /* 281 281 * SGTL5000_CHIP_MIC_CTRL
+7 -1
sound/soc/codecs/ssm4567.c
··· 315 315 if (invert_fclk) 316 316 ctrl1 |= SSM4567_SAI_CTRL_1_FSYNC; 317 317 318 - return regmap_write(ssm4567->regmap, SSM4567_REG_SAI_CTRL_1, ctrl1); 318 + return regmap_update_bits(ssm4567->regmap, SSM4567_REG_SAI_CTRL_1, 319 + SSM4567_SAI_CTRL_1_BCLK | 320 + SSM4567_SAI_CTRL_1_FSYNC | 321 + SSM4567_SAI_CTRL_1_LJ | 322 + SSM4567_SAI_CTRL_1_TDM | 323 + SSM4567_SAI_CTRL_1_PDM, 324 + ctrl1); 319 325 } 320 326 321 327 static int ssm4567_set_power(struct ssm4567 *ssm4567, bool enable)
+1 -1
sound/soc/fsl/fsl_ssi.c
··· 633 633 sub *= 100000; 634 634 do_div(sub, freq); 635 635 636 - if (sub < savesub) { 636 + if (sub < savesub && !(i == 0 && psr == 0 && div2 == 0)) { 637 637 baudrate = tmprate; 638 638 savesub = sub; 639 639 pm = i;
+1 -1
sound/soc/intel/Makefile
··· 7 7 obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += atom/ 8 8 9 9 # Machine support 10 - obj-$(CONFIG_SND_SOC_INTEL_SST) += boards/ 10 + obj-$(CONFIG_SND_SOC) += boards/
+7 -7
sound/soc/intel/atom/sst/sst_drv_interface.c
··· 42 42 #define MIN_FRAGMENT_SIZE (50 * 1024) 43 43 #define MAX_FRAGMENT_SIZE (1024 * 1024) 44 44 #define SST_GET_BYTES_PER_SAMPLE(pcm_wd_sz) (((pcm_wd_sz + 15) >> 4) << 1) 45 + #ifdef CONFIG_PM 46 + #define GET_USAGE_COUNT(dev) (atomic_read(&dev->power.usage_count)) 47 + #else 48 + #define GET_USAGE_COUNT(dev) 1 49 + #endif 45 50 46 51 int free_stream_context(struct intel_sst_drv *ctx, unsigned int str_id) 47 52 { ··· 146 141 int ret = 0; 147 142 int usage_count = 0; 148 143 149 - #ifdef CONFIG_PM 150 - usage_count = atomic_read(&dev->power.usage_count); 151 - #else 152 - usage_count = 1; 153 - #endif 154 - 155 144 if (state == true) { 156 145 ret = pm_runtime_get_sync(dev); 157 - 146 + usage_count = GET_USAGE_COUNT(dev); 158 147 dev_dbg(ctx->dev, "Enable: pm usage count: %d\n", usage_count); 159 148 if (ret < 0) { 160 149 dev_err(ctx->dev, "Runtime get failed with err: %d\n", ret); ··· 163 164 } 164 165 } 165 166 } else { 167 + usage_count = GET_USAGE_COUNT(dev); 166 168 dev_dbg(ctx->dev, "Disable: pm usage count: %d\n", usage_count); 167 169 return sst_pm_runtime_put(ctx); 168 170 }
+2 -2
sound/soc/intel/boards/cht_bsw_max98090_ti.c
··· 69 69 {"Headphone", NULL, "HPR"}, 70 70 {"Ext Spk", NULL, "SPKL"}, 71 71 {"Ext Spk", NULL, "SPKR"}, 72 - {"AIF1 Playback", NULL, "ssp2 Tx"}, 72 + {"HiFi Playback", NULL, "ssp2 Tx"}, 73 73 {"ssp2 Tx", NULL, "codec_out0"}, 74 74 {"ssp2 Tx", NULL, "codec_out1"}, 75 75 {"codec_in0", NULL, "ssp2 Rx" }, 76 76 {"codec_in1", NULL, "ssp2 Rx" }, 77 - {"ssp2 Rx", NULL, "AIF1 Capture"}, 77 + {"ssp2 Rx", NULL, "HiFi Capture"}, 78 78 }; 79 79 80 80 static const struct snd_kcontrol_new cht_mc_controls[] = {
+13 -4
sound/soc/mediatek/mt8173-max98090.c
··· 103 103 .name = "MAX98090 Playback", 104 104 .stream_name = "MAX98090 Playback", 105 105 .cpu_dai_name = "DL1", 106 - .platform_name = "11220000.mt8173-afe-pcm", 107 106 .codec_name = "snd-soc-dummy", 108 107 .codec_dai_name = "snd-soc-dummy-dai", 109 108 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, ··· 113 114 .name = "MAX98090 Capture", 114 115 .stream_name = "MAX98090 Capture", 115 116 .cpu_dai_name = "VUL", 116 - .platform_name = "11220000.mt8173-afe-pcm", 117 117 .codec_name = "snd-soc-dummy", 118 118 .codec_dai_name = "snd-soc-dummy-dai", 119 119 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, ··· 123 125 { 124 126 .name = "Codec", 125 127 .cpu_dai_name = "I2S", 126 - .platform_name = "11220000.mt8173-afe-pcm", 127 128 .no_pcm = 1, 128 129 .codec_dai_name = "HiFi", 129 130 .init = mt8173_max98090_init, ··· 149 152 static int mt8173_max98090_dev_probe(struct platform_device *pdev) 150 153 { 151 154 struct snd_soc_card *card = &mt8173_max98090_card; 152 - struct device_node *codec_node; 155 + struct device_node *codec_node, *platform_node; 153 156 int ret, i; 157 + 158 + platform_node = of_parse_phandle(pdev->dev.of_node, 159 + "mediatek,platform", 0); 160 + if (!platform_node) { 161 + dev_err(&pdev->dev, "Property 'platform' missing or invalid\n"); 162 + return -EINVAL; 163 + } 164 + for (i = 0; i < card->num_links; i++) { 165 + if (mt8173_max98090_dais[i].platform_name) 166 + continue; 167 + mt8173_max98090_dais[i].platform_of_node = platform_node; 168 + } 154 169 155 170 codec_node = of_parse_phandle(pdev->dev.of_node, 156 171 "mediatek,audio-codec", 0);
+15 -4
sound/soc/mediatek/mt8173-rt5650-rt5676.c
··· 138 138 .name = "rt5650_rt5676 Playback", 139 139 .stream_name = "rt5650_rt5676 Playback", 140 140 .cpu_dai_name = "DL1", 141 - .platform_name = "11220000.mt8173-afe-pcm", 142 141 .codec_name = "snd-soc-dummy", 143 142 .codec_dai_name = "snd-soc-dummy-dai", 144 143 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, ··· 148 149 .name = "rt5650_rt5676 Capture", 149 150 .stream_name = "rt5650_rt5676 Capture", 150 151 .cpu_dai_name = "VUL", 151 - .platform_name = "11220000.mt8173-afe-pcm", 152 152 .codec_name = "snd-soc-dummy", 153 153 .codec_dai_name = "snd-soc-dummy-dai", 154 154 .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, ··· 159 161 { 160 162 .name = "Codec", 161 163 .cpu_dai_name = "I2S", 162 - .platform_name = "11220000.mt8173-afe-pcm", 163 164 .no_pcm = 1, 164 165 .codecs = mt8173_rt5650_rt5676_codecs, 165 166 .num_codecs = 2, ··· 206 209 static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev) 207 210 { 208 211 struct snd_soc_card *card = &mt8173_rt5650_rt5676_card; 209 - int ret; 212 + struct device_node *platform_node; 213 + int i, ret; 214 + 215 + platform_node = of_parse_phandle(pdev->dev.of_node, 216 + "mediatek,platform", 0); 217 + if (!platform_node) { 218 + dev_err(&pdev->dev, "Property 'platform' missing or invalid\n"); 219 + return -EINVAL; 220 + } 221 + 222 + for (i = 0; i < card->num_links; i++) { 223 + if (mt8173_rt5650_rt5676_dais[i].platform_name) 224 + continue; 225 + mt8173_rt5650_rt5676_dais[i].platform_of_node = platform_node; 226 + } 210 227 211 228 mt8173_rt5650_rt5676_codecs[0].of_node = 212 229 of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 0);
+2
sound/soc/mediatek/mtk-afe-pcm.c
··· 1199 1199 static int mtk_afe_pcm_dev_remove(struct platform_device *pdev) 1200 1200 { 1201 1201 pm_runtime_disable(&pdev->dev); 1202 + if (!pm_runtime_status_suspended(&pdev->dev)) 1203 + mtk_afe_runtime_suspend(&pdev->dev); 1202 1204 snd_soc_unregister_component(&pdev->dev); 1203 1205 snd_soc_unregister_platform(&pdev->dev); 1204 1206 return 0;
+1
sound/soc/soc-core.c
··· 1716 1716 if (card->remove) 1717 1717 card->remove(card); 1718 1718 1719 + snd_soc_dapm_free(&card->dapm); 1719 1720 soc_cleanup_card_debugfs(card); 1720 1721 snd_card_free(card->snd_card); 1721 1722
+18 -17
sound/soc/soc-dapm.c
··· 358 358 data->widget = 359 359 snd_soc_dapm_new_control_unlocked(widget->dapm, 360 360 &template); 361 + kfree(name); 361 362 if (!data->widget) { 362 363 ret = -ENOMEM; 363 - goto err_name; 364 + goto err_data; 364 365 } 365 366 } 366 367 break; ··· 390 389 391 390 data->value = template.on_val; 392 391 393 - data->widget = snd_soc_dapm_new_control(widget->dapm, 394 - &template); 392 + data->widget = snd_soc_dapm_new_control_unlocked( 393 + widget->dapm, &template); 394 + kfree(name); 395 395 if (!data->widget) { 396 396 ret = -ENOMEM; 397 - goto err_name; 397 + goto err_data; 398 398 } 399 399 400 400 snd_soc_dapm_add_path(widget->dapm, data->widget, ··· 410 408 411 409 return 0; 412 410 413 - err_name: 414 - kfree(name); 415 411 err_data: 416 412 kfree(data); 417 413 return ret; ··· 418 418 static void dapm_kcontrol_free(struct snd_kcontrol *kctl) 419 419 { 420 420 struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl); 421 - if (data->widget) 422 - kfree(data->widget->name); 423 421 kfree(data->wlist); 424 422 kfree(data); 425 423 } ··· 1950 1952 size_t count, loff_t *ppos) 1951 1953 { 1952 1954 struct snd_soc_dapm_widget *w = file->private_data; 1955 + struct snd_soc_card *card = w->dapm->card; 1953 1956 char *buf; 1954 1957 int in, out; 1955 1958 ssize_t ret; ··· 1959 1960 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 1960 1961 if (!buf) 1961 1962 return -ENOMEM; 1963 + 1964 + mutex_lock(&card->dapm_mutex); 1962 1965 1963 1966 /* Supply widgets are not handled by is_connected_{input,output}_ep() */ 1964 1967 if (w->is_supply) { ··· 2007 2006 p->name ? p->name : "static", 2008 2007 p->sink->name); 2009 2008 } 2009 + 2010 + mutex_unlock(&card->dapm_mutex); 2010 2011 2011 2012 ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); 2012 2013 ··· 2284 2281 struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); 2285 2282 int i, count = 0; 2286 2283 2284 + mutex_lock(&rtd->card->dapm_mutex); 2285 + 2287 2286 for (i = 0; i < rtd->num_codecs; i++) { 2288 2287 struct snd_soc_codec *codec = rtd->codec_dais[i]->codec; 2289 2288 count += dapm_widget_show_codec(codec, buf + count); 2290 2289 } 2290 + 2291 + mutex_unlock(&rtd->card->dapm_mutex); 2291 2292 2292 2293 return count; 2293 2294 } ··· 3341 3334 } 3342 3335 3343 3336 prefix = soc_dapm_prefix(dapm); 3344 - if (prefix) { 3337 + if (prefix) 3345 3338 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); 3346 - if (widget->sname) 3347 - w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix, 3348 - widget->sname); 3349 - } else { 3339 + else 3350 3340 w->name = kasprintf(GFP_KERNEL, "%s", widget->name); 3351 - if (widget->sname) 3352 - w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname); 3353 - } 3354 3341 if (w->name == NULL) { 3355 3342 kfree(w); 3356 3343 return NULL; ··· 3793 3792 break; 3794 3793 } 3795 3794 3796 - if (!w->sname || !strstr(w->sname, dai_w->name)) 3795 + if (!w->sname || !strstr(w->sname, dai_w->sname)) 3797 3796 continue; 3798 3797 3799 3798 if (dai_w->id == snd_soc_dapm_dai_in) {
+11 -12
sound/soc/soc-topology.c
··· 144 144 {SND_SOC_TPLG_CTL_STROBE, snd_soc_get_strobe, 145 145 snd_soc_put_strobe, NULL}, 146 146 {SND_SOC_TPLG_DAPM_CTL_VOLSW, snd_soc_dapm_get_volsw, 147 - snd_soc_dapm_put_volsw, NULL}, 147 + snd_soc_dapm_put_volsw, snd_soc_info_volsw}, 148 148 {SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE, snd_soc_dapm_get_enum_double, 149 149 snd_soc_dapm_put_enum_double, snd_soc_info_enum_double}, 150 150 {SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT, snd_soc_dapm_get_enum_double, ··· 580 580 } 581 581 582 582 static int soc_tplg_create_tlv(struct soc_tplg *tplg, 583 - struct snd_kcontrol_new *kc, u32 tlv_size) 583 + struct snd_kcontrol_new *kc, struct snd_soc_tplg_ctl_tlv *tplg_tlv) 584 584 { 585 - struct snd_soc_tplg_ctl_tlv *tplg_tlv; 586 585 struct snd_ctl_tlv *tlv; 586 + int size; 587 587 588 - if (tlv_size == 0) 588 + if (tplg_tlv->count == 0) 589 589 return 0; 590 590 591 - tplg_tlv = (struct snd_soc_tplg_ctl_tlv *) tplg->pos; 592 - tplg->pos += tlv_size; 593 - 594 - tlv = kzalloc(sizeof(*tlv) + tlv_size, GFP_KERNEL); 591 + size = ((tplg_tlv->count + (sizeof(unsigned int) - 1)) & 592 + ~(sizeof(unsigned int) - 1)); 593 + tlv = kzalloc(sizeof(*tlv) + size, GFP_KERNEL); 595 594 if (tlv == NULL) 596 595 return -ENOMEM; 597 596 598 597 dev_dbg(tplg->dev, " created TLV type %d size %d bytes\n", 599 - tplg_tlv->numid, tplg_tlv->size); 598 + tplg_tlv->numid, size); 600 599 601 600 tlv->numid = tplg_tlv->numid; 602 - tlv->length = tplg_tlv->size; 603 - memcpy(tlv->tlv, tplg_tlv + 1, tplg_tlv->size); 601 + tlv->length = size; 602 + memcpy(&tlv->tlv[0], tplg_tlv->data, size); 604 603 kc->tlv.p = (void *)tlv; 605 604 606 605 return 0; ··· 772 773 } 773 774 774 775 /* create any TLV data */ 775 - soc_tplg_create_tlv(tplg, &kc, mc->hdr.tlv_size); 776 + soc_tplg_create_tlv(tplg, &kc, &mc->tlv); 776 777 777 778 /* register control here */ 778 779 err = soc_tplg_add_kcontrol(tplg, &kc,
+2 -2
sound/soc/zte/zx296702-i2s.c
··· 393 393 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 394 394 zx_i2s->mapbase = res->start; 395 395 zx_i2s->reg_base = devm_ioremap_resource(&pdev->dev, res); 396 - if (!zx_i2s->reg_base) { 396 + if (IS_ERR(zx_i2s->reg_base)) { 397 397 dev_err(&pdev->dev, "ioremap failed!\n"); 398 - return -EIO; 398 + return PTR_ERR(zx_i2s->reg_base); 399 399 } 400 400 401 401 writel_relaxed(0, zx_i2s->reg_base + ZX_I2S_FIFO_CTRL);
+2 -2
sound/soc/zte/zx296702-spdif.c
··· 322 322 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 323 323 zx_spdif->mapbase = res->start; 324 324 zx_spdif->reg_base = devm_ioremap_resource(&pdev->dev, res); 325 - if (!zx_spdif->reg_base) { 325 + if (IS_ERR(zx_spdif->reg_base)) { 326 326 dev_err(&pdev->dev, "ioremap failed!\n"); 327 - return -EIO; 327 + return PTR_ERR(zx_spdif->reg_base); 328 328 } 329 329 330 330 zx_spdif_dev_init(zx_spdif->reg_base);
+24
sound/usb/mixer_maps.c
··· 341 341 { 0 } 342 342 }; 343 343 344 + /* Bose companion 5, the dB conversion factor is 16 instead of 256 */ 345 + static struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; 346 + static struct usbmix_name_map bose_companion5_map[] = { 347 + { 3, NULL, .dB = &bose_companion5_dB }, 348 + { 0 } /* terminator */ 349 + }; 350 + 351 + /* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */ 352 + static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000}; 353 + static struct usbmix_name_map dragonfly_1_2_map[] = { 354 + { 7, NULL, .dB = &dragonfly_1_2_dB }, 355 + { 0 } /* terminator */ 356 + }; 357 + 344 358 /* 345 359 * Control map entries 346 360 */ ··· 464 450 /* Arcam rPAC */ 465 451 .id = USB_ID(0x25c4, 0x0003), 466 452 .map = scms_usb3318_map, 453 + }, 454 + { 455 + /* Bose Companion 5 */ 456 + .id = USB_ID(0x05a7, 0x1020), 457 + .map = bose_companion5_map, 458 + }, 459 + { 460 + /* Dragonfly DAC 1.2 */ 461 + .id = USB_ID(0x21b4, 0x0081), 462 + .map = dragonfly_1_2_map, 467 463 }, 468 464 { 0 } /* terminator */ 469 465 };