AC97 codec for STAC9766 used on the Efika.
Datasheet: http://www.idt.com/products/getDoc.cfm?docID=13134007
Signed-off-by: Jon Smirl jonsm...@gmail.com
---
0 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 7f78b65..cb07d9b 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -19,6 +19,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_CS4270 if I2C
select SND_SOC_PCM3008
select SND_SOC_SSM2602 if I2C
+ select SND_SOC_STAC9766 if SND_SOC_AC97_BUS
select SND_SOC_TLV320AIC23 if I2C
select SND_SOC_TLV320AIC26 if SPI_MASTER
select SND_SOC_TLV320AIC3X if I2C
@@ -93,6 +94,9 @@ config SND_SOC_PCM3008
config SND_SOC_SSM2602
tristate
+config SND_SOC_STAC9766
+ tristate
+
config SND_SOC_TLV320AIC23
tristate
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 70c55fa..46c007c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -7,6 +7,7 @@ snd-soc-cs4270-objs := cs4270.o
snd-soc-l3-objs := l3.o
snd-soc-pcm3008-objs := pcm3008.o
snd-soc-ssm2602-objs := ssm2602.o
+snd-soc-stac9766-objs := stac9766.o
snd-soc-tlv320aic23-objs := tlv320aic23.o
snd-soc-tlv320aic26-objs := tlv320aic26.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
@@ -42,6 +43,7 @@ obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o
obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o
+obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
new file mode 100644
index 000..7740cd5
--- /dev/null
+++ b/sound/soc/codecs/stac9766.c
@@ -0,0 +1,470 @@
+/*
+ * stac9766.c -- ALSA SoC STAC9766 codec support
+ *
+ * Copyright 2009 Jon Smirl, Digispeaker
+ * Author: Jon Smirl jonsm...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * Features:-
+ *
+ * o Support for AC97 Codec, S/PDIF
+ */
+
+#include linux/init.h
+#include linux/module.h
+#include linux/device.h
+#include sound/core.h
+#include sound/pcm.h
+#include sound/ac97_codec.h
+#include sound/initval.h
+#include sound/pcm_params.h
+#include sound/soc.h
+#include sound/tlv.h
+#include sound/soc-of-simple.h
+
+#include stac9766.h
+
+#define STAC9766_VERSION 0.10
+
+/*
+ * STAC9766 register cache
+ */
+static const u16 stac9766_reg[] = {
+ 0x6A90, 0x8000, 0x8000, 0x8000, /* 6 */
+ 0x, 0x, 0x8008, 0x8008, /* e */
+ 0x8808, 0x8808, 0x8808, 0x8808, /* 16 */
+ 0x8808, 0x, 0x8000, 0x, /* 1e */
+ 0x, 0x, 0x, 0x000f, /* 26 */
+ 0x0a05, 0x0400, 0xbb80, 0x, /* 2e */
+ 0x, 0xbb80, 0x, 0x, /* 36 */
+ 0x, 0x2000, 0x, 0x0100, /* 3e */
+ 0x, 0x, 0x0080, 0x, /* 46 */
+ 0x, 0x, 0x0003, 0x, /* 4e */
+ 0x, 0x, 0x, 0x, /* 56 */
+ 0x4000, 0x, 0x, 0x, /* 5e */
+ 0x1201, 0x, 0x, 0x, /* 66 */
+ 0x, 0x, 0x, 0x, /* 6e */
+ 0x, 0x, 0x, 0x0006, /* 76 */
+ 0x, 0x, 0x, 0x, /* 7e */
+};
+
+static const char *stac9766_record_mux[] = {Mic, CD, Video, AUX,
Line, Stereo Mix, Mono Mix, Phone};
+static const char *stac9766_mono_mux[] = {Mix, Mic};
+static const char *stac9766_mic_mux[] = {Mic1, Mic2};
+static const char *stac9766_SPDIF_mux[] = {PCM, ADC Record};
+static const char *stac9766_popbypass_mux[] = {Normal, Bypass Mixer};
+static const char *stac9766_record_all_mux[] = {All analog, Analog plus
DAC};
+static const char *stac9766_boost1[] = {0dB, 10dB};
+static const char *stac9766_boost2[] = {0dB, 20dB};
+static const char *stac9766_stereo_mic[] = {Off, On};
+
+static const struct soc_enum stac9766_record_enum =
+ SOC_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, stac9766_record_mux);
+static const struct soc_enum stac9766_mono_enum =
+ SOC_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 9, 2, stac9766_mono_mux);
+static const struct soc_enum stac9766_mic_enum =
+ SOC_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, stac9766_mic_mux);
+static const struct soc_enum stac9766_SPDIF_enum =
+ SOC_ENUM_SINGLE(AC97_STAC_DA_CONTROL, 1, 2, stac9766_SPDIF_mux);
+static const struct soc_enum stac9766_popbypass_enum =
+ SOC_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 15, 2, stac9766_popbypass_mux);
+static const struct soc_enum stac9766_record_all_enum =
+ SOC_ENUM_SINGLE(AC97_STAC_ANALOG_SPECIAL,