aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthw20k1.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-05 03:29:22 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-05 03:29:22 -0400
commit42a0b31827e4c555efebda7d347cf4ea6b82913a (patch)
treec4e747955f716fa7cae83278ccde17c9d74c1415 /sound/pci/ctxfi/cthw20k1.c
parent6d74b86d3c0f9cfa949566a862aaad840e393249 (diff)
ALSA: ctxfi - Fix endian-dependent codes
The UAA-mode check in hwct20k1.c is implemented with the endian-dependent codes. Fix to be more portable (and readable). Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthw20k1.c')
-rw-r--r--sound/pci/ctxfi/cthw20k1.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index 1da1f82fe81..fd5f454c404 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -1785,6 +1785,8 @@ static int hw_have_digit_io_switch(struct hw *hw)
1785 || ((subsys_id & 0xf000) == 0x6000)); 1785 || ((subsys_id & 0xf000) == 0x6000));
1786} 1786}
1787 1787
1788#define CTLBITS(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
1789
1788#define UAA_CFG_PWRSTATUS 0x44 1790#define UAA_CFG_PWRSTATUS 0x44
1789#define UAA_CFG_SPACE_FLAG 0xA0 1791#define UAA_CFG_SPACE_FLAG 0xA0
1790#define UAA_CORE_CHANGE 0x3FFC 1792#define UAA_CORE_CHANGE 0x3FFC
@@ -1792,12 +1794,18 @@ static int uaa_to_xfi(struct pci_dev *pci)
1792{ 1794{
1793 unsigned int bar0, bar1, bar2, bar3, bar4, bar5; 1795 unsigned int bar0, bar1, bar2, bar3, bar4, bar5;
1794 unsigned int cmd, irq, cl_size, l_timer, pwr; 1796 unsigned int cmd, irq, cl_size, l_timer, pwr;
1795 unsigned int CTLA, CTLZ, CTLL, CTLX, CTL_, CTLF, CTLi;
1796 unsigned int is_uaa = 0; 1797 unsigned int is_uaa = 0;
1797 unsigned int data[4] = {0}; 1798 unsigned int data[4] = {0};
1798 unsigned int io_base; 1799 unsigned int io_base;
1799 void *mem_base; 1800 void *mem_base;
1800 int i = 0; 1801 int i = 0;
1802 const u32 CTLX = CTLBITS('C', 'T', 'L', 'X');
1803 const u32 CTL_ = CTLBITS('C', 'T', 'L', '-');
1804 const u32 CTLF = CTLBITS('C', 'T', 'L', 'F');
1805 const u32 CTLi = CTLBITS('C', 'T', 'L', 'i');
1806 const u32 CTLA = CTLBITS('C', 'T', 'L', 'A');
1807 const u32 CTLZ = CTLBITS('C', 'T', 'L', 'Z');
1808 const u32 CTLL = CTLBITS('C', 'T', 'L', 'L');
1801 1809
1802 /* By default, Hendrix card UAA Bar0 should be using memory... */ 1810 /* By default, Hendrix card UAA Bar0 should be using memory... */
1803 io_base = pci_resource_start(pci, 0); 1811 io_base = pci_resource_start(pci, 0);
@@ -1805,14 +1813,6 @@ static int uaa_to_xfi(struct pci_dev *pci)
1805 if (NULL == mem_base) 1813 if (NULL == mem_base)
1806 return -ENOENT; 1814 return -ENOENT;
1807 1815
1808 CTLX = ___constant_swab32(*((unsigned int *)"CTLX"));
1809 CTL_ = ___constant_swab32(*((unsigned int *)"CTL-"));
1810 CTLF = ___constant_swab32(*((unsigned int *)"CTLF"));
1811 CTLi = ___constant_swab32(*((unsigned int *)"CTLi"));
1812 CTLA = ___constant_swab32(*((unsigned int *)"CTLA"));
1813 CTLZ = ___constant_swab32(*((unsigned int *)"CTLZ"));
1814 CTLL = ___constant_swab32(*((unsigned int *)"CTLL"));
1815
1816 /* Read current mode from Mode Change Register */ 1816 /* Read current mode from Mode Change Register */
1817 for (i = 0; i < 4; i++) 1817 for (i = 0; i < 4; i++)
1818 data[i] = readl(mem_base + UAA_CORE_CHANGE); 1818 data[i] = readl(mem_base + UAA_CORE_CHANGE);