Deleted Added
full compact
cs4281.c (119287) cs4281.c (119690)
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

--- 23 unchanged lines hidden (view full) ---

32#include <dev/sound/pcm/sound.h>
33#include <dev/sound/pcm/ac97.h>
34
35#include <dev/pci/pcireg.h>
36#include <dev/pci/pcivar.h>
37
38#include <dev/sound/pci/cs4281.h>
39
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

--- 23 unchanged lines hidden (view full) ---

32#include <dev/sound/pcm/sound.h>
33#include <dev/sound/pcm/ac97.h>
34
35#include <dev/pci/pcireg.h>
36#include <dev/pci/pcivar.h>
37
38#include <dev/sound/pci/cs4281.h>
39
40SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cs4281.c 119287 2003-08-22 07:08:17Z imp $");
40SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cs4281.c 119690 2003-09-02 17:30:40Z jhb $");
41
42#define CS4281_DEFAULT_BUFSZ 16384
43
44/* Max fifo size for full duplex is 64 */
45#define CS4281_FIFO_SIZE 15
46
47/* DMA Engine Indices */
48#define CS4281_DMA_PLAY 0

--- 731 unchanged lines hidden (view full) ---

780 device_printf(dev, "chip is in D%d power mode "
781 "-- setting to D0\n",
782 data & CS4281PCI_PMCS_PS_MASK);
783 pci_write_config(dev, CS4281PCI_PMCS_OFFSET,
784 data & ~CS4281PCI_PMCS_PS_MASK, 4);
785 }
786#endif
787
41
42#define CS4281_DEFAULT_BUFSZ 16384
43
44/* Max fifo size for full duplex is 64 */
45#define CS4281_FIFO_SIZE 15
46
47/* DMA Engine Indices */
48#define CS4281_DMA_PLAY 0

--- 731 unchanged lines hidden (view full) ---

780 device_printf(dev, "chip is in D%d power mode "
781 "-- setting to D0\n",
782 data & CS4281PCI_PMCS_PS_MASK);
783 pci_write_config(dev, CS4281PCI_PMCS_OFFSET,
784 data & ~CS4281PCI_PMCS_PS_MASK, 4);
785 }
786#endif
787
788 sc->regid = PCIR_MAPS;
788 sc->regid = PCIR_BAR(0);
789 sc->regtype = SYS_RES_MEMORY;
790 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
791 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE);
792 if (!sc->reg) {
793 sc->regtype = SYS_RES_IOPORT;
794 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
795 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE);
796 if (!sc->reg) {
797 device_printf(dev, "unable to allocate register space\n");
798 goto bad;
799 }
800 }
801 sc->st = rman_get_bustag(sc->reg);
802 sc->sh = rman_get_bushandle(sc->reg);
803
789 sc->regtype = SYS_RES_MEMORY;
790 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
791 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE);
792 if (!sc->reg) {
793 sc->regtype = SYS_RES_IOPORT;
794 sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
795 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE);
796 if (!sc->reg) {
797 device_printf(dev, "unable to allocate register space\n");
798 goto bad;
799 }
800 }
801 sc->st = rman_get_bustag(sc->reg);
802 sc->sh = rman_get_bushandle(sc->reg);
803
804 sc->memid = PCIR_MAPS + 4;
804 sc->memid = PCIR_BAR(1);
805 sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0,
806 ~0, CS4281PCI_BA1_SIZE, RF_ACTIVE);
807 if (sc->mem == NULL) {
808 device_printf(dev, "unable to allocate fifo space\n");
809 goto bad;
810 }
811
812 sc->irqid = 0;

--- 168 unchanged lines hidden ---
805 sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0,
806 ~0, CS4281PCI_BA1_SIZE, RF_ACTIVE);
807 if (sc->mem == NULL) {
808 device_printf(dev, "unable to allocate fifo space\n");
809 goto bad;
810 }
811
812 sc->irqid = 0;

--- 168 unchanged lines hidden ---