ASoC: wm8998: Initial WM8998 codec driver

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Richard Fitzgerald 2015-09-28 14:01:09 +01:00 committed by Mark Brown
parent 50e6168f27
commit 6ebbce0a6e
6 changed files with 1500 additions and 1 deletions

View file

@ -171,6 +171,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_WM8995 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8995 if SND_SOC_I2C_AND_SPI
select SND_SOC_WM8996 if I2C select SND_SOC_WM8996 if I2C
select SND_SOC_WM8997 if MFD_WM8997 select SND_SOC_WM8997 if MFD_WM8997
select SND_SOC_WM8998 if MFD_WM8998
select SND_SOC_WM9081 if I2C select SND_SOC_WM9081 if I2C
select SND_SOC_WM9090 if I2C select SND_SOC_WM9090 if I2C
select SND_SOC_WM9705 if SND_SOC_AC97_BUS select SND_SOC_WM9705 if SND_SOC_AC97_BUS
@ -195,9 +196,11 @@ config SND_SOC_ARIZONA
default y if SND_SOC_WM5102=y default y if SND_SOC_WM5102=y
default y if SND_SOC_WM5110=y default y if SND_SOC_WM5110=y
default y if SND_SOC_WM8997=y default y if SND_SOC_WM8997=y
default y if SND_SOC_WM8998=y
default m if SND_SOC_WM5102=m default m if SND_SOC_WM5102=m
default m if SND_SOC_WM5110=m default m if SND_SOC_WM5110=m
default m if SND_SOC_WM8997=m default m if SND_SOC_WM8997=m
default m if SND_SOC_WM8998=m
config SND_SOC_WM_HUBS config SND_SOC_WM_HUBS
tristate tristate
@ -865,6 +868,9 @@ config SND_SOC_WM8996
config SND_SOC_WM8997 config SND_SOC_WM8997
tristate tristate
config SND_SOC_WM8998
tristate
config SND_SOC_WM9081 config SND_SOC_WM9081
tristate tristate

View file

@ -176,6 +176,7 @@ snd-soc-wm8993-objs := wm8993.o
snd-soc-wm8994-objs := wm8994.o wm8958-dsp2.o snd-soc-wm8994-objs := wm8994.o wm8958-dsp2.o
snd-soc-wm8995-objs := wm8995.o snd-soc-wm8995-objs := wm8995.o
snd-soc-wm8997-objs := wm8997.o snd-soc-wm8997-objs := wm8997.o
snd-soc-wm8998-objs := wm8998.o
snd-soc-wm9081-objs := wm9081.o snd-soc-wm9081-objs := wm9081.o
snd-soc-wm9090-objs := wm9090.o snd-soc-wm9090-objs := wm9090.o
snd-soc-wm9705-objs := wm9705.o snd-soc-wm9705-objs := wm9705.o
@ -364,6 +365,7 @@ obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o
obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o
obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o
obj-$(CONFIG_SND_SOC_WM8997) += snd-soc-wm8997.o obj-$(CONFIG_SND_SOC_WM8997) += snd-soc-wm8997.o
obj-$(CONFIG_SND_SOC_WM8998) += snd-soc-wm8998.o
obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o
obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o
obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o

View file

@ -316,6 +316,7 @@ const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
"Tone Generator 2", "Tone Generator 2",
"Haptics", "Haptics",
"AEC", "AEC",
"AEC2",
"Mic Mute Mixer", "Mic Mute Mixer",
"Noise Generator", "Noise Generator",
"IN1L", "IN1L",
@ -423,6 +424,7 @@ int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS] = {
0x05, 0x05,
0x06, /* Haptics */ 0x06, /* Haptics */
0x08, /* AEC */ 0x08, /* AEC */
0x09, /* AEC2 */
0x0c, /* Noise mixer */ 0x0c, /* Noise mixer */
0x0d, /* Comfort noise */ 0x0d, /* Comfort noise */
0x10, /* IN1L */ 0x10, /* IN1L */
@ -527,6 +529,32 @@ EXPORT_SYMBOL_GPL(arizona_mixer_values);
const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0); const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0);
EXPORT_SYMBOL_GPL(arizona_mixer_tlv); EXPORT_SYMBOL_GPL(arizona_mixer_tlv);
const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
"12kHz", "24kHz", "48kHz", "96kHz", "192kHz",
"11.025kHz", "22.05kHz", "44.1kHz", "88.2kHz", "176.4kHz",
"4kHz", "8kHz", "16kHz", "32kHz",
};
EXPORT_SYMBOL_GPL(arizona_sample_rate_text);
const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
0x10, 0x11, 0x12, 0x13,
};
EXPORT_SYMBOL_GPL(arizona_sample_rate_val);
const char *arizona_sample_rate_val_to_name(unsigned int rate_val)
{
int i;
for (i = 0; i < ARRAY_SIZE(arizona_sample_rate_val); ++i) {
if (arizona_sample_rate_val[i] == rate_val)
return arizona_sample_rate_text[i];
}
return "Illegal";
}
EXPORT_SYMBOL_GPL(arizona_sample_rate_val_to_name);
const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = { const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = {
"SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate", "SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate",
}; };
@ -1884,6 +1912,11 @@ static int arizona_calc_fratio(struct arizona_fll *fll,
if (fll->arizona->rev < 3 || sync) if (fll->arizona->rev < 3 || sync)
return init_ratio; return init_ratio;
break; break;
case WM8998:
case WM1814:
if (sync)
return init_ratio;
break;
default: default:
return init_ratio; return init_ratio;
} }

View file

@ -93,7 +93,7 @@ struct arizona_priv {
bool dvfs_cached; bool dvfs_cached;
}; };
#define ARIZONA_NUM_MIXER_INPUTS 103 #define ARIZONA_NUM_MIXER_INPUTS 104
extern const unsigned int arizona_mixer_tlv[]; extern const unsigned int arizona_mixer_tlv[];
extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS]; extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS];
@ -214,8 +214,12 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
.num_regs = 1 }) } .num_regs = 1 }) }
#define ARIZONA_RATE_ENUM_SIZE 4 #define ARIZONA_RATE_ENUM_SIZE 4
#define ARIZONA_SAMPLE_RATE_ENUM_SIZE 14
extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE]; extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE];
extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE]; extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE];
extern const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE];
extern const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE];
extern const struct soc_enum arizona_isrc_fsl[]; extern const struct soc_enum arizona_isrc_fsl[];
extern const struct soc_enum arizona_isrc_fsh[]; extern const struct soc_enum arizona_isrc_fsh[];
@ -301,4 +305,5 @@ int arizona_set_output_mode(struct snd_soc_codec *codec, int output,
extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift); extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);
extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val);
#endif #endif

1430
sound/soc/codecs/wm8998.c Normal file

File diff suppressed because it is too large Load diff

23
sound/soc/codecs/wm8998.h Normal file
View file

@ -0,0 +1,23 @@
/*
* wm8998.h -- ALSA SoC Audio driver for WM8998 codecs
*
* Copyright 2015 Cirrus Logic, Inc.
*
* Author: Richard Fitzgerald <rf@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 _WM8998_H
#define _WM8998_H
#include "arizona.h"
#define WM8998_FLL1 1
#define WM8998_FLL2 2
#define WM8998_FLL1_REFCLK 3
#define WM8998_FLL2_REFCLK 4
#endif