cs4281 DLLRDY
PATCH 1/1 cs4281 DLLRDY
Hi,
I've recently played with my old laptop shipped with a cs4281 chipset. Sometimes, I was getting the following message when loading the snd-cs4281 module:
May 7 11:38:20 rtp kernel: ACPI: PCI interrupt 0000:00:08.0[A] -> GSI 5 (level, low) -> IRQ 5 May 7 11:38:20 rtp kernel: DLLRDY not seen May 7 11:38:20 rtp kernel: CS4281: probe of 0000:00:08.0 failed with
error -5
After giving a quick glance at the datasheet from ftp.alsa-project.org, I found that the fpdn bit of the eppmc register was set. After unsetting this bit, the problem disappeared and the card was working.
The attached patch test if this bit is set and unset it in that case.
Regards,
Arnaud Patard
Reset the FPDN bit of the EPPMC register if needed
Signed-off-by Arnaud Patard <[email protected]>
---
cs4281.c | 8 ++++++++ 1 files changed, 8 insertions(+)
sound/pci/cs4281.c renamed from sound/pci/cs4281.c~fpdn +8 -0
@@ -206,7 +206,10 @@ MODULE_PARM_DESC(dual_codec, "Secondary#define BA0_PMCS 0x0344/* Power Management Control/Status */ #define BA0_CWPR 0x03e0/* Configuration Write Protect */ +#define BA0_EPPMC 0x03e4/* Extended PCI Power Management Control */ +#define BA0_EPPMC_FPDN (1<<14)/* Full Power DowN */ +#define BA0_GPIOR 0x03e8/* GPIO Pin Interface Register */ #define BA0_SPMC 0x03ec/* Serial Port Power Management Control (& ASDIN2 enable) */
@@ -1460,6 +1463,11 @@ static int snd_cs4281_chip_init(cs4281_tint timeout;int retry_count =2 ; +/* Having EPPMC.FPDN=1 prevent proper chip initialisation */ + tmp =snd_cs4281_peekBA0 (chip,BA0_EPPMC ); +if ( tmp &BA0_EPPMC_FPDN ) +snd_cs4281_pokeBA0 (chip,BA0_EPPMC , tmp & ~BA0_EPPMC_FPDN ); + __retry: tmp =snd_cs4281_peekBA0 (chip,BA0_CFLR );if (tmp !=BA0_CFLR_DEFAULT ) {