Skip to content

Commit

Permalink
ALSA: ice1712 delta - initialize SPI clock
Browse files Browse the repository at this point in the history
The driver was using an initial value for the clock on the SPI bus
which was read from ICE1712 EEPROM,
ice->eeprom.data[ICE_EEP1_GPIO_STATE] & ICE1712_DELTA_AP_CCLK (0x02)

It appears some cards have it default high, some cards
have it default low. On my Delta 66 rev. E:
$ cat /proc/asound/M66/ice1712 | grep 'GPIO state'
  GPIO state       : 0x70 /* ICE1712_DELTA_AP_CCLK bit is zero */
On my Audiophile 2496:
$ cat /proc/asound/M2496/ice1712 | grep 'GPIO state'
  GPIO state       : 0xfe /* ICE1712_DELTA_AP_CCLK bit is one */

It must be raised before the first SPI write happens, or the write will
fail, leading to:

[   23.248721] invalid CS8427 signature 0x0: let me try again...

I theorize that 4eb4550
is no longer needed, it was a different way to workaround
the problem.

[fixed variable decleration by tiwai]

Signed-off-by: Brian Bloniarz <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
b11z authored and tiwai committed Jan 18, 2011
1 parent 27de094 commit b8b1a4c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/pci/ice1712/delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
{
int err;
struct snd_akm4xxx *ak;
unsigned char tmp;

if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 &&
ice->eeprom.gpiodir == 0x7b)
Expand Down Expand Up @@ -622,6 +623,12 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
break;
}

/* initialize the SPI clock to high */
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
tmp |= ICE1712_DELTA_AP_CCLK;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
udelay(5);

/* initialize spdif */
switch (ice->eeprom.subvendor) {
case ICE1712_SUBDEVICE_AUDIOPHILE:
Expand Down

0 comments on commit b8b1a4c

Please sign in to comment.