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

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

46
47#include <dev/pci/pcireg.h>
48#include <dev/pci/pcivar.h>
49
50#include <sys/sysctl.h>
51
52#include "mixer_if.h"
53
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

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

46
47#include <dev/pci/pcireg.h>
48#include <dev/pci/pcivar.h>
49
50#include <sys/sysctl.h>
51
52#include "mixer_if.h"
53
54SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cmi.c 119287 2003-08-22 07:08:17Z imp $");
54SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/cmi.c 119690 2003-09-02 17:30:40Z jhb $");
55
56/* Supported chip ID's */
57#define CMI8338A_PCI_ID 0x010013f6
58#define CMI8338B_PCI_ID 0x010113f6
59#define CMI8738_PCI_ID 0x011113f6
60#define CMI8738B_PCI_ID 0x011213f6
61
62/* Buffer size max is 64k for permitted DMA boundaries */

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

844
845 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sound softc");
846 data = pci_read_config(dev, PCIR_COMMAND, 2);
847 data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN);
848 pci_write_config(dev, PCIR_COMMAND, data, 2);
849 data = pci_read_config(dev, PCIR_COMMAND, 2);
850
851 sc->dev = dev;
55
56/* Supported chip ID's */
57#define CMI8338A_PCI_ID 0x010013f6
58#define CMI8338B_PCI_ID 0x010113f6
59#define CMI8738_PCI_ID 0x011113f6
60#define CMI8738B_PCI_ID 0x011213f6
61
62/* Buffer size max is 64k for permitted DMA boundaries */

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

844
845 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sound softc");
846 data = pci_read_config(dev, PCIR_COMMAND, 2);
847 data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN);
848 pci_write_config(dev, PCIR_COMMAND, data, 2);
849 data = pci_read_config(dev, PCIR_COMMAND, 2);
850
851 sc->dev = dev;
852 sc->regid = PCIR_MAPS;
852 sc->regid = PCIR_BAR(0);
853 sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid,
854 0, BUS_SPACE_UNRESTRICTED, 1, RF_ACTIVE);
855 if (!sc->reg) {
856 device_printf(dev, "cmi_attach: Cannot allocate bus resource\n");
857 goto bad;
858 }
859 sc->st = rman_get_bustag(sc->reg);
860 sc->sh = rman_get_bushandle(sc->reg);

--- 152 unchanged lines hidden ---
853 sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid,
854 0, BUS_SPACE_UNRESTRICTED, 1, RF_ACTIVE);
855 if (!sc->reg) {
856 device_printf(dev, "cmi_attach: Cannot allocate bus resource\n");
857 goto bad;
858 }
859 sc->st = rman_get_bustag(sc->reg);
860 sc->sh = rman_get_bushandle(sc->reg);

--- 152 unchanged lines hidden ---