Deleted Added
full compact
envy24.c (227293) envy24.c (254263)
1/*-
2 * Copyright (c) 2001 Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
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

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

34#include <dev/sound/pci/spicds.h>
35#include <dev/sound/pci/envy24.h>
36
37#include <dev/pci/pcireg.h>
38#include <dev/pci/pcivar.h>
39
40#include "mixer_if.h"
41
1/*-
2 * Copyright (c) 2001 Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
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

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

34#include <dev/sound/pci/spicds.h>
35#include <dev/sound/pci/envy24.h>
36
37#include <dev/pci/pcireg.h>
38#include <dev/pci/pcivar.h>
39
40#include "mixer_if.h"
41
42SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/envy24.c 227293 2011-11-07 06:44:47Z ed $");
42SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/envy24.c 254263 2013-08-12 23:30:01Z scottl $");
43
44static MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio");
45
46/* -------------------------------------------------------------------- */
47
48struct sc_info;
49
50#define ENVY24_PLAY_CHNUM 10

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

2542 }
2543
2544 return 0;
2545}
2546
2547static int
2548envy24_pci_attach(device_t dev)
2549{
43
44static MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio");
45
46/* -------------------------------------------------------------------- */
47
48struct sc_info;
49
50#define ENVY24_PLAY_CHNUM 10

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

2542 }
2543
2544 return 0;
2545}
2546
2547static int
2548envy24_pci_attach(device_t dev)
2549{
2550 u_int32_t data;
2551 struct sc_info *sc;
2552 char status[SND_STATUSLEN];
2553 int err = 0;
2554 int i;
2555
2556#if(0)
2557 device_printf(dev, "envy24_pci_attach()\n");
2558#endif
2559 /* get sc_info data area */
2560 if ((sc = malloc(sizeof(*sc), M_ENVY24, M_NOWAIT)) == NULL) {
2561 device_printf(dev, "cannot allocate softc\n");
2562 return ENXIO;
2563 }
2564
2565 bzero(sc, sizeof(*sc));
2566 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_envy24 softc");
2567 sc->dev = dev;
2568
2569 /* initialize PCI interface */
2550 struct sc_info *sc;
2551 char status[SND_STATUSLEN];
2552 int err = 0;
2553 int i;
2554
2555#if(0)
2556 device_printf(dev, "envy24_pci_attach()\n");
2557#endif
2558 /* get sc_info data area */
2559 if ((sc = malloc(sizeof(*sc), M_ENVY24, M_NOWAIT)) == NULL) {
2560 device_printf(dev, "cannot allocate softc\n");
2561 return ENXIO;
2562 }
2563
2564 bzero(sc, sizeof(*sc));
2565 sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_envy24 softc");
2566 sc->dev = dev;
2567
2568 /* initialize PCI interface */
2570 data = pci_read_config(dev, PCIR_COMMAND, 2);
2571 data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN);
2572 pci_write_config(dev, PCIR_COMMAND, data, 2);
2573 data = pci_read_config(dev, PCIR_COMMAND, 2);
2569 pci_enable_busmaster(dev);
2574
2575 /* allocate resources */
2576 err = envy24_alloc_resource(sc);
2577 if (err) {
2578 device_printf(dev, "unable to allocate system resources\n");
2579 goto bad;
2580 }
2581

--- 128 unchanged lines hidden ---
2570
2571 /* allocate resources */
2572 err = envy24_alloc_resource(sc);
2573 if (err) {
2574 device_printf(dev, "unable to allocate system resources\n");
2575 goto bad;
2576 }
2577

--- 128 unchanged lines hidden ---