maestro.c (227309) | maestro.c (254263) |
---|---|
1/*- 2 * Copyright (c) 2000-2004 Taku YAMAMOTO <taku@tackymt.homeip.net> 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 --- 44 unchanged lines hidden (view full) --- 53 54#include <dev/sound/pcm/sound.h> 55#include <dev/sound/pcm/ac97.h> 56#include <dev/pci/pcireg.h> 57#include <dev/pci/pcivar.h> 58 59#include <dev/sound/pci/maestro_reg.h> 60 | 1/*- 2 * Copyright (c) 2000-2004 Taku YAMAMOTO <taku@tackymt.homeip.net> 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 --- 44 unchanged lines hidden (view full) --- 53 54#include <dev/sound/pcm/sound.h> 55#include <dev/sound/pcm/ac97.h> 56#include <dev/pci/pcireg.h> 57#include <dev/pci/pcivar.h> 58 59#include <dev/sound/pci/maestro_reg.h> 60 |
61SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/maestro.c 227309 2011-11-07 15:43:11Z ed $"); | 61SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/maestro.c 254263 2013-08-12 23:30:01Z scottl $"); |
62 63/* 64 * PCI IDs of supported chips: 65 * 66 * MAESTRO-1 0x01001285 67 * MAESTRO-2 0x1968125d 68 * MAESTRO-2E 0x1978125d 69 */ --- 1769 unchanged lines hidden (view full) --- 1839 if (bootverbose) 1840 device_printf(dev, "Maestro status/record buffer: %#llx\n", 1841 (long long)ess->phys); 1842 1843 /* State D0-uninitialized. */ 1844 ess->curpwr = PCI_POWERSTATE_D3; 1845 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 1846 | 62 63/* 64 * PCI IDs of supported chips: 65 * 66 * MAESTRO-1 0x01001285 67 * MAESTRO-2 0x1968125d 68 * MAESTRO-2E 0x1978125d 69 */ --- 1769 unchanged lines hidden (view full) --- 1839 if (bootverbose) 1840 device_printf(dev, "Maestro status/record buffer: %#llx\n", 1841 (long long)ess->phys); 1842 1843 /* State D0-uninitialized. */ 1844 ess->curpwr = PCI_POWERSTATE_D3; 1845 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 1846 |
1847 data = pci_read_config(dev, PCIR_COMMAND, 2); 1848 data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN); 1849 pci_write_config(dev, PCIR_COMMAND, data, 2); 1850 data = pci_read_config(dev, PCIR_COMMAND, 2); | 1847 pci_enable_busmaster(dev); |
1851 1852 /* Allocate resources. */ | 1848 1849 /* Allocate resources. */ |
1853 if (data & PCIM_CMD_PORTEN) 1854 reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, ®id, 1855 RF_ACTIVE); | 1850 reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, ®id, RF_ACTIVE); |
1856 if (reg != NULL) { 1857 ess->reg = reg; 1858 ess->regid = regid; 1859 ess->st = rman_get_bustag(reg); 1860 ess->sh = rman_get_bushandle(reg); 1861 } else { 1862 device_printf(dev, "unable to map register space\n"); 1863 ret = ENXIO; --- 202 unchanged lines hidden --- | 1851 if (reg != NULL) { 1852 ess->reg = reg; 1853 ess->regid = regid; 1854 ess->st = rman_get_bustag(reg); 1855 ess->sh = rman_get_bushandle(reg); 1856 } else { 1857 device_printf(dev, "unable to map register space\n"); 1858 ret = ENXIO; --- 202 unchanged lines hidden --- |