/*
* wm9713.c -- ALSA Soc WM9713 codec support
*
* Copyright 2006 Wolfson Microelectronics PLC.
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
*
* 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, Voice DAC and Aux DAC
* o Support for DAPM
*/
#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/soc-dapm.h>
#include "wm9713.h"
#define WM9713_VERSION "0.15"
struct wm9713_priv {
u32 pll_in; /* PLL input frequency */
};
static unsigned int ac97_read(struct snd_soc_codec *codec,
unsigned int reg);
static int ac97_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int val);
/*
* WM9713 register cache
* Reg 0x3c bit 15 is used by touch driver.
*/
static const u16 wm9713_reg[] = {
0x6174, 0x8080, 0x8080, 0x8080,
0xc880, 0xe808, 0xe808, 0x0808,
0x00da, 0x8000, 0xd600, 0xaaa0,
0xaaa0, 0xaaa0, 0x0000, 0x0000,
0x0f0f, 0x0040, 0x0000, 0x7f00,
0x0405, 0x0410, 0xbb80, 0xbb80,
0x0000, 0xbb80, 0x0000, 0x4523,
0x0000, 0x2000, 0x7eff, 0xffff,
0x0000, 0x0000, 0x0080, 0x0000,
0x0000, 0x0000, 0xfffe, 0xffff,
0x0000, 0x0000, 0x0000, 0xfffe,
0x4000, 0x0000, 0x0000, 0x0000,
0xb032, 0x3e00, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0006,
0x0001, 0x0000, 0x574d, 0x4c13,
0x0000, 0x0000, 0x0000
};
/* virtual HP mixers regs */
#define HPL_MIXER 0x80
#define HPR_MIXER 0x82
#define MICB_MUX 0x82
static const char *wm9713_mic_mixer[] = {"Stereo", "Mic 1", "Mic 2", "Mute"};
static const char *wm9713_rec_mux[] = {"Stereo", "Left", "Right", "Mute"};
static const char *wm9713_rec_src[] =
{"Mic 1", "Mic 2", "Line", "Mono In", "Headphone", "Speaker",
"Mono Out"