38#include <sys/kernel.h>
39#include <sys/module.h>
41#include <sys/malloc.h>
44#include <machine/dbdma.h>
45#include <machine/intr_machdep.h>
46#include <machine/resource.h>
47#include <machine/bus.h>
48#include <machine/pio.h>
51#include <dev/iicbus/iicbus.h>
52#include <dev/iicbus/iiconf.h>
53#include <dev/ofw/ofw_bus.h>
55#ifdef HAVE_KERNEL_OPTION_HEADERS
110#define PCM3052_IICADDR 0x8C
116#define PCM3052_REG_LEFT_ATTN 65
117#define PCM3052_REG_RIGHT_ATTN 66
118#define PCM3052_REG_CONTROL 67
119#define PCM3052_MRST (1 << 7)
120#define PCM3052_SRST (1 << 6)
121#define PCM3052_REG_DAC_CONTROL 68
122#define PCM3052_OVR1 (1 << 6)
123#define PCM3052_MUTE_L (1 << 1)
124#define PCM3052_MUTE_R (1 << 0)
125#define PCM3052_REG_DAC_DEEMPH 69
126#define PCM3052_REG_DAC_FILTER 70
127#define PCM3052_DAC_FILTER_ALWAYS (1 << 2)
128#define PCM3052_REG_OUT_PHASE 71
129#define PCM3052_REG_ADC_CONTROL 72
130#define PCM3052_REG_ADC_HPF_BP 75
131#define PCM3052_HPF_ALWAYS (1 << 2)
132#define PCM3052_REG_INFO_1 77
133#define PCM3052_REG_INFO_2 78
134#define PCM3052_REG_INFO_3 79
135#define PCM3052_REG_INFO_4 80
177 struct iic_msg msg[] = {
182 msg[0].len =
size + 1;
186 iicbus_transfer(sc->
sc_dev, msg, 1);
194 const char *
name, *compat;
200 if (strcmp(
name,
"codec") == 0) {
203 }
else if (strcmp(
name,
"codec") == 0) {
204 compat = ofw_bus_get_compat(
dev);
205 if (compat == NULL || strcmp(compat,
"pcm3052") != 0)
210 device_set_desc(
dev,
"Texas Instruments PCM3052 Audio Codec");
219 sc = device_get_softc(
dev);
253 x |= SOUND_MASK_VOLUME;
275 struct mtx *mixer_lock;
281 locked = mtx_owned(mixer_lock);
284 case SOUND_MIXER_VOLUME:
299 mtx_unlock(mixer_lock);
305 mtx_lock(mixer_lock);
struct pcmchan_matrix * m
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
struct mtx * mixer_get_lock(struct snd_mixer *m)
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
int mixer_uninit(device_t dev)
void mix_setdevs(struct snd_mixer *m, u_int32_t v)
int mixer_reinit(device_t dev)
void * mix_getdevinfo(struct snd_mixer *m)
#define PCM3052_REG_OUT_PHASE
static int onyx_attach(device_t)
static kobj_method_t onyx_mixer_methods[]
static int onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
static int onyx_reinit(struct snd_mixer *m)
#define PCM3052_REG_DAC_FILTER
static const struct onyx_reg onyx_initdata
#define PCM3052_REG_INFO_1
static int onyx_write(struct onyx_softc *sc, uint8_t reg, const uint8_t value)
static int onyx_probe(device_t)
#define PCM3052_REG_ADC_CONTROL
static int onyx_uninit(struct snd_mixer *m)
#define PCM3052_REG_RIGHT_ATTN
#define PCM3052_REG_LEFT_ATTN
static devclass_t onyx_devclass
static device_method_t onyx_methods[]
#define PCM3052_REG_DAC_CONTROL
MODULE_DEPEND(onyx, iicbus, 1, 1, 1)
#define PCM3052_REG_CONTROL
static driver_t onyx_driver
static int onyx_init(struct snd_mixer *m)
#define PCM3052_DAC_FILTER_ALWAYS
#define PCM3052_REG_INFO_4
#define PCM3052_REG_INFO_2
MIXER_DECLARE(onyx_mixer)
#define PCM3052_HPF_ALWAYS
#define PCM3052_REG_INFO_3
#define PCM3052_REG_DAC_DEEMPH
kobj_class_t i2s_mixer_class
static u_int32_t onyx_setrecsrc(struct snd_mixer *m, u_int32_t src)
DRIVER_MODULE(onyx, iicbus, onyx_driver, onyx_devclass, 0, 0)
#define PCM3052_REG_ADC_HPF_BP