aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index d56ea2125aa8..cc50d13ee90c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -274,8 +274,8 @@ struct azx_dev {
274 /* for sanity check of position buffer */ 274 /* for sanity check of position buffer */
275 unsigned int period_intr; 275 unsigned int period_intr;
276 276
277 unsigned int opened: 1; 277 unsigned int opened :1;
278 unsigned int running: 1; 278 unsigned int running :1;
279}; 279};
280 280
281/* CORB/RIRB */ 281/* CORB/RIRB */
@@ -333,9 +333,9 @@ struct azx {
333 333
334 /* flags */ 334 /* flags */
335 int position_fix; 335 int position_fix;
336 unsigned int initialized: 1; 336 unsigned int initialized :1;
337 unsigned int single_cmd: 1; 337 unsigned int single_cmd :1;
338 unsigned int polling_mode: 1; 338 unsigned int polling_mode :1;
339}; 339};
340 340
341/* driver types */ 341/* driver types */
@@ -661,14 +661,14 @@ static int azx_reset(struct azx *chip)
661 azx_writeb(chip, GCTL, azx_readb(chip, GCTL) | ICH6_GCTL_RESET); 661 azx_writeb(chip, GCTL, azx_readb(chip, GCTL) | ICH6_GCTL_RESET);
662 662
663 count = 50; 663 count = 50;
664 while (! azx_readb(chip, GCTL) && --count) 664 while (!azx_readb(chip, GCTL) && --count)
665 msleep(1); 665 msleep(1);
666 666
667 /* Brent Chartrand said to wait >= 540us for codecs to intialize */ 667 /* Brent Chartrand said to wait >= 540us for codecs to initialize */
668 msleep(1); 668 msleep(1);
669 669
670 /* check to see if controller is ready */ 670 /* check to see if controller is ready */
671 if (! azx_readb(chip, GCTL)) { 671 if (!azx_readb(chip, GCTL)) {
672 snd_printd("azx_reset: controller not ready!\n"); 672 snd_printd("azx_reset: controller not ready!\n");
673 return -EBUSY; 673 return -EBUSY;
674 } 674 }
@@ -677,7 +677,7 @@ static int azx_reset(struct azx *chip)
677 azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UREN); 677 azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UREN);
678 678
679 /* detect codecs */ 679 /* detect codecs */
680 if (! chip->codec_mask) { 680 if (!chip->codec_mask) {
681 chip->codec_mask = azx_readw(chip, STATESTS); 681 chip->codec_mask = azx_readw(chip, STATESTS);
682 snd_printdd("codec_mask = 0x%x\n", chip->codec_mask); 682 snd_printdd("codec_mask = 0x%x\n", chip->codec_mask);
683 } 683 }
@@ -785,7 +785,7 @@ static void azx_init_chip(struct azx *chip)
785 azx_int_enable(chip); 785 azx_int_enable(chip);
786 786
787 /* initialize the codec command I/O */ 787 /* initialize the codec command I/O */
788 if (! chip->single_cmd) 788 if (!chip->single_cmd)
789 azx_init_cmd_io(chip); 789 azx_init_cmd_io(chip);
790 790
791 /* program the position buffer */ 791 /* program the position buffer */
@@ -813,7 +813,7 @@ static void azx_init_chip(struct azx *chip)
813/* 813/*
814 * interrupt handler 814 * interrupt handler
815 */ 815 */
816static irqreturn_t azx_interrupt(int irq, void* dev_id, struct pt_regs *regs) 816static irqreturn_t azx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
817{ 817{
818 struct azx *chip = dev_id; 818 struct azx *chip = dev_id;
819 struct azx_dev *azx_dev; 819 struct azx_dev *azx_dev;
@@ -1018,8 +1018,9 @@ static struct snd_pcm_hardware azx_pcm_hw = {
1018 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1018 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1019 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1019 SNDRV_PCM_INFO_BLOCK_TRANSFER |
1020 SNDRV_PCM_INFO_MMAP_VALID | 1020 SNDRV_PCM_INFO_MMAP_VALID |
1021 SNDRV_PCM_INFO_PAUSE /*|*/ 1021 /* No full-resume yet implemented */
1022 /*SNDRV_PCM_INFO_RESUME*/), 1022 /* SNDRV_PCM_INFO_RESUME |*/
1023 SNDRV_PCM_INFO_PAUSE),
1023 .formats = SNDRV_PCM_FMTBIT_S16_LE, 1024 .formats = SNDRV_PCM_FMTBIT_S16_LE,
1024 .rates = SNDRV_PCM_RATE_48000, 1025 .rates = SNDRV_PCM_RATE_48000,
1025 .rate_min = 48000, 1026 .rate_min = 48000,
@@ -1454,19 +1455,19 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1454 struct azx **rchip) 1455 struct azx **rchip)
1455{ 1456{
1456 struct azx *chip; 1457 struct azx *chip;
1457 int err = 0; 1458 int err;
1458 static struct snd_device_ops ops = { 1459 static struct snd_device_ops ops = {
1459 .dev_free = azx_dev_free, 1460 .dev_free = azx_dev_free,
1460 }; 1461 };
1461 1462
1462 *rchip = NULL; 1463 *rchip = NULL;
1463 1464
1464 if ((err = pci_enable_device(pci)) < 0) 1465 err = pci_enable_device(pci);
1466 if (err < 0)
1465 return err; 1467 return err;
1466 1468
1467 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1469 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
1468 1470 if (!chip) {
1469 if (NULL == chip) {
1470 snd_printk(KERN_ERR SFX "cannot allocate chip\n"); 1471 snd_printk(KERN_ERR SFX "cannot allocate chip\n");
1471 pci_disable_device(pci); 1472 pci_disable_device(pci);
1472 return -ENOMEM; 1473 return -ENOMEM;
@@ -1492,13 +1493,14 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1492 } 1493 }
1493#endif 1494#endif
1494 1495
1495 if ((err = pci_request_regions(pci, "ICH HD audio")) < 0) { 1496 err = pci_request_regions(pci, "ICH HD audio");
1497 if (err < 0) {
1496 kfree(chip); 1498 kfree(chip);
1497 pci_disable_device(pci); 1499 pci_disable_device(pci);
1498 return err; 1500 return err;
1499 } 1501 }
1500 1502
1501 chip->addr = pci_resource_start(pci,0); 1503 chip->addr = pci_resource_start(pci, 0);
1502 chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0)); 1504 chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0));
1503 if (chip->remap_addr == NULL) { 1505 if (chip->remap_addr == NULL) {
1504 snd_printk(KERN_ERR SFX "ioremap error\n"); 1506 snd_printk(KERN_ERR SFX "ioremap error\n");
@@ -1542,7 +1544,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1542 } 1544 }
1543 chip->num_streams = chip->playback_streams + chip->capture_streams; 1545 chip->num_streams = chip->playback_streams + chip->capture_streams;
1544 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev), GFP_KERNEL); 1546 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev), GFP_KERNEL);
1545 if (! chip->azx_dev) { 1547 if (!chip->azx_dev) {
1546 snd_printk(KERN_ERR "cannot malloc azx_dev\n"); 1548 snd_printk(KERN_ERR "cannot malloc azx_dev\n");
1547 goto errout; 1549 goto errout;
1548 } 1550 }
@@ -1573,7 +1575,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1573 chip->initialized = 1; 1575 chip->initialized = 1;
1574 1576
1575 /* codec detection */ 1577 /* codec detection */
1576 if (! chip->codec_mask) { 1578 if (!chip->codec_mask) {
1577 snd_printk(KERN_ERR SFX "no codecs found!\n"); 1579 snd_printk(KERN_ERR SFX "no codecs found!\n");
1578 err = -ENODEV; 1580 err = -ENODEV;
1579 goto errout; 1581 goto errout;
@@ -1600,16 +1602,16 @@ static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *
1600{ 1602{
1601 struct snd_card *card; 1603 struct snd_card *card;
1602 struct azx *chip; 1604 struct azx *chip;
1603 int err = 0; 1605 int err;
1604 1606
1605 card = snd_card_new(index, id, THIS_MODULE, 0); 1607 card = snd_card_new(index, id, THIS_MODULE, 0);
1606 if (NULL == card) { 1608 if (!card) {
1607 snd_printk(KERN_ERR SFX "Error creating card!\n"); 1609 snd_printk(KERN_ERR SFX "Error creating card!\n");
1608 return -ENOMEM; 1610 return -ENOMEM;
1609 } 1611 }
1610 1612
1611 if ((err = azx_create(card, pci, pci_id->driver_data, 1613 err = azx_create(card, pci, pci_id->driver_data, &chip);
1612 &chip)) < 0) { 1614 if (err < 0) {
1613 snd_card_free(card); 1615 snd_card_free(card);
1614 return err; 1616 return err;
1615 } 1617 }