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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull sound fixes from Takashi Iwai:
"The only bulk changes in this request is ABI updates for ASoC topology
API. It's a new API that was introduced in 4.2, and we'd like to
avoid ABI change after the release, so it's taken now. As there is no
real in-tree user for this API, it should be fairly safe.

Other than that, the usual small fixes are found in various drivers:
ASoC cs4265, rt5645, intel-sst, firewire, oxygen and HD-audio"

* tag 'sound-4.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ASoC: topology: Add private data type and bump ABI version to 3
ASoC: topology: Add ops support to byte controls UAPI
ASoC: topology: Update TLV support so we can support more TLV types
ASoC: topology: add private data to manifest
ASoC: topology: Add subsequence in topology
ALSA: hda - one Dell machine needs the headphone white noise fixup
ALSA: fireworks/firewire-lib: add support for recent firmware quirk
Revert "ALSA: fireworks: add support for AudioFire2 quirk"
ASoC: topology: fix typo in soc_tplg_kcontrol_bind_io()
ALSA: HDA: Dont check return for snd_hdac_chip_readl
ALSA: HDA: Fix stream assignment for host in decoupled mode
ASoC: rt5645: Fix lost pin setting for DMIC1
ALSA: oxygen: Fix logical-not-parentheses warning
ASoC: Intel: sst_byt: fix initialize 'NULL device *' issue
ASoC: Intel: haswell: fix initialize 'NULL device *' issue
ASoC: cs4265: Fix setting dai format for Left/Right Justified

+109 -51
+24 -11
include/uapi/sound/asoc.h
··· 77 77 #define SND_SOC_TPLG_NUM_TEXTS 16 78 78 79 79 /* ABI version */ 80 - #define SND_SOC_TPLG_ABI_VERSION 0x2 80 + #define SND_SOC_TPLG_ABI_VERSION 0x3 81 81 82 82 /* Max size of TLV data */ 83 83 #define SND_SOC_TPLG_TLV_SIZE 32 ··· 97 97 #define SND_SOC_TPLG_TYPE_PCM 7 98 98 #define SND_SOC_TPLG_TYPE_MANIFEST 8 99 99 #define SND_SOC_TPLG_TYPE_CODEC_LINK 9 100 - #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_CODEC_LINK 100 + #define SND_SOC_TPLG_TYPE_PDATA 10 101 + #define SND_SOC_TPLG_TYPE_MAX SND_SOC_TPLG_TYPE_PDATA 101 102 102 103 /* vendor block IDs - please add new vendor types to end */ 103 104 #define SND_SOC_TPLG_TYPE_VENDOR_FW 1000 ··· 138 137 /* 139 138 * Kcontrol TLV data. 140 139 */ 140 + struct snd_soc_tplg_tlv_dbscale { 141 + __le32 min; 142 + __le32 step; 143 + __le32 mute; 144 + } __attribute__((packed)); 145 + 141 146 struct snd_soc_tplg_ctl_tlv { 142 - __le32 size; /* in bytes aligned to 4 */ 143 - __le32 numid; /* control element numeric identification */ 144 - __le32 count; /* number of elem in data array */ 145 - __le32 data[SND_SOC_TPLG_TLV_SIZE]; 147 + __le32 size; /* in bytes of this structure */ 148 + __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */ 149 + union { 150 + __le32 data[SND_SOC_TPLG_TLV_SIZE]; 151 + struct snd_soc_tplg_tlv_dbscale scale; 152 + }; 146 153 } __attribute__((packed)); 147 154 148 155 /* ··· 164 155 } __attribute__((packed)); 165 156 166 157 /* 167 - * Kcontrol Operations IDs 158 + * Genericl Operations IDs, for binding Kcontrol or Bytes ext ops 159 + * Kcontrol ops need get/put/info. 160 + * Bytes ext ops need get/put. 168 161 */ 169 - struct snd_soc_tplg_kcontrol_ops_id { 162 + struct snd_soc_tplg_io_ops { 170 163 __le32 get; 171 164 __le32 put; 172 165 __le32 info; ··· 182 171 __le32 type; 183 172 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 184 173 __le32 access; 185 - struct snd_soc_tplg_kcontrol_ops_id ops; 186 - __le32 tlv_size; /* non zero means control has TLV data */ 174 + struct snd_soc_tplg_io_ops ops; 175 + struct snd_soc_tplg_ctl_tlv tlv; 187 176 } __attribute__((packed)); 188 177 189 178 /* ··· 249 238 __le32 graph_elems; /* number of graph elements */ 250 239 __le32 dai_elems; /* number of DAI elements */ 251 240 __le32 dai_link_elems; /* number of DAI link elements */ 241 + struct snd_soc_tplg_private priv; 252 242 } __attribute__((packed)); 253 243 254 244 /* ··· 271 259 __le32 invert; 272 260 __le32 num_channels; 273 261 struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN]; 274 - struct snd_soc_tplg_ctl_tlv tlv; 275 262 struct snd_soc_tplg_private priv; 276 263 } __attribute__((packed)); 277 264 ··· 314 303 __le32 mask; 315 304 __le32 base; 316 305 __le32 num_regs; 306 + struct snd_soc_tplg_io_ops ext_ops; 317 307 struct snd_soc_tplg_private priv; 318 308 } __attribute__((packed)); 319 309 ··· 359 347 __le32 reg; /* negative reg = no direct dapm */ 360 348 __le32 shift; /* bits to shift */ 361 349 __le32 mask; /* non-shifted mask */ 350 + __le32 subseq; /* sort within widget type */ 362 351 __u32 invert; /* invert the power bit */ 363 352 __u32 ignore_suspend; /* kept enabled over suspend */ 364 353 __u16 event_flags;
+3 -2
sound/firewire/amdtp.c
··· 740 740 s->data_block_counter != UINT_MAX) 741 741 data_block_counter = s->data_block_counter; 742 742 743 - if (((s->flags & CIP_SKIP_DBC_ZERO_CHECK) && data_block_counter == 0) || 744 - (s->data_block_counter == UINT_MAX)) { 743 + if (((s->flags & CIP_SKIP_DBC_ZERO_CHECK) && 744 + data_block_counter == s->tx_first_dbc) || 745 + s->data_block_counter == UINT_MAX) { 745 746 lost = false; 746 747 } else if (!(s->flags & CIP_DBC_IS_END_EVENT)) { 747 748 lost = data_block_counter != s->data_block_counter;
+2
sound/firewire/amdtp.h
··· 157 157 158 158 /* quirk: fixed interval of dbc between previos/current packets. */ 159 159 unsigned int tx_dbc_interval; 160 + /* quirk: indicate the value of dbc field in a first packet. */ 161 + unsigned int tx_first_dbc; 160 162 161 163 bool callbacked; 162 164 wait_queue_head_t callback_wait;
+8 -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 + /* AudioFire8 (since 2009) and AudioFirePre8 */ 253 252 if (entry->model_id == MODEL_ECHO_AUDIOFIRE_9) 254 253 efw->is_af9 = true; 254 + /* These models uses the same firmware. */ 255 + if (entry->model_id == MODEL_ECHO_AUDIOFIRE_2 || 256 + entry->model_id == MODEL_ECHO_AUDIOFIRE_4 || 257 + entry->model_id == MODEL_ECHO_AUDIOFIRE_9 || 258 + entry->model_id == MODEL_GIBSON_RIP || 259 + entry->model_id == MODEL_GIBSON_GOLDTOP) 260 + efw->is_fireworks3 = true; 255 261 256 262 snd_efw_proc_init(efw); 257 263
+1 -1
sound/firewire/fireworks/fireworks.h
··· 70 70 bool resp_addr_changable; 71 71 72 72 /* for quirks */ 73 - bool is_af2; 74 73 bool is_af9; 74 + bool is_fireworks3; 75 75 u32 firmware_version; 76 76 77 77 unsigned int midi_in_ports;
+9 -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 + /* 176 + * But Recent firmwares starts packets with non-zero dbc. 177 + * Driver version 5.7.6 installs firmware version 5.7.3. 178 + */ 179 + if (efw->is_fireworks3 && 180 + (efw->firmware_version == 0x5070000 || 181 + efw->firmware_version == 0x5070300 || 182 + efw->firmware_version == 0x5080000)) 183 + efw->tx_stream.tx_first_dbc = 0x02; 178 184 /* AudioFire9 always reports wrong dbs. */ 179 185 if (efw->is_af9) 180 186 efw->tx_stream.flags |= CIP_WRONG_DBS;
-6
sound/hda/ext/hdac_ext_controller.c
··· 44 44 45 45 offset = snd_hdac_chip_readl(bus, LLCH); 46 46 47 - if (offset < 0) 48 - return -EIO; 49 - 50 47 /* Lets walk the linked capabilities list */ 51 48 do { 52 49 cur_cap = _snd_hdac_chip_read(l, bus, offset); 53 - 54 - if (cur_cap < 0) 55 - return -EIO; 56 50 57 51 dev_dbg(bus->dev, "Capability version: 0x%x\n", 58 52 ((cur_cap & AZX_CAP_HDR_VER_MASK) >> AZX_CAP_HDR_VER_OFF));
+1 -1
sound/hda/ext/hdac_ext_stream.c
··· 299 299 if (stream->direction != substream->stream) 300 300 continue; 301 301 302 - if (stream->opened) { 302 + if (!stream->opened) { 303 303 if (!hstream->decoupled) 304 304 snd_hdac_ext_stream_decouple(ebus, hstream, true); 305 305 res = hstream;
+1
sound/pci/hda/patch_realtek.c
··· 5189 5189 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 5190 5190 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5191 5191 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5192 + SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC292_FIXUP_DISABLE_AAMIX), 5192 5193 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5193 5194 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5194 5195 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
+1 -1
sound/pci/oxygen/oxygen_mixer.c
··· 88 88 int changed; 89 89 90 90 mutex_lock(&chip->mutex); 91 - changed = !value->value.integer.value[0] != chip->dac_mute; 91 + changed = (!value->value.integer.value[0]) != chip->dac_mute; 92 92 if (changed) { 93 93 chip->dac_mute = !value->value.integer.value[0]; 94 94 chip->model.update_dac_mute(chip);
+5 -5
sound/soc/codecs/cs4265.c
··· 457 457 case SND_SOC_DAIFMT_RIGHT_J: 458 458 if (params_width(params) == 16) { 459 459 snd_soc_update_bits(codec, CS4265_DAC_CTL, 460 - CS4265_DAC_CTL_DIF, (1 << 5)); 460 + CS4265_DAC_CTL_DIF, (2 << 4)); 461 461 snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 462 - CS4265_SPDIF_CTL2_DIF, (1 << 7)); 462 + CS4265_SPDIF_CTL2_DIF, (2 << 6)); 463 463 } else { 464 464 snd_soc_update_bits(codec, CS4265_DAC_CTL, 465 - CS4265_DAC_CTL_DIF, (3 << 5)); 465 + CS4265_DAC_CTL_DIF, (3 << 4)); 466 466 snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 467 - CS4265_SPDIF_CTL2_DIF, (1 << 7)); 467 + CS4265_SPDIF_CTL2_DIF, (3 << 6)); 468 468 } 469 469 break; 470 470 case SND_SOC_DAIFMT_LEFT_J: ··· 473 473 snd_soc_update_bits(codec, CS4265_ADC_CTL, 474 474 CS4265_ADC_DIF, 0); 475 475 snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, 476 - CS4265_SPDIF_CTL2_DIF, (1 << 6)); 476 + CS4265_SPDIF_CTL2_DIF, 0); 477 477 478 478 break; 479 479 default:
+2
sound/soc/codecs/rt5645.c
··· 3341 3341 break; 3342 3342 3343 3343 case RT5645_DMIC_DATA_GPIO5: 3344 + regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, 3345 + RT5645_I2S2_DAC_PIN_MASK, RT5645_I2S2_DAC_PIN_GPIO); 3344 3346 regmap_update_bits(rt5645->regmap, RT5645_DMIC_CTRL1, 3345 3347 RT5645_DMIC_1_DP_MASK, RT5645_DMIC_1_DP_GPIO5); 3346 3348 regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1,
+4
sound/soc/codecs/rt5645.h
··· 1693 1693 #define RT5645_GP6_PIN_SFT 6 1694 1694 #define RT5645_GP6_PIN_GPIO6 (0x0 << 6) 1695 1695 #define RT5645_GP6_PIN_DMIC2_SDA (0x1 << 6) 1696 + #define RT5645_I2S2_DAC_PIN_MASK (0x1 << 4) 1697 + #define RT5645_I2S2_DAC_PIN_SFT 4 1698 + #define RT5645_I2S2_DAC_PIN_I2S (0x0 << 4) 1699 + #define RT5645_I2S2_DAC_PIN_GPIO (0x1 << 4) 1696 1700 #define RT5645_GP8_PIN_MASK (0x1 << 3) 1697 1701 #define RT5645_GP8_PIN_SFT 3 1698 1702 #define RT5645_GP8_PIN_GPIO8 (0x0 << 3)
+2
sound/soc/intel/baytrail/sst-baytrail-ipc.c
··· 701 701 if (byt == NULL) 702 702 return -ENOMEM; 703 703 704 + byt->dev = dev; 705 + 704 706 ipc = &byt->ipc; 705 707 ipc->dev = dev; 706 708 ipc->ops.tx_msg = byt_tx_msg;
+2
sound/soc/intel/haswell/sst-haswell-ipc.c
··· 2119 2119 if (hsw == NULL) 2120 2120 return -ENOMEM; 2121 2121 2122 + hsw->dev = dev; 2123 + 2122 2124 ipc = &hsw->ipc; 2123 2125 ipc->dev = dev; 2124 2126 ipc->ops.tx_msg = hsw_tx_msg;
+44 -19
sound/soc/soc-topology.c
··· 33 33 #include <sound/soc.h> 34 34 #include <sound/soc-dapm.h> 35 35 #include <sound/soc-topology.h> 36 + #include <sound/tlv.h> 36 37 37 38 /* 38 39 * We make several passes over the data (since it wont necessarily be ordered) ··· 535 534 k->put = bops[i].put; 536 535 if (k->get == NULL && bops[i].id == hdr->ops.get) 537 536 k->get = bops[i].get; 538 - if (k->info == NULL && ops[i].id == hdr->ops.info) 537 + if (k->info == NULL && bops[i].id == hdr->ops.info) 539 538 k->info = bops[i].info; 540 539 } 541 540 ··· 580 579 return 0; 581 580 } 582 581 583 - static int soc_tplg_create_tlv(struct soc_tplg *tplg, 584 - struct snd_kcontrol_new *kc, struct snd_soc_tplg_ctl_tlv *tplg_tlv) 582 + 583 + static int soc_tplg_create_tlv_db_scale(struct soc_tplg *tplg, 584 + struct snd_kcontrol_new *kc, struct snd_soc_tplg_tlv_dbscale *scale) 585 585 { 586 - struct snd_ctl_tlv *tlv; 587 - int size; 586 + unsigned int item_len = 2 * sizeof(unsigned int); 587 + unsigned int *p; 588 588 589 - if (tplg_tlv->count == 0) 590 - return 0; 591 - 592 - size = ((tplg_tlv->count + (sizeof(unsigned int) - 1)) & 593 - ~(sizeof(unsigned int) - 1)); 594 - tlv = kzalloc(sizeof(*tlv) + size, GFP_KERNEL); 595 - if (tlv == NULL) 589 + p = kzalloc(item_len + 2 * sizeof(unsigned int), GFP_KERNEL); 590 + if (!p) 596 591 return -ENOMEM; 597 592 598 - dev_dbg(tplg->dev, " created TLV type %d size %d bytes\n", 599 - tplg_tlv->numid, size); 593 + p[0] = SNDRV_CTL_TLVT_DB_SCALE; 594 + p[1] = item_len; 595 + p[2] = scale->min; 596 + p[3] = (scale->step & TLV_DB_SCALE_MASK) 597 + | (scale->mute ? TLV_DB_SCALE_MUTE : 0); 600 598 601 - tlv->numid = tplg_tlv->numid; 602 - tlv->length = size; 603 - memcpy(&tlv->tlv[0], tplg_tlv->data, size); 604 - kc->tlv.p = (void *)tlv; 599 + kc->tlv.p = (void *)p; 600 + return 0; 601 + } 602 + 603 + static int soc_tplg_create_tlv(struct soc_tplg *tplg, 604 + struct snd_kcontrol_new *kc, struct snd_soc_tplg_ctl_hdr *tc) 605 + { 606 + struct snd_soc_tplg_ctl_tlv *tplg_tlv; 607 + 608 + if (!(tc->access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)) 609 + return 0; 610 + 611 + if (tc->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { 612 + kc->tlv.c = snd_soc_bytes_tlv_callback; 613 + } else { 614 + tplg_tlv = &tc->tlv; 615 + switch (tplg_tlv->type) { 616 + case SNDRV_CTL_TLVT_DB_SCALE: 617 + return soc_tplg_create_tlv_db_scale(tplg, kc, 618 + &tplg_tlv->scale); 619 + 620 + /* TODO: add support for other TLV types */ 621 + default: 622 + dev_dbg(tplg->dev, "Unsupported TLV type %d\n", 623 + tplg_tlv->type); 624 + return -EINVAL; 625 + } 626 + } 605 627 606 628 return 0; 607 629 } ··· 796 772 } 797 773 798 774 /* create any TLV data */ 799 - soc_tplg_create_tlv(tplg, &kc, &mc->tlv); 775 + soc_tplg_create_tlv(tplg, &kc, &mc->hdr); 800 776 801 777 /* register control here */ 802 778 err = soc_tplg_add_kcontrol(tplg, &kc, ··· 1374 1350 template.reg = w->reg; 1375 1351 template.shift = w->shift; 1376 1352 template.mask = w->mask; 1353 + template.subseq = w->subseq; 1377 1354 template.on_val = w->invert ? 0 : 1; 1378 1355 template.off_val = w->invert ? 1 : 0; 1379 1356 template.ignore_suspend = w->ignore_suspend;