Deleted Added
full compact
solo.c (193640) solo.c (254263)
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

32#include <dev/pci/pcireg.h>
33#include <dev/pci/pcivar.h>
34
35#include <dev/sound/isa/sb.h>
36#include <dev/sound/chip.h>
37
38#include "mixer_if.h"
39
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

32#include <dev/pci/pcireg.h>
33#include <dev/pci/pcivar.h>
34
35#include <dev/sound/isa/sb.h>
36#include <dev/sound/chip.h>
37
38#include "mixer_if.h"
39
40SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/solo.c 193640 2009-06-07 19:12:08Z ariff $");
40SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/solo.c 254263 2013-08-12 23:30:01Z scottl $");
41
42#define SOLO_DEFAULT_BUFSZ 16384
43#define ABS(x) (((x) < 0)? -(x) : (x))
44
45/* if defined, playback always uses the 2nd channel and full duplex works */
46#define ESS18XX_DUPLEX 1
47
48/* more accurate clocks and split audio1/audio2 rates */

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

944{
945 return 0;
946}
947
948static int
949ess_resume(device_t dev)
950{
951 uint16_t ddma;
41
42#define SOLO_DEFAULT_BUFSZ 16384
43#define ABS(x) (((x) < 0)? -(x) : (x))
44
45/* if defined, playback always uses the 2nd channel and full duplex works */
46#define ESS18XX_DUPLEX 1
47
48/* more accurate clocks and split audio1/audio2 rates */

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

944{
945 return 0;
946}
947
948static int
949ess_resume(device_t dev)
950{
951 uint16_t ddma;
952 uint32_t data;
953 struct ess_info *sc = pcm_getdevinfo(dev);
954
955 ess_lock(sc);
952 struct ess_info *sc = pcm_getdevinfo(dev);
953
954 ess_lock(sc);
956 data = pci_read_config(dev, PCIR_COMMAND, 2);
957 data |= PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN;
958 pci_write_config(dev, PCIR_COMMAND, data, 2);
959 data = pci_read_config(dev, PCIR_COMMAND, 2);
960
961 ddma = rman_get_start(sc->vc) | 1;
962 pci_write_config(dev, ESS_PCI_LEGACYCONTROL, 0x805f, 2);
963 pci_write_config(dev, ESS_PCI_DDMACONTROL, ddma, 2);
964 pci_write_config(dev, ESS_PCI_CONFIG, 0, 2);
965
966 if (ess_reset_dsp(sc)) {
967 ess_unlock(sc);
968 goto no;

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

983}
984
985static int
986ess_attach(device_t dev)
987{
988 struct ess_info *sc;
989 char status[SND_STATUSLEN];
990 u_int16_t ddma;
955 ddma = rman_get_start(sc->vc) | 1;
956 pci_write_config(dev, ESS_PCI_LEGACYCONTROL, 0x805f, 2);
957 pci_write_config(dev, ESS_PCI_DDMACONTROL, ddma, 2);
958 pci_write_config(dev, ESS_PCI_CONFIG, 0, 2);
959
960 if (ess_reset_dsp(sc)) {
961 ess_unlock(sc);
962 goto no;

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

977}
978
979static int
980ess_attach(device_t dev)
981{
982 struct ess_info *sc;
983 char status[SND_STATUSLEN];
984 u_int16_t ddma;
991 u_int32_t data;
992
993 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
985
986 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
994 data = pci_read_config(dev, PCIR_COMMAND, 2);
995 data |= PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN;
996 pci_write_config(dev, PCIR_COMMAND, data, 2);
997 data = pci_read_config(dev, PCIR_COMMAND, 2);
987 pci_enable_busmaster(dev);
998
999 if (ess_alloc_resources(sc, dev))
1000 goto no;
1001
1002 sc->bufsz = pcm_getbuffersize(dev, 4096, SOLO_DEFAULT_BUFSZ, 65536);
1003
1004 ddma = rman_get_start(sc->vc) | 1;
1005 pci_write_config(dev, ESS_PCI_LEGACYCONTROL, 0x805f, 2);

--- 113 unchanged lines hidden ---
988
989 if (ess_alloc_resources(sc, dev))
990 goto no;
991
992 sc->bufsz = pcm_getbuffersize(dev, 4096, SOLO_DEFAULT_BUFSZ, 65536);
993
994 ddma = rman_get_start(sc->vc) | 1;
995 pci_write_config(dev, ESS_PCI_LEGACYCONTROL, 0x805f, 2);

--- 113 unchanged lines hidden ---