Commit 5baeb169 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Jaroslav Kysela <perex@suse.cz>

ICE1712 driver
DFS bit must be handled also for Delta1010 and Delta2496
parent 82e883e5
......@@ -256,6 +256,26 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip)
priv->cs_addr = chip << 4;
}
/*
* change the DFS bit according rate for Delta1010
*/
static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate)
{
unsigned char tmp, tmp2;
if (rate == 0) /* no hint - S/PDIF input is master, simply return */
return;
down(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
tmp2 = tmp & ~ICE1712_DELTA_DFS;
if (rate > 48000)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp != tmp2)
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp2);
up(&ice->gpio_mutex);
}
/*
* change the rate of AK4524 on Delta 44/66, AP, 1010LT
*/
......@@ -271,8 +291,7 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
down(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
up(&ice->gpio_mutex);
tmp2 = tmp;
tmp2 &= ~ICE1712_DELTA_DFS;
tmp2 = tmp & ~ICE1712_DELTA_DFS;
if (rate > 48000)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp == tmp2)
......@@ -454,7 +473,11 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
return err;
break;
case ICE1712_SUBDEVICE_DELTA1010:
ice->gpio.set_pro_rate = delta_1010_set_rate_val;
break;
case ICE1712_SUBDEVICE_DELTADIO2496:
ice->gpio.set_pro_rate = delta_1010_set_rate_val;
/* fall thru */
case ICE1712_SUBDEVICE_DELTA66:
ice->spdif.ops.open = delta_open_spdif;
ice->spdif.ops.setup_rate = delta_setup_spdif;
......
......@@ -1047,6 +1047,8 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int forc
spin_unlock_irqrestore(&ice->reg_lock, flags);
if (ice->gpio.set_pro_rate)
ice->gpio.set_pro_rate(ice, rate);
for (i = 0; i < ice->akm_codecs; i++) {
if (ice->akm[i].ops.set_rate_val)
ice->akm[i].ops.set_rate_val(&ice->akm[i], rate);
......
......@@ -353,6 +353,8 @@ struct _snd_ice1712 {
void (*set_dir)(ice1712_t *ice, unsigned int data);
void (*set_data)(ice1712_t *ice, unsigned int data);
unsigned int (*get_data)(ice1712_t *ice);
/* misc operators - move to another place? */
void (*set_pro_rate)(ice1712_t *ice, unsigned int rate);
} gpio;
struct semaphore gpio_mutex;
};
......
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