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 | tumbler_softc |
struct | tumbler_reg |
Macros | |
#define | TUMBLER_IICADDR 0x68 /* Tumbler I2C slave address */ |
#define | TUMBLER_MCR 0x01 /* Main control register (1byte) */ |
#define | TUMBLER_DRC 0x02 /* Dynamic Range Compression (2bytes) */ |
#define | TUMBLER_VOLUME 0x04 /* Volume (6bytes) */ |
#define | TUMBLER_TREBLE 0x05 /* Treble control (1byte) */ |
#define | TUMBLER_BASS 0x06 /* Bass control (1byte) */ |
#define | TUMBLER_MIXER1 0x07 /* Mixer1 (3bytes) */ |
#define | TUMBLER_MIXER2 0x08 /* Mixer2 (3bytes) */ |
#define | TUMBLER_LB0 0x0a /* Left biquad 0 (15bytes) */ |
#define | TUMBLER_LB1 0x0b /* Left biquad 1 (15bytes) */ |
#define | TUMBLER_LB2 0x0c /* Left biquad 2 (15bytes) */ |
#define | TUMBLER_LB3 0x0d /* Left biquad 3 (15bytes) */ |
#define | TUMBLER_LB4 0x0e /* Left biquad 4 (15bytes) */ |
#define | TUMBLER_LB5 0x0f /* Left biquad 5 (15bytes) */ |
#define | TUMBLER_RB0 0x13 /* Right biquad 0 (15bytes) */ |
#define | TUMBLER_RB1 0x14 /* Right biquad 1 (15bytes) */ |
#define | TUMBLER_RB2 0x15 /* Right biquad 2 (15bytes) */ |
#define | TUMBLER_RB3 0x16 /* Right biquad 3 (15bytes) */ |
#define | TUMBLER_RB4 0x17 /* Right biquad 4 (15bytes) */ |
#define | TUMBLER_RB5 0x18 /* Right biquad 5 (15bytes) */ |
#define | TUMBLER_MCR_FL 0x80 /* Fast load */ |
#define | TUMBLER_MCR_SC 0x40 /* SCLK frequency */ |
#define | TUMBLER_MCR_SC_32 0x00 /* 32fs */ |
#define | TUMBLER_MCR_SC_64 0x40 /* 64fs */ |
#define | TUMBLER_MCR_SM 0x30 /* Output serial port mode */ |
#define | TUMBLER_MCR_SM_L 0x00 /* Left justified */ |
#define | TUMBLER_MCR_SM_R 0x10 /* Right justified */ |
#define | TUMBLER_MCR_SM_I2S 0x20 /* I2S */ |
#define | TUMBLER_MCR_ISM 0x0C /* Input serial mode */ |
#define | TUMBLER_MCR_ISM_L 0x00 |
#define | TUMBLER_MCR_ISM_R 0x04 |
#define | TUMBLER_MCR_ISM_I2S 0x08 |
#define | TUMBLER_MCR_W 0x03 /* Serial port word length */ |
#define | TUMBLER_MCR_W_16 0x00 /* 16 bit */ |
#define | TUMBLER_MCR_W_18 0x01 /* 18 bit */ |
#define | TUMBLER_MCR_W_20 0x02 /* 20 bit */ |
#define | TUMBLER_DRC_COMP_31 0xc0 /* 3:1 compression */ |
#define | TUMBLER_DRC_ENABLE 0x01 /* enable DRC */ |
#define | TUMBLER_DRC_DEFL_TH 0xa0 /* default compression threshold */ |
Functions | |
static int | tumbler_probe (device_t) |
static int | tumbler_attach (device_t) |
static int | tumbler_init (struct snd_mixer *m) |
static int | tumbler_uninit (struct snd_mixer *m) |
static int | tumbler_reinit (struct snd_mixer *m) |
static int | tumbler_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) |
static u_int32_t | tumbler_setrecsrc (struct snd_mixer *m, u_int32_t src) |
DRIVER_MODULE (tumbler, iicbus, tumbler_driver, tumbler_devclass, 0, 0) | |
MODULE_VERSION (tumbler, 1) | |
MODULE_DEPEND (tumbler, iicbus, 1, 1, 1) | |
MIXER_DECLARE (tumbler_mixer) | |
static int | tumbler_write (struct tumbler_softc *sc, uint8_t reg, const void *data) |
Variables | |
kobj_class_t | i2s_mixer_class |
device_t | i2s_mixer |
static device_method_t | tumbler_methods [] |
static driver_t | tumbler_driver |
static devclass_t | tumbler_devclass |
static kobj_method_t | tumbler_mixer_methods [] |
const struct tumbler_reg | tumbler_initdata |
const char | tumbler_regsize [] |
static u_int | tumbler_volume_table [100] |
#define TUMBLER_DRC 0x02 /* Dynamic Range Compression (2bytes) */ |
#define TUMBLER_DRC_DEFL_TH 0xa0 /* default compression threshold */ |
#define TUMBLER_IICADDR 0x68 /* Tumbler I2C slave address */ |
#define TUMBLER_MCR 0x01 /* Main control register (1byte) */ |
DRIVER_MODULE | ( | tumbler | , |
iicbus | , | ||
tumbler_driver | , | ||
tumbler_devclass | , | ||
0 | , | ||
0 | |||
) |
MIXER_DECLARE | ( | tumbler_mixer | ) |
MODULE_DEPEND | ( | tumbler | , |
iicbus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | tumbler | , |
1 | |||
) |
|
static |
Definition at line 324 of file tumbler.c.
References dev, i2s_mixer, i2s_mixer_class, tumbler_softc::sc_addr, and tumbler_softc::sc_dev.
|
static |
Definition at line 339 of file tumbler.c.
References tumbler_reg::BASS, tumbler_reg::DRC, tumbler_reg::LB0, tumbler_reg::LB1, tumbler_reg::LB2, tumbler_reg::LB3, tumbler_reg::LB4, tumbler_reg::LB5, m, tumbler_reg::MCR, mix_getdevinfo(), mix_setdevs(), tumbler_reg::MIXER1, tumbler_reg::MIXER2, tumbler_reg::RB0, tumbler_reg::RB1, tumbler_reg::RB2, tumbler_reg::RB3, tumbler_reg::RB4, tumbler_reg::RB5, tumbler_reg::TREBLE, TUMBLER_BASS, TUMBLER_DRC, tumbler_initdata, TUMBLER_LB0, TUMBLER_LB1, TUMBLER_LB2, TUMBLER_LB3, TUMBLER_LB4, TUMBLER_LB5, TUMBLER_MCR, TUMBLER_MIXER1, TUMBLER_MIXER2, TUMBLER_RB0, TUMBLER_RB1, TUMBLER_RB2, TUMBLER_RB3, TUMBLER_RB4, TUMBLER_RB5, TUMBLER_TREBLE, TUMBLER_VOLUME, tumbler_write(), and tumbler_reg::VOLUME.
|
static |
Definition at line 306 of file tumbler.c.
References dev, name, and TUMBLER_IICADDR.
|
static |
Definition at line 386 of file tumbler.c.
References dev, left, m, mix_getdevinfo(), mixer_get_lock(), r, reg, right, TUMBLER_VOLUME, tumbler_volume_table, and tumbler_write().
|
static |
|
static |
Definition at line 285 of file tumbler.c.
References buf, data, reg, tumbler_softc::sc_addr, tumbler_softc::sc_dev, size, and tumbler_regsize.
Referenced by tumbler_init(), and tumbler_set().
|
extern |
Definition at line 108 of file i2s.c.
Referenced by i2s_postattach(), and tumbler_attach().
|
extern |
Definition at line 107 of file i2s.c.
Referenced by i2s_postattach(), and tumbler_attach().
|
static |
const struct tumbler_reg tumbler_initdata |
Definition at line 204 of file tumbler.c.
Referenced by tumbler_init().
|
static |
|
static |
const char tumbler_regsize[] |
Definition at line 227 of file tumbler.c.
Referenced by tumbler_write().
|
static |
Definition at line 256 of file tumbler.c.
Referenced by tumbler_set().