Beispiel #1
0
	return (bus_space_read_1(bas->bst, bas->bsh, SSCOM_URXH));
}

static int exynos4210_bus_probe(struct uart_softc *sc);
static int exynos4210_bus_attach(struct uart_softc *sc);
static int exynos4210_bus_flush(struct uart_softc *, int);
static int exynos4210_bus_getsig(struct uart_softc *);
static int exynos4210_bus_ioctl(struct uart_softc *, int, intptr_t);
static int exynos4210_bus_ipend(struct uart_softc *);
static int exynos4210_bus_param(struct uart_softc *, int, int, int, int);
static int exynos4210_bus_receive(struct uart_softc *);
static int exynos4210_bus_setsig(struct uart_softc *, int);
static int exynos4210_bus_transmit(struct uart_softc *);

static kobj_method_t exynos4210_methods[] = {
	KOBJMETHOD(uart_probe,		exynos4210_bus_probe),
	KOBJMETHOD(uart_attach, 	exynos4210_bus_attach),
	KOBJMETHOD(uart_flush,		exynos4210_bus_flush),
	KOBJMETHOD(uart_getsig,		exynos4210_bus_getsig),
	KOBJMETHOD(uart_ioctl,		exynos4210_bus_ioctl),
	KOBJMETHOD(uart_ipend,		exynos4210_bus_ipend),
	KOBJMETHOD(uart_param,		exynos4210_bus_param),
	KOBJMETHOD(uart_receive,	exynos4210_bus_receive),
	KOBJMETHOD(uart_setsig,		exynos4210_bus_setsig),
	KOBJMETHOD(uart_transmit,	exynos4210_bus_transmit),

	{0, 0 }
};

int
exynos4210_bus_probe(struct uart_softc *sc)
Beispiel #2
0
    regno &= 0xff;

    cs4281_wr(sc, CS4281PCI_ACCAD, regno);
    cs4281_wr(sc, CS4281PCI_ACCDA, data);
    cs4281_wr(sc, CS4281PCI_ACCTL, CS4281PCI_ACCTL_ESYN |
	      CS4281PCI_ACCTL_VFRM | CS4281PCI_ACCTL_DCV);

    if (cs4281_waitclr(sc, CS4281PCI_ACCTL, CS4281PCI_ACCTL_DCV, 250) == 0) {
	device_printf(sc->dev,"cs4281_wrcd: DCV did not go\n");
    }

    return 0;
}

static kobj_method_t cs4281_ac97_methods[] = {
        KOBJMETHOD(ac97_read,           cs4281_rdcd),
        KOBJMETHOD(ac97_write,          cs4281_wrcd),
	KOBJMETHOD_END
};
AC97_DECLARE(cs4281_ac97);

/* ------------------------------------------------------------------------- */
/* shared rec/play channel interface */

static void *
cs4281chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
{
    struct sc_info *sc = devinfo;
    struct sc_chinfo *ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;

    ch->buffer = b;
    case SOUND_MASK_MIC:
    default:
        dev = 0x50;
        src = SOUND_MASK_MIC;
    }

    dev |= dev << 8;
    ad1816_lock(ad1816);
    ad1816_write(ad1816, 20, (ad1816_read(ad1816, 20) & ~0x7070) | dev);
    ad1816_unlock(ad1816);
    return src;
}

static kobj_method_t ad1816mixer_methods[] = {
    KOBJMETHOD(mixer_init,		ad1816mix_init),
    KOBJMETHOD(mixer_set,		ad1816mix_set),
    KOBJMETHOD(mixer_setrecsrc,	ad1816mix_setrecsrc),
    KOBJMETHOD_END
};
MIXER_DECLARE(ad1816mixer);

/* -------------------------------------------------------------------- */
/* channel interface */
static void *
ad1816chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
{
    struct ad1816_info *ad1816 = devinfo;
    struct ad1816_chinfo *ch = (dir == PCMDIR_PLAY)? &ad1816->pch : &ad1816->rch;

    ch->dir = dir;
Beispiel #4
0
    src = *inbuf;
    dst = *outbuf;
    while(r--)
        *dst++ = dp->d_table[(u_char)*src++];
    *inbuf += n;
    *outbuf += n;
    *inbytesleft -= n;
    *outbytesleft -= n;
    return 0;
}

static const char *
iconv_xlat_name(struct iconv_converter_class *dcp)
{
    return "xlat";
}

static kobj_method_t iconv_xlat_methods[] = {
    KOBJMETHOD(iconv_converter_open,	iconv_xlat_open),
    KOBJMETHOD(iconv_converter_close,	iconv_xlat_close),
    KOBJMETHOD(iconv_converter_conv,	iconv_xlat_conv),
#if 0
    KOBJMETHOD(iconv_converter_init,	iconv_xlat_init),
    KOBJMETHOD(iconv_converter_done,	iconv_xlat_done),
#endif
    KOBJMETHOD(iconv_converter_name,	iconv_xlat_name),
    {0, 0}
};

KICONV_CONVERTER(xlat, sizeof(struct iconv_xlat));
Beispiel #5
0
static int	msm_bus_probe(struct uart_softc *sc);
static int	msm_bus_attach(struct uart_softc *sc);
static int	msm_bus_flush(struct uart_softc *, int);
static int	msm_bus_getsig(struct uart_softc *);
static int	msm_bus_ioctl(struct uart_softc *, int, intptr_t);
static int	msm_bus_ipend(struct uart_softc *);
static int	msm_bus_param(struct uart_softc *, int, int, int, int);
static int	msm_bus_receive(struct uart_softc *);
static int	msm_bus_setsig(struct uart_softc *, int);
static int	msm_bus_transmit(struct uart_softc *);
static void	msm_bus_grab(struct uart_softc *);
static void	msm_bus_ungrab(struct uart_softc *);

static kobj_method_t msm_methods[] = {
	KOBJMETHOD(uart_probe,		msm_bus_probe),
	KOBJMETHOD(uart_attach, 	msm_bus_attach),
	KOBJMETHOD(uart_flush,		msm_bus_flush),
	KOBJMETHOD(uart_getsig,		msm_bus_getsig),
	KOBJMETHOD(uart_ioctl,		msm_bus_ioctl),
	KOBJMETHOD(uart_ipend,		msm_bus_ipend),
	KOBJMETHOD(uart_param,		msm_bus_param),
	KOBJMETHOD(uart_receive,	msm_bus_receive),
	KOBJMETHOD(uart_setsig,		msm_bus_setsig),
	KOBJMETHOD(uart_transmit,	msm_bus_transmit),
	KOBJMETHOD(uart_grab,		msm_bus_grab),
	KOBJMETHOD(uart_ungrab,		msm_bus_ungrab),
	{0, 0 }
};

int
Beispiel #6
0
			    out[j].device == out[i].device)
				out[i].unit++;
		}
	}

	return (0);
}

/* BHND_EROM_FREE_CORE_TABLE() */
static void
siba_erom_free_core_table(bhnd_erom_t *erom, struct bhnd_core_info *cores)
{
	free(cores, M_BHND);
}

static kobj_method_t siba_erom_methods[] = {
	KOBJMETHOD(bhnd_erom_probe,		siba_erom_probe),
	KOBJMETHOD(bhnd_erom_probe_static,	siba_erom_probe_static),
	KOBJMETHOD(bhnd_erom_init,		siba_erom_init),
	KOBJMETHOD(bhnd_erom_init_static,	siba_erom_init_static),
	KOBJMETHOD(bhnd_erom_fini,		siba_erom_fini),
	KOBJMETHOD(bhnd_erom_get_core_table,	siba_erom_get_core_table),
	KOBJMETHOD(bhnd_erom_free_core_table,	siba_erom_free_core_table),
	KOBJMETHOD(bhnd_erom_lookup_core,	siba_erom_lookup_core),
	KOBJMETHOD(bhnd_erom_lookup_core_addr,	siba_erom_lookup_core_addr),

	KOBJMETHOD_END
};

BHND_EROM_DEFINE_CLASS(siba_erom, siba_erom_parser, siba_erom_methods, sizeof(struct siba_erom));
Beispiel #7
0
#include <sys/serial.h>

#include <dev/scc/scc_bfe.h>
#include <dev/scc/scc_bus.h>

#include <dev/ic/z8530.h>

#include "scc_if.h"

static int z8530_bfe_attach(struct scc_softc *, int);
static int z8530_bfe_iclear(struct scc_softc *, struct scc_chan *);
static int z8530_bfe_ipend(struct scc_softc *);
static int z8530_bfe_probe(struct scc_softc *);

static kobj_method_t z8530_methods[] = {
	KOBJMETHOD(scc_attach,	z8530_bfe_attach),
	KOBJMETHOD(scc_iclear,	z8530_bfe_iclear),
	KOBJMETHOD(scc_ipend,	z8530_bfe_ipend),
	KOBJMETHOD(scc_probe,	z8530_bfe_probe),
	KOBJMETHOD_END
};

struct scc_class scc_z8530_class = {
	"z8530 class",
	z8530_methods,
	sizeof(struct scc_softc),
	.cl_channels = 2,
	.cl_class = SCC_CLASS_Z8530,
	.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
	.cl_range = CHAN_B - CHAN_A,
};
Beispiel #8
0
	/* wait until codec is ready */
	for (i = 0; i < TIMO && fm801_rd(fm801,FM_CODEC_CMD,2) & FM_CODEC_CMD_BUSY; i++) {
		DELAY(10000);
		DPRINT("fm801 wrcd: 2 - DELAY\n");
	}
	if (i >= TIMO) {
		kprintf("fm801 wrcd: read codec busy\n");
		return -1;
	}
	DPRINT("fm801 wrcd release reg 0x%x val 0x%x\n",regno, data);
	return 0;
}

static kobj_method_t fm801_ac97_methods[] = {
    	KOBJMETHOD(ac97_read,		fm801_rdcd),
    	KOBJMETHOD(ac97_write,		fm801_wrcd),
	DEVMETHOD_END
};
AC97_DECLARE(fm801_ac97);

/* -------------------------------------------------------------------- */

/*
 * The interrupt handler
 */
static void
fm801_intr(void *p)
{
	struct fm801_info 	*fm801 = (struct fm801_info *)p;
	u_int32_t       	intsrc = fm801_rd(fm801, FM_INTSTATUS, 2);
		return -1;

	via_wr(via, VIA_AC97_CONTROL, VIA_AC97_CODEC00_VALID | 
	       VIA_AC97_READ | VIA_AC97_INDEX(reg), 4);

	if (via_waitready_codec(via))
		return -1;

	if (via_waitvalid_codec(via))
		return -1;

	return via_rd(via, VIA_AC97_CONTROL, 2);
}

static kobj_method_t via_ac97_methods[] = {
    	KOBJMETHOD(ac97_read,		via_read_codec),
    	KOBJMETHOD(ac97_write,		via_write_codec),
	KOBJMETHOD_END
};
AC97_DECLARE(via_ac97);

/* -------------------------------------------------------------------- */

static int
via_buildsgdt(struct via_chinfo *ch)
{
	u_int32_t phys_addr, flag;
	int i, seg_size;

	seg_size = sndbuf_getsize(ch->buffer) / SEGS_PER_CHAN;
	phys_addr = sndbuf_getbufaddr(ch->buffer);
Beispiel #10
0
};

static void mpu401_timeout(void *m);
static mpu401_intr_t mpu401_intr;

static int mpu401_minit(struct snd_midi *, void *);
static int mpu401_muninit(struct snd_midi *, void *);
static int mpu401_minqsize(struct snd_midi *, void *);
static int mpu401_moutqsize(struct snd_midi *, void *);
static void mpu401_mcallback(struct snd_midi *, void *, int);
static void mpu401_mcallbackp(struct snd_midi *, void *, int);
static const char *mpu401_mdescr(struct snd_midi *, void *, int);
static const char *mpu401_mprovider(struct snd_midi *, void *);

static kobj_method_t mpu401_methods[] = {
	KOBJMETHOD(mpu_init, mpu401_minit),
	KOBJMETHOD(mpu_uninit, mpu401_muninit),
	KOBJMETHOD(mpu_inqsize, mpu401_minqsize),
	KOBJMETHOD(mpu_outqsize, mpu401_moutqsize),
	KOBJMETHOD(mpu_callback, mpu401_mcallback),
	KOBJMETHOD(mpu_callbackp, mpu401_mcallbackp),
	KOBJMETHOD(mpu_descr, mpu401_mdescr),
	KOBJMETHOD(mpu_provider, mpu401_mprovider),
	KOBJMETHOD_END
};

DEFINE_CLASS(mpu401, mpu401_methods, 0);

void
mpu401_timeout(void *a)
{
Beispiel #11
0
{
	struct au88x0_info *aui = arg;
	int sl;

	sl = spltty();
	au88x0_codec_wait(aui);
	au88x0_write(aui, AU88X0_CODEC_IO, AU88X0_CDIO_WRITE(reg, data), 4);
	splx(sl);
	return 0;
}

/*
 * Codec interface glue
 */
static kobj_method_t au88x0_ac97_methods[] = {
	KOBJMETHOD(ac97_read, au88x0_codec_read),
	KOBJMETHOD(ac97_write, au88x0_codec_write),
	KOBJMETHOD_END
};
AC97_DECLARE(au88x0_ac97);

#define au88x0_channel(aui, dir) \
	&(aui)->aui_chan[((dir) == PCMDIR_PLAY) ? 0 : 1]


/***************************************************************************\
 *                                                                         *
 *                          CHANNEL INTERFACE                              *
 *                                                                         *
\***************************************************************************/
Beispiel #12
0
	}
	if (t == 20) {
		/* Timed out. Abort writing. */
		device_printf(ess->dev, "agg_wrcodec() PROGLESS timed out.\n");
		return -1;
	}

	bus_space_write_2(ess->st, ess->sh, PORT_CODEC_REG, data);
	bus_space_write_1(ess->st, ess->sh, PORT_CODEC_CMD,
	    CODEC_CMD_WRITE | regno);

	return 0;
}

static kobj_method_t agg_ac97_methods[] = {
    	KOBJMETHOD(ac97_init,		agg_ac97_init),
    	KOBJMETHOD(ac97_read,		agg_rdcodec),
    	KOBJMETHOD(ac97_write,		agg_wrcodec),
	{ 0, 0 }
};
AC97_DECLARE(agg_ac97);

/* -------------------------------------------------------------------- */

static inline void
ringbus_setdest(struct agg_info *ess, int src, int dest)
{
	u_int32_t	data;

	data = bus_space_read_4(ess->st, ess->sh, PORT_RINGBUS_CTRL);
	data &= ~(0xfU << src);
Beispiel #13
0
#define	quicc_read4(bas, reg)		\
	bus_space_read_4((bas)->bst, (bas)->bsh, reg)

#define	quicc_write2(bas, reg, val)	\
	bus_space_write_2((bas)->bst, (bas)->bsh, reg, val)
#define	quicc_write4(bas, reg, val)	\
	bus_space_write_4((bas)->bst, (bas)->bsh, reg, val)

static int quicc_bfe_attach(struct scc_softc *, int);
static int quicc_bfe_enabled(struct scc_softc *, struct scc_chan *);
static int quicc_bfe_iclear(struct scc_softc *, struct scc_chan *);
static int quicc_bfe_ipend(struct scc_softc *);
static int quicc_bfe_probe(struct scc_softc *);

static kobj_method_t quicc_methods[] = {
	KOBJMETHOD(scc_attach,	quicc_bfe_attach),
	KOBJMETHOD(scc_enabled,	quicc_bfe_enabled),
	KOBJMETHOD(scc_iclear,	quicc_bfe_iclear),
	KOBJMETHOD(scc_ipend,	quicc_bfe_ipend),
	KOBJMETHOD(scc_probe,	quicc_bfe_probe),
	KOBJMETHOD_END
};

struct scc_class scc_quicc_class = {
	"QUICC class",
	quicc_methods,
	sizeof(struct scc_softc),
	.cl_channels = 4,
	.cl_class = SCC_CLASS_QUICC,
	.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
	.cl_range = 0,
Beispiel #14
0
#include <sys/serial.h>

#include <dev/scc/scc_bfe.h>
#include <dev/scc/scc_bus.h>

#include <dev/ic/sab82532.h>

#include "scc_if.h"

static int sab82532_bfe_attach(struct scc_softc *, int);
static int sab82532_bfe_iclear(struct scc_softc *, struct scc_chan *);
static int sab82532_bfe_ipend(struct scc_softc *);
static int sab82532_bfe_probe(struct scc_softc *);

static kobj_method_t sab82532_methods[] = {
	KOBJMETHOD(scc_attach,	sab82532_bfe_attach),
	KOBJMETHOD(scc_iclear,	sab82532_bfe_iclear),
	KOBJMETHOD(scc_ipend,	sab82532_bfe_ipend),
	KOBJMETHOD(scc_probe,	sab82532_bfe_probe),
	{ 0, 0 }
};

struct scc_class scc_sab82532_class = {
	"sab82532 class",
	sab82532_methods,
	sizeof(struct scc_softc),
	.cl_channels = SAB_NCHAN,
	.cl_class = SCC_CLASS_SAB82532,
	.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
	.cl_range = SAB_CHANLEN,
};
Beispiel #15
0
	sec = regno & 0x100;
	regno &= 0xff;
	cid = sec? (sc->cd2id << 8) : 0;
	if (sec && cid == 0)
		return ENXIO;

	cmd = YDSXG_AC97WRITECMD | cid | regno;
	cmd <<= 16;
	cmd |= data;
	ds_wr(sc, YDSXGR_AC97CMDDATA, cmd, 4);

	return ds_cdbusy(sc, sec);
}

static kobj_method_t ds_ac97_methods[] = {
    	KOBJMETHOD(ac97_init,		ds_initcd),
    	KOBJMETHOD(ac97_read,		ds_rdcd),
    	KOBJMETHOD(ac97_write,		ds_wrcd),
	KOBJMETHOD_END
};
AC97_DECLARE(ds_ac97);

/* -------------------------------------------------------------------- */

static void
ds_enadsp(struct sc_info *sc, int on)
{
	u_int32_t v, i;

	v = on? 1 : 0;
	if (on) {
Beispiel #16
0
		j *= align;
		dst += j;
		count -= j;

	} while (count != 0);

	return (dst - b);
}

static struct pcm_feederdesc feeder_volume_desc[] = {
	{ FEEDER_VOLUME, 0, 0, 0, 0 },
	{ 0, 0, 0, 0, 0 }
};

static kobj_method_t feeder_volume_methods[] = {
	KOBJMETHOD(feeder_init,		feed_volume_init),
	KOBJMETHOD(feeder_free,		feed_volume_free),
	KOBJMETHOD(feeder_set,		feed_volume_set),
	KOBJMETHOD(feeder_feed,		feed_volume_feed),
	KOBJMETHOD_END
};

FEEDER_DECLARE(feeder_volume, NULL);

/* Extern */

/*
 * feeder_volume_apply_matrix(): For given matrix map, apply its configuration
 *                               to feeder_volume matrix structure. There are
 *                               possibilites that feeder_volume be inserted
 *                               before or after feeder_matrix, which in this
Beispiel #17
0
}

static struct pcmchan_caps *
ua_chan_getcaps(kobj_t obj, void *data)
{
	return (uaudio_chan_getcaps(data));
}

static struct pcmchan_matrix *
ua_chan_getmatrix(kobj_t obj, void *data, uint32_t format)
{
	return (uaudio_chan_getmatrix(data, format));
}

static kobj_method_t ua_chan_methods[] = {
	KOBJMETHOD(channel_init, ua_chan_init),
	KOBJMETHOD(channel_free, ua_chan_free),
	KOBJMETHOD(channel_setformat, ua_chan_setformat),
	KOBJMETHOD(channel_setspeed, ua_chan_setspeed),
	KOBJMETHOD(channel_setblocksize, ua_chan_setblocksize),
	KOBJMETHOD(channel_setfragments, ua_chan_setfragments),
	KOBJMETHOD(channel_trigger, ua_chan_trigger),
	KOBJMETHOD(channel_getptr, ua_chan_getptr),
	KOBJMETHOD(channel_getcaps, ua_chan_getcaps),
	KOBJMETHOD(channel_getmatrix, ua_chan_getmatrix),
	KOBJMETHOD_END
};

CHANNEL_DECLARE(ua_chan);

/************************************************************/
Beispiel #18
0
	{ 0, 0 }
};

static driver_t snapper_driver = {
	"snapper",
	snapper_methods,
	sizeof(struct snapper_softc)
};
static devclass_t snapper_devclass;

DRIVER_MODULE(snapper, iicbus, snapper_driver, snapper_devclass, 0, 0);
MODULE_VERSION(snapper, 1);
MODULE_DEPEND(snapper, iicbus, 1, 1, 1);

static kobj_method_t snapper_mixer_methods[] = {
	KOBJMETHOD(mixer_init, 		snapper_init),
	KOBJMETHOD(mixer_uninit, 	snapper_uninit),
	KOBJMETHOD(mixer_reinit, 	snapper_reinit),
	KOBJMETHOD(mixer_set, 		snapper_set),
	KOBJMETHOD(mixer_setrecsrc, 	snapper_setrecsrc),
	KOBJMETHOD_END
};

MIXER_DECLARE(snapper_mixer);

#define SNAPPER_IICADDR	0x6a	/* Hard-coded I2C slave addr */

/* Snapper (Texas Instruments TAS3004) registers. */
#define SNAPPER_MCR1	0x01	/* Main control register 1 (1byte) */
#define SNAPPER_DRC	0x02	/* Dynamic range compression (6bytes) */
#define SNAPPER_VOLUME	0x04	/* Volume (6bytes) */
Beispiel #19
0
	if (!nm_waitcd(sc)) {
		while (cnt-- > 0) {
			nm_wr(sc, sc->ac97_base + regno, data, 2);
			if (!nm_waitcd(sc)) {
				DELAY(1000);
				return 0;
			}
		}
	}
	device_printf(sc->dev, "ac97 codec not ready\n");
	return -1;
}

static kobj_method_t nm_ac97_methods[] = {
    	KOBJMETHOD(ac97_init,		nm_initcd),
    	KOBJMETHOD(ac97_read,		nm_rdcd),
    	KOBJMETHOD(ac97_write,		nm_wrcd),
	KOBJMETHOD_END
};
AC97_DECLARE(nm_ac97);

/* -------------------------------------------------------------------- */

static void
nm_ackint(struct sc_info *sc, u_int32_t num)
{
	if (sc->type == NM256AV_PCI_ID) {
		nm_wr(sc, NM_INT_REG, num << 1, 2);
	} else if (sc->type == NM256ZX_PCI_ID) {
		nm_wr(sc, NM_INT_REG, num, 4);
Beispiel #20
0
    { 0, 0 }
};

static driver_t tumbler_driver = {
    "tumbler",
    tumbler_methods,
    sizeof(struct tumbler_softc)
};
static devclass_t tumbler_devclass;

DRIVER_MODULE(tumbler, iicbus, tumbler_driver, tumbler_devclass, 0, 0);
MODULE_VERSION(tumbler, 1);
MODULE_DEPEND(tumbler, iicbus, 1, 1, 1);

static kobj_method_t tumbler_mixer_methods[] = {
    KOBJMETHOD(mixer_init, 		tumbler_init),
    KOBJMETHOD(mixer_uninit, 	tumbler_uninit),
    KOBJMETHOD(mixer_reinit, 	tumbler_reinit),
    KOBJMETHOD(mixer_set, 		tumbler_set),
    KOBJMETHOD(mixer_setrecsrc, 	tumbler_setrecsrc),
    KOBJMETHOD_END
};

MIXER_DECLARE(tumbler_mixer);

#define TUMBLER_IICADDR		0x68	/* Tumbler I2C slave address */

/* Tumbler (Texas Instruments TAS3001) registers. */
#define TUMBLER_MCR		0x01	/* Main control register (1byte) */
#define TUMBLER_DRC         	0x02    /* Dynamic Range Compression (2bytes) */
#define TUMBLER_VOLUME		0x04	/* Volume (6bytes) */
Beispiel #21
0
	return (c);
}

static int at91_usart_bus_probe(struct uart_softc *sc);
static int at91_usart_bus_attach(struct uart_softc *sc);
static int at91_usart_bus_flush(struct uart_softc *, int);
static int at91_usart_bus_getsig(struct uart_softc *);
static int at91_usart_bus_ioctl(struct uart_softc *, int, intptr_t);
static int at91_usart_bus_ipend(struct uart_softc *);
static int at91_usart_bus_param(struct uart_softc *, int, int, int, int);
static int at91_usart_bus_receive(struct uart_softc *);
static int at91_usart_bus_setsig(struct uart_softc *, int);
static int at91_usart_bus_transmit(struct uart_softc *);

static kobj_method_t at91_usart_methods[] = {
	KOBJMETHOD(uart_probe,		at91_usart_bus_probe),
	KOBJMETHOD(uart_attach,		at91_usart_bus_attach),
	KOBJMETHOD(uart_flush,		at91_usart_bus_flush),
	KOBJMETHOD(uart_getsig,		at91_usart_bus_getsig),
	KOBJMETHOD(uart_ioctl,		at91_usart_bus_ioctl),
	KOBJMETHOD(uart_ipend,		at91_usart_bus_ipend),
	KOBJMETHOD(uart_param,		at91_usart_bus_param),
	KOBJMETHOD(uart_receive,	at91_usart_bus_receive),
	KOBJMETHOD(uart_setsig,		at91_usart_bus_setsig),
	KOBJMETHOD(uart_transmit,	at91_usart_bus_transmit),

	KOBJMETHOD_END
};

int
at91_usart_bus_probe(struct uart_softc *sc)
Beispiel #22
0
icl_conn_pdu_free_t	icl_cxgbei_conn_pdu_free;
static icl_conn_pdu_data_segment_length_t
				    icl_cxgbei_conn_pdu_data_segment_length;
static icl_conn_pdu_append_data_t	icl_cxgbei_conn_pdu_append_data;
static icl_conn_pdu_get_data_t	icl_cxgbei_conn_pdu_get_data;
static icl_conn_pdu_queue_t	icl_cxgbei_conn_pdu_queue;
static icl_conn_handoff_t	icl_cxgbei_conn_handoff;
static icl_conn_free_t		icl_cxgbei_conn_free;
static icl_conn_close_t		icl_cxgbei_conn_close;
static icl_conn_task_setup_t	icl_cxgbei_conn_task_setup;
static icl_conn_task_done_t	icl_cxgbei_conn_task_done;
static icl_conn_transfer_setup_t	icl_cxgbei_conn_transfer_setup;
static icl_conn_transfer_done_t	icl_cxgbei_conn_transfer_done;

static kobj_method_t icl_cxgbei_methods[] = {
	KOBJMETHOD(icl_conn_new_pdu, icl_cxgbei_conn_new_pdu),
	KOBJMETHOD(icl_conn_pdu_free, icl_cxgbei_conn_pdu_free),
	KOBJMETHOD(icl_conn_pdu_data_segment_length,
	    icl_cxgbei_conn_pdu_data_segment_length),
	KOBJMETHOD(icl_conn_pdu_append_data, icl_cxgbei_conn_pdu_append_data),
	KOBJMETHOD(icl_conn_pdu_get_data, icl_cxgbei_conn_pdu_get_data),
	KOBJMETHOD(icl_conn_pdu_queue, icl_cxgbei_conn_pdu_queue),
	KOBJMETHOD(icl_conn_handoff, icl_cxgbei_conn_handoff),
	KOBJMETHOD(icl_conn_free, icl_cxgbei_conn_free),
	KOBJMETHOD(icl_conn_close, icl_cxgbei_conn_close),
	KOBJMETHOD(icl_conn_task_setup, icl_cxgbei_conn_task_setup),
	KOBJMETHOD(icl_conn_task_done, icl_cxgbei_conn_task_done),
	KOBJMETHOD(icl_conn_transfer_setup, icl_cxgbei_conn_transfer_setup),
	KOBJMETHOD(icl_conn_transfer_done, icl_cxgbei_conn_transfer_done),
	{ 0, 0 }
};
Beispiel #23
0
}

static int
ich_wrcd(kobj_t obj, void *devinfo, int regno, uint32_t data)
{
	struct sc_info *sc = (struct sc_info *)devinfo;

	regno &= 0xff;
	ich_waitcd(sc);
	bus_space_write_2(sc->nambart, sc->nambarh, regno, data);

	return (0);
}

static kobj_method_t ich_ac97_methods[] = {
	KOBJMETHOD(ac97_read,		ich_rdcd),
	KOBJMETHOD(ac97_write,		ich_wrcd),
	KOBJMETHOD_END
};
AC97_DECLARE(ich_ac97);

/* -------------------------------------------------------------------- */
/* common routines */

static void
ich_filldtbl(struct sc_chinfo *ch)
{
	struct sc_info *sc = ch->parent;
	uint32_t base;
	int i;
Beispiel #24
0
	struct atiixp_info *sc = devinfo;

	if (atiixp_waitready_codec(sc))
		return -1;

	data = (data << ATI_REG_PHYS_OUT_DATA_SHIFT) |
			(((uint32_t)reg) << ATI_REG_PHYS_OUT_ADDR_SHIFT) |
			ATI_REG_PHYS_OUT_ADDR_EN | sc->codec_idx;

	atiixp_wr(sc, ATI_REG_PHYS_OUT_ADDR, data);

	return 0;
}

static kobj_method_t atiixp_ac97_methods[] = {
    	KOBJMETHOD(ac97_read,		atiixp_rdcd),
    	KOBJMETHOD(ac97_write,		atiixp_wrcd),
	{ 0, 0 }
};
AC97_DECLARE(atiixp_ac97);

/*
 * Playback / Record channel interface
 */
static void *
atiixp_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b,
					struct pcm_channel *c, int dir)
{
	struct atiixp_info *sc = devinfo;
	struct atiixp_chinfo *ch;
	int num;
Beispiel #25
0
static void	link_elf_unload_file(linker_file_t);
static int	link_elf_lookup_set(linker_file_t, const char *,
		    void ***, void ***, int *);
static int	link_elf_each_function_name(linker_file_t,
		    int (*)(const char *, void *), void *);
static int	link_elf_each_function_nameval(linker_file_t,
				linker_function_nameval_callback_t,
				void *);
static void	link_elf_reloc_local(linker_file_t);
static long	link_elf_symtab_get(linker_file_t, const Elf_Sym **);
static long	link_elf_strtab_get(linker_file_t, caddr_t *);

static Elf_Addr elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps);

static kobj_method_t link_elf_methods[] = {
	KOBJMETHOD(linker_lookup_symbol,	link_elf_lookup_symbol),
	KOBJMETHOD(linker_symbol_values,	link_elf_symbol_values),
	KOBJMETHOD(linker_search_symbol,	link_elf_search_symbol),
	KOBJMETHOD(linker_unload,		link_elf_unload_file),
	KOBJMETHOD(linker_load_file,		link_elf_load_file),
	KOBJMETHOD(linker_link_preload,		link_elf_link_preload),
	KOBJMETHOD(linker_link_preload_finish,	link_elf_link_preload_finish),
	KOBJMETHOD(linker_lookup_set,		link_elf_lookup_set),
	KOBJMETHOD(linker_each_function_name,	link_elf_each_function_name),
	KOBJMETHOD(linker_each_function_nameval, link_elf_each_function_nameval),
	KOBJMETHOD(linker_ctf_get,		link_elf_ctf_get),
	KOBJMETHOD(linker_symtab_get, 		link_elf_symtab_get),
	KOBJMETHOD(linker_strtab_get, 		link_elf_strtab_get),
	{ 0, 0 }
};
Beispiel #26
0
	ret = ch->complete_pos - (ch->complete_pos % VCHIQ_AUDIO_PACKET_SIZE);

	bcm2835_audio_unlock(sc);

	return ret;
}

static struct pcmchan_caps *
bcmchan_getcaps(kobj_t obj, void *data)
{

	return &bcm2835_audio_playcaps;
}

static kobj_method_t bcmchan_methods[] = {
    	KOBJMETHOD(channel_init,		bcmchan_init),
    	KOBJMETHOD(channel_free,		bcmchan_free),
    	KOBJMETHOD(channel_setformat,		bcmchan_setformat),
    	KOBJMETHOD(channel_setspeed,		bcmchan_setspeed),
    	KOBJMETHOD(channel_setblocksize,	bcmchan_setblocksize),
    	KOBJMETHOD(channel_trigger,		bcmchan_trigger),
    	KOBJMETHOD(channel_getptr,		bcmchan_getptr),
    	KOBJMETHOD(channel_getcaps,		bcmchan_getcaps),
	KOBJMETHOD_END
};
CHANNEL_DECLARE(bcmchan);

/************************************************************/

static int
bcmmix_init(struct snd_mixer *m)
Beispiel #27
0
	{ 0, 0 }
};

static driver_t onyx_driver = {
	"onyx",
	onyx_methods,
	sizeof(struct onyx_softc)
};
static devclass_t onyx_devclass;

DRIVER_MODULE(onyx, iicbus, onyx_driver, onyx_devclass, 0, 0);
MODULE_VERSION(onyx, 1);
MODULE_DEPEND(onyx, iicbus, 1, 1, 1);

static kobj_method_t onyx_mixer_methods[] = {
	KOBJMETHOD(mixer_init,		onyx_init),
	KOBJMETHOD(mixer_uninit,	onyx_uninit),
	KOBJMETHOD(mixer_reinit,	onyx_reinit),
	KOBJMETHOD(mixer_set,		onyx_set),
	KOBJMETHOD(mixer_setrecsrc,	onyx_setrecsrc),
	KOBJMETHOD_END
};

MIXER_DECLARE(onyx_mixer);

#define PCM3052_IICADDR	0x8C	/* Hard-coded I2C slave addr */

/*
 * PCM3052 registers.
 * Numbering in decimal as used in the data sheet.
 */
Beispiel #28
0
{
	struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc;
	struct uart_bas *bas = &sc->sc_bas;

	/*
	 * Restore previous interrupt mask
	 */
	uart_lock(sc->sc_hwmtx);
	uart_setreg(bas, REG_FCR, ns8250->fcr);
	uart_setreg(bas, REG_IER, ns8250->ier);
	uart_barrier(bas);
	uart_unlock(sc->sc_hwmtx);
}

static kobj_method_t tegra_methods[] = {
	KOBJMETHOD(uart_probe,		ns8250_bus_probe),
	KOBJMETHOD(uart_attach,		tegra_uart_attach),
	KOBJMETHOD(uart_detach,		ns8250_bus_detach),
	KOBJMETHOD(uart_flush,		ns8250_bus_flush),
	KOBJMETHOD(uart_getsig,		ns8250_bus_getsig),
	KOBJMETHOD(uart_ioctl,		ns8250_bus_ioctl),
	KOBJMETHOD(uart_ipend,		ns8250_bus_ipend),
	KOBJMETHOD(uart_param,		ns8250_bus_param),
	KOBJMETHOD(uart_receive,	ns8250_bus_receive),
	KOBJMETHOD(uart_setsig,		ns8250_bus_setsig),
	KOBJMETHOD(uart_transmit,	ns8250_bus_transmit),
	KOBJMETHOD(uart_grab,		tegra_uart_grab),
	KOBJMETHOD(uart_ungrab,		tegra_uart_ungrab),
	KOBJMETHOD_END
};
Beispiel #29
0
	return (c);
}

static int sa1110_bus_probe(struct uart_softc *sc);
static int sa1110_bus_attach(struct uart_softc *sc);
static int sa1110_bus_flush(struct uart_softc *, int);
static int sa1110_bus_getsig(struct uart_softc *);
static int sa1110_bus_ioctl(struct uart_softc *, int, intptr_t);
static int sa1110_bus_ipend(struct uart_softc *);
static int sa1110_bus_param(struct uart_softc *, int, int, int, int);
static int sa1110_bus_receive(struct uart_softc *);
static int sa1110_bus_setsig(struct uart_softc *, int);
static int sa1110_bus_transmit(struct uart_softc *);

static kobj_method_t sa1110_methods[] = {
	KOBJMETHOD(uart_probe,		sa1110_bus_probe),
	KOBJMETHOD(uart_attach, 	sa1110_bus_attach),
	KOBJMETHOD(uart_flush,		sa1110_bus_flush),
	KOBJMETHOD(uart_getsig,		sa1110_bus_getsig),
	KOBJMETHOD(uart_ioctl,		sa1110_bus_ioctl),
	KOBJMETHOD(uart_ipend,		sa1110_bus_ipend),
	KOBJMETHOD(uart_param,		sa1110_bus_param),
	KOBJMETHOD(uart_receive,	sa1110_bus_receive),
	KOBJMETHOD(uart_setsig,		sa1110_bus_setsig),
	KOBJMETHOD(uart_transmit,	sa1110_bus_transmit),
	
	{0, 0 }
};

int
sa1110_bus_probe(struct uart_softc *sc)
Beispiel #30
0
/*
 * Burgundy codec control
 */

static int	burgundy_init(struct snd_mixer *m);
static int	burgundy_uninit(struct snd_mixer *m);
static int	burgundy_reinit(struct snd_mixer *m);
static void 	burgundy_write_locked(struct davbus_softc *, u_int, u_int);
static void	burgundy_set_outputs(struct davbus_softc *d, u_int mask);
static u_int	burgundy_read_status(struct davbus_softc *d, u_int status);
static int	burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left,
		    unsigned right);
static u_int32_t	burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src);

static kobj_method_t burgundy_mixer_methods[] = {
	KOBJMETHOD(mixer_init, 		burgundy_init),
	KOBJMETHOD(mixer_uninit, 	burgundy_uninit),
	KOBJMETHOD(mixer_reinit, 	burgundy_reinit),
	KOBJMETHOD(mixer_set, 		burgundy_set),
	KOBJMETHOD(mixer_setrecsrc,	burgundy_setrecsrc),
	KOBJMETHOD_END
};

MIXER_DECLARE(burgundy_mixer);

static int
burgundy_init(struct snd_mixer *m)
{
	struct davbus_softc *d;

	d = mix_getdevinfo(m);