cs4281.c (274035) | cs4281.c (296135) |
---|---|
1/*- 2 * Copyright (c) 2000 Orion Hodson <O.Hodson@cs.ucl.ac.uk> 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 --- 29 unchanged lines hidden (view full) --- 38#include <dev/sound/pcm/sound.h> 39#include <dev/sound/pcm/ac97.h> 40 41#include <dev/pci/pcireg.h> 42#include <dev/pci/pcivar.h> 43 44#include <dev/sound/pci/cs4281.h> 45 | 1/*- 2 * Copyright (c) 2000 Orion Hodson <O.Hodson@cs.ucl.ac.uk> 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 --- 29 unchanged lines hidden (view full) --- 38#include <dev/sound/pcm/sound.h> 39#include <dev/sound/pcm/ac97.h> 40 41#include <dev/pci/pcireg.h> 42#include <dev/pci/pcivar.h> 43 44#include <dev/sound/pci/cs4281.h> 45 |
46SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cs4281.c 274035 2014-11-03 11:11:45Z bapt $"); | 46SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cs4281.c 296135 2016-02-27 03:34:01Z jhibbits $"); |
47 48#define CS4281_DEFAULT_BUFSZ 16384 49 50/* Max fifo size for full duplex is 64 */ 51#define CS4281_FIFO_SIZE 15 52 53/* DMA Engine Indices */ 54#define CS4281_DMA_PLAY 0 --- 718 unchanged lines hidden (view full) --- 773 device_printf(dev, "chip is in D%d power mode " 774 "-- setting to D0\n", pci_get_powerstate(dev)); 775 776 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 777 } 778 779 sc->regid = PCIR_BAR(0); 780 sc->regtype = SYS_RES_MEMORY; | 47 48#define CS4281_DEFAULT_BUFSZ 16384 49 50/* Max fifo size for full duplex is 64 */ 51#define CS4281_FIFO_SIZE 15 52 53/* DMA Engine Indices */ 54#define CS4281_DMA_PLAY 0 --- 718 unchanged lines hidden (view full) --- 773 device_printf(dev, "chip is in D%d power mode " 774 "-- setting to D0\n", pci_get_powerstate(dev)); 775 776 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 777 } 778 779 sc->regid = PCIR_BAR(0); 780 sc->regtype = SYS_RES_MEMORY; |
781 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, 782 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); | 781 sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, RF_ACTIVE); |
783 if (!sc->reg) { 784 sc->regtype = SYS_RES_IOPORT; | 782 if (!sc->reg) { 783 sc->regtype = SYS_RES_IOPORT; |
785 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, 786 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); | 784 sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, 785 RF_ACTIVE); |
787 if (!sc->reg) { 788 device_printf(dev, "unable to allocate register space\n"); 789 goto bad; 790 } 791 } 792 sc->st = rman_get_bustag(sc->reg); 793 sc->sh = rman_get_bushandle(sc->reg); 794 795 sc->memid = PCIR_BAR(1); | 786 if (!sc->reg) { 787 device_printf(dev, "unable to allocate register space\n"); 788 goto bad; 789 } 790 } 791 sc->st = rman_get_bustag(sc->reg); 792 sc->sh = rman_get_bushandle(sc->reg); 793 794 sc->memid = PCIR_BAR(1); |
796 sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0, 797 ~0, CS4281PCI_BA1_SIZE, RF_ACTIVE); | 795 sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, 796 RF_ACTIVE); |
798 if (sc->mem == NULL) { 799 device_printf(dev, "unable to allocate fifo space\n"); 800 goto bad; 801 } 802 803 sc->irqid = 0; 804 sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, 805 RF_ACTIVE | RF_SHAREABLE); --- 167 unchanged lines hidden --- | 797 if (sc->mem == NULL) { 798 device_printf(dev, "unable to allocate fifo space\n"); 799 goto bad; 800 } 801 802 sc->irqid = 0; 803 sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, 804 RF_ACTIVE | RF_SHAREABLE); --- 167 unchanged lines hidden --- |