|
Lines 896-902
Link Here
|
| 896 |
#define PCI_LEGACYCONTROL 0x40 |
896 |
#define PCI_LEGACYCONTROL 0x40 |
| 897 |
#define PCI_CONFIG 0x50 |
897 |
#define PCI_CONFIG 0x50 |
| 898 |
#define PCI_DDMACONTROL 0x60 |
898 |
#define PCI_DDMACONTROL 0x60 |
|
|
899 |
static int |
| 900 |
ess_suspend(device_t dev) |
| 901 |
{ |
| 902 |
return 0; |
| 903 |
} |
| 904 |
static int |
| 905 |
ess_resume(device_t dev) |
| 906 |
{ |
| 907 |
uint16_t ddma; |
| 908 |
uint32_t data; |
| 909 |
struct ess_info *sc = pcm_getdevinfo(dev); |
| 910 |
|
| 911 |
data = pci_read_config(dev, PCIR_COMMAND, 2); |
| 912 |
data |= PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN; |
| 913 |
pci_write_config(dev, PCIR_COMMAND, data, 2); |
| 914 |
data = pci_read_config(dev, PCIR_COMMAND, 2); |
| 915 |
|
| 916 |
ddma = rman_get_start(sc->vc) | 1; |
| 917 |
pci_write_config(dev, PCI_LEGACYCONTROL, 0x805f, 2); |
| 918 |
pci_write_config(dev, PCI_DDMACONTROL, ddma, 2); |
| 919 |
pci_write_config(dev, PCI_CONFIG, 0, 2); |
| 899 |
|
920 |
|
|
|
921 |
if (ess_reset_dsp(sc)) |
| 922 |
goto no; |
| 923 |
if (mixer_reinit(dev)) |
| 924 |
goto no; |
| 925 |
if (sc->newspeed) |
| 926 |
ess_setmixer(sc, 0x71, 0x2a); |
| 927 |
|
| 928 |
port_wr(sc->io, 0x7, 0xb0, 1); /* enable irqs */ |
| 929 |
|
| 930 |
return 0; |
| 931 |
no: |
| 932 |
return EIO; |
| 933 |
} |
| 900 |
static int |
934 |
static int |
| 901 |
ess_attach(device_t dev) |
935 |
ess_attach(device_t dev) |
| 902 |
{ |
936 |
{ |
|
Lines 996-1003
Link Here
|
| 996 |
DEVMETHOD(device_probe, ess_probe), |
1030 |
DEVMETHOD(device_probe, ess_probe), |
| 997 |
DEVMETHOD(device_attach, ess_attach), |
1031 |
DEVMETHOD(device_attach, ess_attach), |
| 998 |
DEVMETHOD(device_detach, ess_detach), |
1032 |
DEVMETHOD(device_detach, ess_detach), |
| 999 |
DEVMETHOD(device_resume, bus_generic_resume), |
1033 |
DEVMETHOD(device_resume, ess_resume), |
| 1000 |
DEVMETHOD(device_suspend, bus_generic_suspend), |
1034 |
DEVMETHOD(device_suspend, ess_suspend), |
| 1001 |
|
1035 |
|
| 1002 |
{ 0, 0 } |
1036 |
{ 0, 0 } |
| 1003 |
}; |
1037 |
}; |