#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/ofw/ofw_bus.h>
#include <dev/sound/pcm/sound.h>
#include <dev/sound/macio/aoa.h>
#include <powerpc/powermac/macgpiovar.h>
Go to the source code of this file.
|
static int | i2s_probe (device_t) |
|
static int | i2s_attach (device_t) |
|
static void | i2s_postattach (void *) |
|
static int | i2s_setup (struct i2s_softc *, u_int, u_int, u_int) |
|
static void | i2s_mute_headphone (struct i2s_softc *, int) |
|
static void | i2s_mute_lineout (struct i2s_softc *, int) |
|
static void | i2s_mute_speaker (struct i2s_softc *, int) |
|
static void | i2s_set_outputs (void *, u_int) |
|
| DRIVER_MODULE (pcm_i2s, macio, pcm_i2s_driver, pcm_devclass, 0, 0) |
|
| MODULE_DEPEND (pcm_i2s, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) |
|
static int | aoagpio_probe (device_t) |
|
static int | aoagpio_attach (device_t) |
|
| DRIVER_MODULE (aoagpio, macgpio, aoagpio_driver, aoagpio_devclass, 0, 0) |
|
static phandle_t | of_find_firstchild_byname (phandle_t, const char *) |
|
static void | i2s_cint (struct i2s_softc *) |
|
static void | aoagpio_int (void *cookie) |
|
static u_int | gpio_read (enum gpio_ctrl ctrl) |
|
static void | gpio_write (enum gpio_ctrl ctrl, u_int x) |
|
static void | i2s_audio_hw_reset (struct i2s_softc *sc) |
|
◆ AMP_ACTIVE
#define AMP_ACTIVE 0 /* XXX OF */ |
◆ CLKSRC_18MHz
#define CLKSRC_18MHz 0x00000000 /* Use 18432000Hz Osc. */ |
◆ CLKSRC_45MHz
#define CLKSRC_45MHz 0x40000000 /* Use 45158400Hz Osc. */ |
◆ CLKSRC_49MHz
#define CLKSRC_49MHz 0x80000000 /* Use 49152000Hz Osc. */ |
◆ GPIO_CTRL_EXTINT_SET
#define GPIO_CTRL_EXTINT_SET |
Value:
Definition at line 274 of file i2s.c.
◆ HEADPHONE_ACTIVE
#define HEADPHONE_ACTIVE 0 /* XXX OF */ |
◆ I2S_FORMAT
◆ I2S_FRAMECOUNT
#define I2S_FRAMECOUNT 0x40 |
◆ I2S_FRAMEMATCH
#define I2S_FRAMEMATCH 0x50 |
◆ I2S_INT
◆ I2S_INT_CLKSTOPPEND
#define I2S_INT_CLKSTOPPEND 0x01000000 /* clock-stop interrupt pending */ |
◆ I2S_WORDSIZE
#define I2S_WORDSIZE 0x60 |
◆ INPUT_16BIT
#define INPUT_16BIT (0 << 16) |
◆ INPUT_24BIT
#define INPUT_24BIT (3 << 16) |
◆ INPUT_MONO
#define INPUT_MONO (1 << 24) |
◆ INPUT_STEREO
#define INPUT_STEREO (2 << 24) |
◆ LINEOUT_ACTIVE
#define LINEOUT_ACTIVE 0 /* XXX OF */ |
◆ MCLK_DIV_MASK
#define MCLK_DIV_MASK 0x1f000000 /* MCLK = SRC / DIV */ |
◆ MCLK_FS
◆ MUTE_CONTROL
#define MUTE_CONTROL |
( |
|
xxx, |
|
|
|
yyy |
|
) |
| |
Value:static void \
i2s_mute_##xxx(
struct i2s_softc *sc,
int mute) \
{ \
int x; \
\
return; \
if (mute) \
x = yyy##_ACTIVE; \
else \
x = ! yyy##_ACTIVE; \
\
gpio_write(yyy##_MUTE, x); \
}
static u_int gpio_read(enum gpio_ctrl ctrl)
static struct aoagpio_softc * gpio_ctrls[GPIO_CTRL_NUM]
Definition at line 677 of file i2s.c.
◆ NCLKS
◆ OUTPUT_16BIT
#define OUTPUT_16BIT (0 << 0) |
◆ OUTPUT_24BIT
#define OUTPUT_24BIT (3 << 0) |
◆ OUTPUT_MONO
#define OUTPUT_MONO (1 << 8) |
◆ OUTPUT_STEREO
#define OUTPUT_STEREO (2 << 8) |
◆ reset_active
◆ RESET_HOLD_TIME
#define RESET_HOLD_TIME 20000 |
◆ RESET_RELEASE_TIME
#define RESET_RELEASE_TIME 10000 |
◆ RESET_SETUP_TIME
#define RESET_SETUP_TIME 5000 |
◆ SCLK_DIV_MASK
#define SCLK_DIV_MASK 0x00f00000 /* SCLK = MCLK / DIV */ |
◆ SCLK_MASTER
#define SCLK_MASTER 0x00080000 /* Master mode */ |
◆ SCLK_SLAVE
#define SCLK_SLAVE 0x00000000 /* Slave mode */ |
◆ SERIAL_32x
#define SERIAL_32x 0x00020000 |
◆ SERIAL_64x
#define SERIAL_64x 0x00010000 |
◆ SERIAL_DAV
#define SERIAL_DAV 0x00040000 |
◆ SERIAL_FORMAT
#define SERIAL_FORMAT 0x00070000 |
◆ SERIAL_SILICON
#define SERIAL_SILICON 0x00050000 |
◆ SERIAL_SONY
#define SERIAL_SONY 0x00000000 |
◆ gpio_ctrl
Enumerator |
---|
AMP_MUTE | |
HEADPHONE_MUTE | |
LINEOUT_MUTE | |
AUDIO_HW_RESET | |
HEADPHONE_DETECT | |
LINEOUT_DETECT | |
GPIO_CTRL_NUM | |
Definition at line 264 of file i2s.c.
◆ aoagpio_attach()
static int aoagpio_attach |
( |
device_t |
gpio | ) |
|
|
static |
◆ aoagpio_int()
static void aoagpio_int |
( |
void * |
cookie | ) |
|
|
static |
◆ aoagpio_probe()
static int aoagpio_probe |
( |
device_t |
gpio | ) |
|
|
static |
Definition at line 316 of file i2s.c.
References aoagpio_int(), aoagpio_softc::ctrl, aoagpio_softc::detect_active, aoagpio_softc::dev, gpio, gpio_controls, GPIO_CTRL_EXTINT_SET, gpio_ctrls, aoagpio_softc::i2s, aoagpio_softc::level, m, and name.
◆ DRIVER_MODULE() [1/2]
◆ DRIVER_MODULE() [2/2]
◆ gpio_read()
static u_int gpio_read |
( |
enum gpio_ctrl |
ctrl | ) |
|
|
static |
◆ gpio_write()
static void gpio_write |
( |
enum gpio_ctrl |
ctrl, |
|
|
u_int |
x |
|
) |
| |
|
static |
◆ i2s_attach()
static int i2s_attach |
( |
device_t |
self | ) |
|
|
static |
Definition at line 188 of file i2s.c.
References i2s_softc::aoa, aoa_attach(), aoa_interrupt(), i2s_delayed_attach, i2s_postattach(), i2s_setup(), i2s_softc::node, of_find_firstchild_byname(), i2s_softc::port_mtx, i2s_softc::reg, rid, aoa_softc::sc_dev, aoa_softc::sc_odma, snd_setup_intr(), and i2s_softc::soundnode.
◆ i2s_audio_hw_reset()
static void i2s_audio_hw_reset |
( |
struct i2s_softc * |
sc | ) |
|
|
static |
◆ i2s_cint()
static void i2s_cint |
( |
struct i2s_softc * |
sc | ) |
|
|
static |
◆ i2s_mute_headphone()
static void i2s_mute_headphone |
( |
struct i2s_softc * |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ i2s_mute_lineout()
static void i2s_mute_lineout |
( |
struct i2s_softc * |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ i2s_mute_speaker()
static void i2s_mute_speaker |
( |
struct i2s_softc * |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ i2s_postattach()
static void i2s_postattach |
( |
void * |
xsc | ) |
|
|
static |
Definition at line 734 of file i2s.c.
References i2s_softc::aoa, free, GPIO_CTRL_NUM, gpio_ctrls, aoagpio_softc::i2s, i2s_audio_hw_reset(), i2s_cint(), i2s_delayed_attach, i2s_mixer, i2s_mixer_class, mixer_init(), and aoa_softc::sc_dev.
Referenced by i2s_attach().
◆ i2s_probe()
static int i2s_probe |
( |
device_t |
self | ) |
|
|
static |
◆ i2s_set_outputs()
static void i2s_set_outputs |
( |
void * |
ptr, |
|
|
u_int |
mask |
|
) |
| |
|
static |
◆ i2s_setup()
static int i2s_setup |
( |
struct i2s_softc * |
sc, |
|
|
u_int |
rate, |
|
|
u_int |
wordsize, |
|
|
u_int |
sclk_fs |
|
) |
| |
|
static |
Definition at line 448 of file i2s.c.
References clksrc, i2s_clksrc::cs_clock, i2s_clksrc::cs_reg, I2S_FORMAT, I2S_INT, I2S_INT_CLKSTOPPEND, I2S_WORDSIZE, INPUT_16BIT, INPUT_24BIT, INPUT_STEREO, MCLK_DIV_MASK, MCLK_FS, NCLKS, OUTPUT_16BIT, OUTPUT_24BIT, OUTPUT_STEREO, rate, i2s_softc::reg, reg, SCLK_DIV_MASK, SCLK_MASTER, SERIAL_32x, and SERIAL_64x.
Referenced by i2s_attach().
◆ MODULE_DEPEND()
◆ of_find_firstchild_byname()
static phandle_t of_find_firstchild_byname |
( |
phandle_t |
node, |
|
|
const char * |
req_name |
|
) |
| |
|
static |
◆ aoagpio_devclass
devclass_t aoagpio_devclass |
|
static |
◆ aoagpio_driver
Initial value:= {
"aoagpio",
}
static device_method_t aoagpio_methods[]
Definition at line 144 of file i2s.c.
◆ aoagpio_methods
device_method_t aoagpio_methods[] |
|
static |
Initial value:= {
{ 0, 0 }
}
static int aoagpio_attach(device_t)
static int aoagpio_probe(device_t)
Definition at line 129 of file i2s.c.
◆ clksrc
◆ gpio_controls
◆ gpio_ctrls
Initial value:=
{NULL, NULL, NULL, NULL, NULL, NULL}
Definition at line 278 of file i2s.c.
Referenced by aoagpio_probe(), gpio_read(), gpio_write(), i2s_audio_hw_reset(), i2s_cint(), and i2s_postattach().
◆ i2s_delayed_attach
struct intr_config_hook* i2s_delayed_attach = NULL |
|
static |
◆ i2s_mixer
device_t i2s_mixer = NULL |
◆ i2s_mixer_class
kobj_class_t i2s_mixer_class = NULL |
◆ pcm_i2s_driver
Initial value:= {
"pcm",
}
static device_method_t pcm_i2s_methods[]
Definition at line 117 of file i2s.c.
◆ pcm_i2s_methods
device_method_t pcm_i2s_methods[] |
|
static |
Initial value:= {
{ 0, 0 }
}
static int i2s_probe(device_t)
static int i2s_attach(device_t)
Definition at line 110 of file i2s.c.