Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/wm8711', 'asoc/topic/wm872…
Browse files Browse the repository at this point in the history
…8', 'asoc/topic/wm8731', 'asoc/topic/wm8737' and 'asoc/topic/wm8750' into asoc-next
  • Loading branch information
Mark Brown committed Dec 8, 2014
6 parents 4ddc81c + 0bd324b + d4d4143 + 2081b2c + 67cac3a + d12cbf9 commit d7e05f9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 147 deletions.
27 changes: 2 additions & 25 deletions sound/soc/codecs/wm8711.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,6 @@ static struct snd_soc_dai_driver wm8711_dai = {
.ops = &wm8711_ops,
};

static int wm8711_suspend(struct snd_soc_codec *codec)
{
snd_soc_write(codec, WM8711_ACTIVE, 0x0);
wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static int wm8711_resume(struct snd_soc_codec *codec)
{
wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}

static int wm8711_probe(struct snd_soc_codec *codec)
{
int ret;
Expand All @@ -373,8 +360,6 @@ static int wm8711_probe(struct snd_soc_codec *codec)
return ret;
}

wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

/* Latch the update bits */
snd_soc_update_bits(codec, WM8711_LOUT1V, 0x0100, 0x0100);
snd_soc_update_bits(codec, WM8711_ROUT1V, 0x0100, 0x0100);
Expand All @@ -383,19 +368,11 @@ static int wm8711_probe(struct snd_soc_codec *codec)

}

/* power down chip */
static int wm8711_remove(struct snd_soc_codec *codec)
{
wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_wm8711 = {
.probe = wm8711_probe,
.remove = wm8711_remove,
.suspend = wm8711_suspend,
.resume = wm8711_resume,
.set_bias_level = wm8711_set_bias_level,
.suspend_bias_off = true,

.controls = wm8711_snd_controls,
.num_controls = ARRAY_SIZE(wm8711_snd_controls),
.dapm_widgets = wm8711_dapm_widgets,
Expand Down
34 changes: 2 additions & 32 deletions sound/soc/codecs/wm8728.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,40 +212,10 @@ static struct snd_soc_dai_driver wm8728_dai = {
.ops = &wm8728_dai_ops,
};

static int wm8728_suspend(struct snd_soc_codec *codec)
{
wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int wm8728_resume(struct snd_soc_codec *codec)
{
wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int wm8728_probe(struct snd_soc_codec *codec)
{
/* power on device */
wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int wm8728_remove(struct snd_soc_codec *codec)
{
wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
.probe = wm8728_probe,
.remove = wm8728_remove,
.suspend = wm8728_suspend,
.resume = wm8728_resume,
.set_bias_level = wm8728_set_bias_level,
.suspend_bias_off = true,

.controls = wm8728_snd_controls,
.num_controls = ARRAY_SIZE(wm8728_snd_controls),
.dapm_widgets = wm8728_dapm_widgets,
Expand Down
28 changes: 3 additions & 25 deletions sound/soc/codecs/wm8731.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,25 +562,6 @@ static struct snd_soc_dai_driver wm8731_dai = {
.symmetric_rates = 1,
};

#ifdef CONFIG_PM
static int wm8731_suspend(struct snd_soc_codec *codec)
{
wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int wm8731_resume(struct snd_soc_codec *codec)
{
wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}
#else
#define wm8731_suspend NULL
#define wm8731_resume NULL
#endif

static int wm8731_probe(struct snd_soc_codec *codec)
{
struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
Expand Down Expand Up @@ -636,8 +617,6 @@ static int wm8731_remove(struct snd_soc_codec *codec)
{
struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);

wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF);

regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);

return 0;
Expand All @@ -646,9 +625,9 @@ static int wm8731_remove(struct snd_soc_codec *codec)
static struct snd_soc_codec_driver soc_codec_dev_wm8731 = {
.probe = wm8731_probe,
.remove = wm8731_remove,
.suspend = wm8731_suspend,
.resume = wm8731_resume,
.set_bias_level = wm8731_set_bias_level,
.suspend_bias_off = true,

.dapm_widgets = wm8731_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
.dapm_routes = wm8731_intercon,
Expand Down Expand Up @@ -683,8 +662,7 @@ static int wm8731_spi_probe(struct spi_device *spi)
struct wm8731_priv *wm8731;
int ret;

wm8731 = devm_kzalloc(&spi->dev, sizeof(struct wm8731_priv),
GFP_KERNEL);
wm8731 = devm_kzalloc(&spi->dev, sizeof(*wm8731), GFP_KERNEL);
if (wm8731 == NULL)
return -ENOMEM;

Expand Down
49 changes: 8 additions & 41 deletions sound/soc/codecs/wm8737.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,6 @@ static const struct snd_soc_dapm_route intercon[] = {
{ "AIF", NULL, "ADCR" },
};

static int wm8737_add_widgets(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;

snd_soc_dapm_new_controls(dapm, wm8737_dapm_widgets,
ARRAY_SIZE(wm8737_dapm_widgets));
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));

return 0;
}

/* codec mclk clock divider coefficients */
static const struct {
u32 mclk;
Expand Down Expand Up @@ -548,23 +537,6 @@ static struct snd_soc_dai_driver wm8737_dai = {
.ops = &wm8737_dai_ops,
};

#ifdef CONFIG_PM
static int wm8737_suspend(struct snd_soc_codec *codec)
{
wm8737_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static int wm8737_resume(struct snd_soc_codec *codec)
{
wm8737_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}
#else
#define wm8737_suspend NULL
#define wm8737_resume NULL
#endif

static int wm8737_probe(struct snd_soc_codec *codec)
{
struct wm8737_priv *wm8737 = snd_soc_codec_get_drvdata(codec);
Expand Down Expand Up @@ -593,10 +565,6 @@ static int wm8737_probe(struct snd_soc_codec *codec)
/* Bias level configuration will have done an extra enable */
regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);

snd_soc_add_codec_controls(codec, wm8737_snd_controls,
ARRAY_SIZE(wm8737_snd_controls));
wm8737_add_widgets(codec);

return 0;

err_enable:
Expand All @@ -605,18 +573,17 @@ static int wm8737_probe(struct snd_soc_codec *codec)
return ret;
}

static int wm8737_remove(struct snd_soc_codec *codec)
{
wm8737_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_wm8737 = {
.probe = wm8737_probe,
.remove = wm8737_remove,
.suspend = wm8737_suspend,
.resume = wm8737_resume,
.set_bias_level = wm8737_set_bias_level,
.suspend_bias_off = true,

.controls = wm8737_snd_controls,
.num_controls = ARRAY_SIZE(wm8737_snd_controls),
.dapm_widgets = wm8737_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8737_dapm_widgets),
.dapm_routes = intercon,
.num_dapm_routes = ARRAY_SIZE(intercon),
};

static const struct of_device_id wm8737_of_match[] = {
Expand Down
25 changes: 1 addition & 24 deletions sound/soc/codecs/wm8750.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,18 +686,6 @@ static struct snd_soc_dai_driver wm8750_dai = {
.ops = &wm8750_dai_ops,
};

static int wm8750_suspend(struct snd_soc_codec *codec)
{
wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static int wm8750_resume(struct snd_soc_codec *codec)
{
wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}

static int wm8750_probe(struct snd_soc_codec *codec)
{
int ret;
Expand All @@ -708,9 +696,6 @@ static int wm8750_probe(struct snd_soc_codec *codec)
return ret;
}

/* charge output caps */
wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

/* set the update bits */
snd_soc_update_bits(codec, WM8750_LDAC, 0x0100, 0x0100);
snd_soc_update_bits(codec, WM8750_RDAC, 0x0100, 0x0100);
Expand All @@ -724,18 +709,10 @@ static int wm8750_probe(struct snd_soc_codec *codec)
return ret;
}

static int wm8750_remove(struct snd_soc_codec *codec)
{
wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_wm8750 = {
.probe = wm8750_probe,
.remove = wm8750_remove,
.suspend = wm8750_suspend,
.resume = wm8750_resume,
.set_bias_level = wm8750_set_bias_level,
.suspend_bias_off = true,

.controls = wm8750_snd_controls,
.num_controls = ARRAY_SIZE(wm8750_snd_controls),
Expand Down

0 comments on commit d7e05f9

Please sign in to comment.