Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170384
b: refs/heads/master
c: 6796d5a
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Hofman authored and Takashi Iwai committed Sep 21, 2009
1 parent 9a3cee6 commit 2398f85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 494703062b6e6ef5e72364aafc9bcbc172d53dea
refs/heads/master: 6796d5a05f4d3caad17d2586b3e5776fda50ef82
23 changes: 16 additions & 7 deletions trunk/sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ static inline int stdclock_is_spdif_master(struct snd_ice1712 *ice)
return (inb(ICEMT1724(ice, RATE)) & VT1724_SPDIF_MASTER) ? 1 : 0;
}

/*
* locking rate makes sense only for internal clock mode
*/
static inline int is_pro_rate_locked(struct snd_ice1712 *ice)
{
return ice->is_spdif_master(ice) || PRO_RATE_LOCKED;
return (!ice->is_spdif_master(ice)) && PRO_RATE_LOCKED;
}

/*
Expand Down Expand Up @@ -668,16 +671,22 @@ static int snd_vt1724_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate,
return -EBUSY;
}
if (!force && is_pro_rate_locked(ice)) {
/* comparing required and current rate - makes sense for
* internal clock only */
spin_unlock_irqrestore(&ice->reg_lock, flags);
return (rate == ice->cur_rate) ? 0 : -EBUSY;
}

old_rate = ice->get_rate(ice);
if (force || (old_rate != rate))
ice->set_rate(ice, rate);
else if (rate == ice->cur_rate) {
spin_unlock_irqrestore(&ice->reg_lock, flags);
return 0;
if (force || !ice->is_spdif_master(ice)) {
/* force means the rate was switched by ucontrol, otherwise
* setting clock rate for internal clock mode */
old_rate = ice->get_rate(ice);
if (force || (old_rate != rate))
ice->set_rate(ice, rate);
else if (rate == ice->cur_rate) {
spin_unlock_irqrestore(&ice->reg_lock, flags);
return 0;
}
}

ice->cur_rate = rate;
Expand Down

0 comments on commit 2398f85

Please sign in to comment.