FreeBSD kernel sound device code
hdspe.c File Reference
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pci/hdspe.h>
#include <dev/sound/chip.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <mixer_if.h>
Include dependency graph for hdspe.c:

Go to the source code of this file.

Functions

 SND_DECLARE_FILE ("$FreeBSD: head/sys/dev/sound/pci/hdspe.c 326255 2017-11-27 14:52:40Z pfg $")
 
static void hdspe_intr (void *p)
 
static void hdspe_dmapsetmap (void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
static int hdspe_alloc_resources (struct sc_info *sc)
 
static void hdspe_map_dmabuf (struct sc_info *sc)
 
static int hdspe_probe (device_t dev)
 
static int hdspe_init (struct sc_info *sc)
 
static int hdspe_attach (device_t dev)
 
static void hdspe_dmafree (struct sc_info *sc)
 
static int hdspe_detach (device_t dev)
 
 DRIVER_MODULE (snd_hdspe, pci, hdspe_driver, hdspe_devclass, 0, 0)
 

Variables

static struct hdspe_channel chan_map_aio []
 
static struct hdspe_channel chan_map_rd []
 
static device_method_t hdspe_methods []
 
static driver_t hdspe_driver
 
static devclass_t hdspe_devclass
 

Function Documentation

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_hdspe  ,
pci  ,
hdspe_driver  ,
hdspe_devclass  ,
,
 
)

◆ hdspe_alloc_resources()

static int hdspe_alloc_resources ( struct sc_info sc)
static

Definition at line 135 of file hdspe.c.

References sc_info::bufsize, sc_info::cs, sc_info::csh, sc_info::csid, sc_info::cst, sc_info::dev, sc_info::dmat, hdspe_dmapsetmap(), HDSPE_DMASEGSIZE, hdspe_intr(), sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::pbuf, PCIR_BAR, sc_info::pmap, sc_info::rbuf, and sc_info::rmap.

Referenced by hdspe_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hdspe_attach()

static int hdspe_attach ( device_t  dev)
static

Definition at line 293 of file hdspe.c.

References AIO, chan_map_aio, chan_map_rd, hdspe_channel::descr, sc_info::dev, dev, sc_pcminfo::dev, sc_pcminfo::hc, hdspe_alloc_resources(), hdspe_init(), hdspe_map_dmabuf(), HDSPE_MAX_CHANS, sc_info::lock, PCI_REVISION_AIO, PCI_REVISION_RAYDAT, RAYDAT, sc_info::rev, sc_pcminfo::sc, snd_mtxcreate(), and sc_info::type.

Here is the call graph for this function:

◆ hdspe_detach()

static int hdspe_detach ( device_t  dev)
static

Definition at line 360 of file hdspe.c.

References sc_info::cs, dev, sc_info::dmat, hdspe_dmafree(), sc_info::ih, sc_info::irq, sc_info::lock, PCIR_BAR, and snd_mtxfree().

Here is the call graph for this function:

◆ hdspe_dmafree()

static void hdspe_dmafree ( struct sc_info sc)
static

Definition at line 349 of file hdspe.c.

References sc_info::dmat, sc_info::pbuf, sc_info::pmap, sc_info::rbuf, and sc_info::rmap.

Referenced by hdspe_detach().

Here is the caller graph for this function:

◆ hdspe_dmapsetmap()

static void hdspe_dmapsetmap ( void *  arg,
bus_dma_segment_t *  segs,
int  nseg,
int  error 
)
static

Definition at line 123 of file hdspe.c.

References sc_info::dev.

Referenced by hdspe_alloc_resources().

Here is the caller graph for this function:

◆ hdspe_init()

static int hdspe_init ( struct sc_info sc)
static

Definition at line 255 of file hdspe.c.

References AIO, sc_info::ctrl_register, HDSPE_CONTROL_REG, hdspe_encode_latency, HDSPE_FREQ_AIO, HDSPE_FREQ_MASK, HDSPE_FREQ_MASK_DEFAULT, HDSPE_FREQ_REG, HDSPE_SETTINGS_REG, HDSPE_SPEED_DEFAULT, hdspe_write_4, HDSPM_CLOCK_MODE_MASTER, sc_info::period, RAYDAT, sc_info::settings_register, sc_info::speed, and sc_info::type.

Referenced by hdspe_attach().

Here is the caller graph for this function:

◆ hdspe_intr()

static void hdspe_intr ( void *  p)
static

Definition at line 90 of file hdspe.c.

References sc_info::dev, free, HDSPE_AUDIO_IRQ_PENDING, HDSPE_INTERRUPT_ACK, hdspe_read_1, HDSPE_STATUS_REG, hdspe_write_1, sc_pcminfo::ih, sc_info::lock, snd_mtxlock, snd_mtxunlock, and status.

Referenced by hdspe_alloc_resources().

Here is the caller graph for this function:

◆ hdspe_map_dmabuf()

static void hdspe_map_dmabuf ( struct sc_info sc)
static

Definition at line 217 of file hdspe.c.

References HDSPE_MAX_SLOTS, HDSPE_PAGE_ADDR_BUF_IN, HDSPE_PAGE_ADDR_BUF_OUT, hdspe_write_4, sc_info::paddr, sc_info::pbuf, sc_info::raddr, and sc_info::rbuf.

Referenced by hdspe_attach().

Here is the caller graph for this function:

◆ hdspe_probe()

static int hdspe_probe ( device_t  dev)
static

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD: head/sys/dev/sound/pci/hdspe.c 326255 2017-11-27 14:52:40Z pfg $"  )

Variable Documentation

◆ chan_map_aio

struct hdspe_channel chan_map_aio[]
static
Initial value:
= {
{ 0, 1, "line", 1, 1 },
{ 6, 7, "phone", 1, 0 },
{ 8, 9, "aes", 1, 1 },
{ 10, 11, "s/pdif", 1, 1 },
{ 12, 16, "adat", 1, 1 },
{ 14, 18, "adat", 1, 1 },
{ 13, 15, "adat", 1, 1 },
{ 17, 19, "adat", 1, 1 },
{ 0, 0, NULL, 0, 0 },
}

Definition at line 45 of file hdspe.c.

Referenced by hdspe_attach().

◆ chan_map_rd

struct hdspe_channel chan_map_rd[]
static
Initial value:
= {
{ 0, 1, "aes", 1, 1 },
{ 2, 3, "s/pdif", 1, 1 },
{ 4, 5, "adat", 1, 1 },
{ 6, 7, "adat", 1, 1 },
{ 8, 9, "adat", 1, 1 },
{ 10, 11, "adat", 1, 1 },
{ 12, 13, "adat", 1, 1 },
{ 14, 15, "adat", 1, 1 },
{ 16, 17, "adat", 1, 1 },
{ 18, 19, "adat", 1, 1 },
{ 20, 21, "adat", 1, 1 },
{ 22, 23, "adat", 1, 1 },
{ 24, 25, "adat", 1, 1 },
{ 26, 27, "adat", 1, 1 },
{ 28, 29, "adat", 1, 1 },
{ 30, 31, "adat", 1, 1 },
{ 32, 33, "adat", 1, 1 },
{ 34, 35, "adat", 1, 1 },
{ 0, 0, NULL, 0, 0 },
}

Definition at line 62 of file hdspe.c.

Referenced by hdspe_attach().

◆ hdspe_devclass

devclass_t hdspe_devclass
static

Definition at line 404 of file hdspe.c.

◆ hdspe_driver

driver_t hdspe_driver
static
Initial value:
= {
"hdspe",
}
#define PCM_SOFTC_SIZE
Definition: sound.h:95
static device_method_t hdspe_methods[]
Definition: hdspe.c:391

Definition at line 398 of file hdspe.c.

◆ hdspe_methods

device_method_t hdspe_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, hdspe_probe),
DEVMETHOD(device_attach, hdspe_attach),
DEVMETHOD(device_detach, hdspe_detach),
{ 0, 0 }
}
static int hdspe_detach(device_t dev)
Definition: hdspe.c:360
static int hdspe_probe(device_t dev)
Definition: hdspe.c:234
static int hdspe_attach(device_t dev)
Definition: hdspe.c:293

Definition at line 391 of file hdspe.c.