summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-01-18 17:13:43 +0000
committercg <cg@FreeBSD.org>2000-01-18 17:13:43 +0000
commitfc15400060f2632255029d99d6de8f8f31880596 (patch)
tree34ef7acb1f7683904321a28a08828a8b624489ea
parent3005c00a64df52d1c5d631814a99d0c94d7cfee6 (diff)
downloadFreeBSD-src-fc15400060f2632255029d99d6de8f8f31880596.zip
FreeBSD-src-fc15400060f2632255029d99d6de8f8f31880596.tar.gz
update ac97 layer to use device_printf when printing messages
-rw-r--r--sys/dev/sound/pci/aureal.c2
-rw-r--r--sys/dev/sound/pci/csapcm.c6
-rw-r--r--sys/dev/sound/pci/es137x.c2
-rw-r--r--sys/dev/sound/pci/neomagic.c2
-rw-r--r--sys/dev/sound/pci/t4dwave.c2
-rw-r--r--sys/dev/sound/pcm/ac97.c11
-rw-r--r--sys/dev/sound/pcm/ac97.h2
7 files changed, 15 insertions, 12 deletions
diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c
index 1be8364..e35db34 100644
--- a/sys/dev/sound/pci/aureal.c
+++ b/sys/dev/sound/pci/aureal.c
@@ -636,7 +636,7 @@ au_pci_attach(device_t dev)
goto bad;
}
- codec = ac97_create(au, au_rdcd, au_wrcd);
+ codec = ac97_create(dev, au, au_rdcd, au_wrcd);
if (codec == NULL) goto bad;
mixer_init(d, &ac97_mixer, codec);
diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c
index b50be34..571f877 100644
--- a/sys/dev/sound/pci/csapcm.c
+++ b/sys/dev/sound/pci/csapcm.c
@@ -326,10 +326,10 @@ csa_setcapturesamplerate(csa_res *resp, u_long ulOutRate)
/*
* Fill in the VariDecimate control block.
*/
- csa_writemem(resp, BA1_CSRC,
+ csa_writemem(resp, BA1_CSRC,
((ulCorrectionPerSec << 16) & 0xFFFF0000) | (ulCorrectionPerGOF & 0xFFFF));
csa_writemem(resp, BA1_CCI, ulCoeffIncr);
- csa_writemem(resp, BA1_CD,
+ csa_writemem(resp, BA1_CD,
(((BA1_VARIDEC_BUF_1 + (ulInitialDelay << 2)) << 16) & 0xFFFF0000) | 0x80);
csa_writemem(resp, BA1_CPI, ulPhiIncr);
@@ -788,7 +788,7 @@ pcmcsa_attach(device_t dev)
csa_releaseres(csa, dev);
return (ENXIO);
}
- codec = ac97_create(csa, csa_rdcd, csa_wrcd);
+ codec = ac97_create(dev, csa, csa_rdcd, csa_wrcd);
if (codec == NULL)
return (ENXIO);
mixer_init(devinfo, &ac97_mixer, codec);
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c
index f6978e0..c4c04b6 100644
--- a/sys/dev/sound/pci/es137x.c
+++ b/sys/dev/sound/pci/es137x.c
@@ -774,7 +774,7 @@ es_pci_attach(device_t dev)
device_printf(dev, "unable to initialize the card\n");
goto bad;
}
- codec = ac97_create(es, es1371_rdcodec, es1371_wrcodec);
+ codec = ac97_create(dev, es, es1371_rdcodec, es1371_wrcodec);
if (codec == NULL) goto bad;
/* our init routine does everything for us */
/* set to NULL; flag mixer_init not to run the ac97_init */
diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c
index 8cdc5de..f139d93 100644
--- a/sys/dev/sound/pci/neomagic.c
+++ b/sys/dev/sound/pci/neomagic.c
@@ -614,7 +614,7 @@ nm_pci_attach(device_t dev)
goto bad;
}
- codec = ac97_create(sc, nm_rdcd, nm_wrcd);
+ codec = ac97_create(dev, sc, nm_rdcd, nm_wrcd);
if (codec == NULL) goto bad;
mixer_init(d, &ac97_mixer, codec);
diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c
index 03485ec..924cc6e 100644
--- a/sys/dev/sound/pci/t4dwave.c
+++ b/sys/dev/sound/pci/t4dwave.c
@@ -631,7 +631,7 @@ tr_pci_attach(device_t dev)
goto bad;
}
- codec = ac97_create(tr, tr_rdcd, tr_wrcd);
+ codec = ac97_create(dev, tr, tr_rdcd, tr_wrcd);
if (codec == NULL) goto bad;
mixer_init(d, &ac97_mixer, codec);
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 7785436..e0ddad7 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -64,6 +64,7 @@ struct ac97mixtable_entry {
};
struct ac97_info {
+ device_t dev;
ac97_read *read;
ac97_write *write;
void *devinfo;
@@ -262,11 +263,12 @@ ac97_init(struct ac97_info *codec)
codec->write(codec->devinfo, AC97_MIX_MASTER, 0x00);
if (bootverbose) {
- printf("ac97: codec id 0x%8x", id);
+ device_printf(codec->dev, "ac97 codec id 0x%8x", id);
for (i = 0; ac97codecid[i].id; i++) {
if (ac97codecid[i].id == id) printf(" (%s)", ac97codecid[i].name);
}
- printf("\nac97: codec features ");
+ printf("\n");
+ device_printf(codec->dev, "ac97 codec features ");
for (i = j = 0; i < 10; i++) {
if (codec->caps & (1 << i)) {
printf("%s%s", j? ", " : "", ac97feature[i]);
@@ -278,17 +280,18 @@ ac97_init(struct ac97_info *codec)
}
if ((codec->read(codec->devinfo, AC97_REG_POWER) & 2) == 0)
- printf("ac97: dac not ready\n");
+ device_printf(codec->dev, "ac97 codec reports dac not ready\n");
return 0;
}
struct ac97_info *
-ac97_create(void *devinfo, ac97_read *rd, ac97_write *wr)
+ac97_create(device_t dev, void *devinfo, ac97_read *rd, ac97_write *wr)
{
struct ac97_info *codec;
codec = (struct ac97_info *)malloc(sizeof *codec, M_DEVBUF, M_NOWAIT);
if (codec != NULL) {
+ codec->dev = dev;
codec->read = rd;
codec->write = wr;
codec->devinfo = devinfo;
diff --git a/sys/dev/sound/pcm/ac97.h b/sys/dev/sound/pcm/ac97.h
index b38d344..c93b29b 100644
--- a/sys/dev/sound/pcm/ac97.h
+++ b/sys/dev/sound/pcm/ac97.h
@@ -32,4 +32,4 @@ typedef void (ac97_write)(void *devinfo, int regno, u_int32_t data);
extern snd_mixer ac97_mixer;
struct ac97_info;
-struct ac97_info *ac97_create(void *devinfo, ac97_read *rd, ac97_write *wr);
+struct ac97_info *ac97_create(device_t dev, void *devinfo, ac97_read *rd, ac97_write *wr);
OpenPOWER on IntegriCloud