FreeBSD kernel sound device code
|
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <machine/dbdma.h>
#include <machine/intr_machdep.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <machine/pio.h>
#include <sys/rman.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/sound/pcm/sound.h>
#include "mixer_if.h"
Go to the source code of this file.
Data Structures | |
struct | snapper_softc |
struct | snapper_reg |
Macros | |
#define | SNAPPER_IICADDR 0x6a /* Hard-coded I2C slave addr */ |
#define | SNAPPER_MCR1 0x01 /* Main control register 1 (1byte) */ |
#define | SNAPPER_DRC 0x02 /* Dynamic range compression (6bytes) */ |
#define | SNAPPER_VOLUME 0x04 /* Volume (6bytes) */ |
#define | SNAPPER_TREBLE 0x05 /* Treble control (1byte) */ |
#define | SNAPPER_BASS 0x06 /* Bass control (1byte) */ |
#define | SNAPPER_MIXER_L 0x07 /* Mixer left gain (9bytes) */ |
#define | SNAPPER_MIXER_R 0x08 /* Mixer right gain (9bytes) */ |
#define | SNAPPER_LB0 0x0a /* Left biquad 0 (15bytes) */ |
#define | SNAPPER_LB1 0x0b /* Left biquad 1 (15bytes) */ |
#define | SNAPPER_LB2 0x0c /* Left biquad 2 (15bytes) */ |
#define | SNAPPER_LB3 0x0d /* Left biquad 3 (15bytes) */ |
#define | SNAPPER_LB4 0x0e /* Left biquad 4 (15bytes) */ |
#define | SNAPPER_LB5 0x0f /* Left biquad 5 (15bytes) */ |
#define | SNAPPER_LB6 0x10 /* Left biquad 6 (15bytes) */ |
#define | SNAPPER_RB0 0x13 /* Right biquad 0 (15bytes) */ |
#define | SNAPPER_RB1 0x14 /* Right biquad 1 (15bytes) */ |
#define | SNAPPER_RB2 0x15 /* Right biquad 2 (15bytes) */ |
#define | SNAPPER_RB3 0x16 /* Right biquad 3 (15bytes) */ |
#define | SNAPPER_RB4 0x17 /* Right biquad 4 (15bytes) */ |
#define | SNAPPER_RB5 0x18 /* Right biquad 5 (15bytes) */ |
#define | SNAPPER_RB6 0x19 /* Right biquad 6 (15bytes) */ |
#define | SNAPPER_LLB 0x21 /* Left loudness biquad (15bytes) */ |
#define | SNAPPER_RLB 0x22 /* Right loudness biquad (15bytes) */ |
#define | SNAPPER_LLB_GAIN 0x23 /* Left loudness biquad gain (3bytes) */ |
#define | SNAPPER_RLB_GAIN 0x24 /* Right loudness biquad gain (3bytes) */ |
#define | SNAPPER_ACR 0x40 /* Analog control register (1byte) */ |
#define | SNAPPER_MCR2 0x43 /* Main control register 2 (1byte) */ |
#define | SNAPPER_MCR1_FL 0x80 /* Fast load */ |
#define | SNAPPER_MCR1_SC 0x40 /* SCLK frequency */ |
#define | SNAPPER_MCR1_SC_32 0x00 /* 32fs */ |
#define | SNAPPER_MCR1_SC_64 0x40 /* 64fs */ |
#define | SNAPPER_MCR1_SM 0x30 /* Output serial port mode */ |
#define | SNAPPER_MCR1_SM_L 0x00 /* Left justified */ |
#define | SNAPPER_MCR1_SM_R 0x10 /* Right justified */ |
#define | SNAPPER_MCR1_SM_I2S 0x20 /* I2S */ |
#define | SNAPPER_MCR1_W 0x03 /* Serial port word length */ |
#define | SNAPPER_MCR1_W_16 0x00 /* 16 bit */ |
#define | SNAPPER_MCR1_W_18 0x01 /* 18 bit */ |
#define | SNAPPER_MCR1_W_20 0x02 /* 20 bit */ |
#define | SNAPPER_MCR1_W_24 0x03 /* 24 bit */ |
#define | SNAPPER_MCR2_DL 0x80 /* Download */ |
#define | SNAPPER_MCR2_AP 0x02 /* All pass mode */ |
#define | SNAPPER_ACR_ADM 0x80 /* ADC output mode */ |
#define | SNAPPER_ACR_LRB 0x40 /* Select B input */ |
#define | SNAPPER_ACR_DM 0x0c /* De-emphasis control */ |
#define | SNAPPER_ACR_DM_OFF 0x00 /* off */ |
#define | SNAPPER_ACR_DM_48 0x04 /* fs = 48kHz */ |
#define | SNAPPER_ACR_DM_44 0x08 /* fs = 44.1kHz */ |
#define | SNAPPER_ACR_INP 0x02 /* Analog input select */ |
#define | SNAPPER_ACR_INP_A 0x00 /* A */ |
#define | SNAPPER_ACR_INP_B 0x02 /* B */ |
#define | SNAPPER_ACR_APD 0x01 /* Analog power down */ |
Functions | |
static int | snapper_probe (device_t) |
static int | snapper_attach (device_t) |
static int | snapper_init (struct snd_mixer *m) |
static int | snapper_uninit (struct snd_mixer *m) |
static int | snapper_reinit (struct snd_mixer *m) |
static int | snapper_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) |
static u_int32_t | snapper_setrecsrc (struct snd_mixer *m, u_int32_t src) |
DRIVER_MODULE (snapper, iicbus, snapper_driver, snapper_devclass, 0, 0) | |
MODULE_VERSION (snapper, 1) | |
MODULE_DEPEND (snapper, iicbus, 1, 1, 1) | |
MIXER_DECLARE (snapper_mixer) | |
static int | snapper_write (struct snapper_softc *sc, uint8_t reg, const void *data) |
Variables | |
kobj_class_t | i2s_mixer_class |
device_t | i2s_mixer |
static device_method_t | snapper_methods [] |
static driver_t | snapper_driver |
static devclass_t | snapper_devclass |
static kobj_method_t | snapper_mixer_methods [] |
static const struct snapper_reg | snapper_initdata |
static const char | snapper_regsize [] |
static u_int | snapper_volume_table [100] |
#define SNAPPER_ACR 0x40 /* Analog control register (1byte) */ |
#define SNAPPER_DRC 0x02 /* Dynamic range compression (6bytes) */ |
#define SNAPPER_IICADDR 0x6a /* Hard-coded I2C slave addr */ |
#define SNAPPER_LLB 0x21 /* Left loudness biquad (15bytes) */ |
#define SNAPPER_LLB_GAIN 0x23 /* Left loudness biquad gain (3bytes) */ |
#define SNAPPER_MCR1 0x01 /* Main control register 1 (1byte) */ |
#define SNAPPER_MCR1_SM 0x30 /* Output serial port mode */ |
#define SNAPPER_MCR2 0x43 /* Main control register 2 (1byte) */ |
#define SNAPPER_MIXER_L 0x07 /* Mixer left gain (9bytes) */ |
#define SNAPPER_MIXER_R 0x08 /* Mixer right gain (9bytes) */ |
#define SNAPPER_RLB 0x22 /* Right loudness biquad (15bytes) */ |
#define SNAPPER_RLB_GAIN 0x24 /* Right loudness biquad gain (3bytes) */ |
DRIVER_MODULE | ( | snapper | , |
iicbus | , | ||
snapper_driver | , | ||
snapper_devclass | , | ||
0 | , | ||
0 | |||
) |
MIXER_DECLARE | ( | snapper_mixer | ) |
MODULE_DEPEND | ( | snapper | , |
iicbus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | snapper | , |
1 | |||
) |
|
static |
Definition at line 369 of file snapper.c.
References dev, i2s_mixer, i2s_mixer_class, snapper_softc::sc_addr, and snapper_softc::sc_dev.
|
static |
Definition at line 384 of file snapper.c.
References snapper_reg::ACR, snapper_reg::BASS, snapper_reg::DRC, snapper_reg::LB0, snapper_reg::LB1, snapper_reg::LB2, snapper_reg::LB3, snapper_reg::LB4, snapper_reg::LB5, snapper_reg::LB6, snapper_reg::LLB, snapper_reg::LLB_GAIN, m, snapper_reg::MCR1, snapper_reg::MCR2, mix_getdevinfo(), mix_setdevs(), snapper_reg::MIXER_L, snapper_reg::MIXER_R, snapper_reg::RB0, snapper_reg::RB1, snapper_reg::RB2, snapper_reg::RB3, snapper_reg::RB4, snapper_reg::RB5, snapper_reg::RB6, snapper_reg::RLB, snapper_reg::RLB_GAIN, SNAPPER_ACR, SNAPPER_BASS, SNAPPER_DRC, snapper_initdata, SNAPPER_LB0, SNAPPER_LB1, SNAPPER_LB2, SNAPPER_LB3, SNAPPER_LB4, SNAPPER_LB5, SNAPPER_LB6, SNAPPER_LLB, SNAPPER_LLB_GAIN, SNAPPER_MCR1, SNAPPER_MCR2, SNAPPER_MIXER_L, SNAPPER_MIXER_R, SNAPPER_RB0, SNAPPER_RB1, SNAPPER_RB2, SNAPPER_RB3, SNAPPER_RB4, SNAPPER_RB5, SNAPPER_RB6, SNAPPER_RLB, SNAPPER_RLB_GAIN, SNAPPER_TREBLE, SNAPPER_VOLUME, snapper_write(), snapper_reg::TREBLE, and snapper_reg::VOLUME.
|
static |
Definition at line 345 of file snapper.c.
References dev, name, and SNAPPER_IICADDR.
|
static |
Definition at line 439 of file snapper.c.
References dev, left, m, mix_getdevinfo(), mixer_get_lock(), r, reg, right, SNAPPER_VOLUME, snapper_volume_table, and snapper_write().
|
static |
|
static |
Definition at line 324 of file snapper.c.
References buf, data, reg, snapper_softc::sc_addr, snapper_softc::sc_dev, size, and snapper_regsize.
Referenced by snapper_init(), and snapper_set().
|
extern |
Definition at line 108 of file i2s.c.
Referenced by snapper_attach().
|
extern |
Definition at line 107 of file i2s.c.
Referenced by snapper_attach().
|
static |
|
static |
Definition at line 222 of file snapper.c.
Referenced by snapper_init().
|
static |
|
static |
|
static |
Definition at line 253 of file snapper.c.
Referenced by snapper_write().
|
static |
Definition at line 295 of file snapper.c.
Referenced by snapper_set().