Deleted Added
full compact
hdac.c (170521) hdac.c (170721)
1/*-
2 * Copyright (c) 2006 Stephane E. Potvin <sepotvin@videotron.ca>
3 * Copyright (c) 2006 Ariff Abdullah <ariff@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 69 unchanged lines hidden (view full) ---

78#include <dev/sound/pci/hda/hda_reg.h>
79#include <dev/sound/pci/hda/hdac.h>
80
81#include "mixer_if.h"
82
83#define HDA_DRV_TEST_REV "20070611_0045"
84#define HDA_WIDGET_PARSER_REV 1
85
1/*-
2 * Copyright (c) 2006 Stephane E. Potvin <sepotvin@videotron.ca>
3 * Copyright (c) 2006 Ariff Abdullah <ariff@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 69 unchanged lines hidden (view full) ---

78#include <dev/sound/pci/hda/hda_reg.h>
79#include <dev/sound/pci/hda/hdac.h>
80
81#include "mixer_if.h"
82
83#define HDA_DRV_TEST_REV "20070611_0045"
84#define HDA_WIDGET_PARSER_REV 1
85
86SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/hda/hdac.c 170521 2007-06-11 00:49:46Z ariff $");
86SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/hda/hdac.c 170721 2007-06-14 11:13:38Z ariff $");
87
88#define HDA_BOOTVERBOSE(stmt) do { \
89 if (bootverbose != 0 || snd_verbose > 3) { \
90 stmt \
91 } \
92} while(0)
93
94#if 1

--- 3476 unchanged lines hidden (view full) ---

3571hdac_attach(device_t dev)
3572{
3573 struct hdac_softc *sc;
3574 int result;
3575 int i;
3576 uint16_t vendor;
3577 uint8_t v;
3578
87
88#define HDA_BOOTVERBOSE(stmt) do { \
89 if (bootverbose != 0 || snd_verbose > 3) { \
90 stmt \
91 } \
92} while(0)
93
94#if 1

--- 3476 unchanged lines hidden (view full) ---

3571hdac_attach(device_t dev)
3572{
3573 struct hdac_softc *sc;
3574 int result;
3575 int i;
3576 uint16_t vendor;
3577 uint8_t v;
3578
3579 sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO);
3580 if (sc == NULL) {
3581 device_printf(dev, "cannot allocate softc\n");
3582 return (ENOMEM);
3583 }
3584
3579 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
3585 sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME);
3586 sc->dev = dev;
3587 sc->pci_subvendor = (uint32_t)pci_get_subdevice(sc->dev) << 16;
3588 sc->pci_subvendor |= (uint32_t)pci_get_subvendor(sc->dev) & 0x0000ffff;
3589 vendor = pci_get_vendor(dev);
3590
3591 if (sc->pci_subvendor == HP_NX6325_SUBVENDORX) {
3592 /* Screw nx6325 - subdevice/subvendor swapped */

--- 2010 unchanged lines hidden (view full) ---

5603 int i, devcount;
5604
5605 if (sc == NULL)
5606 return;
5607
5608 hdac_lock(sc);
5609 sc->polling = 0;
5610 sc->poll_ival = 0;
3580 sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME);
3581 sc->dev = dev;
3582 sc->pci_subvendor = (uint32_t)pci_get_subdevice(sc->dev) << 16;
3583 sc->pci_subvendor |= (uint32_t)pci_get_subvendor(sc->dev) & 0x0000ffff;
3584 vendor = pci_get_vendor(dev);
3585
3586 if (sc->pci_subvendor == HP_NX6325_SUBVENDORX) {
3587 /* Screw nx6325 - subdevice/subvendor swapped */

--- 2010 unchanged lines hidden (view full) ---

5598 int i, devcount;
5599
5600 if (sc == NULL)
5601 return;
5602
5603 hdac_lock(sc);
5604 sc->polling = 0;
5605 sc->poll_ival = 0;
5606 callout_stop(&sc->poll_hda);
5611 callout_stop(&sc->poll_hdac);
5612 callout_stop(&sc->poll_jack);
5613 hdac_reset(sc);
5614 hdac_unlock(sc);
5607 callout_stop(&sc->poll_hdac);
5608 callout_stop(&sc->poll_jack);
5609 hdac_reset(sc);
5610 hdac_unlock(sc);
5611 callout_drain(&sc->poll_hda);
5615 callout_drain(&sc->poll_hdac);
5616 callout_drain(&sc->poll_jack);
5617
5618 hdac_irq_free(sc);
5619
5620 device_get_children(sc->dev, &devlist, &devcount);
5621 for (i = 0; devlist != NULL && i < devcount; i++) {
5622 devinfo = (struct hdac_devinfo *)device_get_ivars(devlist[i]);

--- 628 unchanged lines hidden ---
5612 callout_drain(&sc->poll_hdac);
5613 callout_drain(&sc->poll_jack);
5614
5615 hdac_irq_free(sc);
5616
5617 device_get_children(sc->dev, &devlist, &devcount);
5618 for (i = 0; devlist != NULL && i < devcount; i++) {
5619 devinfo = (struct hdac_devinfo *)device_get_ivars(devlist[i]);

--- 628 unchanged lines hidden ---