#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
+#include <linux/delay.h>
#define CT_XFI_DMA_MASK DMA_BIT_MASK(32) /* 32 bits */
hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x11111111);
hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0);
} else {
- printk(KERN_ALERT "ERROR!!! Invalid sampling rate!!!\n");
+ printk(KERN_ALERT "ctxfi: ERROR!!! Invalid sampling rate!!!\n");
return -EINVAL;
}
/* Set up device page table */
if ((~0UL) == info->vm_pgt_phys) {
- printk(KERN_ALERT "Wrong device page table page address!!!\n");
+ printk(KERN_ALERT "ctxfi: "
+ "Wrong device page table page address!!!\n");
return -1;
}
vmctl = 0x80000C0F; /* 32-bit, 4k-size page */
-#if BITS_PER_LONG == 64
- ptp_phys_low = info->vm_pgt_phys & ((1UL<<32)-1);
- ptp_phys_high = (info->vm_pgt_phys>>32) & ((1UL<<32)-1);
- vmctl |= (3<<8);
-#elif BITS_PER_LONG == 32
- ptp_phys_low = info->vm_pgt_phys & (~0UL);
- ptp_phys_high = 0;
-#else
-# error "Unknown BITS_PER_LONG!"
-#endif
-#if PAGE_SIZE == 8192
-# error "Don't support 8k-page!"
-#endif
+ ptp_phys_low = (u32)info->vm_pgt_phys;
+ ptp_phys_high = upper_32_bits(info->vm_pgt_phys);
+ if (sizeof(void *) == 8) /* 64bit address */
+ vmctl |= (3 << 8);
/* Write page table physical address to all PTPAL registers */
for (i = 0; i < 64; i++) {
hw_write_20kx(hw, VMEM_PTPAL+(16*i), ptp_phys_low);
break;
}
if (i >= 1000) {
- printk(KERN_ALERT "PLL initialization failed!!!\n");
+ printk(KERN_ALERT "ctxfi: PLL initialization failed!!!\n");
return -EBUSY;
}
break;
}
if (!get_field(gctl, GCTL_AID)) {
- printk(KERN_ALERT "Card Auto-init failed!!!\n");
+ printk(KERN_ALERT "ctxfi: Card Auto-init failed!!!\n");
return -EBUSY;
}
/* Initialize I2C */
err = I2CInit(hw, 0x1A, 1, 1);
if (err < 0) {
- printk(KERN_ALERT "Failure to acquire I2C!!!\n");
+ printk(KERN_ALERT "ctxfi: Failure to acquire I2C!!!\n");
goto error;
}
I2CWrite(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x0A),
MAKE_WM8775_DATA(0x0A));
} else {
- printk(KERN_ALERT "Invalid master sampling "
+ printk(KERN_ALERT "ctxfi: Invalid master sampling "
"rate (msr %d)!!!\n", info->msr);
err = -EINVAL;
goto error;
I2CWrite(hw, MAKE_WM8775_ADDR(WM8775_AADCR, 0xCF),
MAKE_WM8775_DATA(0xCF)); /* No boost */
} else {
- printk(KERN_ALERT "ERROR!!! Invalid input mux!!!\n");
+ printk(KERN_ALERT "ctxfi: ERROR!!! Invalid input mux!!!\n");
err = -EINVAL;
goto error;
}
dma_mask = CT_XFI_DMA_MASK;
if (pci_set_dma_mask(pci, dma_mask) < 0 ||
pci_set_consistent_dma_mask(pci, dma_mask) < 0) {
- printk(KERN_ERR "architecture does not support PCI "
+ printk(KERN_ERR "ctxfi: architecture does not support PCI "
"busmaster DMA with mask 0x%x\n", dma_mask);
err = -ENXIO;
goto error1;