Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev split audiocs
details: https://anonhg.NetBSD.org/src/rev/34b26c8d3ab4
branches: trunk
changeset: 765667:34b26c8d3ab4
user: christos <christos%NetBSD.org@localhost>
date: Thu Jun 02 00:23:28 2011 +0000
description:
split audiocs
diffstat:
sys/dev/ebus/cs4231_ebus.c | 14 +++++++-------
sys/dev/ic/ad1848var.h | 4 ++--
sys/dev/ic/cs4231.c | 24 +++++++++++++-----------
sys/dev/ic/cs4231var.h | 5 +++--
sys/dev/sbus/cs4231_sbus.c | 14 +++++++-------
5 files changed, 32 insertions(+), 29 deletions(-)
diffs (249 lines):
diff -r b2a0e07c91b5 -r 34b26c8d3ab4 sys/dev/ebus/cs4231_ebus.c
--- a/sys/dev/ebus/cs4231_ebus.c Thu Jun 02 00:16:22 2011 +0000
+++ b/sys/dev/ebus/cs4231_ebus.c Thu Jun 02 00:23:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231_ebus.c,v 1.33 2009/05/12 14:20:45 cegger Exp $ */
+/* $NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.33 2009/05/12 14:20:45 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_sparc_arch.h"
@@ -79,7 +79,7 @@
static int cs4231_ebus_pint(void *);
static int cs4231_ebus_rint(void *);
-CFATTACH_DECL(audiocs_ebus, sizeof(struct cs4231_ebus_softc),
+CFATTACH_DECL_NEW(audiocs_ebus, sizeof(struct cs4231_ebus_softc),
cs4231_ebus_match, cs4231_ebus_attach, NULL, NULL);
/* audio_hw_if methods specific to ebus DMA */
@@ -253,11 +253,11 @@
ea->ea_intr[i], IPL_SCHED,
cs4231_ebus_intr, ebsc);
- cs4231_common_attach(sc, bh);
+ cs4231_common_attach(sc, self, bh);
printf("\n");
/* XXX: todo: move to cs4231_common_attach, pass hw_if as arg? */
- audio_attach_mi(&audiocs_ebus_hw_if, sc, &sc->sc_ad1848.sc_dev);
+ audio_attach_mi(&audiocs_ebus_hw_if, sc, sc->sc_ad1848.sc_dev);
}
@@ -547,7 +547,7 @@
cs4231_ebus_regdump("audiointr", ebsc);
snprintb(bits, sizeof(bits), AD_R2_BITS, status);
- DPRINTF(("%s: status: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
+ DPRINTF(("%s: status: %s\n", device_xname(sc->sc_ad1848.sc_dev),
bits));
#endif
@@ -557,7 +557,7 @@
reason = ad_read(&sc->sc_ad1848, CS_IRQ_STATUS);
snprintb(bits, sizeof(bits), CS_I24_BITS, reason);
- DPRINTF(("%s: i24: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
+ DPRINTF(("%s: i24: %s\n", device_xname(sc->sc_ad1848.sc_dev),
bits));
#endif
/* clear interrupt from ad1848 */
diff -r b2a0e07c91b5 -r 34b26c8d3ab4 sys/dev/ic/ad1848var.h
--- a/sys/dev/ic/ad1848var.h Thu Jun 02 00:16:22 2011 +0000
+++ b/sys/dev/ic/ad1848var.h Thu Jun 02 00:23:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848var.h,v 1.16 2008/04/28 20:23:48 martin Exp $ */
+/* $NetBSD: ad1848var.h,v 1.17 2011/06/02 00:23:28 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
};
struct ad1848_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
bus_space_tag_t sc_iot; /* tag */
bus_space_handle_t sc_ioh; /* handle */
diff -r b2a0e07c91b5 -r 34b26c8d3ab4 sys/dev/ic/cs4231.c
--- a/sys/dev/ic/cs4231.c Thu Jun 02 00:16:22 2011 +0000
+++ b/sys/dev/ic/cs4231.c Thu Jun 02 00:23:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231.c,v 1.25 2010/04/16 18:59:12 dyoung Exp $ */
+/* $NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.25 2010/04/16 18:59:12 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -107,12 +107,14 @@
void
-cs4231_common_attach(struct cs4231_softc *sc, bus_space_handle_t ioh)
+cs4231_common_attach(struct cs4231_softc *sc, device_t self,
+ bus_space_handle_t ioh)
{
char *buf;
int reg;
sc->sc_ad1848.parent = sc;
+ sc->sc_ad1848.sc_dev = self;
sc->sc_ad1848.sc_iot = sc->sc_bustag;
sc->sc_ad1848.sc_ioh = ioh;
sc->sc_ad1848.sc_readreg = cs4231_read;
@@ -123,23 +125,23 @@
evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR,
NULL,
- device_xname(&sc->sc_ad1848.sc_dev), "total");
+ device_xname(sc->sc_ad1848.sc_dev), "total");
evcnt_attach_dynamic(&sc->sc_playback.t_intrcnt, EVCNT_TYPE_INTR,
&sc->sc_intrcnt,
- device_xname(&sc->sc_ad1848.sc_dev), "playback");
+ device_xname(sc->sc_ad1848.sc_dev), "playback");
evcnt_attach_dynamic(&sc->sc_playback.t_ierrcnt, EVCNT_TYPE_INTR,
&sc->sc_intrcnt,
- device_xname(&sc->sc_ad1848.sc_dev), "perrors");
+ device_xname(sc->sc_ad1848.sc_dev), "perrors");
evcnt_attach_dynamic(&sc->sc_capture.t_intrcnt, EVCNT_TYPE_INTR,
&sc->sc_intrcnt,
- device_xname(&sc->sc_ad1848.sc_dev), "capture");
+ device_xname(sc->sc_ad1848.sc_dev), "capture");
evcnt_attach_dynamic(&sc->sc_capture.t_ierrcnt, EVCNT_TYPE_INTR,
&sc->sc_intrcnt,
- device_xname(&sc->sc_ad1848.sc_dev), "cerrors");
+ device_xname(sc->sc_ad1848.sc_dev), "cerrors");
/* put chip in native mode to access (extended) ID register */
reg = ad_read(&sc->sc_ad1848, SP_MISC_INFO);
@@ -267,7 +269,7 @@
if (t->t_active) {
printf("%s: %s already running\n",
- device_xname(&sc->sc_ad1848.sc_dev), t->t_name);
+ device_xname(sc->sc_ad1848.sc_dev), t->t_name);
return EINVAL;
}
@@ -278,7 +280,7 @@
continue;
if (p == NULL) {
printf("%s: bad %s addr %p\n",
- device_xname(&sc->sc_ad1848.sc_dev), t->t_name, start);
+ device_xname(sc->sc_ad1848.sc_dev), t->t_name, start);
return EINVAL;
}
@@ -299,7 +301,7 @@
DPRINTF(("%s: init %s: [%p..%p] %lu bytes %lu blocks;"
" DMA at 0x%lx count %lu\n",
- device_xname(&sc->sc_ad1848.sc_dev), t->t_name,
+ device_xname(sc->sc_ad1848.sc_dev), t->t_name,
start, end, (u_long)t->t_segsz, (u_long)t->t_blksz,
(u_long)*paddr, (u_long)*psize));
diff -r b2a0e07c91b5 -r 34b26c8d3ab4 sys/dev/ic/cs4231var.h
--- a/sys/dev/ic/cs4231var.h Thu Jun 02 00:16:22 2011 +0000
+++ b/sys/dev/ic/cs4231var.h Thu Jun 02 00:23:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231var.h,v 1.8 2008/04/28 20:23:49 martin Exp $ */
+/* $NetBSD: cs4231var.h,v 1.9 2011/06/02 00:23:28 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -88,7 +88,8 @@
/*
* Bus independent code shared by sbus and ebus attachments.
*/
-void cs4231_common_attach(struct cs4231_softc *, bus_space_handle_t);
+void cs4231_common_attach(struct cs4231_softc *, device_t,
+ bus_space_handle_t);
int cs4231_transfer_init(struct cs4231_softc *, struct cs_transfer *,
bus_addr_t *, bus_size_t *,
void *, void *, int, void (*)(void *), void *);
diff -r b2a0e07c91b5 -r 34b26c8d3ab4 sys/dev/sbus/cs4231_sbus.c
--- a/sys/dev/sbus/cs4231_sbus.c Thu Jun 02 00:16:22 2011 +0000
+++ b/sys/dev/sbus/cs4231_sbus.c Thu Jun 02 00:23:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231_sbus.c,v 1.47 2009/09/18 12:23:16 tsutsui Exp $ */
+/* $NetBSD: cs4231_sbus.c,v 1.48 2011/06/02 00:23:28 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.47 2009/09/18 12:23:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.48 2011/06/02 00:23:28 christos Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -83,7 +83,7 @@
static int cs4231_sbus_pint(void *);
static int cs4231_sbus_rint(void *);
-CFATTACH_DECL(audiocs_sbus, sizeof(struct cs4231_sbus_softc),
+CFATTACH_DECL_NEW(audiocs_sbus, sizeof(struct cs4231_sbus_softc),
cs4231_sbus_match, cs4231_sbus_attach, NULL, NULL);
/* audio_hw_if methods specific to apc DMA */
@@ -184,7 +184,7 @@
bus_space_subregion(sa->sa_bustag, bh, CS4231_APCDMA_OFFSET,
APC_DMA_SIZE, &sbsc->sc_bh);
- cs4231_common_attach(sc, bh);
+ cs4231_common_attach(sc, self, bh);
printf("\n");
/* Establish interrupt channel */
@@ -529,7 +529,7 @@
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), AD_R2_BITS, status);
#endif
- DPRINTF(("%s: status: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
+ DPRINTF(("%s: status: %s\n", device_xname(sc->sc_ad1848.sc_dev),
bits));
if (status & INTERRUPT_STATUS) {
#ifdef AUDIO_DEBUG
@@ -537,7 +537,7 @@
reason = ad_read(&sc->sc_ad1848, CS_IRQ_STATUS);
snprintb(bits, sizeof(bits), CS_I24_BITS, reason);
- DPRINTF(("%s: i24: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
+ DPRINTF(("%s: i24: %s\n", device_xname(sc->sc_ad1848.sc_dev),
bits));
#endif
/* clear ad1848 interrupt */
@@ -590,7 +590,7 @@
#ifdef DIAGNOSTIC
snprintb(bits, sizeof(bits), APC_BITS, csr);
printf("%s: unhandled csr=%s\n",
- device_xname(&sc->sc_ad1848.sc_dev), bits);
+ device_xname(sc->sc_ad1848.sc_dev), bits);
#endif
/* evcnt? */
}
Home |
Main Index |
Thread Index |
Old Index