/* write_ad1843_reg writes the specified value to a 16 bit AD1843 register.  */
static int write_ad1843_reg(void *priv, int reg, int word)
/* write_ad1843_reg writes the specified value to a 16 bit AD1843 register.  */
static int write_ad1843_reg(void *priv, int reg, int word)
{
	struct snd_sgio2audio *chip = priv;
	int val;
	unsigned long flags;
	spin_lock_irqsave(&chip->ad1843_lock, flags);
	writeq((reg << CODEC_CONTROL_ADDRESS_SHIFT) |
	       (word << CODEC_CONTROL_WORD_SHIFT),
	       &mace->perif.audio.codec_control);
	wmb();
	val = readq(&mace->perif.audio.codec_control);
	udelay(200);
	spin_unlock_irqrestore(&chip->ad1843_lock, flags);
	return 0;
}