diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-02 09:04:29 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-02 09:54:46 -0400 |
commit | cd391e206f486955e216a61bd9ebcb0e142122e9 (patch) | |
tree | ecbf2facf4199093d44bae7e16767566353758d8 /sound/pci/ctxfi/cthw20k1.c | |
parent | d2b9b96c516d4d61663d92ab4ad4f15ca0134ef2 (diff) |
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/cthw20k1.c')
-rw-r--r-- | sound/pci/ctxfi/cthw20k1.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 44283bd7b2df..b7b8e6f41d0d 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -1249,19 +1249,15 @@ static int hw_trn_init(struct hw *hw, const struct trn_conf *info) | |||
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | trnctl = 0x13; /* 32-bit, 4k-size page */ | 1251 | trnctl = 0x13; /* 32-bit, 4k-size page */ |
1252 | #if BITS_PER_LONG == 64 | 1252 | ptp_phys_low = (u32)info->vm_pgt_phys; |
1253 | ptp_phys_low = info->vm_pgt_phys & ((1UL<<32)-1); | 1253 | ptp_phys_high = upper_32_bits(info->vm_pgt_phys); |
1254 | ptp_phys_high = (info->vm_pgt_phys>>32) & ((1UL<<32)-1); | 1254 | if (sizeof(void *) == 8) /* 64bit address */ |
1255 | trnctl |= (1<<2); | 1255 | trnctl |= (1 << 2); |
1256 | #elif BITS_PER_LONG == 32 | 1256 | #if 0 /* Only 4k h/w pages for simplicitiy */ |
1257 | ptp_phys_low = info->vm_pgt_phys & (~0UL); | ||
1258 | ptp_phys_high = 0; | ||
1259 | #else | ||
1260 | # error "Unknown BITS_PER_LONG!" | ||
1261 | #endif | ||
1262 | #if PAGE_SIZE == 8192 | 1257 | #if PAGE_SIZE == 8192 |
1263 | trnctl |= (1<<5); | 1258 | trnctl |= (1<<5); |
1264 | #endif | 1259 | #endif |
1260 | #endif | ||
1265 | hw_write_20kx(hw, PTPALX, ptp_phys_low); | 1261 | hw_write_20kx(hw, PTPALX, ptp_phys_low); |
1266 | hw_write_20kx(hw, PTPAHX, ptp_phys_high); | 1262 | hw_write_20kx(hw, PTPAHX, ptp_phys_high); |
1267 | hw_write_20kx(hw, TRNCTL, trnctl); | 1263 | hw_write_20kx(hw, TRNCTL, trnctl); |