Commit 401de818 authored by Akinobu Mita's avatar Akinobu Mita Committed by Takashi Iwai

ALSA: ice1712: Use bitrev8

Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0d26ce34
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/bitrev.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/control.h> #include <sound/control.h>
...@@ -55,18 +56,6 @@ struct cs8427 { ...@@ -55,18 +56,6 @@ struct cs8427 {
struct cs8427_stream capture; 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, int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
unsigned char val) unsigned char val)
{ {
...@@ -149,7 +138,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device, ...@@ -149,7 +138,7 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
} }
data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF; data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
for (idx = 0; idx < count; idx++) 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) if (snd_i2c_sendbytes(device, data, count + 1) != count + 1)
return -EIO; return -EIO;
return 1; return 1;
......
...@@ -570,6 +570,7 @@ config SND_ICE1712 ...@@ -570,6 +570,7 @@ config SND_ICE1712
tristate "ICEnsemble ICE1712 (Envy24)" tristate "ICEnsemble ICE1712 (Envy24)"
select SND_MPU401_UART select SND_MPU401_UART
select SND_AC97_CODEC select SND_AC97_CODEC
select BITREVERSE
help help
Say Y here to include support for soundcards based on the Say Y here to include support for soundcards based on the
ICE1712 (Envy24) chip. ICE1712 (Envy24) chip.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment