aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/intel8x0.c16
-rw-r--r--sound/pci/intel8x0m.c12
2 files changed, 10 insertions, 18 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index cf7801d2dd10..af2b1435e630 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2149,10 +2149,6 @@ static void do_ali_reset(intel8x0_t *chip)
2149 iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000); 2149 iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000);
2150} 2150}
2151 2151
2152#define do_delay(chip) do {\
2153 schedule_timeout_uninterruptible(1);\
2154} while (0)
2155
2156static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) 2152static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2157{ 2153{
2158 unsigned long end_time; 2154 unsigned long end_time;
@@ -2176,7 +2172,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2176 do { 2172 do {
2177 if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0) 2173 if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0)
2178 goto __ok; 2174 goto __ok;
2179 do_delay(chip); 2175 schedule_timeout_uninterruptible(1);
2180 } while (time_after_eq(end_time, jiffies)); 2176 } while (time_after_eq(end_time, jiffies));
2181 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); 2177 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT)));
2182 return -EIO; 2178 return -EIO;
@@ -2192,7 +2188,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2192 status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 2188 status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
2193 if (status) 2189 if (status)
2194 break; 2190 break;
2195 do_delay(chip); 2191 schedule_timeout_uninterruptible(1);
2196 } while (time_after_eq(end_time, jiffies)); 2192 } while (time_after_eq(end_time, jiffies));
2197 if (! status) { 2193 if (! status) {
2198 /* no codec is found */ 2194 /* no codec is found */
@@ -2210,7 +2206,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2210 /* wait for other codecs ready status. */ 2206 /* wait for other codecs ready status. */
2211 end_time = jiffies + HZ / 4; 2207 end_time = jiffies + HZ / 4;
2212 while (status != nstatus && time_after_eq(end_time, jiffies)) { 2208 while (status != nstatus && time_after_eq(end_time, jiffies)) {
2213 do_delay(chip); 2209 schedule_timeout_uninterruptible(1);
2214 status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus; 2210 status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus;
2215 } 2211 }
2216 2212
@@ -2227,7 +2223,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
2227 nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 2223 nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
2228 if (status == nstatus) 2224 if (status == nstatus)
2229 break; 2225 break;
2230 do_delay(chip); 2226 schedule_timeout_uninterruptible(1);
2231 } while (time_after_eq(end_time, jiffies)); 2227 } while (time_after_eq(end_time, jiffies));
2232 } 2228 }
2233 2229
@@ -2261,7 +2257,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing)
2261 for (i = 0; i < HZ / 2; i++) { 2257 for (i = 0; i < HZ / 2; i++) {
2262 if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO)) 2258 if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
2263 goto __ok; 2259 goto __ok;
2264 do_delay(chip); 2260 schedule_timeout_uninterruptible(1);
2265 } 2261 }
2266 snd_printk(KERN_ERR "AC'97 reset failed.\n"); 2262 snd_printk(KERN_ERR "AC'97 reset failed.\n");
2267 if (probing) 2263 if (probing)
@@ -2273,7 +2269,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing)
2273 if (reg & 0x80) /* primary codec */ 2269 if (reg & 0x80) /* primary codec */
2274 break; 2270 break;
2275 iputdword(chip, ICHREG(ALI_RTSR), reg | 0x80); 2271 iputdword(chip, ICHREG(ALI_RTSR), reg | 0x80);
2276 do_delay(chip); 2272 schedule_timeout_uninterruptible(1);
2277 } 2273 }
2278 2274
2279 do_ali_reset(chip); 2275 do_ali_reset(chip);
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index a42091860da7..3244df9c1e92 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -889,10 +889,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
889 * 889 *
890 */ 890 */
891 891
892#define do_delay(chip) do {\
893 schedule_timeout_uninterruptible(1);\
894} while (0)
895
896static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) 892static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
897{ 893{
898 unsigned long end_time; 894 unsigned long end_time;
@@ -914,7 +910,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
914 do { 910 do {
915 if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0) 911 if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0)
916 goto __ok; 912 goto __ok;
917 do_delay(chip); 913 schedule_timeout_uninterruptible(1);
918 } while (time_after_eq(end_time, jiffies)); 914 } while (time_after_eq(end_time, jiffies));
919 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); 915 snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT)));
920 return -EIO; 916 return -EIO;
@@ -930,7 +926,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
930 status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 926 status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
931 if (status) 927 if (status)
932 break; 928 break;
933 do_delay(chip); 929 schedule_timeout_uninterruptible(1);
934 } while (time_after_eq(end_time, jiffies)); 930 } while (time_after_eq(end_time, jiffies));
935 if (! status) { 931 if (! status) {
936 /* no codec is found */ 932 /* no codec is found */
@@ -944,7 +940,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
944 /* wait for other codecs ready status. */ 940 /* wait for other codecs ready status. */
945 end_time = jiffies + HZ / 4; 941 end_time = jiffies + HZ / 4;
946 while (status != nstatus && time_after_eq(end_time, jiffies)) { 942 while (status != nstatus && time_after_eq(end_time, jiffies)) {
947 do_delay(chip); 943 schedule_timeout_uninterruptible(1);
948 status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus; 944 status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus;
949 } 945 }
950 946
@@ -959,7 +955,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
959 nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); 955 nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
960 if (status == nstatus) 956 if (status == nstatus)
961 break; 957 break;
962 do_delay(chip); 958 schedule_timeout_uninterruptible(1);
963 } while (time_after_eq(end_time, jiffies)); 959 } while (time_after_eq(end_time, jiffies));
964 } 960 }
965 961