Deleted Added
full compact
t4dwave.c (197401) t4dwave.c (254263)
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
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

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

30
31#include <dev/sound/pcm/sound.h>
32#include <dev/sound/pcm/ac97.h>
33#include <dev/sound/pci/t4dwave.h>
34
35#include <dev/pci/pcireg.h>
36#include <dev/pci/pcivar.h>
37
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
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

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

30
31#include <dev/sound/pcm/sound.h>
32#include <dev/sound/pcm/ac97.h>
33#include <dev/sound/pci/t4dwave.h>
34
35#include <dev/pci/pcireg.h>
36#include <dev/pci/pcivar.h>
37
38SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/t4dwave.c 197401 2009-09-22 11:38:45Z marius $");
38SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/t4dwave.c 254263 2013-08-12 23:30:01Z scottl $");
39
40/* -------------------------------------------------------------------- */
41
42#define TDX_PCI_ID 0x20001023
43#define TNX_PCI_ID 0x20011023
44#define ALI_PCI_ID 0x545110b9
45#define SPA_PCI_ID 0x70181039
46

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

817 }
818
819 return ENXIO;
820}
821
822static int
823tr_pci_attach(device_t dev)
824{
39
40/* -------------------------------------------------------------------- */
41
42#define TDX_PCI_ID 0x20001023
43#define TNX_PCI_ID 0x20011023
44#define ALI_PCI_ID 0x545110b9
45#define SPA_PCI_ID 0x70181039
46

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

817 }
818
819 return ENXIO;
820}
821
822static int
823tr_pci_attach(device_t dev)
824{
825 u_int32_t data;
826 struct tr_info *tr;
827 struct ac97_info *codec = 0;
828 bus_addr_t lowaddr;
829 int i, dacn;
830 char status[SND_STATUSLEN];
831#ifdef __sparc64__
832 device_t *children;
833 int nchildren;
825 struct tr_info *tr;
826 struct ac97_info *codec = 0;
827 bus_addr_t lowaddr;
828 int i, dacn;
829 char status[SND_STATUSLEN];
830#ifdef __sparc64__
831 device_t *children;
832 int nchildren;
833 u_int32_t data;
834#endif
835
836 tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO);
837 tr->type = pci_get_devid(dev);
838 tr->rev = pci_get_revid(dev);
839 tr->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_t4dwave softc");
840
841 if (resource_int_value(device_get_name(dev), device_get_unit(dev),

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

852 dacn = ALI_MAXPLAYCH;
853 break;
854 default:
855 dacn = TR_MAXPLAYCH;
856 break;
857 }
858 }
859
834#endif
835
836 tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO);
837 tr->type = pci_get_devid(dev);
838 tr->rev = pci_get_revid(dev);
839 tr->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_t4dwave softc");
840
841 if (resource_int_value(device_get_name(dev), device_get_unit(dev),

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

852 dacn = ALI_MAXPLAYCH;
853 break;
854 default:
855 dacn = TR_MAXPLAYCH;
856 break;
857 }
858 }
859
860 data = pci_read_config(dev, PCIR_COMMAND, 2);
861 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
862 pci_write_config(dev, PCIR_COMMAND, data, 2);
863 data = pci_read_config(dev, PCIR_COMMAND, 2);
860 pci_enable_busmaster(dev);
864
865 tr->regid = PCIR_BAR(0);
866 tr->regtype = SYS_RES_IOPORT;
867 tr->reg = bus_alloc_resource_any(dev, tr->regtype, &tr->regid,
868 RF_ACTIVE);
869 if (tr->reg) {
870 tr->st = rman_get_bustag(tr->reg);
871 tr->sh = rman_get_bushandle(tr->reg);

--- 199 unchanged lines hidden ---
861
862 tr->regid = PCIR_BAR(0);
863 tr->regtype = SYS_RES_IOPORT;
864 tr->reg = bus_alloc_resource_any(dev, tr->regtype, &tr->regid,
865 RF_ACTIVE);
866 if (tr->reg) {
867 tr->st = rman_get_bustag(tr->reg);
868 tr->sh = rman_get_bushandle(tr->reg);

--- 199 unchanged lines hidden ---