>> +#define ASUS_VENDOR_ID 0x1043 // Is it? > > It is. Ok.
>> +/* Xonar specific */ >> +#define XONAR_DX_FRONTDAC 0x9e >> +#define XONAR_DX_GPIO_OUTPUT 0x01 >> ... >> +/* Xonar DX */ >> +#define XONAR_DX_OUTPUT 0x0001 >> +#define XONAR_ADDR_FRONT 0x9e > > ? The redundant defines are gone already. >> + /* Card model */ >> + int card_model; > > I think you can use the model field for this purpose. Ah, haven't seen that. >> + /* Wait for it to stop being busy */ >> + while((INW(devc->osdev, TWO_WIRE_CTRL) & 0x1) && (count > 0)) >> + ... >> MUTEX_ENTER_IRQDISABLE (devc->low_mutex, flags); > > Waiting outside the mutex means that this functions isn't reentrant. > >> + oss_udelay(100); >> + >> MUTEX_EXIT_IRQRESTORE (devc->low_mutex, flags); > > Why is this wait inside the mutex? > > I think it would be a better idea to wrap the entire function in a mutex > that doesn't disable interupts. Will do. As said, this is more of a cold water approach. The last time I effectively did C was around 1999, and that more as a hobby and not with DDIs or anything more delicate. So a few dumb things are still to be expected. Thanks for the feedback, though. >> + // Left justified PCM (DAC and 8788 support I2S, but doesn't work). > > How does it not work? When I've tried setting it, I had no output. Changing to left-justified made it work. I can try again though, I've had a bunch of other issues during that time, too. >> + /* SPI communication */ >> + bVal |= 0x80; > > SPI is actually enabled by clearing bit 6. Bit 7 enables SPI outputs 4 > and 5. I should really get in contact with C-Media, there's quite another bunch of things I'd like to change, but don't know what they do. >> + /* Must set master clock. */ >> + sDac |= 0x0010; > > Please mention "256". Has been replaced with a define that also says MCLOCK_256. >> + /* Enable Xonar output */ >> + unsigned short output_enable; >> + switch(devc->card_model) >> + { >> + case SUBID_XONAR_DX: >> + output_enable = XONAR_DX_OUTPUT; >> + break; >> + } >> + OUTW(devc->osdev, output_enable, GPIO_CONTROL); >> + OUTW(devc->osdev, output_enable, GPIO_DATA); > > output_enable is not initialized when the model is not a Xonar DX. Going to fix that. Thanks, -mg _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel