From 5b648edefe9236e38bc587b0972ccdba8c2495d1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 14 Mar 2008 17:17:09 +0100 Subject: [PATCH] --- yaml --- r: 92135 b: refs/heads/master c: c93f5a1eca1f6d662d791c14c469b6962e05a08f h: refs/heads/master i: 92133: 581771bf34f6642ee9fa9d2ef67d2cc1bae0dfa0 92131: 8abf20df277bcb86f56f0fa9e5b37005fbd2e00d 92127: 1a9eb5f80fc9f9914220c8f97e847771e4a8f9b7 v: v3 --- [refs] | 2 +- trunk/sound/pci/ice1712/ice1724.c | 8 ++++++++ trunk/sound/pci/ice1712/juli.c | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7dbdb5d37953..a9bdad3abf61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5d9fab2d84963ec598810c54a67332decdd922a8 +refs/heads/master: c93f5a1eca1f6d662d791c14c469b6962e05a08f diff --git a/trunk/sound/pci/ice1712/ice1724.c b/trunk/sound/pci/ice1712/ice1724.c index f533850ec6e7..3bfd70577d7a 100644 --- a/trunk/sound/pci/ice1712/ice1724.c +++ b/trunk/sound/pci/ice1712/ice1724.c @@ -970,6 +970,8 @@ static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream) VT1724_BUFFER_ALIGN); snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, VT1724_BUFFER_ALIGN); + if (ice->spdif.ops.open) + ice->spdif.ops.open(ice, substream); return 0; } @@ -980,6 +982,8 @@ static int snd_vt1724_playback_spdif_close(struct snd_pcm_substream *substream) if (PRO_RATE_RESET) snd_vt1724_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); ice->playback_con_substream = NULL; + if (ice->spdif.ops.close) + ice->spdif.ops.close(ice, substream); return 0; } @@ -1002,6 +1006,8 @@ static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream) VT1724_BUFFER_ALIGN); snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, VT1724_BUFFER_ALIGN); + if (ice->spdif.ops.open) + ice->spdif.ops.open(ice, substream); return 0; } @@ -1012,6 +1018,8 @@ static int snd_vt1724_capture_spdif_close(struct snd_pcm_substream *substream) if (PRO_RATE_RESET) snd_vt1724_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); ice->capture_con_substream = NULL; + if (ice->spdif.ops.close) + ice->spdif.ops.close(ice, substream); return 0; } diff --git a/trunk/sound/pci/ice1712/juli.c b/trunk/sound/pci/ice1712/juli.c index e8038c0ceb72..4550609b4d47 100644 --- a/trunk/sound/pci/ice1712/juli.c +++ b/trunk/sound/pci/ice1712/juli.c @@ -77,6 +77,22 @@ static unsigned char juli_ak4114_read(void *private_data, unsigned char reg) return snd_vt1724_read_i2c((struct snd_ice1712 *)private_data, AK4114_ADDR, reg); } +static void juli_spdif_in_open(struct snd_ice1712 *ice, + struct snd_pcm_substream *substream) +{ + struct juli_spec *spec = ice->spec; + struct snd_pcm_runtime *runtime = substream->runtime; + int rate; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return; + rate = snd_ak4114_external_rate(spec->ak4114); + if (rate >= runtime->hw.rate_min && rate <= runtime->hw.rate_max) { + runtime->hw.rate_min = rate; + runtime->hw.rate_max = rate; + } +} + /* * AK4358 section */ @@ -210,6 +226,7 @@ static int __devinit juli_init(struct snd_ice1712 *ice) return err; } + ice->spdif.ops.open = juli_spdif_in_open; return 0; }