aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-11-13 02:02:56 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-13 02:30:22 -0500
commit401de8184a4d94688962b9258fe10ab309ffda9c (patch)
treeae1e6c7d92825c6ac95f905f0471056ac2b89865
parent0d26ce3403b3841fa2656df08a819fc7eaebaa17 (diff)
ALSA: ice1712: Use bitrev8
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/i2c/cs8427.c15
-rw-r--r--sound/pci/Kconfig1
2 files changed, 3 insertions, 13 deletions
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 020a5d512472..04ae8704cdcd 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -23,6 +23,7 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/bitrev.h>
26#include <asm/unaligned.h> 27#include <asm/unaligned.h>
27#include <sound/core.h> 28#include <sound/core.h>
28#include <sound/control.h> 29#include <sound/control.h>
@@ -55,18 +56,6 @@ struct cs8427 {
55 struct cs8427_stream capture; 56 struct cs8427_stream capture;
56}; 57};
57 58
58static unsigned char swapbits(unsigned char val)
59{
60 int bit;
61 unsigned char res = 0;
62 for (bit = 0; bit < 8; bit++) {
63 res <<= 1;
64 res |= val & 1;
65 val >>= 1;
66 }
67 return res;
68}
69
70int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg, 59int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
71 unsigned char val) 60 unsigned char val)
72{ 61{
@@ -149,7 +138,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
149 } 138 }
150 data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF; 139 data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
151 for (idx = 0; idx < count; idx++) 140 for (idx = 0; idx < count; idx++)
152 data[idx + 1] = swapbits(ndata[idx]); 141 data[idx + 1] = bitrev8(ndata[idx]);
153 if (snd_i2c_sendbytes(device, data, count + 1) != count + 1) 142 if (snd_i2c_sendbytes(device, data, count + 1) != count + 1)
154 return -EIO; 143 return -EIO;
155 return 1; 144 return 1;
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 75c602b5b132..351654cf7b09 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -570,6 +570,7 @@ config SND_ICE1712
570 tristate "ICEnsemble ICE1712 (Envy24)" 570 tristate "ICEnsemble ICE1712 (Envy24)"
571 select SND_MPU401_UART 571 select SND_MPU401_UART
572 select SND_AC97_CODEC 572 select SND_AC97_CODEC
573 select BITREVERSE
573 help 574 help
574 Say Y here to include support for soundcards based on the 575 Say Y here to include support for soundcards based on the
575 ICE1712 (Envy24) chip. 576 ICE1712 (Envy24) chip.