diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 13:37:37 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 13:37:37 -0700 |
commit | dbf7b5915b39bfff548e4c6a3a753fc291a60e25 (patch) | |
tree | 55c457a22aa869d2ab558317877138369ae5f9bb /sound/soc/codecs/arizona.h | |
parent | d14b7a419a664cd7c1c585c9e7fffee9e9051d53 (diff) | |
parent | c1b623d9e4117d18d244e9b7fb30d2c27aeaf074 (diff) |
Merge tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound update from Takashi Iwai:
"This is a fairly quiet release in all sound area. Only a little bit
of changes in the core side while most of changes are seen in the
drivers.
HD-audio:
- A few new codec additions for Nvidia, Realtek and VIA
- Intel Haswell audio support
- Support for "phantom" jacks for consistent jack reporting
- Major clean-ups in HDMI/DP driver codes
- A workaround for inverted digital-mic pins with Realtek codecs
- Removal of beep_mode=2 option
ASoC:
- Added the ability to add and remove DAPM paths dynamically, mostly
for reparenting on clock changes
- New machine drivers for Marvell Brownstone, ST-Ericsson Ux500
reference platform and ttc-dkp
- New CPU drivers for Blackfin BF6xx SPORTs in I2S mode, Marvell MMP,
Synopsis Designware I2S controllers, and SPEAr DMA and S/PDIF
- New CODEC drivers for Dialog DA732x, ST STA529, ST-Ericsson AB8500,
TI Isabelle and Wolfson Microelectronics WM5102 and WM5110
- DAPM fixes for the recent locking changes
- Fix for _PRE and _POST widgets (which have been broken for a few
releases now)
- A couple of minor driver updates
Misc
- Conversion to new dev_pm_ops in platform and PCI drivers
- LTC support and some fixes in PCXHR driver
- A few fixes and PM support for ISA OPti9xx and WSS cards
- Some TLV code cleanup
- Move driver-specific headers from include/sound to local dirs"
* tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (212 commits)
ASoC: dapm: Fix _PRE and _POST events for DAPM performance improvements
ALSA: hda - add dock support for Thinkpad X230 Tablet
ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
ASoC imx-audmux: add MX31_AUDMUX_PORT7_SSI_PINS_7 define
ASoC: littlemill: Add userspace control of the WM1250 I/O
ASoC: wm8994: Update micdet for irqdomain conversion
ALSA: hda - make sure alc268 does not OOPS on codec parse
ALSA: hda - Add support for Realtek ALC282
ALSA: hda - Fix index number conflicts of phantom jacks
ALSA: opti9xx: Fix section mismatch by PM support
ALSA: snd-opti9xx: Implement suspend/resume
ALSA: hda - Add new GPU codec ID to snd-hda
ALSA: hda - Fix driver type of Haswell controller to AZX_DRIVER_SCH
ALSA: hda - add Haswell HDMI codec id
ALSA: hda - Add DeviceID for Haswell HDA
ALSA: wss_lib: Fix resume on Yamaha OPL3-SAx
ALSA: wss_lib: fix suspend/resume
ALSA: es1938: replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE
ALSA: tlv: add DECLARE_TLV_DB_RANGE()
ALSA: tlv: add DECLARE_TLV_CONTAINER()
...
Diffstat (limited to 'sound/soc/codecs/arizona.h')
-rw-r--r-- | sound/soc/codecs/arizona.h | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h new file mode 100644 index 00000000000..59caca8865e --- /dev/null +++ b/sound/soc/codecs/arizona.h @@ -0,0 +1,159 @@ +/* + * arizona.h - Wolfson Arizona class device shared support + * + * Copyright 2012 Wolfson Microelectronics plc + * + * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _ASOC_ARIZONA_H +#define _ASOC_ARIZONA_H + +#include <linux/completion.h> + +#include <sound/soc.h> + +#define ARIZONA_CLK_SYSCLK 1 +#define ARIZONA_CLK_ASYNCCLK 2 + +#define ARIZONA_CLK_SRC_MCLK1 0x0 +#define ARIZONA_CLK_SRC_MCLK2 0x1 +#define ARIZONA_CLK_SRC_FLL1 0x4 +#define ARIZONA_CLK_SRC_FLL2 0x5 +#define ARIZONA_CLK_SRC_AIF1BCLK 0x8 +#define ARIZONA_CLK_SRC_AIF2BCLK 0x9 +#define ARIZONA_CLK_SRC_AIF3BCLK 0xa + +#define ARIZONA_FLL_SRC_MCLK1 0 +#define ARIZONA_FLL_SRC_MCLK2 1 +#define ARIZONA_FLL_SRC_SLIMCLK 2 +#define ARIZONA_FLL_SRC_FLL1 3 +#define ARIZONA_FLL_SRC_FLL2 4 +#define ARIZONA_FLL_SRC_AIF1BCLK 5 +#define ARIZONA_FLL_SRC_AIF2BCLK 6 +#define ARIZONA_FLL_SRC_AIF3BCLK 7 +#define ARIZONA_FLL_SRC_AIF1LRCLK 8 +#define ARIZONA_FLL_SRC_AIF2LRCLK 9 +#define ARIZONA_FLL_SRC_AIF3LRCLK 10 + +#define ARIZONA_MIXER_VOL_MASK 0x00FE +#define ARIZONA_MIXER_VOL_SHIFT 1 +#define ARIZONA_MIXER_VOL_WIDTH 7 + +#define ARIZONA_MAX_DAI 3 + +struct arizona; + +struct arizona_dai_priv { + int clk; +}; + +struct arizona_priv { + struct arizona *arizona; + int sysclk; + int asyncclk; + struct arizona_dai_priv dai[ARIZONA_MAX_DAI]; +}; + +#define ARIZONA_NUM_MIXER_INPUTS 57 + +extern const unsigned int arizona_mixer_tlv[]; +extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS]; +extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS]; + +#define ARIZONA_MIXER_CONTROLS(name, base) \ + SOC_SINGLE_RANGE_TLV(name " Input 1 Volume", base + 1, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv), \ + SOC_SINGLE_RANGE_TLV(name " Input 2 Volume", base + 3, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv), \ + SOC_SINGLE_RANGE_TLV(name " Input 3 Volume", base + 5, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv), \ + SOC_SINGLE_RANGE_TLV(name " Input 4 Volume", base + 7, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv) + +#define ARIZONA_MUX_ENUM_DECL(name, reg) \ + SOC_VALUE_ENUM_SINGLE_DECL(name, reg, 0, 0xff, \ + arizona_mixer_texts, arizona_mixer_values) + +#define ARIZONA_MUX_CTL_DECL(name) \ + const struct snd_kcontrol_new name##_mux = \ + SOC_DAPM_VALUE_ENUM("Route", name##_enum) + +#define ARIZONA_MIXER_ENUMS(name, base_reg) \ + static ARIZONA_MUX_ENUM_DECL(name##_in1_enum, base_reg); \ + static ARIZONA_MUX_ENUM_DECL(name##_in2_enum, base_reg + 2); \ + static ARIZONA_MUX_ENUM_DECL(name##_in3_enum, base_reg + 4); \ + static ARIZONA_MUX_ENUM_DECL(name##_in4_enum, base_reg + 6); \ + static ARIZONA_MUX_CTL_DECL(name##_in1); \ + static ARIZONA_MUX_CTL_DECL(name##_in2); \ + static ARIZONA_MUX_CTL_DECL(name##_in3); \ + static ARIZONA_MUX_CTL_DECL(name##_in4) + +#define ARIZONA_MUX(name, ctrl) \ + SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl) + +#define ARIZONA_MIXER_WIDGETS(name, name_str) \ + ARIZONA_MUX(name_str " Input 1", &name##_in1_mux), \ + ARIZONA_MUX(name_str " Input 2", &name##_in2_mux), \ + ARIZONA_MUX(name_str " Input 3", &name##_in3_mux), \ + ARIZONA_MUX(name_str " Input 4", &name##_in4_mux), \ + SND_SOC_DAPM_MIXER(name_str " Mixer", SND_SOC_NOPM, 0, 0, NULL, 0) + +#define ARIZONA_MIXER_ROUTES(widget, name) \ + { widget, NULL, name " Mixer" }, \ + { name " Mixer", NULL, name " Input 1" }, \ + { name " Mixer", NULL, name " Input 2" }, \ + { name " Mixer", NULL, name " Input 3" }, \ + { name " Mixer", NULL, name " Input 4" }, \ + ARIZONA_MIXER_INPUT_ROUTES(name " Input 1"), \ + ARIZONA_MIXER_INPUT_ROUTES(name " Input 2"), \ + ARIZONA_MIXER_INPUT_ROUTES(name " Input 3"), \ + ARIZONA_MIXER_INPUT_ROUTES(name " Input 4") + +extern const struct soc_enum arizona_lhpf1_mode; +extern const struct soc_enum arizona_lhpf2_mode; +extern const struct soc_enum arizona_lhpf3_mode; +extern const struct soc_enum arizona_lhpf4_mode; + +extern int arizona_in_ev(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, + int event); +extern int arizona_out_ev(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, + int event); + +extern int arizona_set_sysclk(struct snd_soc_codec *codec, int clk_id, + int source, unsigned int freq, int dir); + +extern const struct snd_soc_dai_ops arizona_dai_ops; + +#define ARIZONA_FLL_NAME_LEN 20 + +struct arizona_fll { + struct arizona *arizona; + int id; + unsigned int base; + unsigned int vco_mult; + struct completion lock; + struct completion ok; + + char lock_name[ARIZONA_FLL_NAME_LEN]; + char clock_ok_name[ARIZONA_FLL_NAME_LEN]; +}; + +extern int arizona_init_fll(struct arizona *arizona, int id, int base, + int lock_irq, int ok_irq, struct arizona_fll *fll); +extern int arizona_set_fll(struct arizona_fll *fll, int source, + unsigned int Fref, unsigned int Fout); + +extern int arizona_init_dai(struct arizona_priv *priv, int dai); + +#endif |