1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 18 unchanged lines hidden (view full) ---
27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/ac97.h>
29#include <dev/sound/pcm/ac97_patch.h>
30
31#include <dev/pci/pcivar.h>
32
33#include "mixer_if.h"
34
35SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/ac97.c 167256 2007-03-06 02:36:54Z ariff $");
36
37MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec");
38
39struct ac97mixtable_entry {
40 int reg:8; /* register index */
41 /* reg < 0 if inverted polarity */
42 unsigned bits:4; /* width of control field */
43 unsigned ofs:4; /* offset (only if stereo=0) */
--- 489 unchanged lines hidden (view full) ---
533 bzero(&codec->mix[SOUND_MIXER_OGAIN],
534 sizeof(codec->mix[SOUND_MIXER_OGAIN]));
535 }
536}
537
538static void
539ac97_fix_tone(struct ac97_info *codec)
540{
541 /*
542 * YMF chips does not indicate tone and 3D enhancement capability
543 * in the AC97_REG_RESET register.
544 */
545 switch (codec->id) {
546 case 0x594d4800: /* YMF743 */
547 case 0x594d4803: /* YMF753 */
548 codec->caps |= AC97_CAP_TONE;
549 codec->se |= 0x04;
550 break;
551 case 0x594d4802: /* YMF752 */
552 codec->se |= 0x04;
553 break;
554 default:
555 break;
556 }
557
558 /* Hide treble and bass if they don't exist */
559 if ((codec->caps & AC97_CAP_TONE) == 0) {
560 bzero(&codec->mix[SOUND_MIXER_BASS],
561 sizeof(codec->mix[SOUND_MIXER_BASS]));
562 bzero(&codec->mix[SOUND_MIXER_TREBLE],
563 sizeof(codec->mix[SOUND_MIXER_TREBLE]));
564 }
565}
--- 499 unchanged lines hidden ---
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 18 unchanged lines hidden (view full) ---
27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/ac97.h>
29#include <dev/sound/pcm/ac97_patch.h>
30
31#include <dev/pci/pcivar.h>
32
33#include "mixer_if.h"
34
35SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/ac97.c 167256 2007-03-06 02:36:54Z ariff $");
36
37MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec");
38
39struct ac97mixtable_entry {
40 int reg:8; /* register index */
41 /* reg < 0 if inverted polarity */
42 unsigned bits:4; /* width of control field */
43 unsigned ofs:4; /* offset (only if stereo=0) */
--- 489 unchanged lines hidden (view full) ---
533 bzero(&codec->mix[SOUND_MIXER_OGAIN],
534 sizeof(codec->mix[SOUND_MIXER_OGAIN]));
535 }
536}
537
538static void
539ac97_fix_tone(struct ac97_info *codec)
540{
541 /*
542 * YMF chips does not indicate tone and 3D enhancement capability
543 * in the AC97_REG_RESET register.
544 */
545 switch (codec->id) {
546 case 0x594d4800: /* YMF743 */
547 case 0x594d4803: /* YMF753 */
548 codec->caps |= AC97_CAP_TONE;
549 codec->se |= 0x04;
550 break;
551 case 0x594d4802: /* YMF752 */
552 codec->se |= 0x04;
553 break;
554 default:
555 break;
556 }
557
558 /* Hide treble and bass if they don't exist */
559 if ((codec->caps & AC97_CAP_TONE) == 0) {
560 bzero(&codec->mix[SOUND_MIXER_BASS],
561 sizeof(codec->mix[SOUND_MIXER_BASS]));
562 bzero(&codec->mix[SOUND_MIXER_TREBLE],
563 sizeof(codec->mix[SOUND_MIXER_TREBLE]));
564 }
565}
--- 499 unchanged lines hidden ---