summaryrefslogtreecommitdiff
path: root/sound/i2c/cs8427.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-11-13 16:02:56 +0900
committerTakashi Iwai <tiwai@suse.de>2009-11-13 08:30:22 +0100
commit401de8184a4d94688962b9258fe10ab309ffda9c (patch)
treeae1e6c7d92825c6ac95f905f0471056ac2b89865 /sound/i2c/cs8427.c
parent0d26ce3403b3841fa2656df08a819fc7eaebaa17 (diff)
downloadlwn-401de8184a4d94688962b9258fe10ab309ffda9c.tar.gz
lwn-401de8184a4d94688962b9258fe10ab309ffda9c.zip
ALSA: ice1712: Use bitrev8
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/i2c/cs8427.c')
-rw-r--r--sound/i2c/cs8427.c15
1 files changed, 2 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 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/bitrev.h>
#include <asm/unaligned.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -55,18 +56,6 @@ struct cs8427 {
struct cs8427_stream capture;
};
-static unsigned char swapbits(unsigned char val)
-{
- int bit;
- unsigned char res = 0;
- for (bit = 0; bit < 8; bit++) {
- res <<= 1;
- res |= val & 1;
- val >>= 1;
- }
- return res;
-}
-
int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
unsigned char val)
{
@@ -149,7 +138,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
}
data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
for (idx = 0; idx < count; idx++)
- data[idx + 1] = swapbits(ndata[idx]);
+ data[idx + 1] = bitrev8(ndata[idx]);
if (snd_i2c_sendbytes(device, data, count + 1) != count + 1)
return -EIO;
return 1;