[ALSA] maestro3: HP OmniBook HW volume button magic
authorVille Syrjala <syrjala@sci.fi>
Thu, 12 May 2005 12:20:57 +0000 (14:20 +0200)
committerJaroslav Kysela <perex@suse.cz>
Sun, 29 May 2005 08:08:26 +0000 (10:08 +0200)
Maestro3 driver
Some HP OmniBook laptops (500 and 6000 at least) require some GPIO magic
before the HW volume buttons work. This patch makes them work mostly.
Something is still missing to make them work perfectly. However I have been
unable to figure out what exactly.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/maestro3.c

index c1c7eee..3690ea0 100644 (file)
@@ -2392,6 +2392,18 @@ snd_m3_chip_init(m3_t *chip)
               DISABLE_LEGACY);
        pci_write_config_word(pcidev, PCI_LEGACY_AUDIO_CTRL, w);
 
+       /*
+        * Volume buttons on some HP OmniBook laptops (500 and 6000 at least)
+        * don't work correctly. This makes them work for the most part.
+        * Volume up and down buttons on the laptop side work perfectly.
+        * Fn+cursor_up (volme up) works, Fn+cursor_down (volume down) doesn't,
+        * Fn+F8 (mute) works acts as volume up.
+        */
+       outw(~(GPI_VOL_DOWN|GPI_VOL_UP), io + GPIO_MASK);
+       outw(inw(io + GPIO_DIRECTION) & ~(GPI_VOL_DOWN|GPI_VOL_UP), io + GPIO_DIRECTION);
+       outw((GPI_VOL_DOWN|GPI_VOL_UP), io + GPIO_DATA);
+       outw(0xffff, io + GPIO_MASK);
+
        pci_read_config_dword(pcidev, PCI_ALLEGRO_CONFIG, &n);
        n &= ~HV_BUTTON_FROM_GD;
        n |= HV_CTRL_ENABLE | REDUCED_DEBOUNCE;