aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-06-13 14:53:56 -0400
committerJaroslav Kysela <perex@perex.cz>2008-06-16 03:32:36 -0400
commit766979e09d302315f314bfd96fdd83f8f9896d9c (patch)
tree512cfb5df849399359143b8d8a7cedac92cbbe01 /sound/pci
parent0c6341ace5efb14a0da08482e299b3c158e0d5fb (diff)
ALSA: hda - use upper_32_bits()
Use the standard upper_32_bits() instead of own macro. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 539d20102c32..16715a68ba5e 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -440,11 +440,6 @@ static char *driver_short_names[] __devinitdata = {
440/* for pcm support */ 440/* for pcm support */
441#define get_azx_dev(substream) (substream->runtime->private_data) 441#define get_azx_dev(substream) (substream->runtime->private_data)
442 442
443/* Get the upper 32bit of the given dma_addr_t
444 * Compiler should optimize and eliminate the code if dma_addr_t is 32bit
445 */
446#define upper_32bit(addr) (sizeof(addr) > 4 ? (u32)((addr) >> 32) : (u32)0)
447
448static int azx_acquire_irq(struct azx *chip, int do_disconnect); 443static int azx_acquire_irq(struct azx *chip, int do_disconnect);
449 444
450/* 445/*
@@ -475,7 +470,7 @@ static void azx_init_cmd_io(struct azx *chip)
475 chip->corb.addr = chip->rb.addr; 470 chip->corb.addr = chip->rb.addr;
476 chip->corb.buf = (u32 *)chip->rb.area; 471 chip->corb.buf = (u32 *)chip->rb.area;
477 azx_writel(chip, CORBLBASE, (u32)chip->corb.addr); 472 azx_writel(chip, CORBLBASE, (u32)chip->corb.addr);
478 azx_writel(chip, CORBUBASE, upper_32bit(chip->corb.addr)); 473 azx_writel(chip, CORBUBASE, upper_32_bits(chip->corb.addr));
479 474
480 /* set the corb size to 256 entries (ULI requires explicitly) */ 475 /* set the corb size to 256 entries (ULI requires explicitly) */
481 azx_writeb(chip, CORBSIZE, 0x02); 476 azx_writeb(chip, CORBSIZE, 0x02);
@@ -490,7 +485,7 @@ static void azx_init_cmd_io(struct azx *chip)
490 chip->rirb.addr = chip->rb.addr + 2048; 485 chip->rirb.addr = chip->rb.addr + 2048;
491 chip->rirb.buf = (u32 *)(chip->rb.area + 2048); 486 chip->rirb.buf = (u32 *)(chip->rb.area + 2048);
492 azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); 487 azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr);
493 azx_writel(chip, RIRBUBASE, upper_32bit(chip->rirb.addr)); 488 azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr));
494 489
495 /* set the rirb size to 256 entries (ULI requires explicitly) */ 490 /* set the rirb size to 256 entries (ULI requires explicitly) */
496 azx_writeb(chip, RIRBSIZE, 0x02); 491 azx_writeb(chip, RIRBSIZE, 0x02);
@@ -861,7 +856,7 @@ static void azx_init_chip(struct azx *chip)
861 856
862 /* program the position buffer */ 857 /* program the position buffer */
863 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); 858 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
864 azx_writel(chip, DPUBASE, upper_32bit(chip->posbuf.addr)); 859 azx_writel(chip, DPUBASE, upper_32_bits(chip->posbuf.addr));
865 860
866 chip->initialized = 1; 861 chip->initialized = 1;
867} 862}
@@ -1006,7 +1001,7 @@ static int setup_bdle(struct snd_pcm_substream *substream,
1006 addr = snd_pcm_sgbuf_get_addr(sgbuf, ofs); 1001 addr = snd_pcm_sgbuf_get_addr(sgbuf, ofs);
1007 /* program the address field of the BDL entry */ 1002 /* program the address field of the BDL entry */
1008 bdl[0] = cpu_to_le32((u32)addr); 1003 bdl[0] = cpu_to_le32((u32)addr);
1009 bdl[1] = cpu_to_le32(upper_32bit(addr)); 1004 bdl[1] = cpu_to_le32(upper_32_bits(addr));
1010 /* program the size field of the BDL entry */ 1005 /* program the size field of the BDL entry */
1011 chunk = PAGE_SIZE - (ofs % PAGE_SIZE); 1006 chunk = PAGE_SIZE - (ofs % PAGE_SIZE);
1012 if (size < chunk) 1007 if (size < chunk)
@@ -1138,7 +1133,7 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
1138 /* lower BDL address */ 1133 /* lower BDL address */
1139 azx_sd_writel(azx_dev, SD_BDLPL, (u32)azx_dev->bdl.addr); 1134 azx_sd_writel(azx_dev, SD_BDLPL, (u32)azx_dev->bdl.addr);
1140 /* upper BDL address */ 1135 /* upper BDL address */
1141 azx_sd_writel(azx_dev, SD_BDLPU, upper_32bit(azx_dev->bdl.addr)); 1136 azx_sd_writel(azx_dev, SD_BDLPU, upper_32_bits(azx_dev->bdl.addr));
1142 1137
1143 /* enable the position buffer */ 1138 /* enable the position buffer */
1144 if (chip->position_fix == POS_FIX_POSBUF || 1139 if (chip->position_fix == POS_FIX_POSBUF ||