Date: Tue, 13 Dec 2005 13:18:30 +0900 From: Pyun YongHyeon <pyunyh@gmail.com> To: "Steven S." <steven@403forbidden.net> Cc: freebsd-multimedia@freebsd.org Subject: Re: kern/63204: [sound] /dev/mixer broken with ESS Maestro-2E (still on 5.4) Message-ID: <20051213041830.GB5920@rndsoft.co.kr> In-Reply-To: <20051212201440.G701@atlantis.403forbidden.net> References: <200512030310.jB33A77R038278@freefall.freebsd.org> <20051203092819.GB13672@rndsoft.co.kr> <20051204181714.C728@atlantis.403forbidden.net> <20051205060208.GC1086@rndsoft.co.kr> <20051205202824.C45817@atlantis.403forbidden.net> <20051212030939.GA1093@rndsoft.co.kr> <20051212201440.G701@atlantis.403forbidden.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 12, 2005 at 08:24:03PM -0500, Steven S. wrote: > > > same problem. no mixer devices, no sound. > I guess the codec may need some special handling. Please apply attached patch too. Did it make any difference? -- Regards, Pyun YongHyeon --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ac97.patch.1213" --- sys/dev/sound/pcm/ac97.c.orig Tue Dec 13 09:29:05 2005 +++ sys/dev/sound/pcm/ac97.c Tue Dec 13 13:12:08 2005 @@ -317,10 +317,30 @@ return AC97_READ(codec->methods, codec->devinfo, reg); } +static int +ac97_valid_reg(struct ac97_info *codec, int reg) +{ + + switch (codec->id) { + case 0x414b4d00: /* AK4540 */ + case 0x414b4d01: /* AK4542 */ + if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c) + return 1; + return 0; + /* NOTREACHED */ + break; + default: + break; + } + + return 1; +} + void ac97_wrcd(struct ac97_info *codec, int reg, u_int16_t val) { - AC97_WRITE(codec->methods, codec->devinfo, reg, val); + if (ac97_valid_reg(codec, reg)) + AC97_WRITE(codec->methods, codec->devinfo, reg, val); } static void --82I3+IH0IqGh5yIs--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051213041830.GB5920>