hw/ac97: Make a bunch of mixer registers read only
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 May 2012 07:24:35 +0000 (09:24 +0200)
committersyeon.hwang <syeon.hwang@samsung.com>
Fri, 10 Aug 2012 04:42:25 +0000 (13:42 +0900)
commit491746e02938c4b2e1cbce0d29af1661f6381426
tree1e3b84f6c8c37ae17d7097ff32e2b8cc840bdb71
parent33bd7103b1c2888df8af3b243415ef4d854d5ba9
hw/ac97: Make a bunch of mixer registers read only

The Linux ac97 driver tries to see if optional things like video input
volume control are available in 2 ways:
1) See if the mute bit is set after reset, if it is no further tests are done
2) If the mute bit is not set it does a write/read test of the mute bit

This patch changes our ac97 to conform to what the Linux driver expects, it
initializes registers for things which we don't emulate to 0 (so the mute bit
is not set) and makes them read only.

This causes Linux to now longer show the following (functionless)
controls in alsamixer:

Master Mono vol + mute
3d Control toggle
PCM out pre / post 3d select
Surround toggle
CD vol + mute
Mic vol + mute
Mic boost toggle
Mic mic1 / mic2 select
Video vol + mute
Phone vol + mute
Beep mono vol + mute
Aux vol + mute
Mono "output mic" / "mix" select
Sigmatel 4 speaker stereo toggle
Sigmatel ADC 6Db att toggle
Sigmatel DAC 6Db att toggle

This patch was also tested with a Windows XP guest and there it also makes
a number of functionless mixer controls go away.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
hw/ac97.c