aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthw20k2.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-02 15:04:29 +0200
committerTakashi Iwai <tiwai@suse.de>2009-06-02 15:54:46 +0200
commitcd391e206f486955e216a61bd9ebcb0e142122e9 (patch)
treeecbf2facf4199093d44bae7e16767566353758d8 /sound/pci/ctxfi/cthw20k2.c
parentd2b9b96c516d4d61663d92ab4ad4f15ca0134ef2 (diff)
downloadkernel_samsung_smdk4412-cd391e206f486955e216a61bd9ebcb0e142122e9.zip
kernel_samsung_smdk4412-cd391e206f486955e216a61bd9ebcb0e142122e9.tar.gz
kernel_samsung_smdk4412-cd391e206f486955e216a61bd9ebcb0e142122e9.tar.bz2
ALSA: ctxfi - Remove PAGE_SIZE limitation
Remove the limitation of PAGE_SIZE to be 4k by defining the own page size and macros for 4k. 8kb page size could be natively supported, but it's disabled right now for simplicity. Also, clean up using upper_32_bits() macro. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthw20k2.c')
-rw-r--r--sound/pci/ctxfi/cthw20k2.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 7c24c2c..3497287 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -1203,19 +1203,10 @@ static int hw_trn_init(struct hw *hw, const struct trn_conf *info)
}
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);