diff options
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 2213beec009a..514e15385f7a 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -118,9 +118,12 @@ static inline int stdclock_is_spdif_master(struct snd_ice1712 *ice) | |||
118 | return (inb(ICEMT1724(ice, RATE)) & VT1724_SPDIF_MASTER) ? 1 : 0; | 118 | return (inb(ICEMT1724(ice, RATE)) & VT1724_SPDIF_MASTER) ? 1 : 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | /* | ||
122 | * locking rate makes sense only for internal clock mode | ||
123 | */ | ||
121 | static inline int is_pro_rate_locked(struct snd_ice1712 *ice) | 124 | static inline int is_pro_rate_locked(struct snd_ice1712 *ice) |
122 | { | 125 | { |
123 | return ice->is_spdif_master(ice) || PRO_RATE_LOCKED; | 126 | return (!ice->is_spdif_master(ice)) && PRO_RATE_LOCKED; |
124 | } | 127 | } |
125 | 128 | ||
126 | /* | 129 | /* |
@@ -668,16 +671,22 @@ static int snd_vt1724_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate, | |||
668 | return -EBUSY; | 671 | return -EBUSY; |
669 | } | 672 | } |
670 | if (!force && is_pro_rate_locked(ice)) { | 673 | if (!force && is_pro_rate_locked(ice)) { |
674 | /* comparing required and current rate - makes sense for | ||
675 | * internal clock only */ | ||
671 | spin_unlock_irqrestore(&ice->reg_lock, flags); | 676 | spin_unlock_irqrestore(&ice->reg_lock, flags); |
672 | return (rate == ice->cur_rate) ? 0 : -EBUSY; | 677 | return (rate == ice->cur_rate) ? 0 : -EBUSY; |
673 | } | 678 | } |
674 | 679 | ||
675 | old_rate = ice->get_rate(ice); | 680 | if (force || !ice->is_spdif_master(ice)) { |
676 | if (force || (old_rate != rate)) | 681 | /* force means the rate was switched by ucontrol, otherwise |
677 | ice->set_rate(ice, rate); | 682 | * setting clock rate for internal clock mode */ |
678 | else if (rate == ice->cur_rate) { | 683 | old_rate = ice->get_rate(ice); |
679 | spin_unlock_irqrestore(&ice->reg_lock, flags); | 684 | if (force || (old_rate != rate)) |
680 | return 0; | 685 | ice->set_rate(ice, rate); |
686 | else if (rate == ice->cur_rate) { | ||
687 | spin_unlock_irqrestore(&ice->reg_lock, flags); | ||
688 | return 0; | ||
689 | } | ||
681 | } | 690 | } |
682 | 691 | ||
683 | ice->cur_rate = rate; | 692 | ice->cur_rate = rate; |