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.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"In this rc, we've got more volume than previous rc, unsurprisingly;
the majority of updates in ASoC are about Intel drivers, and another
major changes are the continued plumbing of ALSA timer bugs revealed
by syzkaller fuzzer. Hopefully both settle down now.

Other than that, HD-audio received a couple of code fixes as well as
the usual quirks, and various small fixes are found for FireWire
devices, ASoC codecs and drivers"

* tag 'sound-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (50 commits)
ASoC: arizona: fref must be limited in pseudo-fractional mode
ASoC: sigmadsp: Fix missleading return value
ALSA: timer: Fix race at concurrent reads
ALSA: firewire-digi00x: Drop bogus const type qualifier on dot_scrt()
ALSA: hda - Fix bad dereference of jack object
ALSA: timer: Fix race between stop and interrupt
ALSA: timer: Fix wrong instance passed to slave callbacks
ASoC: Intel: Add module tags for common match module
ASoC: Intel: Load the atom DPCM driver only
ASoC: Intel: Create independent acpi match module
ASoC: Intel: Revert "ASoC: Intel: fix ACPI probe regression with Atom DPCM driver"
ALSA: dummy: Implement timer backend switching more safely
ALSA: hda - Fix speaker output from VAIO AiO machines
Revert "ALSA: hda - Fix noise on Gigabyte Z170X mobo"
ALSA: firewire-tascam: remove needless member for control and status message
ALSA: firewire-tascam: remove a flag for controller
ALSA: firewire-tascam: add support for FW-1804
ALSA: firewire-tascam: fix NULL pointer dereference when model identification fails
ALSA: hda - Fix static checker warning in patch_hdmi.c
ASoC: Intel: Skylake: Remove autosuspend delay
...

+293 -210
+2
Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
··· 30 30 "fsl,imx-audio-sgtl5000" 31 31 (compatible with Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt) 32 32 33 + "fsl,imx-audio-wm8960" 34 + 33 35 Required properties: 34 36 35 37 - compatible : Contains one of entries in the compatible list.
+20 -20
sound/core/timer.c
··· 422 422 spin_lock_irqsave(&timer->lock, flags); 423 423 list_for_each_entry(ts, &ti->slave_active_head, active_list) 424 424 if (ts->ccallback) 425 - ts->ccallback(ti, event + 100, &tstamp, resolution); 425 + ts->ccallback(ts, event + 100, &tstamp, resolution); 426 426 spin_unlock_irqrestore(&timer->lock, flags); 427 427 } 428 428 ··· 518 518 spin_unlock_irqrestore(&slave_active_lock, flags); 519 519 return -EBUSY; 520 520 } 521 + if (timeri->timer) 522 + spin_lock(&timeri->timer->lock); 521 523 timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING; 522 524 list_del_init(&timeri->ack_list); 523 525 list_del_init(&timeri->active_list); 526 + if (timeri->timer) 527 + spin_unlock(&timeri->timer->lock); 524 528 spin_unlock_irqrestore(&slave_active_lock, flags); 525 529 goto __end; 526 530 } ··· 1933 1929 { 1934 1930 struct snd_timer_user *tu; 1935 1931 long result = 0, unit; 1932 + int qhead; 1936 1933 int err = 0; 1937 1934 1938 1935 tu = file->private_data; ··· 1945 1940 1946 1941 if ((file->f_flags & O_NONBLOCK) != 0 || result > 0) { 1947 1942 err = -EAGAIN; 1948 - break; 1943 + goto _error; 1949 1944 } 1950 1945 1951 1946 set_current_state(TASK_INTERRUPTIBLE); ··· 1960 1955 1961 1956 if (tu->disconnected) { 1962 1957 err = -ENODEV; 1963 - break; 1958 + goto _error; 1964 1959 } 1965 1960 if (signal_pending(current)) { 1966 1961 err = -ERESTARTSYS; 1967 - break; 1962 + goto _error; 1968 1963 } 1969 1964 } 1970 1965 1966 + qhead = tu->qhead++; 1967 + tu->qhead %= tu->queue_size; 1971 1968 spin_unlock_irq(&tu->qlock); 1972 - if (err < 0) 1973 - goto _error; 1974 1969 1975 1970 if (tu->tread) { 1976 - if (copy_to_user(buffer, &tu->tqueue[tu->qhead++], 1977 - sizeof(struct snd_timer_tread))) { 1971 + if (copy_to_user(buffer, &tu->tqueue[qhead], 1972 + sizeof(struct snd_timer_tread))) 1978 1973 err = -EFAULT; 1979 - goto _error; 1980 - } 1981 1974 } else { 1982 - if (copy_to_user(buffer, &tu->queue[tu->qhead++], 1983 - sizeof(struct snd_timer_read))) { 1975 + if (copy_to_user(buffer, &tu->queue[qhead], 1976 + sizeof(struct snd_timer_read))) 1984 1977 err = -EFAULT; 1985 - goto _error; 1986 - } 1987 1978 } 1988 - 1989 - tu->qhead %= tu->queue_size; 1990 - 1991 - result += unit; 1992 - buffer += unit; 1993 1979 1994 1980 spin_lock_irq(&tu->qlock); 1995 1981 tu->qused--; 1982 + if (err < 0) 1983 + goto _error; 1984 + result += unit; 1985 + buffer += unit; 1996 1986 } 1997 - spin_unlock_irq(&tu->qlock); 1998 1987 _error: 1988 + spin_unlock_irq(&tu->qlock); 1999 1989 return result > 0 ? result : err; 2000 1990 } 2001 1991
+19 -18
sound/drivers/dummy.c
··· 87 87 module_param(fake_buffer, bool, 0444); 88 88 MODULE_PARM_DESC(fake_buffer, "Fake buffer allocations."); 89 89 #ifdef CONFIG_HIGH_RES_TIMERS 90 - module_param(hrtimer, bool, 0444); 90 + module_param(hrtimer, bool, 0644); 91 91 MODULE_PARM_DESC(hrtimer, "Use hrtimer as the timer source."); 92 92 #endif 93 93 ··· 108 108 int (*stop)(struct snd_pcm_substream *); 109 109 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *); 110 110 }; 111 + 112 + #define get_dummy_ops(substream) \ 113 + (*(const struct dummy_timer_ops **)(substream)->runtime->private_data) 111 114 112 115 struct dummy_model { 113 116 const char *name; ··· 140 137 int iobox; 141 138 struct snd_kcontrol *cd_volume_ctl; 142 139 struct snd_kcontrol *cd_switch_ctl; 143 - const struct dummy_timer_ops *timer_ops; 144 140 }; 145 141 146 142 /* ··· 233 231 */ 234 232 235 233 struct dummy_systimer_pcm { 234 + /* ops must be the first item */ 235 + const struct dummy_timer_ops *timer_ops; 236 236 spinlock_t lock; 237 237 struct timer_list timer; 238 238 unsigned long base_time; ··· 370 366 */ 371 367 372 368 struct dummy_hrtimer_pcm { 369 + /* ops must be the first item */ 370 + const struct dummy_timer_ops *timer_ops; 373 371 ktime_t base_time; 374 372 ktime_t period_time; 375 373 atomic_t running; ··· 498 492 499 493 static int dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd) 500 494 { 501 - struct snd_dummy *dummy = snd_pcm_substream_chip(substream); 502 - 503 495 switch (cmd) { 504 496 case SNDRV_PCM_TRIGGER_START: 505 497 case SNDRV_PCM_TRIGGER_RESUME: 506 - return dummy->timer_ops->start(substream); 498 + return get_dummy_ops(substream)->start(substream); 507 499 case SNDRV_PCM_TRIGGER_STOP: 508 500 case SNDRV_PCM_TRIGGER_SUSPEND: 509 - return dummy->timer_ops->stop(substream); 501 + return get_dummy_ops(substream)->stop(substream); 510 502 } 511 503 return -EINVAL; 512 504 } 513 505 514 506 static int dummy_pcm_prepare(struct snd_pcm_substream *substream) 515 507 { 516 - struct snd_dummy *dummy = snd_pcm_substream_chip(substream); 517 - 518 - return dummy->timer_ops->prepare(substream); 508 + return get_dummy_ops(substream)->prepare(substream); 519 509 } 520 510 521 511 static snd_pcm_uframes_t dummy_pcm_pointer(struct snd_pcm_substream *substream) 522 512 { 523 - struct snd_dummy *dummy = snd_pcm_substream_chip(substream); 524 - 525 - return dummy->timer_ops->pointer(substream); 513 + return get_dummy_ops(substream)->pointer(substream); 526 514 } 527 515 528 516 static struct snd_pcm_hardware dummy_pcm_hardware = { ··· 562 562 struct snd_dummy *dummy = snd_pcm_substream_chip(substream); 563 563 struct dummy_model *model = dummy->model; 564 564 struct snd_pcm_runtime *runtime = substream->runtime; 565 + const struct dummy_timer_ops *ops; 565 566 int err; 566 567 567 - dummy->timer_ops = &dummy_systimer_ops; 568 + ops = &dummy_systimer_ops; 568 569 #ifdef CONFIG_HIGH_RES_TIMERS 569 570 if (hrtimer) 570 - dummy->timer_ops = &dummy_hrtimer_ops; 571 + ops = &dummy_hrtimer_ops; 571 572 #endif 572 573 573 - err = dummy->timer_ops->create(substream); 574 + err = ops->create(substream); 574 575 if (err < 0) 575 576 return err; 577 + get_dummy_ops(substream) = ops; 576 578 577 579 runtime->hw = dummy->pcm_hw; 578 580 if (substream->pcm->device & 1) { ··· 596 594 err = model->capture_constraints(substream->runtime); 597 595 } 598 596 if (err < 0) { 599 - dummy->timer_ops->free(substream); 597 + get_dummy_ops(substream)->free(substream); 600 598 return err; 601 599 } 602 600 return 0; ··· 604 602 605 603 static int dummy_pcm_close(struct snd_pcm_substream *substream) 606 604 { 607 - struct snd_dummy *dummy = snd_pcm_substream_chip(substream); 608 - dummy->timer_ops->free(substream); 605 + get_dummy_ops(substream)->free(substream); 609 606 return 0; 610 607 } 611 608
+1 -1
sound/firewire/digi00x/amdtp-dot.c
··· 63 63 #define BYTE_PER_SAMPLE (4) 64 64 #define MAGIC_DOT_BYTE (2) 65 65 #define MAGIC_BYTE_OFF(x) (((x) * BYTE_PER_SAMPLE) + MAGIC_DOT_BYTE) 66 - static const u8 dot_scrt(const u8 idx, const unsigned int off) 66 + static u8 dot_scrt(const u8 idx, const unsigned int off) 67 67 { 68 68 /* 69 69 * the length of the added pattern only depends on the lower nibble
+6
sound/firewire/tascam/tascam-transaction.c
··· 230 230 return err; 231 231 error: 232 232 fw_core_remove_address_handler(&tscm->async_handler); 233 + tscm->async_handler.callback_data = NULL; 233 234 return err; 234 235 } 235 236 ··· 277 276 __be32 reg; 278 277 unsigned int i; 279 278 279 + if (tscm->async_handler.callback_data == NULL) 280 + return; 281 + 280 282 /* Turn off FireWire LED. */ 281 283 reg = cpu_to_be32(0x0000008e); 282 284 snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST, ··· 301 297 &reg, sizeof(reg), 0); 302 298 303 299 fw_core_remove_address_handler(&tscm->async_handler); 300 + tscm->async_handler.callback_data = NULL; 301 + 304 302 for (i = 0; i < TSCM_MIDI_OUT_PORT_MAX; i++) 305 303 snd_fw_async_midi_port_destroy(&tscm->out_ports[i]); 306 304 }
+9 -3
sound/firewire/tascam/tascam.c
··· 21 21 .pcm_playback_analog_channels = 8, 22 22 .midi_capture_ports = 4, 23 23 .midi_playback_ports = 4, 24 - .is_controller = true, 25 24 }, 26 25 { 27 26 .name = "FW-1082", ··· 30 31 .pcm_playback_analog_channels = 2, 31 32 .midi_capture_ports = 2, 32 33 .midi_playback_ports = 2, 33 - .is_controller = true, 34 34 }, 35 - /* FW-1804 may be supported. */ 35 + { 36 + .name = "FW-1804", 37 + .has_adat = true, 38 + .has_spdif = true, 39 + .pcm_capture_analog_channels = 8, 40 + .pcm_playback_analog_channels = 2, 41 + .midi_capture_ports = 2, 42 + .midi_playback_ports = 4, 43 + }, 36 44 }; 37 45 38 46 static int identify_model(struct snd_tscm *tscm)
-4
sound/firewire/tascam/tascam.h
··· 39 39 unsigned int pcm_playback_analog_channels; 40 40 unsigned int midi_capture_ports; 41 41 unsigned int midi_playback_ports; 42 - bool is_controller; 43 42 }; 44 43 45 44 #define TSCM_MIDI_IN_PORT_MAX 4 ··· 71 72 struct snd_fw_async_midi_port out_ports[TSCM_MIDI_OUT_PORT_MAX]; 72 73 u8 running_status[TSCM_MIDI_OUT_PORT_MAX]; 73 74 bool on_sysex[TSCM_MIDI_OUT_PORT_MAX]; 74 - 75 - /* For control messages. */ 76 - struct snd_firewire_tascam_status *status; 77 75 }; 78 76 79 77 #define TSCM_ADDR_BASE 0xffff00000000ull
+2 -2
sound/pci/hda/hda_generic.c
··· 4028 4028 struct hda_jack_callback *jack, 4029 4029 bool on) 4030 4030 { 4031 - if (jack && jack->tbl->nid) 4031 + if (jack && jack->nid) 4032 4032 sync_power_state_change(codec, 4033 - set_pin_power_jack(codec, jack->tbl->nid, on)); 4033 + set_pin_power_jack(codec, jack->nid, on)); 4034 4034 } 4035 4035 4036 4036 /* callback only doing power up -- called at first */
+1 -1
sound/pci/hda/hda_jack.c
··· 259 259 if (!callback) 260 260 return ERR_PTR(-ENOMEM); 261 261 callback->func = func; 262 - callback->tbl = jack; 262 + callback->nid = jack->nid; 263 263 callback->next = jack->callback; 264 264 jack->callback = callback; 265 265 }
+1 -1
sound/pci/hda/hda_jack.h
··· 21 21 typedef void (*hda_jack_callback_fn) (struct hda_codec *, struct hda_jack_callback *); 22 22 23 23 struct hda_jack_callback { 24 - struct hda_jack_tbl *tbl; 24 + hda_nid_t nid; 25 25 hda_jack_callback_fn func; 26 26 unsigned int private_data; /* arbitrary data */ 27 27 struct hda_jack_callback *next;
+4 -1
sound/pci/hda/patch_ca0132.c
··· 4427 4427 static void hp_callback(struct hda_codec *codec, struct hda_jack_callback *cb) 4428 4428 { 4429 4429 struct ca0132_spec *spec = codec->spec; 4430 + struct hda_jack_tbl *tbl; 4430 4431 4431 4432 /* Delay enabling the HP amp, to let the mic-detection 4432 4433 * state machine run. 4433 4434 */ 4434 4435 cancel_delayed_work_sync(&spec->unsol_hp_work); 4435 4436 schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); 4436 - cb->tbl->block_report = 1; 4437 + tbl = snd_hda_jack_tbl_get(codec, cb->nid); 4438 + if (tbl) 4439 + tbl->block_report = 1; 4437 4440 } 4438 4441 4439 4442 static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
+3 -2
sound/pci/hda/patch_hdmi.c
··· 448 448 eld = &per_pin->sink_eld; 449 449 450 450 mutex_lock(&per_pin->lock); 451 - if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data)) { 451 + if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data) || 452 + eld->eld_size > ELD_MAX_SIZE) { 452 453 mutex_unlock(&per_pin->lock); 453 454 snd_BUG(); 454 455 return -EINVAL; ··· 1194 1193 static void jack_callback(struct hda_codec *codec, 1195 1194 struct hda_jack_callback *jack) 1196 1195 { 1197 - check_presence_and_report(codec, jack->tbl->nid); 1196 + check_presence_and_report(codec, jack->nid); 1198 1197 } 1199 1198 1200 1199 static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
+2 -9
sound/pci/hda/patch_realtek.c
··· 282 282 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); 283 283 if (!uctl) 284 284 return; 285 - val = snd_hda_codec_read(codec, jack->tbl->nid, 0, 285 + val = snd_hda_codec_read(codec, jack->nid, 0, 286 286 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); 287 287 val &= HDA_AMP_VOLMASK; 288 288 uctl->value.integer.value[0] = val; ··· 1787 1787 ALC882_FIXUP_NO_PRIMARY_HP, 1788 1788 ALC887_FIXUP_ASUS_BASS, 1789 1789 ALC887_FIXUP_BASS_CHMAP, 1790 - ALC882_FIXUP_DISABLE_AAMIX, 1791 1790 }; 1792 1791 1793 1792 static void alc889_fixup_coef(struct hda_codec *codec, ··· 1948 1949 1949 1950 static void alc_fixup_bass_chmap(struct hda_codec *codec, 1950 1951 const struct hda_fixup *fix, int action); 1951 - static void alc_fixup_disable_aamix(struct hda_codec *codec, 1952 - const struct hda_fixup *fix, int action); 1953 1952 1954 1953 static const struct hda_fixup alc882_fixups[] = { 1955 1954 [ALC882_FIXUP_ABIT_AW9D_MAX] = { ··· 2185 2188 .type = HDA_FIXUP_FUNC, 2186 2189 .v.func = alc_fixup_bass_chmap, 2187 2190 }, 2188 - [ALC882_FIXUP_DISABLE_AAMIX] = { 2189 - .type = HDA_FIXUP_FUNC, 2190 - .v.func = alc_fixup_disable_aamix, 2191 - }, 2192 2191 }; 2193 2192 2194 2193 static const struct snd_pci_quirk alc882_fixup_tbl[] = { ··· 2223 2230 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), 2224 2231 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), 2225 2232 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), 2233 + SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), 2226 2234 2227 2235 /* All Apple entries are in codec SSIDs */ 2228 2236 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), ··· 2253 2259 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 2254 2260 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 2255 2261 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 2256 - SND_PCI_QUIRK(0x1458, 0xa182, "Gigabyte Z170X-UD3", ALC882_FIXUP_DISABLE_AAMIX), 2257 2262 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 2258 2263 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), 2259 2264 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
+3 -3
sound/pci/hda/patch_sigmatel.c
··· 493 493 if (!spec->num_pwrs) 494 494 return; 495 495 496 - if (jack && jack->tbl->nid) { 497 - stac_toggle_power_map(codec, jack->tbl->nid, 498 - snd_hda_jack_detect(codec, jack->tbl->nid), 496 + if (jack && jack->nid) { 497 + stac_toggle_power_map(codec, jack->nid, 498 + snd_hda_jack_detect(codec, jack->nid), 499 499 true); 500 500 return; 501 501 }
+1
sound/soc/amd/acp-pcm-dma.c
··· 635 635 SNDRV_PCM_HW_PARAM_PERIODS); 636 636 if (ret < 0) { 637 637 dev_err(prtd->platform->dev, "set integer constraint failed\n"); 638 + kfree(adata); 638 639 return ret; 639 640 } 640 641
+42 -1
sound/soc/codecs/arizona.c
··· 1929 1929 { 1000000, 13500000, 0, 1 }, 1930 1930 }; 1931 1931 1932 + static const unsigned int pseudo_fref_max[ARIZONA_FLL_MAX_FRATIO] = { 1933 + 13500000, 1934 + 6144000, 1935 + 6144000, 1936 + 3072000, 1937 + 3072000, 1938 + 2822400, 1939 + 2822400, 1940 + 1536000, 1941 + 1536000, 1942 + 1536000, 1943 + 1536000, 1944 + 1536000, 1945 + 1536000, 1946 + 1536000, 1947 + 1536000, 1948 + 768000, 1949 + }; 1950 + 1932 1951 static struct { 1933 1952 unsigned int min; 1934 1953 unsigned int max; ··· 2061 2042 /* Adjust FRATIO/refdiv to avoid integer mode if possible */ 2062 2043 refdiv = cfg->refdiv; 2063 2044 2045 + arizona_fll_dbg(fll, "pseudo: initial ratio=%u fref=%u refdiv=%u\n", 2046 + init_ratio, Fref, refdiv); 2047 + 2064 2048 while (div <= ARIZONA_FLL_MAX_REFDIV) { 2065 2049 for (ratio = init_ratio; ratio <= ARIZONA_FLL_MAX_FRATIO; 2066 2050 ratio++) { 2067 2051 if ((ARIZONA_FLL_VCO_CORNER / 2) / 2068 - (fll->vco_mult * ratio) < Fref) 2052 + (fll->vco_mult * ratio) < Fref) { 2053 + arizona_fll_dbg(fll, "pseudo: hit VCO corner\n"); 2069 2054 break; 2055 + } 2056 + 2057 + if (Fref > pseudo_fref_max[ratio - 1]) { 2058 + arizona_fll_dbg(fll, 2059 + "pseudo: exceeded max fref(%u) for ratio=%u\n", 2060 + pseudo_fref_max[ratio - 1], 2061 + ratio); 2062 + break; 2063 + } 2070 2064 2071 2065 if (target % (ratio * Fref)) { 2072 2066 cfg->refdiv = refdiv; 2073 2067 cfg->fratio = ratio - 1; 2068 + arizona_fll_dbg(fll, 2069 + "pseudo: found fref=%u refdiv=%d(%d) ratio=%d\n", 2070 + Fref, refdiv, div, ratio); 2074 2071 return ratio; 2075 2072 } 2076 2073 } ··· 2095 2060 if (target % (ratio * Fref)) { 2096 2061 cfg->refdiv = refdiv; 2097 2062 cfg->fratio = ratio - 1; 2063 + arizona_fll_dbg(fll, 2064 + "pseudo: found fref=%u refdiv=%d(%d) ratio=%d\n", 2065 + Fref, refdiv, div, ratio); 2098 2066 return ratio; 2099 2067 } 2100 2068 } ··· 2106 2068 Fref /= 2; 2107 2069 refdiv++; 2108 2070 init_ratio = arizona_find_fratio(Fref, NULL); 2071 + arizona_fll_dbg(fll, 2072 + "pseudo: change fref=%u refdiv=%d(%d) ratio=%u\n", 2073 + Fref, refdiv, div, init_ratio); 2109 2074 } 2110 2075 2111 2076 arizona_fll_warn(fll, "Falling back to integer mode operation\n");
+3 -23
sound/soc/codecs/rt286.c
··· 266 266 } else { 267 267 *mic = false; 268 268 regmap_write(rt286->regmap, RT286_SET_MIC1, 0x20); 269 + regmap_update_bits(rt286->regmap, 270 + RT286_CBJ_CTRL1, 0x0400, 0x0000); 269 271 } 270 272 } else { 271 273 regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf); ··· 472 470 return 0; 473 471 } 474 472 475 - static int rt286_vref_event(struct snd_soc_dapm_widget *w, 476 - struct snd_kcontrol *kcontrol, int event) 477 - { 478 - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); 479 - 480 - switch (event) { 481 - case SND_SOC_DAPM_PRE_PMU: 482 - snd_soc_update_bits(codec, 483 - RT286_CBJ_CTRL1, 0x0400, 0x0000); 484 - mdelay(50); 485 - break; 486 - default: 487 - return 0; 488 - } 489 - 490 - return 0; 491 - } 492 - 493 473 static int rt286_ldo2_event(struct snd_soc_dapm_widget *w, 494 474 struct snd_kcontrol *kcontrol, int event) 495 475 { ··· 520 536 SND_SOC_DAPM_SUPPLY_S("HV", 1, RT286_POWER_CTRL1, 521 537 12, 1, NULL, 0), 522 538 SND_SOC_DAPM_SUPPLY("VREF", RT286_POWER_CTRL1, 523 - 0, 1, rt286_vref_event, SND_SOC_DAPM_PRE_PMU), 539 + 0, 1, NULL, 0), 524 540 SND_SOC_DAPM_SUPPLY_S("LDO1", 1, RT286_POWER_CTRL2, 525 541 2, 0, NULL, 0), 526 542 SND_SOC_DAPM_SUPPLY_S("LDO2", 2, RT286_POWER_CTRL1, ··· 895 911 case SND_SOC_BIAS_ON: 896 912 mdelay(10); 897 913 snd_soc_update_bits(codec, 898 - RT286_CBJ_CTRL1, 0x0400, 0x0400); 899 - snd_soc_update_bits(codec, 900 914 RT286_DC_GAIN, 0x200, 0x0); 901 915 902 916 break; ··· 902 920 case SND_SOC_BIAS_STANDBY: 903 921 snd_soc_write(codec, 904 922 RT286_SET_AUDIO_POWER, AC_PWRST_D3); 905 - snd_soc_update_bits(codec, 906 - RT286_CBJ_CTRL1, 0x0400, 0x0000); 907 923 break; 908 924 909 925 default:
+1 -1
sound/soc/codecs/rt5645.c
··· 776 776 777 777 /* IN1/IN2 Control */ 778 778 SOC_SINGLE_TLV("IN1 Boost", RT5645_IN1_CTRL1, 779 - RT5645_BST_SFT1, 8, 0, bst_tlv), 779 + RT5645_BST_SFT1, 12, 0, bst_tlv), 780 780 SOC_SINGLE_TLV("IN2 Boost", RT5645_IN2_CTRL, 781 781 RT5645_BST_SFT2, 8, 0, bst_tlv), 782 782
+14 -17
sound/soc/codecs/rt5659.c
··· 3985 3985 if (rt5659 == NULL) 3986 3986 return -ENOMEM; 3987 3987 3988 - rt5659->i2c = i2c; 3989 3988 i2c_set_clientdata(i2c, rt5659); 3990 3989 3991 3990 if (pdata) ··· 4156 4157 4157 4158 INIT_DELAYED_WORK(&rt5659->jack_detect_work, rt5659_jack_detect_work); 4158 4159 4159 - if (rt5659->i2c->irq) { 4160 - ret = request_threaded_irq(rt5659->i2c->irq, NULL, rt5659_irq, 4161 - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING 4160 + if (i2c->irq) { 4161 + ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL, 4162 + rt5659_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING 4162 4163 | IRQF_ONESHOT, "rt5659", rt5659); 4163 4164 if (ret) 4164 4165 dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret); 4165 4166 4166 4167 } 4167 4168 4168 - ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659, 4169 + return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659, 4169 4170 rt5659_dai, ARRAY_SIZE(rt5659_dai)); 4170 - 4171 - if (ret) { 4172 - if (rt5659->i2c->irq) 4173 - free_irq(rt5659->i2c->irq, rt5659); 4174 - } 4175 - 4176 - return 0; 4177 4171 } 4178 4172 4179 4173 static int rt5659_i2c_remove(struct i2c_client *i2c) ··· 4183 4191 regmap_write(rt5659->regmap, RT5659_RESET, 0); 4184 4192 } 4185 4193 4194 + #ifdef CONFIG_OF 4186 4195 static const struct of_device_id rt5659_of_match[] = { 4187 4196 { .compatible = "realtek,rt5658", }, 4188 4197 { .compatible = "realtek,rt5659", }, 4189 - {}, 4198 + { }, 4190 4199 }; 4200 + MODULE_DEVICE_TABLE(of, rt5659_of_match); 4201 + #endif 4191 4202 4203 + #ifdef CONFIG_ACPI 4192 4204 static struct acpi_device_id rt5659_acpi_match[] = { 4193 - { "10EC5658", 0}, 4194 - { "10EC5659", 0}, 4195 - { }, 4205 + { "10EC5658", 0, }, 4206 + { "10EC5659", 0, }, 4207 + { }, 4196 4208 }; 4197 4209 MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match); 4210 + #endif 4198 4211 4199 4212 struct i2c_driver rt5659_i2c_driver = { 4200 4213 .driver = { 4201 4214 .name = "rt5659", 4202 4215 .owner = THIS_MODULE, 4203 - .of_match_table = rt5659_of_match, 4216 + .of_match_table = of_match_ptr(rt5659_of_match), 4204 4217 .acpi_match_table = ACPI_PTR(rt5659_acpi_match), 4205 4218 }, 4206 4219 .probe = rt5659_i2c_probe,
-1
sound/soc/codecs/rt5659.h
··· 1792 1792 struct snd_soc_codec *codec; 1793 1793 struct rt5659_platform_data pdata; 1794 1794 struct regmap *regmap; 1795 - struct i2c_client *i2c; 1796 1795 struct gpio_desc *gpiod_ldo1_en; 1797 1796 struct gpio_desc *gpiod_reset; 1798 1797 struct snd_soc_jack *hs_jack;
+4 -1
sound/soc/codecs/sigmadsp-i2c.c
··· 31 31 32 32 kfree(buf); 33 33 34 - return ret; 34 + if (ret < 0) 35 + return ret; 36 + 37 + return 0; 35 38 } 36 39 37 40 static int sigmadsp_read_i2c(void *control_data,
+1
sound/soc/codecs/wm5110.c
··· 2382 2382 2383 2383 static int wm5110_remove(struct platform_device *pdev) 2384 2384 { 2385 + snd_soc_unregister_platform(&pdev->dev); 2385 2386 snd_soc_unregister_codec(&pdev->dev); 2386 2387 pm_runtime_disable(&pdev->dev); 2387 2388
+22 -20
sound/soc/codecs/wm8960.c
··· 240 240 SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL, 241 241 7, 1, 1), 242 242 243 - SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume", 244 - WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv), 245 - SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume", 246 - WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv), 247 243 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume", 248 - WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv), 244 + WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv), 249 245 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume", 246 + WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv), 247 + SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume", 248 + WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv), 249 + SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume", 250 250 WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv), 251 251 SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume", 252 252 WM8960_RINPATH, 4, 3, 0, micboost_tlv), ··· 643 643 return -EINVAL; 644 644 } 645 645 646 - /* check if the sysclk frequency is available. */ 647 - for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) { 648 - if (sysclk_divs[i] == -1) 649 - continue; 650 - sysclk = freq_out / sysclk_divs[i]; 651 - for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) { 652 - if (sysclk == dac_divs[j] * lrclk) { 646 + if (wm8960->clk_id != WM8960_SYSCLK_PLL) { 647 + /* check if the sysclk frequency is available. */ 648 + for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) { 649 + if (sysclk_divs[i] == -1) 650 + continue; 651 + sysclk = freq_out / sysclk_divs[i]; 652 + for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) { 653 + if (sysclk != dac_divs[j] * lrclk) 654 + continue; 653 655 for (k = 0; k < ARRAY_SIZE(bclk_divs); ++k) 654 656 if (sysclk == bclk * bclk_divs[k] / 10) 655 657 break; 656 658 if (k != ARRAY_SIZE(bclk_divs)) 657 659 break; 658 660 } 661 + if (j != ARRAY_SIZE(dac_divs)) 662 + break; 659 663 } 660 - if (j != ARRAY_SIZE(dac_divs)) 661 - break; 662 - } 663 664 664 - if (i != ARRAY_SIZE(sysclk_divs)) { 665 - goto configure_clock; 666 - } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) { 667 - dev_err(codec->dev, "failed to configure clock\n"); 668 - return -EINVAL; 665 + if (i != ARRAY_SIZE(sysclk_divs)) { 666 + goto configure_clock; 667 + } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) { 668 + dev_err(codec->dev, "failed to configure clock\n"); 669 + return -EINVAL; 670 + } 669 671 } 670 672 /* get a available pll out frequency and set pll */ 671 673 for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
+2 -3
sound/soc/dwc/designware_i2s.c
··· 645 645 646 646 dev->dev = &pdev->dev; 647 647 648 + dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; 649 + dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; 648 650 if (pdata) { 649 651 dev->capability = pdata->cap; 650 652 clk_id = NULL; ··· 654 652 if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) { 655 653 dev->i2s_reg_comp1 = pdata->i2s_reg_comp1; 656 654 dev->i2s_reg_comp2 = pdata->i2s_reg_comp2; 657 - } else { 658 - dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; 659 - dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; 660 655 } 661 656 ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); 662 657 } else {
+22 -20
sound/soc/fsl/fsl_ssi.c
··· 112 112 struct fsl_ssi_reg_val tx; 113 113 }; 114 114 115 - static const struct reg_default fsl_ssi_reg_defaults[] = { 116 - {CCSR_SSI_SCR, 0x00000000}, 117 - {CCSR_SSI_SIER, 0x00003003}, 118 - {CCSR_SSI_STCR, 0x00000200}, 119 - {CCSR_SSI_SRCR, 0x00000200}, 120 - {CCSR_SSI_STCCR, 0x00040000}, 121 - {CCSR_SSI_SRCCR, 0x00040000}, 122 - {CCSR_SSI_SACNT, 0x00000000}, 123 - {CCSR_SSI_STMSK, 0x00000000}, 124 - {CCSR_SSI_SRMSK, 0x00000000}, 125 - {CCSR_SSI_SACCEN, 0x00000000}, 126 - {CCSR_SSI_SACCDIS, 0x00000000}, 127 - }; 128 - 129 115 static bool fsl_ssi_readable_reg(struct device *dev, unsigned int reg) 130 116 { 131 117 switch (reg) { ··· 176 190 .val_bits = 32, 177 191 .reg_stride = 4, 178 192 .val_format_endian = REGMAP_ENDIAN_NATIVE, 179 - .reg_defaults = fsl_ssi_reg_defaults, 180 - .num_reg_defaults = ARRAY_SIZE(fsl_ssi_reg_defaults), 193 + .num_reg_defaults_raw = CCSR_SSI_SACCDIS / sizeof(uint32_t) + 1, 181 194 .readable_reg = fsl_ssi_readable_reg, 182 195 .volatile_reg = fsl_ssi_volatile_reg, 183 196 .precious_reg = fsl_ssi_precious_reg, ··· 186 201 187 202 struct fsl_ssi_soc_data { 188 203 bool imx; 204 + bool imx21regs; /* imx21-class SSI - no SACC{ST,EN,DIS} regs */ 189 205 bool offline_config; 190 206 u32 sisr_write_mask; 191 207 }; ··· 289 303 290 304 static struct fsl_ssi_soc_data fsl_ssi_imx21 = { 291 305 .imx = true, 306 + .imx21regs = true, 292 307 .offline_config = true, 293 308 .sisr_write_mask = 0, 294 309 }; ··· 573 586 */ 574 587 regmap_write(regs, CCSR_SSI_SACNT, 575 588 CCSR_SSI_SACNT_AC97EN | CCSR_SSI_SACNT_FV); 576 - regmap_write(regs, CCSR_SSI_SACCDIS, 0xff); 577 - regmap_write(regs, CCSR_SSI_SACCEN, 0x300); 589 + 590 + /* no SACC{ST,EN,DIS} regs on imx21-class SSI */ 591 + if (!ssi_private->soc->imx21regs) { 592 + regmap_write(regs, CCSR_SSI_SACCDIS, 0xff); 593 + regmap_write(regs, CCSR_SSI_SACCEN, 0x300); 594 + } 578 595 579 596 /* 580 597 * Enable SSI, Transmit and Receive. AC97 has to communicate with the ··· 1388 1397 struct resource *res; 1389 1398 void __iomem *iomem; 1390 1399 char name[64]; 1400 + struct regmap_config regconfig = fsl_ssi_regconfig; 1391 1401 1392 1402 of_id = of_match_device(fsl_ssi_ids, &pdev->dev); 1393 1403 if (!of_id || !of_id->data) ··· 1436 1444 return PTR_ERR(iomem); 1437 1445 ssi_private->ssi_phys = res->start; 1438 1446 1447 + if (ssi_private->soc->imx21regs) { 1448 + /* 1449 + * According to datasheet imx21-class SSI 1450 + * don't have SACC{ST,EN,DIS} regs. 1451 + */ 1452 + regconfig.max_register = CCSR_SSI_SRMSK; 1453 + regconfig.num_reg_defaults_raw = 1454 + CCSR_SSI_SRMSK / sizeof(uint32_t) + 1; 1455 + } 1456 + 1439 1457 ret = of_property_match_string(np, "clock-names", "ipg"); 1440 1458 if (ret < 0) { 1441 1459 ssi_private->has_ipg_clk_name = false; 1442 1460 ssi_private->regs = devm_regmap_init_mmio(&pdev->dev, iomem, 1443 - &fsl_ssi_regconfig); 1461 + &regconfig); 1444 1462 } else { 1445 1463 ssi_private->has_ipg_clk_name = true; 1446 1464 ssi_private->regs = devm_regmap_init_mmio_clk(&pdev->dev, 1447 - "ipg", iomem, &fsl_ssi_regconfig); 1465 + "ipg", iomem, &regconfig); 1448 1466 } 1449 1467 if (IS_ERR(ssi_private->regs)) { 1450 1468 dev_err(&pdev->dev, "Failed to init register map\n");
-2
sound/soc/fsl/imx-spdif.c
··· 72 72 goto end; 73 73 } 74 74 75 - platform_set_drvdata(pdev, data); 76 - 77 75 end: 78 76 of_node_put(spdif_np); 79 77
+1 -1
sound/soc/generic/simple-card.c
··· 99 99 if (ret && ret != -ENOTSUPP) 100 100 goto err; 101 101 } 102 - 102 + return 0; 103 103 err: 104 104 return ret; 105 105 }
+11 -2
sound/soc/intel/Kconfig
··· 30 30 config SND_SOC_INTEL_SST 31 31 tristate 32 32 select SND_SOC_INTEL_SST_ACPI if ACPI 33 + select SND_SOC_INTEL_SST_MATCH if ACPI 33 34 depends on (X86 || COMPILE_TEST) 34 35 35 36 config SND_SOC_INTEL_SST_ACPI 37 + tristate 38 + 39 + config SND_SOC_INTEL_SST_MATCH 36 40 tristate 37 41 38 42 config SND_SOC_INTEL_HASWELL ··· 61 57 config SND_SOC_INTEL_BYT_RT5640_MACH 62 58 tristate "ASoC Audio driver for Intel Baytrail with RT5640 codec" 63 59 depends on X86_INTEL_LPSS && I2C 64 - depends on DW_DMAC_CORE=y && (SND_SOC_INTEL_BYTCR_RT5640_MACH = n) 60 + depends on DW_DMAC_CORE=y && (SND_SST_IPC_ACPI = n) 65 61 select SND_SOC_INTEL_SST 66 62 select SND_SOC_INTEL_BAYTRAIL 67 63 select SND_SOC_RT5640 ··· 73 69 config SND_SOC_INTEL_BYT_MAX98090_MACH 74 70 tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec" 75 71 depends on X86_INTEL_LPSS && I2C 76 - depends on DW_DMAC_CORE=y 72 + depends on DW_DMAC_CORE=y && (SND_SST_IPC_ACPI = n) 77 73 select SND_SOC_INTEL_SST 78 74 select SND_SOC_INTEL_BAYTRAIL 79 75 select SND_SOC_MAX98090 ··· 101 97 select SND_SOC_RT5640 102 98 select SND_SST_MFLD_PLATFORM 103 99 select SND_SST_IPC_ACPI 100 + select SND_SOC_INTEL_SST_MATCH if ACPI 104 101 help 105 102 This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR 106 103 platforms with RT5640 audio codec. ··· 114 109 select SND_SOC_RT5651 115 110 select SND_SST_MFLD_PLATFORM 116 111 select SND_SST_IPC_ACPI 112 + select SND_SOC_INTEL_SST_MATCH if ACPI 117 113 help 118 114 This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR 119 115 platforms with RT5651 audio codec. ··· 127 121 select SND_SOC_RT5670 128 122 select SND_SST_MFLD_PLATFORM 129 123 select SND_SST_IPC_ACPI 124 + select SND_SOC_INTEL_SST_MATCH if ACPI 130 125 help 131 126 This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell 132 127 platforms with RT5672 audio codec. ··· 140 133 select SND_SOC_RT5645 141 134 select SND_SST_MFLD_PLATFORM 142 135 select SND_SST_IPC_ACPI 136 + select SND_SOC_INTEL_SST_MATCH if ACPI 143 137 help 144 138 This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell 145 139 platforms with RT5645/5650 audio codec. ··· 153 145 select SND_SOC_TS3A227E 154 146 select SND_SST_MFLD_PLATFORM 155 147 select SND_SST_IPC_ACPI 148 + select SND_SOC_INTEL_SST_MATCH if ACPI 156 149 help 157 150 This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell 158 151 platforms with MAX98090 audio codec it also can support TI jack chip as aux device.
+1
sound/soc/intel/atom/sst-mfld-platform-pcm.c
··· 528 528 .ops = &sst_compr_dai_ops, 529 529 .playback = { 530 530 .stream_name = "Compress Playback", 531 + .channels_min = 1, 531 532 }, 532 533 }, 533 534 /* BE CPU Dais */
+4 -1
sound/soc/intel/boards/skl_rt286.c
··· 212 212 { 213 213 struct snd_interval *channels = hw_param_interval(params, 214 214 SNDRV_PCM_HW_PARAM_CHANNELS); 215 - channels->min = channels->max = 4; 215 + if (params_channels(params) == 2) 216 + channels->min = channels->max = 2; 217 + else 218 + channels->min = channels->max = 4; 216 219 217 220 return 0; 218 221 }
+3 -6
sound/soc/intel/common/Makefile
··· 1 1 snd-soc-sst-dsp-objs := sst-dsp.o 2 - ifneq ($(CONFIG_SND_SST_IPC_ACPI),) 3 - snd-soc-sst-acpi-objs := sst-match-acpi.o 4 - else 5 - snd-soc-sst-acpi-objs := sst-acpi.o sst-match-acpi.o 6 - endif 7 - 2 + snd-soc-sst-acpi-objs := sst-acpi.o 3 + snd-soc-sst-match-objs := sst-match-acpi.o 8 4 snd-soc-sst-ipc-objs := sst-ipc.o 9 5 10 6 snd-soc-sst-dsp-$(CONFIG_DW_DMAC_CORE) += sst-firmware.o 11 7 12 8 obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o 13 9 obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o 10 + obj-$(CONFIG_SND_SOC_INTEL_SST_MATCH) += snd-soc-sst-match.o
+4
sound/soc/intel/common/sst-acpi.c
··· 215 215 .dma_size = SST_LPT_DSP_DMA_SIZE, 216 216 }; 217 217 218 + #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) 218 219 static struct sst_acpi_mach baytrail_machines[] = { 219 220 { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, 220 221 { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, ··· 232 231 .sst_id = SST_DEV_ID_BYT, 233 232 .resindex_dma_base = -1, 234 233 }; 234 + #endif 235 235 236 236 static const struct acpi_device_id sst_acpi_match[] = { 237 237 { "INT33C8", (unsigned long)&sst_acpi_haswell_desc }, 238 238 { "INT3438", (unsigned long)&sst_acpi_broadwell_desc }, 239 + #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) 239 240 { "80860F28", (unsigned long)&sst_acpi_baytrail_desc }, 241 + #endif 240 242 { } 241 243 }; 242 244 MODULE_DEVICE_TABLE(acpi, sst_acpi_match);
+3
sound/soc/intel/common/sst-match-acpi.c
··· 41 41 return NULL; 42 42 } 43 43 EXPORT_SYMBOL_GPL(sst_acpi_find_machine); 44 + 45 + MODULE_LICENSE("GPL v2"); 46 + MODULE_DESCRIPTION("Intel Common ACPI Match module");
+3 -3
sound/soc/intel/skylake/skl-messages.c
··· 688 688 /* get src queue index */ 689 689 src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max); 690 690 if (src_index < 0) 691 - return -EINVAL; 691 + return 0; 692 692 693 693 msg.src_queue = src_index; 694 694 695 695 /* get dst queue index */ 696 696 dst_index = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max); 697 697 if (dst_index < 0) 698 - return -EINVAL; 698 + return 0; 699 699 700 700 msg.dst_queue = dst_index; 701 701 ··· 747 747 748 748 skl_dump_bind_info(ctx, src_mcfg, dst_mcfg); 749 749 750 - if (src_mcfg->m_state < SKL_MODULE_INIT_DONE && 750 + if (src_mcfg->m_state < SKL_MODULE_INIT_DONE || 751 751 dst_mcfg->m_state < SKL_MODULE_INIT_DONE) 752 752 return 0; 753 753
+1
sound/soc/intel/skylake/skl-pcm.c
··· 863 863 else 864 864 delay += hstream->bufsize; 865 865 } 866 + delay = (hstream->bufsize == delay) ? 0 : delay; 866 867 867 868 if (delay >= hstream->period_bytes) { 868 869 dev_info(bus->dev,
+52 -23
sound/soc/intel/skylake/skl-topology.c
··· 54 54 55 55 /* 56 56 * Each pipelines needs memory to be allocated. Check if we have free memory 57 - * from available pool. Then only add this to pool 58 - * This is freed when pipe is deleted 59 - * Note: DSP does actual memory management we only keep track for complete 60 - * pool 57 + * from available pool. 61 58 */ 62 - static bool skl_tplg_alloc_pipe_mem(struct skl *skl, 59 + static bool skl_is_pipe_mem_avail(struct skl *skl, 63 60 struct skl_module_cfg *mconfig) 64 61 { 65 62 struct skl_sst *ctx = skl->skl_sst; ··· 71 74 "exceeds ppl memory available %d mem %d\n", 72 75 skl->resource.max_mem, skl->resource.mem); 73 76 return false; 77 + } else { 78 + return true; 74 79 } 80 + } 75 81 82 + /* 83 + * Add the mem to the mem pool. This is freed when pipe is deleted. 84 + * Note: DSP does actual memory management we only keep track for complete 85 + * pool 86 + */ 87 + static void skl_tplg_alloc_pipe_mem(struct skl *skl, 88 + struct skl_module_cfg *mconfig) 89 + { 76 90 skl->resource.mem += mconfig->pipe->memory_pages; 77 - return true; 78 91 } 79 92 80 93 /* ··· 92 85 * quantified in MCPS (Million Clocks Per Second) required for module/pipe 93 86 * 94 87 * Each pipelines needs mcps to be allocated. Check if we have mcps for this 95 - * pipe. This adds the mcps to driver counter 96 - * This is removed on pipeline delete 88 + * pipe. 97 89 */ 98 - static bool skl_tplg_alloc_pipe_mcps(struct skl *skl, 90 + 91 + static bool skl_is_pipe_mcps_avail(struct skl *skl, 99 92 struct skl_module_cfg *mconfig) 100 93 { 101 94 struct skl_sst *ctx = skl->skl_sst; ··· 105 98 "%s: module_id %d instance %d\n", __func__, 106 99 mconfig->id.module_id, mconfig->id.instance_id); 107 100 dev_err(ctx->dev, 108 - "exceeds ppl memory available %d > mem %d\n", 101 + "exceeds ppl mcps available %d > mem %d\n", 109 102 skl->resource.max_mcps, skl->resource.mcps); 110 103 return false; 104 + } else { 105 + return true; 111 106 } 107 + } 112 108 109 + static void skl_tplg_alloc_pipe_mcps(struct skl *skl, 110 + struct skl_module_cfg *mconfig) 111 + { 113 112 skl->resource.mcps += mconfig->mcps; 114 - return true; 115 113 } 116 114 117 115 /* ··· 423 411 mconfig = w->priv; 424 412 425 413 /* check resource available */ 426 - if (!skl_tplg_alloc_pipe_mcps(skl, mconfig)) 414 + if (!skl_is_pipe_mcps_avail(skl, mconfig)) 427 415 return -ENOMEM; 428 416 429 417 if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) { ··· 447 435 ret = skl_tplg_set_module_params(w, ctx); 448 436 if (ret < 0) 449 437 return ret; 438 + skl_tplg_alloc_pipe_mcps(skl, mconfig); 450 439 } 451 440 452 441 return 0; ··· 490 477 struct skl_sst *ctx = skl->skl_sst; 491 478 492 479 /* check resource available */ 493 - if (!skl_tplg_alloc_pipe_mcps(skl, mconfig)) 480 + if (!skl_is_pipe_mcps_avail(skl, mconfig)) 494 481 return -EBUSY; 495 482 496 - if (!skl_tplg_alloc_pipe_mem(skl, mconfig)) 483 + if (!skl_is_pipe_mem_avail(skl, mconfig)) 497 484 return -ENOMEM; 498 485 499 486 /* ··· 539 526 src_module = dst_module; 540 527 } 541 528 529 + skl_tplg_alloc_pipe_mem(skl, mconfig); 530 + skl_tplg_alloc_pipe_mcps(skl, mconfig); 531 + 542 532 return 0; 543 533 } 544 534 545 535 static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, 546 536 struct skl *skl, 537 + struct snd_soc_dapm_widget *src_w, 547 538 struct skl_module_cfg *src_mconfig) 548 539 { 549 540 struct snd_soc_dapm_path *p; ··· 564 547 dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name); 565 548 566 549 next_sink = p->sink; 550 + 551 + if (!is_skl_dsp_widget_type(p->sink)) 552 + return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig); 553 + 567 554 /* 568 555 * here we will check widgets in sink pipelines, so that 569 556 * can be any widgets type and we are only interested if ··· 597 576 } 598 577 599 578 if (!sink) 600 - return skl_tplg_bind_sinks(next_sink, skl, src_mconfig); 579 + return skl_tplg_bind_sinks(next_sink, skl, src_w, src_mconfig); 601 580 602 581 return 0; 603 582 } ··· 626 605 * if sink is not started, start sink pipe first, then start 627 606 * this pipe 628 607 */ 629 - ret = skl_tplg_bind_sinks(w, skl, src_mconfig); 608 + ret = skl_tplg_bind_sinks(w, skl, w, src_mconfig); 630 609 if (ret) 631 610 return ret; 632 611 ··· 794 773 continue; 795 774 } 796 775 797 - ret = skl_unbind_modules(ctx, src_module, dst_module); 798 - if (ret < 0) 799 - return ret; 800 - 776 + skl_unbind_modules(ctx, src_module, dst_module); 801 777 src_module = dst_module; 802 778 } 803 779 ··· 832 814 * This is a connecter and if path is found that means 833 815 * unbind between source and sink has not happened yet 834 816 */ 835 - ret = skl_stop_pipe(ctx, sink_mconfig->pipe); 836 - if (ret < 0) 837 - return ret; 838 817 ret = skl_unbind_modules(ctx, src_mconfig, 839 818 sink_mconfig); 840 819 } ··· 856 841 switch (event) { 857 842 case SND_SOC_DAPM_PRE_PMU: 858 843 return skl_tplg_mixer_dapm_pre_pmu_event(w, skl); 844 + 845 + case SND_SOC_DAPM_POST_PMU: 846 + return skl_tplg_mixer_dapm_post_pmu_event(w, skl); 847 + 848 + case SND_SOC_DAPM_PRE_PMD: 849 + return skl_tplg_mixer_dapm_pre_pmd_event(w, skl); 859 850 860 851 case SND_SOC_DAPM_POST_PMD: 861 852 return skl_tplg_mixer_dapm_post_pmd_event(w, skl); ··· 936 915 if (w->power) 937 916 skl_get_module_params(skl->skl_sst, (u32 *)bc->params, 938 917 bc->max, bc->param_id, mconfig); 918 + 919 + /* decrement size for TLV header */ 920 + size -= 2 * sizeof(u32); 921 + 922 + /* check size as we don't want to send kernel data */ 923 + if (size > bc->max) 924 + size = bc->max; 939 925 940 926 if (bc->params) { 941 927 if (copy_to_user(data, &bc->param_id, sizeof(u32))) ··· 1538 1510 &skl_tplg_ops, fw, 0); 1539 1511 if (ret < 0) { 1540 1512 dev_err(bus->dev, "tplg component load failed%d\n", ret); 1513 + release_firmware(fw); 1541 1514 return -EINVAL; 1542 1515 } 1543 1516
-2
sound/soc/intel/skylake/skl.c
··· 614 614 goto out_unregister; 615 615 616 616 /*configure PM */ 617 - pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY); 618 - pm_runtime_use_autosuspend(bus->dev); 619 617 pm_runtime_put_noidle(bus->dev); 620 618 pm_runtime_allow(bus->dev); 621 619
+2 -2
sound/soc/mediatek/Kconfig
··· 9 9 10 10 config SND_SOC_MT8173_MAX98090 11 11 tristate "ASoC Audio driver for MT8173 with MAX98090 codec" 12 - depends on SND_SOC_MEDIATEK 12 + depends on SND_SOC_MEDIATEK && I2C 13 13 select SND_SOC_MAX98090 14 14 help 15 15 This adds ASoC driver for Mediatek MT8173 boards ··· 19 19 20 20 config SND_SOC_MT8173_RT5650_RT5676 21 21 tristate "ASoC Audio driver for MT8173 with RT5650 RT5676 codecs" 22 - depends on SND_SOC_MEDIATEK 22 + depends on SND_SOC_MEDIATEK && I2C 23 23 select SND_SOC_RT5645 24 24 select SND_SOC_RT5677 25 25 help
+11 -2
sound/soc/mxs/mxs-saif.c
··· 381 381 __raw_writel(BM_SAIF_CTRL_CLKGATE, 382 382 saif->base + SAIF_CTRL + MXS_CLR_ADDR); 383 383 384 + clk_prepare(saif->clk); 385 + 384 386 return 0; 387 + } 388 + 389 + static void mxs_saif_shutdown(struct snd_pcm_substream *substream, 390 + struct snd_soc_dai *cpu_dai) 391 + { 392 + struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); 393 + 394 + clk_unprepare(saif->clk); 385 395 } 386 396 387 397 /* ··· 434 424 return ret; 435 425 } 436 426 437 - /* prepare clk in hw_param, enable in trigger */ 438 - clk_prepare(saif->clk); 439 427 if (saif != master_saif) { 440 428 /* 441 429 * Set an initial clock rate for the saif internal logic to work ··· 619 611 620 612 static const struct snd_soc_dai_ops mxs_saif_dai_ops = { 621 613 .startup = mxs_saif_startup, 614 + .shutdown = mxs_saif_shutdown, 622 615 .trigger = mxs_saif_trigger, 623 616 .prepare = mxs_saif_prepare, 624 617 .hw_params = mxs_saif_hw_params,
+6 -9
sound/soc/qcom/lpass-platform.c
··· 440 440 } 441 441 442 442 static int lpass_platform_alloc_buffer(struct snd_pcm_substream *substream, 443 - struct snd_soc_pcm_runtime *soc_runtime) 443 + struct snd_soc_pcm_runtime *rt) 444 444 { 445 445 struct snd_dma_buffer *buf = &substream->dma_buffer; 446 446 size_t size = lpass_platform_pcm_hardware.buffer_bytes_max; 447 447 448 448 buf->dev.type = SNDRV_DMA_TYPE_DEV; 449 - buf->dev.dev = soc_runtime->dev; 449 + buf->dev.dev = rt->platform->dev; 450 450 buf->private_data = NULL; 451 - buf->area = dma_alloc_coherent(soc_runtime->dev, size, &buf->addr, 451 + buf->area = dma_alloc_coherent(rt->platform->dev, size, &buf->addr, 452 452 GFP_KERNEL); 453 453 if (!buf->area) { 454 - dev_err(soc_runtime->dev, "%s: Could not allocate DMA buffer\n", 454 + dev_err(rt->platform->dev, "%s: Could not allocate DMA buffer\n", 455 455 __func__); 456 456 return -ENOMEM; 457 457 } ··· 461 461 } 462 462 463 463 static void lpass_platform_free_buffer(struct snd_pcm_substream *substream, 464 - struct snd_soc_pcm_runtime *soc_runtime) 464 + struct snd_soc_pcm_runtime *rt) 465 465 { 466 466 struct snd_dma_buffer *buf = &substream->dma_buffer; 467 467 468 468 if (buf->area) { 469 - dma_free_coherent(soc_runtime->dev, buf->bytes, buf->area, 469 + dma_free_coherent(rt->dev, buf->bytes, buf->area, 470 470 buf->addr); 471 471 } 472 472 buf->area = NULL; ··· 498 498 data->i2s_port = cpu_dai->driver->id; 499 499 500 500 snd_soc_pcm_set_drvdata(soc_runtime, data); 501 - 502 - soc_runtime->dev->coherent_dma_mask = DMA_BIT_MASK(32); 503 - soc_runtime->dev->dma_mask = &soc_runtime->dev->coherent_dma_mask; 504 501 505 502 ret = lpass_platform_alloc_buffer(substream, soc_runtime); 506 503 if (ret)
+4 -4
sound/soc/soc-dapm.c
··· 310 310 }; 311 311 312 312 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, 313 - struct snd_kcontrol *kcontrol) 313 + struct snd_kcontrol *kcontrol, const char *ctrl_name) 314 314 { 315 315 struct dapm_kcontrol_data *data; 316 316 struct soc_mixer_control *mc; ··· 333 333 if (mc->autodisable) { 334 334 struct snd_soc_dapm_widget template; 335 335 336 - name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name, 336 + name = kasprintf(GFP_KERNEL, "%s %s", ctrl_name, 337 337 "Autodisable"); 338 338 if (!name) { 339 339 ret = -ENOMEM; ··· 371 371 if (e->autodisable) { 372 372 struct snd_soc_dapm_widget template; 373 373 374 - name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name, 374 + name = kasprintf(GFP_KERNEL, "%s %s", ctrl_name, 375 375 "Autodisable"); 376 376 if (!name) { 377 377 ret = -ENOMEM; ··· 871 871 872 872 kcontrol->private_free = dapm_kcontrol_free; 873 873 874 - ret = dapm_kcontrol_data_alloc(w, kcontrol); 874 + ret = dapm_kcontrol_data_alloc(w, kcontrol, name); 875 875 if (ret) { 876 876 snd_ctl_free_one(kcontrol); 877 877 goto exit_free;
+2 -1
sound/soc/soc-pcm.c
··· 1810 1810 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && 1811 1811 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && 1812 1812 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && 1813 - (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) 1813 + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && 1814 + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) 1814 1815 continue; 1815 1816 1816 1817 dev_dbg(be->dev, "ASoC: hw_free BE %s\n",