Modified: trunk/sound/soc/codecs/adau1761.h (7718 => 7719)
--- trunk/sound/soc/codecs/adau1761.h 2009-10-27 08:02:49 UTC (rev 7718)
+++ trunk/sound/soc/codecs/adau1761.h 2009-10-27 09:57:14 UTC (rev 7719)
@@ -10,6 +10,30 @@
#ifndef __ADAU1761_H__
#define __ADAU1761_H__
+struct adau1761_setup_data {
+ unsigned short i2c_bus;
+ unsigned short i2c_address;
+};
+
+struct adau1761_mode_register {
+ u16 regaddress;
+ u16 regvalue;
+};
+
+#define RESET_REGISTER_COUNT 54
+#define MODE_REGISTER_COUNT 10
+
+/* DSP program patch for ADAU1761 ADC IIS 16bit mode */
+#define ADAU1716_ADC_SOFT_PATCH 1
+#define MASTER_MODE 1
+#ifdef MASTER_MODE
+/* IIS mater mode*/
+#define ADAU_SRPT_CTRL0 0x01
+#else
+/* IIS slave mode*/
+#define ADAU_SRPT_CTRL0 0x00
+#endif
+
/* adau1761_set_dai_sysclk clk_id */
#define ADAU1761_MCLK_ID 0
#define ADAU1761_BCLK_ID 0x33
@@ -174,12 +198,122 @@
#define ADAU1761_MUTE_BITS 0x1
#define ADAU1761_ADVOL_MASK 0xff
+/*
+ * Reset Mode - ADC capture/DAC playback, dsp core disabled
+ * (AInput mixers 0db, AOuput mixers 0db, HP out ON, DSP core OFF)
+*/
+static struct adau1761_mode_register adau1761_reset[RESET_REGISTER_COUNT] = {
+ /* mute outputs */
+ {ADAU_PLBMNOC, 0xE5},
+ {ADAU_PLBHPVL, 0x01},
+ {ADAU_PLBHPVR, 0x01},
+ {ADAU_PLBLOVL, 0x00},
+ {ADAU_PLBLOVR, 0x00},
-struct adau1761_setup_data {
- unsigned short i2c_bus;
- unsigned short i2c_address;
+ {ADAU_DSP_RUN, 0x00},
+ {ADAU_DSP_ENA, 0x00},
+ {ADAU_MICCTRL, 0x00},
+ {ADAU_RECPWRM, 0x00},
+ {ADAU_RECMLC0, 0x01},
+ {ADAU_RECMLC1, RECMLC_MIC_0DB},
+ {ADAU_RECMRC0, 0x01},
+ {ADAU_RECMRC1, RECMLC_MIC_0DB},
+ {ADAU_RECVLCL, 0x82},
+ {ADAU_RECVLCR, 0x82},
+ {ADAU_RECMBIA, RECMBIA_DISABLE},
+ {ADAU_ALCCTR0, 0x00},
+ {ADAU_ALCCTR1, 0x00},
+ {ADAU_ALCCTR2, 0x00},
+ {ADAU_ALCCTR3, 0x1F},
+ {ADAU_SPRTCT0, ADAU_SRPT_CTRL0},
+ {ADAU_SPRTCT1, 0x21}, /*0x21 = 32bclocks frame, 0x41 = 48*/
+ {ADAU_CONVCT0, 0x00},
+ {ADAU_CONVCT1, 0x00},
+ {ADAU_ADCCTL0, 0x00},
+ {ADAU_ADCCTL1, 0x00},
+ {ADAU_ADCCTL2, 0x00},
+ {ADAU_PLBMLC0, 0x21},
+ {ADAU_PLBMLC1, 0x00},
+ {ADAU_PLBMRC0, 0x41},
+ {ADAU_PLBMRC1, 0x00},
+ {ADAU_PLBMLLO, 0x03},
+ {ADAU_PLBMRLO, 0x09},
+ {ADAU_PLBLRMC, 0x01},
+ {ADAU_PLBCTRL, 0x00},
+ {ADAU_PLBPWRM, 0x00},
+ {ADAU_DACCTL0, 0x03},
+ {ADAU_DACCTL1, 0x00},
+ {ADAU_DACCTL2, 0x00},
+ {ADAU_DSP_CRC, 0x00},
+ {ADAU_DSP_GPI, 0x00},
+ {ADAU_DSP_SR1, 0x07},
+ {ADAU_SERPAD0, 0xAA},
+ {ADAU_SERPAD1, 0x00},
+ {ADAU_COMPAD0, 0xAA},
+ {ADAU_COMPAD1, 0x00},
+ {ADAU_MCLKPAD, 0x0A},
+ {ADAU_INP_ROT, 0x01},
+#ifdef ADAU1716_ADC_SOFT_PATCH
+ {ADAU_OUT_ROT, 0x00},
+#else
+ {ADAU_OUT_ROT, 0x01},
+#endif
+ {ADAU_SER_SRT, 0x00},
+ {ADAU_DSP_SLW, 0x00},
+ {ADAU_SER_DAT, 0x00},
+ {ADAU_CLK_EN0, 0x5F},
+ {ADAU_CLK_EN1, 0x01},
};
+/*
+ * Default Mode
+ * Analog microphones, ADC capture/DAC playback, dsp core disabled
+ * (AInput mixers ON, AOuput mixers ON, HP out ON)
+*/
+static struct adau1761_mode_register adau1761_mode0[MODE_REGISTER_COUNT] = {
+ /* mute outputs */
+ {ADAU_PLBHPVL, 0x03},
+ {ADAU_PLBHPVR, 0x03},
+ {ADAU_PLBLOVL, 0x02},
+ {ADAU_PLBLOVR, 0x02},
+ {ADAU_PLBMNOC, 0xE5},
+
+ {ADAU_CLK_EN0, 0x5F},
+ {ADAU_CLK_EN1, 0x01},
+
+ /*analog mic*/
+ {ADAU_RECVLCL, 0x82},
+ {ADAU_RECVLCR, 0x82},
+ {ADAU_MICCTRL, 0x00},
+};
+
+/*
+ * Digital Microphone mode,
+ * IIS Master, ADC capture/DAC playback, dsp core disabled
+ * (AInput mixers OFF, AOuput mixers ON, HP out ON)
+ */
+static struct adau1761_mode_register adau1761_mode1[MODE_REGISTER_COUNT] = {
+ /* mute outputs */
+ {ADAU_PLBHPVL, 0x03},
+ {ADAU_PLBHPVR, 0x03},
+ {ADAU_PLBLOVL, 0x02},
+ {ADAU_PLBLOVR, 0x02},
+ {ADAU_PLBMNOC, 0xE5},
+
+ {ADAU_CLK_EN0, 0x5F},
+ {ADAU_CLK_EN1, 0x03},
+
+ /*digital mic*/
+ {ADAU_RECVLCL, 0x00},
+ {ADAU_RECVLCR, 0x00},
+ {ADAU_MICCTRL, 0x20},
+};
+
+static struct adau1761_mode_register *adau1761_mode_registers[] = {
+ adau1761_mode0,
+ adau1761_mode1,
+};
+
extern struct snd_soc_dai adau1761_dai;
extern struct snd_soc_codec_device soc_codec_dev_adau1761;
Deleted: trunk/sound/soc/codecs/adau1761_fw.h (7718 => 7719)
--- trunk/sound/soc/codecs/adau1761_fw.h 2009-10-27 08:02:49 UTC (rev 7718)
+++ trunk/sound/soc/codecs/adau1761_fw.h 2009-10-27 09:57:14 UTC (rev 7719)
@@ -1,337 +0,0 @@
-/*
- * File: sound/blackfin/adau1761_fw.h
- * Author: John McCarty <[email protected]>
- *
- * Created: Thr Jun 5 2008
- * Description: register and program definitions for adau1761 signal-flow modes
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __ADAU1761_MODES_H__
-#define __ADAU1761_MODES_H__
-
-#include "adau1761.h"
-
-#define RESET_REGISTER_COUNT 54
-#define MODE_REGISTER_COUNT 10
-
-/* DSP program patch for ADAU1761 ADC IIS 16bit mode */
-#define ADAU1716_ADC_SOFT_PATCH 1
-
-#ifdef CONFIG_SND_ADAU1761_IIS_MASTER
-/*digital mic mode - IIS mater mode*/
-#define ADAU_SRPT_CTRL0 0x01
-#else
-/* analog mic - IIS slave mode*/
-#define ADAU_SRPT_CTRL0 0x00
-#endif
-
-struct adau1761_mode_register {
- u16 regaddress;
- u16 regvalue;
-};
-
-struct adau1761_mode_data {
- u16 size;
- u8 *data;
-};
-
-/*
- * Reset Mode - ADC capture/DAC playback, dsp core disabled
- * (AInput mixers 0db, AOuput mixers 0db, HP out ON, DSP core OFF)
-*/
-static struct adau1761_mode_register adau1761_reset[RESET_REGISTER_COUNT] = {
- /* mute outputs */
- {ADAU_PLBMNOC, 0xE5},
- {ADAU_PLBHPVL, 0x01},
- {ADAU_PLBHPVR, 0x01},
- {ADAU_PLBLOVL, 0x00},
- {ADAU_PLBLOVR, 0x00},
-
- {ADAU_DSP_RUN, 0x00},
- {ADAU_DSP_ENA, 0x00},
- {ADAU_MICCTRL, 0x00},
- {ADAU_RECPWRM, 0x00},
- {ADAU_RECMLC0, 0x01},
- {ADAU_RECMLC1, RECMLC_MIC_0DB},
- {ADAU_RECMRC0, 0x01},
- {ADAU_RECMRC1, RECMLC_MIC_0DB},
- {ADAU_RECVLCL, 0x82},
- {ADAU_RECVLCR, 0x82},
- {ADAU_RECMBIA, RECMBIA_DISABLE},
- {ADAU_ALCCTR0, 0x00},
- {ADAU_ALCCTR1, 0x00},
- {ADAU_ALCCTR2, 0x00},
- {ADAU_ALCCTR3, 0x1F},
- {ADAU_SPRTCT0, ADAU_SRPT_CTRL0},
- {ADAU_SPRTCT1, 0x21}, /*0x21 = 32bclocks frame, 0x41 = 48*/
- {ADAU_CONVCT0, 0x00},
- {ADAU_CONVCT1, 0x00},
- {ADAU_ADCCTL0, 0x00},
- {ADAU_ADCCTL1, 0x00},
- {ADAU_ADCCTL2, 0x00},
- {ADAU_PLBMLC0, 0x21},
- {ADAU_PLBMLC1, 0x00},
- {ADAU_PLBMRC0, 0x41},
- {ADAU_PLBMRC1, 0x00},
- {ADAU_PLBMLLO, 0x03},
- {ADAU_PLBMRLO, 0x09},
- {ADAU_PLBLRMC, 0x01},
- {ADAU_PLBCTRL, 0x00},
- {ADAU_PLBPWRM, 0x00},
- {ADAU_DACCTL0, 0x03},
- {ADAU_DACCTL1, 0x00},
- {ADAU_DACCTL2, 0x00},
- {ADAU_DSP_CRC, 0x00},
- {ADAU_DSP_GPI, 0x00},
- {ADAU_DSP_SR1, 0x07},
- {ADAU_SERPAD0, 0xAA},
- {ADAU_SERPAD1, 0x00},
- {ADAU_COMPAD0, 0xAA},
- {ADAU_COMPAD1, 0x00},
- {ADAU_MCLKPAD, 0x0A},
- {ADAU_INP_ROT, 0x01},
-#ifdef ADAU1716_ADC_SOFT_PATCH
- {ADAU_OUT_ROT, 0x00},
-#else
- {ADAU_OUT_ROT, 0x01},
-#endif
- {ADAU_SER_SRT, 0x00},
- {ADAU_DSP_SLW, 0x00},
- {ADAU_SER_DAT, 0x00},
- {ADAU_CLK_EN0, 0x5F},
- {ADAU_CLK_EN1, 0x01},
-};
-
-/*
- * Default Mode
- * Analog microphones, ADC capture/DAC playback, dsp core disabled
- * (AInput mixers ON, AOuput mixers ON, HP out ON)
-*/
-static struct adau1761_mode_register adau1761_mode0[MODE_REGISTER_COUNT] = {
- /* mute outputs */
- {ADAU_PLBHPVL, 0x03},
- {ADAU_PLBHPVR, 0x03},
- {ADAU_PLBLOVL, 0x02},
- {ADAU_PLBLOVR, 0x02},
- {ADAU_PLBMNOC, 0xE5},
-
- {ADAU_CLK_EN0, 0x5F},
- {ADAU_CLK_EN1, 0x01},
-
- /*analog mic*/
- {ADAU_RECVLCL, 0x82},
- {ADAU_RECVLCR, 0x82},
- {ADAU_MICCTRL, 0x00},
-};
-
-#ifdef ADAU1716_ADC_SOFT_PATCH
-#define ADAU1761_PROGRAM_SIZE_MODE0 575
-static u8 adau1761_mode0_prog[ADAU1761_PROGRAM_SIZE_MODE0] = {
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0xE0, 0x00, 0x00, 0x00,
-0xFF, 0xF5, 0x08, 0x20, 0x00,
-0xFF, 0x38, 0x00, 0x00, 0x00,
-0xFF, 0x80, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0xE8, 0x08, 0x00, 0x00,
-0xFE, 0x30, 0x00, 0xE2, 0x00,
-0xFF, 0x34, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0x2C, 0x00, 0x00, 0x00,
-0xFF, 0x54, 0x00, 0x00, 0x00,
-0xFF, 0x5C, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0xE8, 0x07, 0x20, 0x08,
-0x00, 0x00, 0x06, 0xA0, 0x00,
-0xFF, 0xE0, 0x00, 0xC0, 0x00,
-0xFF, 0x80, 0x07, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0xC0, 0x22, 0x00, 0x27,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0xE8, 0x1E, 0x00, 0x00,
-0xFF, 0xE8, 0x01, 0x20, 0x00,
-0xFF, 0xD8, 0x01, 0x03, 0x00,
-0x00, 0x07, 0xC6, 0x00, 0x00,
-0xFF, 0x08, 0x00, 0x00, 0x00,
-0xFF, 0xF4, 0x00, 0x20, 0x00,
-0xFF, 0xD8, 0x07, 0x02, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFD, 0xA5, 0x08, 0x20, 0x00,
-0xFF, 0xD8, 0x0D, 0x02, 0x00,
-0xFD, 0xAD, 0x08, 0x20, 0x00,
-0xFF, 0xD8, 0x0E, 0x02, 0x00,
-0xFD, 0xA5, 0x08, 0x20, 0x00,
-0x00, 0x00, 0x08, 0xA0, 0x00,
-0xFF, 0xD8, 0x11, 0x0A, 0x00,
-0x00, 0x20, 0x00, 0xEA, 0x00,
-0x00, 0x25, 0x08, 0x20, 0x08,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0xF5, 0x08, 0x20, 0x00,
-0xFF, 0xED, 0x17, 0x20, 0x26,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0xD8, 0x12, 0x02, 0x00,
-0xFD, 0xA5, 0x08, 0x20, 0x00,
-0x00, 0x00, 0x0C, 0xA0, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x48, 0x00, 0xEA, 0x00,
-0xFF, 0xD8, 0x16, 0x0A, 0x00,
-0x00, 0x4D, 0x07, 0x40, 0x00,
-0x00, 0x15, 0x08, 0x20, 0x00,
-0x00, 0x18, 0x00, 0xE4, 0x00,
-0x00, 0x00, 0x09, 0xA0, 0x00,
-0xFF, 0xD8, 0x10, 0x0A, 0x00,
-0xFD, 0xAD, 0x08, 0x20, 0x00,
-0x00, 0x00, 0x08, 0xA0, 0x00,
-0xFF, 0xD8, 0x14, 0x0A, 0x00,
-0x00, 0x20, 0x00, 0xEA, 0x00,
-0x00, 0x25, 0x08, 0x20, 0x08,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFF, 0xF5, 0x08, 0x20, 0x00,
-0xFF, 0xED, 0x17, 0x20, 0x26,
-0xFF, 0xD8, 0x15, 0x02, 0x00,
-0xFD, 0xAD, 0x08, 0x20, 0x00,
-0x00, 0x00, 0x0C, 0xA0, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x50, 0x00, 0xEA, 0x00,
-0x00, 0x55, 0x07, 0x20, 0x00,
-0x00, 0x00, 0x09, 0xA0, 0x00,
-0xFF, 0xD8, 0x13, 0x0A, 0x00,
-0xFF, 0xE8, 0x15, 0x40, 0x00,
-0xFF, 0xE8, 0x10, 0x44, 0x00,
-0xFF, 0xED, 0x08, 0x24, 0x48,
-0xFF, 0xF5, 0x08, 0x24, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x0A, 0xA0, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x58, 0x00, 0xEC, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x60, 0x00, 0xE2, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x65, 0x08, 0x20, 0x00,
-0x00, 0x5D, 0x08, 0x20, 0x30,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFD, 0x60, 0x00, 0xE2, 0x00,
-0xFF, 0xE8, 0x12, 0x40, 0x00,
-0xFF, 0xE8, 0x13, 0x44, 0x00,
-0xFF, 0xED, 0x08, 0x24, 0x48,
-0xFF, 0xF5, 0x08, 0x24, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x0A, 0xA0, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x68, 0x00, 0xEC, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x70, 0x00, 0xE2, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x75, 0x08, 0x20, 0x00,
-0x00, 0x6D, 0x08, 0x20, 0x30,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFD, 0x68, 0x00, 0xE2, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0x30, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00,
-0xFE, 0xC0, 0x0F, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00
-};
-#else
-#define ADAU1761_PROGRAM_SIZE_MODE0 0
-static u8 adau1761_mode0_prog[ADAU1761_PROGRAM_SIZE_MODE0] = {};
-#endif
-
-#if ADAU1716_ADC_SOFT_PATCH
-#define ADAU1761_PARAM_SIZE_MODE0 92
-static u8 adau1761_mode0_param[ADAU1761_PARAM_SIZE_MODE0] = {
-0x00, 0x00, 0x10, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x0F, 0x80, 0x00, 0x00,
-0x0F, 0xFF, 0xFE, 0x00,
-0x0F, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x7F, 0xFE, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00
-};
-#else
-#define ADAU1761_PARAM_SIZE_MODE0 0
-static u8 adau1761_mode0_param[ADAU1761_PARAM_SIZE_MODE0] = {};
-#endif
-
-/*
- * Digital Microphone mode,
- * IIS Master, ADC capture/DAC playback, dsp core disabled
- * (AInput mixers OFF, AOuput mixers ON, HP out ON)
- */
-static struct adau1761_mode_register adau1761_mode1[MODE_REGISTER_COUNT] = {
- /* mute outputs */
- {ADAU_PLBHPVL, 0x03},
- {ADAU_PLBHPVR, 0x03},
- {ADAU_PLBLOVL, 0x02},
- {ADAU_PLBLOVR, 0x02},
- {ADAU_PLBMNOC, 0xE5},
-
- {ADAU_CLK_EN0, 0x5F},
- {ADAU_CLK_EN1, 0x03},
-
- /*digital mic*/
- {ADAU_RECVLCL, 0x00},
- {ADAU_RECVLCR, 0x00},
- {ADAU_MICCTRL, 0x20},
-};
-
-static struct adau1761_mode_register *adau1761_mode_registers[] = {
- adau1761_mode0,
- adau1761_mode1,
-};
-
-static struct adau1761_mode_data adau1761_mode_programs[] = {
- {ADAU1761_PROGRAM_SIZE_MODE0, adau1761_mode0_prog},
- {ADAU1761_PROGRAM_SIZE_MODE0, adau1761_mode0_prog},
-};
-
-static struct adau1761_mode_data adau1761_mode_params[] = {
- {ADAU1761_PARAM_SIZE_MODE0, adau1761_mode0_param},
- {ADAU1761_PARAM_SIZE_MODE0, adau1761_mode0_param},
-};
-
-#endif