als4000.c (193640) | als4000.c (254263) |
---|---|
1/*- 2 * Copyright (c) 2001 Orion Hodson <oho@acm.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 32 unchanged lines hidden (view full) --- 41#include <dev/sound/isa/sb.h> 42#include <dev/sound/pci/als4000.h> 43 44#include <dev/pci/pcireg.h> 45#include <dev/pci/pcivar.h> 46 47#include "mixer_if.h" 48 | 1/*- 2 * Copyright (c) 2001 Orion Hodson <oho@acm.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 32 unchanged lines hidden (view full) --- 41#include <dev/sound/isa/sb.h> 42#include <dev/sound/pci/als4000.h> 43 44#include <dev/pci/pcireg.h> 45#include <dev/pci/pcivar.h> 46 47#include "mixer_if.h" 48 |
49SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/als4000.c 193640 2009-06-07 19:12:08Z ariff $"); | 49SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/als4000.c 254263 2013-08-12 23:30:01Z scottl $"); |
50 51/* Debugging macro's */ 52#undef DEB 53#ifndef DEB 54#define DEB(x) /* x */ 55#endif /* DEB */ 56 57#define ALS_DEFAULT_BUFSZ 16384 --- 743 unchanged lines hidden (view full) --- 801 als_resource_free(dev, sc); 802 return ENXIO; 803} 804 805static int 806als_pci_attach(device_t dev) 807{ 808 struct sc_info *sc; | 50 51/* Debugging macro's */ 52#undef DEB 53#ifndef DEB 54#define DEB(x) /* x */ 55#endif /* DEB */ 56 57#define ALS_DEFAULT_BUFSZ 16384 --- 743 unchanged lines hidden (view full) --- 801 als_resource_free(dev, sc); 802 return ENXIO; 803} 804 805static int 806als_pci_attach(device_t dev) 807{ 808 struct sc_info *sc; |
809 u_int32_t data; | |
810 char status[SND_STATUSLEN]; 811 812 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); 813 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_als4000 softc"); 814 sc->dev = dev; 815 | 809 char status[SND_STATUSLEN]; 810 811 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); 812 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_als4000 softc"); 813 sc->dev = dev; 814 |
816 data = pci_read_config(dev, PCIR_COMMAND, 2); 817 data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); 818 pci_write_config(dev, PCIR_COMMAND, data, 2); | 815 pci_enable_busmaster(dev); |
819 /* 820 * By default the power to the various components on the 821 * ALS4000 is entirely controlled by the pci powerstate. We 822 * could attempt finer grained control by setting GCR6.31. 823 */ 824#if __FreeBSD_version > 500000 825 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { 826 /* Reset the power state. */ --- 128 unchanged lines hidden --- | 816 /* 817 * By default the power to the various components on the 818 * ALS4000 is entirely controlled by the pci powerstate. We 819 * could attempt finer grained control by setting GCR6.31. 820 */ 821#if __FreeBSD_version > 500000 822 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { 823 /* Reset the power state. */ --- 128 unchanged lines hidden --- |