Commit 16c5cde2 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'for-linus' into for-next

Once again back-merge the 6.0-rc devel branch for further USB-audio
and HD-audio developments.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents 32eeeed9 37137ec2
...@@ -558,10 +558,13 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) ...@@ -558,10 +558,13 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.need_sync = dma_need_sync(dmab->dev.dev,
sg_dma_address(sgt->sgl)); sg_dma_address(sgt->sgl));
p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt);
if (p) if (p) {
dmab->private_data = sgt; dmab->private_data = sgt;
else /* store the first page address for convenience */
dmab->addr = snd_sgbuf_get_addr(dmab, 0);
} else {
dma_free_noncontiguous(dmab->dev.dev, size, sgt, dmab->dev.dir); dma_free_noncontiguous(dmab->dev.dev, size, sgt, dmab->dev.dir);
}
return p; return p;
} }
...@@ -763,6 +766,8 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) ...@@ -763,6 +766,8 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size)
if (!p) if (!p)
goto error; goto error;
dmab->private_data = sgbuf; dmab->private_data = sgbuf;
/* store the first page address for convenience */
dmab->addr = snd_sgbuf_get_addr(dmab, 0);
return p; return p;
error: error:
......
...@@ -1672,14 +1672,14 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file) ...@@ -1672,14 +1672,14 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
runtime = substream->runtime; runtime = substream->runtime;
if (atomic_read(&substream->mmap_count)) if (atomic_read(&substream->mmap_count))
goto __direct; goto __direct;
err = snd_pcm_oss_make_ready(substream);
if (err < 0)
return err;
atomic_inc(&runtime->oss.rw_ref); atomic_inc(&runtime->oss.rw_ref);
if (mutex_lock_interruptible(&runtime->oss.params_lock)) { if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
atomic_dec(&runtime->oss.rw_ref); atomic_dec(&runtime->oss.rw_ref);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
err = snd_pcm_oss_make_ready_locked(substream);
if (err < 0)
goto unlock;
format = snd_pcm_oss_format_from(runtime->oss.format); format = snd_pcm_oss_format_from(runtime->oss.format);
width = snd_pcm_format_physical_width(format); width = snd_pcm_format_physical_width(format);
if (runtime->oss.buffer_used > 0) { if (runtime->oss.buffer_used > 0) {
......
...@@ -605,17 +605,18 @@ static unsigned int loopback_jiffies_timer_pos_update ...@@ -605,17 +605,18 @@ static unsigned int loopback_jiffies_timer_pos_update
cable->streams[SNDRV_PCM_STREAM_PLAYBACK]; cable->streams[SNDRV_PCM_STREAM_PLAYBACK];
struct loopback_pcm *dpcm_capt = struct loopback_pcm *dpcm_capt =
cable->streams[SNDRV_PCM_STREAM_CAPTURE]; cable->streams[SNDRV_PCM_STREAM_CAPTURE];
unsigned long delta_play = 0, delta_capt = 0; unsigned long delta_play = 0, delta_capt = 0, cur_jiffies;
unsigned int running, count1, count2; unsigned int running, count1, count2;
cur_jiffies = jiffies;
running = cable->running ^ cable->pause; running = cable->running ^ cable->pause;
if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) { if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) {
delta_play = jiffies - dpcm_play->last_jiffies; delta_play = cur_jiffies - dpcm_play->last_jiffies;
dpcm_play->last_jiffies += delta_play; dpcm_play->last_jiffies += delta_play;
} }
if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) { if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) {
delta_capt = jiffies - dpcm_capt->last_jiffies; delta_capt = cur_jiffies - dpcm_capt->last_jiffies;
dpcm_capt->last_jiffies += delta_capt; dpcm_capt->last_jiffies += delta_capt;
} }
......
...@@ -1810,7 +1810,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -1810,7 +1810,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
/* use the non-cached pages in non-snoop mode */ /* use the non-cached pages in non-snoop mode */
if (!azx_snoop(chip)) if (!azx_snoop(chip))
azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC; azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC_SG;
if (chip->driver_type == AZX_DRIVER_NVIDIA) { if (chip->driver_type == AZX_DRIVER_NVIDIA) {
dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n"); dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");
......
...@@ -474,7 +474,8 @@ MODULE_DEVICE_TABLE(of, hda_tegra_match); ...@@ -474,7 +474,8 @@ MODULE_DEVICE_TABLE(of, hda_tegra_match);
static int hda_tegra_probe(struct platform_device *pdev) static int hda_tegra_probe(struct platform_device *pdev)
{ {
const unsigned int driver_flags = AZX_DCAPS_CORBRP_SELF_CLEAR | const unsigned int driver_flags = AZX_DCAPS_CORBRP_SELF_CLEAR |
AZX_DCAPS_PM_RUNTIME; AZX_DCAPS_PM_RUNTIME |
AZX_DCAPS_4K_BDLE_BOUNDARY;
struct snd_card *card; struct snd_card *card;
struct azx *chip; struct azx *chip;
struct hda_tegra *hda; struct hda_tegra *hda;
......
...@@ -209,6 +209,7 @@ struct sigmatel_spec { ...@@ -209,6 +209,7 @@ struct sigmatel_spec {
/* beep widgets */ /* beep widgets */
hda_nid_t anabeep_nid; hda_nid_t anabeep_nid;
bool beep_power_on;
/* SPDIF-out mux */ /* SPDIF-out mux */
const char * const *spdif_labels; const char * const *spdif_labels;
...@@ -4443,6 +4444,28 @@ static int stac_suspend(struct hda_codec *codec) ...@@ -4443,6 +4444,28 @@ static int stac_suspend(struct hda_codec *codec)
return 0; return 0;
} }
static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{
#ifdef CONFIG_SND_HDA_INPUT_BEEP
struct sigmatel_spec *spec = codec->spec;
#endif
int ret = snd_hda_gen_check_power_status(codec, nid);
#ifdef CONFIG_SND_HDA_INPUT_BEEP
if (nid == spec->gen.beep_nid && codec->beep) {
if (codec->beep->enabled != spec->beep_power_on) {
spec->beep_power_on = codec->beep->enabled;
if (spec->beep_power_on)
snd_hda_power_up_pm(codec);
else
snd_hda_power_down_pm(codec);
}
ret |= spec->beep_power_on;
}
#endif
return ret;
}
#else #else
#define stac_suspend NULL #define stac_suspend NULL
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
...@@ -4455,6 +4478,7 @@ static const struct hda_codec_ops stac_patch_ops = { ...@@ -4455,6 +4478,7 @@ static const struct hda_codec_ops stac_patch_ops = {
.unsol_event = snd_hda_jack_unsol_event, .unsol_event = snd_hda_jack_unsol_event,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = stac_suspend, .suspend = stac_suspend,
.check_power_status = stac_check_power_status,
#endif #endif
}; };
......
...@@ -1106,7 +1106,7 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip, ...@@ -1106,7 +1106,7 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
* Dallas DS4201 workaround: It presents 5 altsettings, but the last * Dallas DS4201 workaround: It presents 5 altsettings, but the last
* one misses syncpipe, and does not produce any sound. * one misses syncpipe, and does not produce any sound.
*/ */
if (chip->usb_id == USB_ID(0x04fa, 0x4201)) if (chip->usb_id == USB_ID(0x04fa, 0x4201) && num >= 4)
num = 4; num = 4;
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment