 /* * 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); 
snd_m3_chip_init(m3_t *chip){	struct pci_dev *pcidev = chip->pci;	unsigned long io = chip->iobase;	u32 n;	u16 w;	u8 t; /* makes as much sense as 'n', no? */	pci_read_config_word(pcidev, PCI_LEGACY_AUDIO_CTRL, &w);	w &= ~(SOUND_BLASTER_ENABLE|FM_SYNTHESIS_ENABLE|	       MPU401_IO_ENABLE|MPU401_IRQ_ENABLE|ALIAS_10BIT_IO|	       DISABLE_LEGACY);	pci_write_config_word(pcidev, PCI_LEGACY_AUDIO_CTRL, w);	pci_read_config_dword(pcidev, PCI_ALLEGRO_CONFIG, &n);	n &= ~HV_BUTTON_FROM_GD;	n |= HV_CTRL_ENABLE | REDUCED_DEBOUNCE;	n |= PM_CTRL_ENABLE | CLK_DIV_BY_49 | USE_PCI_TIMING;	pci_write_config_dword(pcidev, PCI_ALLEGRO_CONFIG, n);	outb(RESET_ASSP, chip->iobase + ASSP_CONTROL_B);	pci_read_config_dword(pcidev, PCI_ALLEGRO_CONFIG, &n);	n &= ~INT_CLK_SELECT;	if (!chip->allegro_flag) {		n &= ~INT_CLK_MULT_ENABLE; 		n |= INT_CLK_SRC_NOT_PCI;	}	n &=  ~( CLK_MULT_MODE_SELECT | CLK_MULT_MODE_SELECT_2 );	pci_write_config_dword(pcidev, PCI_ALLEGRO_CONFIG, n);	if (chip->allegro_flag) {		pci_read_config_dword(pcidev, PCI_USER_CONFIG, &n);		n |= IN_CLK_12MHZ_SELECT;		pci_write_config_dword(pcidev, PCI_USER_CONFIG, n);	}	t = inb(chip->iobase + ASSP_CONTROL_A);	t &= ~( DSP_CLK_36MHZ_SELECT  | ASSP_CLK_49MHZ_SELECT);	t |= ASSP_CLK_49MHZ_SELECT;	t |= ASSP_0_WS_ENABLE; 	outb(t, chip->iobase + ASSP_CONTROL_A);	outb(RUN_ASSP, chip->iobase + ASSP_CONTROL_B); 	outb(0x00, io + HARDWARE_VOL_CTRL);	outb(0x88, io + SHADOW_MIX_REG_VOICE);	outb(0x88, io + HW_VOL_COUNTER_VOICE);	outb(0x88, io + SHADOW_MIX_REG_MASTER);	outb(0x88, io + HW_VOL_COUNTER_MASTER);	return 0;} 
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/091bf4dcab10b083f944d4eafbe0c734786485fe/maestro3.c/clean/sound/pci/maestro3.c