/* Assigns the desired input slots to a particular channel.  */
void AC97C_AssignInputSlots(unsigned char channel, unsigned int slots)
/* Assigns the desired input slots to a particular channel.  */
void AC97C_AssignInputSlots(unsigned char channel, unsigned int slots)
{
    unsigned int value;
    unsigned int i;
    SANITY_CHECK(channel <= AC97C_CHANNEL_B);
    slots >>= 3;
    for (i = 3; i < 15; i++) {
        if (slots & 1) {
            value = AT91C_BASE_AC97C->AC97C_ICA;
            value &= ~(0x07 << ((i - 3) * 3));
            value |= channel << ((i - 3) * 3);
            AT91C_BASE_AC97C->AC97C_ICA = value;
        }
        slots >>= 1;
    }
}