提交 cae59c7b 编写于 作者: M Mark Brown

ASoC: Remove WM8994 register cache

Now that the mfd is using the register map cache there's no need for the
CODEC driver to do any register cache management or any funny dances to
interact with the other drivers using the device so just remove the cache
initialisation and volatility information.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 d9a7666f
...@@ -87,7 +87,7 @@ snd-soc-wm8988-objs := wm8988.o ...@@ -87,7 +87,7 @@ snd-soc-wm8988-objs := wm8988.o
snd-soc-wm8990-objs := wm8990.o snd-soc-wm8990-objs := wm8990.o
snd-soc-wm8991-objs := wm8991.o snd-soc-wm8991-objs := wm8991.o
snd-soc-wm8993-objs := wm8993.o snd-soc-wm8993-objs := wm8993.o
snd-soc-wm8994-objs := wm8994.o wm8994-tables.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-wm9081-objs := wm9081.o snd-soc-wm9081-objs := wm9081.o
snd-soc-wm9090-objs := wm9090.o snd-soc-wm9090-objs := wm9090.o
......
此差异已折叠。
...@@ -123,67 +123,6 @@ static void wm8958_micd_set_rate(struct snd_soc_codec *codec) ...@@ -123,67 +123,6 @@ static void wm8958_micd_set_rate(struct snd_soc_codec *codec)
WM8958_MICD_RATE_MASK, val); WM8958_MICD_RATE_MASK, val);
} }
static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg)
{
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
switch (reg) {
case WM8994_GPIO_1:
case WM8994_GPIO_2:
case WM8994_GPIO_3:
case WM8994_GPIO_4:
case WM8994_GPIO_5:
case WM8994_GPIO_6:
case WM8994_GPIO_7:
case WM8994_GPIO_8:
case WM8994_GPIO_9:
case WM8994_GPIO_10:
case WM8994_GPIO_11:
case WM8994_INTERRUPT_STATUS_1:
case WM8994_INTERRUPT_STATUS_2:
case WM8994_INTERRUPT_RAW_STATUS_2:
return 1;
case WM8958_DSP2_PROGRAM:
case WM8958_DSP2_CONFIG:
case WM8958_DSP2_EXECCONTROL:
if (control->type == WM8958)
return 1;
else
return 0;
default:
break;
}
if (reg >= WM8994_CACHE_SIZE)
return 0;
return wm8994_access_masks[reg].readable != 0;
}
static int wm8994_volatile(struct snd_soc_codec *codec, unsigned int reg)
{
if (reg >= WM8994_CACHE_SIZE)
return 1;
switch (reg) {
case WM8994_SOFTWARE_RESET:
case WM8994_CHIP_REVISION:
case WM8994_DC_SERVO_1:
case WM8994_DC_SERVO_READBACK:
case WM8994_RATE_STATUS:
case WM8994_LDO_1:
case WM8994_LDO_2:
case WM8958_DSP2_EXECCONTROL:
case WM8958_MIC_DETECT_3:
case WM8994_DC_SERVO_4E:
return 1;
default:
return 0;
}
}
static int configure_aif_clock(struct snd_soc_codec *codec, int aif) static int configure_aif_clock(struct snd_soc_codec *codec, int aif)
{ {
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
...@@ -3451,25 +3390,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) ...@@ -3451,25 +3390,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
pm_runtime_enable(codec->dev); pm_runtime_enable(codec->dev);
pm_runtime_resume(codec->dev); pm_runtime_resume(codec->dev);
/* Read our current status back from the chip - we don't want to
* reset as this may interfere with the GPIO or LDO operation. */
for (i = 0; i < WM8994_CACHE_SIZE; i++) {
if (!wm8994_readable(codec, i) || wm8994_volatile(codec, i))
continue;
ret = regmap_read(control->regmap, i, &reg);
if (ret <= 0)
continue;
ret = snd_soc_cache_write(codec, i, reg);
if (ret != 0) {
dev_err(codec->dev,
"Failed to initialise cache for 0x%x: %d\n",
i, ret);
goto err;
}
}
/* Set revision-specific configuration */ /* Set revision-specific configuration */
wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION);
switch (control->type) { switch (control->type) {
...@@ -3900,14 +3820,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { ...@@ -3900,14 +3820,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = {
.remove = wm8994_codec_remove, .remove = wm8994_codec_remove,
.suspend = wm8994_suspend, .suspend = wm8994_suspend,
.resume = wm8994_resume, .resume = wm8994_resume,
.readable_register = wm8994_readable,
.volatile_register = wm8994_volatile,
.set_bias_level = wm8994_set_bias_level, .set_bias_level = wm8994_set_bias_level,
.reg_cache_size = WM8994_CACHE_SIZE,
.reg_cache_default = wm8994_reg_defaults,
.reg_word_size = 2,
.compress_type = SND_SOC_RBTREE_COMPRESSION,
}; };
static int __devinit wm8994_probe(struct platform_device *pdev) static int __devinit wm8994_probe(struct platform_device *pdev)
......
...@@ -39,16 +39,6 @@ int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, ...@@ -39,16 +39,6 @@ int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
wm8958_micdet_cb cb, void *cb_data); wm8958_micdet_cb cb, void *cb_data);
#define WM8994_CACHE_SIZE 1570
struct wm8994_access_mask {
unsigned short readable; /* Mask of readable bits */
unsigned short writable; /* Mask of writable bits */
};
extern const struct wm8994_access_mask wm8994_access_masks[WM8994_CACHE_SIZE];
extern const u16 wm8994_reg_defaults[WM8994_CACHE_SIZE];
int wm8958_aif_ev(struct snd_soc_dapm_widget *w, int wm8958_aif_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event); struct snd_kcontrol *kcontrol, int event);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册