mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 06:39:32 -04:00
update ac97 layer to use device_printf when printing messages
This commit is contained in:
parent
2af3c5f687
commit
03a00905d3
7 changed files with 15 additions and 12 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue