/* The SoundScape can use two IRQs from a possible set of four. These IRQs are encoded as bit patterns so that they can be written to the control registers.  */
static unsigned __devinit get_irq_config(int sscape_type, int irq)
/* The SoundScape can use two IRQs from a possible set of four. These IRQs are encoded as bit patterns so that they can be written to the control registers.  */
static unsigned __devinit get_irq_config(int sscape_type, int irq)
{
	static const int valid_irq[] = { 9, 5, 7, 10 };
	static const int old_irq[] = { 9, 7, 5, 15 };
	unsigned cfg;
	if (sscape_type == MEDIA_FX) {
		for (cfg = 0; cfg < ARRAY_SIZE(old_irq); ++cfg)
			if (irq == old_irq[cfg])
				return cfg;
	} else {
		for (cfg = 0; cfg < ARRAY_SIZE(valid_irq); ++cfg)
			if (irq == valid_irq[cfg])
				return cfg;
	}
	return INVALID_IRQ;
}