aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2006-02-02 01:56:54 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:28:15 -0500
commite957ebf164e880ddb0c057418195db47d013c4ac (patch)
tree63f4315f81246869a8eb0da48be4c33315cdb7aa
parent2ba8c15c738b64b4d3acaace1e19750362ff2b69 (diff)
[ALSA] ice1712 & cs8427 - fix problem for S/PDIF input setup
Modules: I2C cs8427,ICE1712 driver See ALSA bug#1785 for more details. Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/i2c/cs8427.c7
-rw-r--r--sound/pci/ice1712/ice1712.c33
2 files changed, 23 insertions, 17 deletions
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 9deba80a587c..cb89f7eb9236 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -291,11 +291,13 @@ static void snd_cs8427_reset(struct snd_i2c_device *cs8427)
291{ 291{
292 struct cs8427 *chip; 292 struct cs8427 *chip;
293 unsigned long end_time; 293 unsigned long end_time;
294 int data; 294 int data, aes3input = 0;
295 295
296 snd_assert(cs8427, return); 296 snd_assert(cs8427, return);
297 chip = cs8427->private_data; 297 chip = cs8427->private_data;
298 snd_i2c_lock(cs8427->bus); 298 snd_i2c_lock(cs8427->bus);
299 if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) == CS8427_RXDAES3INPUT) /* AES3 bit is set */
300 aes3input = 1;
299 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK); 301 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK);
300 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, 302 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE,
301 chip->regmap[CS8427_REG_CLOCKSOURCE]); 303 chip->regmap[CS8427_REG_CLOCKSOURCE]);
@@ -316,7 +318,8 @@ static void snd_cs8427_reset(struct snd_i2c_device *cs8427)
316 } 318 }
317 snd_i2c_lock(cs8427->bus); 319 snd_i2c_lock(cs8427->bus);
318 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK; 320 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK;
319 chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RXDAES3INPUT; 321 if (aes3input)
322 chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RXDAES3INPUT;
320 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, 323 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE,
321 chip->regmap[CS8427_REG_CLOCKSOURCE]); 324 chip->regmap[CS8427_REG_CLOCKSOURCE]);
322 snd_i2c_unlock(cs8427->bus); 325 snd_i2c_unlock(cs8427->bus);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 3156a3132990..6682e1fc1449 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -317,7 +317,6 @@ static void snd_ice1712_set_gpio_data(struct snd_ice1712 *ice, unsigned int val)
317 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ 317 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
318} 318}
319 319
320
321/* 320/*
322 * 321 *
323 * CS8427 interface 322 * CS8427 interface
@@ -397,6 +396,20 @@ int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
397 return 0; 396 return 0;
398} 397}
399 398
399static void snd_ice1712_set_input_clock_source(struct snd_ice1712 *ice, int spdif_is_master)
400{
401 /* change CS8427 clock source too */
402 if (ice->cs8427)
403 snd_ice1712_cs8427_set_input_clock(ice, spdif_is_master);
404 /* notify ak4524 chip as well */
405 if (spdif_is_master) {
406 unsigned int i;
407 for (i = 0; i < ice->akm_codecs; i++) {
408 if (ice->akm[i].ops.set_rate_val)
409 ice->akm[i].ops.set_rate_val(&ice->akm[i], 0);
410 }
411 }
412}
400 413
401/* 414/*
402 * Interrupt handler 415 * Interrupt handler
@@ -1857,20 +1870,8 @@ static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
1857 spin_unlock_irq(&ice->reg_lock); 1870 spin_unlock_irq(&ice->reg_lock);
1858 1871
1859 if ((oval & ICE1712_SPDIF_MASTER) != 1872 if ((oval & ICE1712_SPDIF_MASTER) !=
1860 (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) { 1873 (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER))
1861 /* change CS8427 clock source too */ 1874 snd_ice1712_set_input_clock_source(ice, is_spdif_master(ice));
1862 if (ice->cs8427) {
1863 snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice));
1864 }
1865 /* notify ak4524 chip as well */
1866 if (is_spdif_master(ice)) {
1867 unsigned int i;
1868 for (i = 0; i < ice->akm_codecs; i++) {
1869 if (ice->akm[i].ops.set_rate_val)
1870 ice->akm[i].ops.set_rate_val(&ice->akm[i], 0);
1871 }
1872 }
1873 }
1874 1875
1875 return change; 1876 return change;
1876} 1877}
@@ -2736,6 +2737,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2736 } 2737 }
2737 } 2738 }
2738 2739
2740 snd_ice1712_set_input_clock_source(ice, 0);
2741
2739 sprintf(card->longname, "%s at 0x%lx, irq %i", 2742 sprintf(card->longname, "%s at 0x%lx, irq %i",
2740 card->shortname, ice->port, ice->irq); 2743 card->shortname, ice->port, ice->irq);
2741 2744