maestro.c (267581) | maestro.c (274035) |
---|---|
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 267581 2014-06-17 16:07:57Z jhb $"); | 61SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/maestro.c 274035 2014-11-03 11:11:45Z bapt $"); |
62 63/* 64 * PCI IDs of supported chips: 65 * 66 * MAESTRO-1 0x01001285 67 * MAESTRO-2 0x1968125d 68 * MAESTRO-2E 0x1978125d 69 */ --- 12 unchanged lines hidden (view full) --- 82# endif 83#else 84# define AGG_MAXPLAYCH 4 85#endif 86 87#define AGG_DEFAULT_BUFSZ 0x4000 /* 0x1000, but gets underflows */ 88 89 | 62 63/* 64 * PCI IDs of supported chips: 65 * 66 * MAESTRO-1 0x01001285 67 * MAESTRO-2 0x1968125d 68 * MAESTRO-2E 0x1978125d 69 */ --- 12 unchanged lines hidden (view full) --- 82# endif 83#else 84# define AGG_MAXPLAYCH 4 85#endif 86 87#define AGG_DEFAULT_BUFSZ 0x4000 /* 0x1000, but gets underflows */ 88 89 |
90/* compatibility */ 91#if __FreeBSD_version < 500000 92# define critical_enter() disable_intr() 93# define critical_exit() enable_intr() 94#endif 95 | |
96#ifndef PCIR_BAR 97#define PCIR_BAR(x) (PCIR_MAPS + (x) * 4) 98#endif 99 100 101/* ----------------------------- 102 * Data structures. 103 */ --- 1706 unchanged lines hidden (view full) --- 1810 1811 ess->bufsz = pcm_getbuffersize(dev, 4096, AGG_DEFAULT_BUFSZ, 65536); 1812 if (bus_dma_tag_create(/*parent*/ bus_get_dma_tag(dev), 1813 /*align */ 4, 1 << (16+1), 1814 /*limit */ MAESTRO_MAXADDR, BUS_SPACE_MAXADDR, 1815 /*filter*/ NULL, NULL, 1816 /*size */ ess->bufsz, 1, 0x3ffff, 1817 /*flags */ 0, | 90#ifndef PCIR_BAR 91#define PCIR_BAR(x) (PCIR_MAPS + (x) * 4) 92#endif 93 94 95/* ----------------------------- 96 * Data structures. 97 */ --- 1706 unchanged lines hidden (view full) --- 1804 1805 ess->bufsz = pcm_getbuffersize(dev, 4096, AGG_DEFAULT_BUFSZ, 65536); 1806 if (bus_dma_tag_create(/*parent*/ bus_get_dma_tag(dev), 1807 /*align */ 4, 1 << (16+1), 1808 /*limit */ MAESTRO_MAXADDR, BUS_SPACE_MAXADDR, 1809 /*filter*/ NULL, NULL, 1810 /*size */ ess->bufsz, 1, 0x3ffff, 1811 /*flags */ 0, |
1818#if __FreeBSD_version >= 501102 | |
1819 /*lock */ busdma_lock_mutex, &Giant, | 1812 /*lock */ busdma_lock_mutex, &Giant, |
1820#endif | |
1821 &ess->buf_dmat) != 0) { 1822 device_printf(dev, "unable to create dma tag\n"); 1823 ret = ENOMEM; 1824 goto bad; 1825 } 1826 1827 if (bus_dma_tag_create(/*parent*/ bus_get_dma_tag(dev), 1828 /*align */ 1 << WAVCACHE_BASEADDR_SHIFT, 1829 1 << (16+1), 1830 /*limit */ MAESTRO_MAXADDR, BUS_SPACE_MAXADDR, 1831 /*filter*/ NULL, NULL, 1832 /*size */ 3*ess->bufsz, 1, 0x3ffff, 1833 /*flags */ 0, | 1813 &ess->buf_dmat) != 0) { 1814 device_printf(dev, "unable to create dma tag\n"); 1815 ret = ENOMEM; 1816 goto bad; 1817 } 1818 1819 if (bus_dma_tag_create(/*parent*/ bus_get_dma_tag(dev), 1820 /*align */ 1 << WAVCACHE_BASEADDR_SHIFT, 1821 1 << (16+1), 1822 /*limit */ MAESTRO_MAXADDR, BUS_SPACE_MAXADDR, 1823 /*filter*/ NULL, NULL, 1824 /*size */ 3*ess->bufsz, 1, 0x3ffff, 1825 /*flags */ 0, |
1834#if __FreeBSD_version >= 501102 | |
1835 /*lock */ busdma_lock_mutex, &Giant, | 1826 /*lock */ busdma_lock_mutex, &Giant, |
1836#endif | |
1837 &ess->stat_dmat) != 0) { 1838 device_printf(dev, "unable to create dma tag\n"); 1839 ret = ENOMEM; 1840 goto bad; 1841 } 1842 1843 /* Allocate the room for brain-damaging status buffer. */ 1844 ess->stat = dma_malloc(ess->stat_dmat, 3*ess->bufsz, &ess->phys, --- 228 unchanged lines hidden --- | 1827 &ess->stat_dmat) != 0) { 1828 device_printf(dev, "unable to create dma tag\n"); 1829 ret = ENOMEM; 1830 goto bad; 1831 } 1832 1833 /* Allocate the room for brain-damaging status buffer. */ 1834 ess->stat = dma_malloc(ess->stat_dmat, 3*ess->bufsz, &ess->phys, --- 228 unchanged lines hidden --- |