ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io

Just for safety. azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by Wu Fengguang and committed by Takashi Iwai cdb1fbf2 a678cdee

+4
+4
sound/pci/hda/hda_intel.c
··· 513 513 514 514 static void azx_init_cmd_io(struct azx *chip) 515 515 { 516 + spin_lock_irq(&chip->reg_lock); 516 517 /* CORB set up */ 517 518 chip->corb.addr = chip->rb.addr; 518 519 chip->corb.buf = (u32 *)chip->rb.area; ··· 545 544 azx_writew(chip, RINTCNT, 1); 546 545 /* enable rirb dma and response irq */ 547 546 azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); 547 + spin_unlock_irq(&chip->reg_lock); 548 548 } 549 549 550 550 static void azx_free_cmd_io(struct azx *chip) 551 551 { 552 + spin_lock_irq(&chip->reg_lock); 552 553 /* disable ringbuffer DMAs */ 553 554 azx_writeb(chip, RIRBCTL, 0); 554 555 azx_writeb(chip, CORBCTL, 0); 556 + spin_unlock_irq(&chip->reg_lock); 555 557 } 556 558 557 559 static unsigned int azx_command_addr(u32 cmd)