Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/suspend', 'asoc/topic/tas2…
Browse files Browse the repository at this point in the history
…552', 'asoc/topic/tegra', 'asoc/topic/tlv320aic31xx' and 'asoc/topic/tlv320aic3x' into asoc-next
  • Loading branch information
Mark Brown committed Oct 6, 2014
6 parents 248519c + 83a7fc9 + be1aa3e + 9766a1c + 9cfb769 + 31d9f8f commit 978d4dd
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Required properties:

Optional properties:
- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
- nvidia,mic-det-gpios : The GPIO that detect microphones are plugged in

Example:

Expand Down
3 changes: 0 additions & 3 deletions sound/soc/codecs/88pm860x-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,6 @@ static int pm860x_probe(struct snd_soc_codec *codec)
}
}

pm860x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;

out:
Expand All @@ -1354,7 +1352,6 @@ static int pm860x_remove(struct snd_soc_codec *codec)

for (i = 3; i >= 0; i--)
free_irq(pm860x->irq[i], pm860x);
pm860x_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

Expand Down
20 changes: 1 addition & 19 deletions sound/soc/codecs/cs42l52.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,20 +946,6 @@ static struct snd_soc_dai_driver cs42l52_dai = {
.ops = &cs42l52_ops,
};

static int cs42l52_suspend(struct snd_soc_codec *codec)
{
cs42l52_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int cs42l52_resume(struct snd_soc_codec *codec)
{
cs42l52_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int beep_rates[] = {
261, 522, 585, 667, 706, 774, 889, 1000,
1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182
Expand Down Expand Up @@ -1104,8 +1090,6 @@ static int cs42l52_probe(struct snd_soc_codec *codec)

cs42l52_init_beep(codec);

cs42l52_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

cs42l52->sysclk = CS42L52_DEFAULT_CLK;
cs42l52->config.format = CS42L52_DEFAULT_FORMAT;

Expand All @@ -1115,17 +1099,15 @@ static int cs42l52_probe(struct snd_soc_codec *codec)
static int cs42l52_remove(struct snd_soc_codec *codec)
{
cs42l52_free_beep(codec);
cs42l52_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_cs42l52 = {
.probe = cs42l52_probe,
.remove = cs42l52_remove,
.suspend = cs42l52_suspend,
.resume = cs42l52_resume,
.set_bias_level = cs42l52_set_bias_level,
.suspend_bias_off = true,

.dapm_widgets = cs42l52_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(cs42l52_dapm_widgets),
Expand Down
20 changes: 1 addition & 19 deletions sound/soc/codecs/cs42l56.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,20 +1016,6 @@ static struct snd_soc_dai_driver cs42l56_dai = {
.ops = &cs42l56_ops,
};

static int cs42l56_suspend(struct snd_soc_codec *codec)
{
cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int cs42l56_resume(struct snd_soc_codec *codec)
{
cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int beep_freq[] = {
261, 522, 585, 667, 706, 774, 889, 1000,
1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182
Expand Down Expand Up @@ -1168,25 +1154,21 @@ static int cs42l56_probe(struct snd_soc_codec *codec)
{
cs42l56_init_beep(codec);

cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int cs42l56_remove(struct snd_soc_codec *codec)
{
cs42l56_free_beep(codec);
cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_cs42l56 = {
.probe = cs42l56_probe,
.remove = cs42l56_remove,
.suspend = cs42l56_suspend,
.resume = cs42l56_resume,
.set_bias_level = cs42l56_set_bias_level,
.suspend_bias_off = true,

.dapm_widgets = cs42l56_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(cs42l56_dapm_widgets),
Expand Down
25 changes: 1 addition & 24 deletions sound/soc/codecs/cs42l73.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,25 +1330,10 @@ static struct snd_soc_dai_driver cs42l73_dai[] = {
}
};

static int cs42l73_suspend(struct snd_soc_codec *codec)
{
cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int cs42l73_resume(struct snd_soc_codec *codec)
{
cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}

static int cs42l73_probe(struct snd_soc_codec *codec)
{
struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec);

cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

/* Set Charge Pump Frequency */
if (cs42l73->pdata.chgfreq)
snd_soc_update_bits(codec, CS42L73_CPFCHC,
Expand All @@ -1362,18 +1347,10 @@ static int cs42l73_probe(struct snd_soc_codec *codec)
return 0;
}

static int cs42l73_remove(struct snd_soc_codec *codec)
{
cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_cs42l73 = {
.probe = cs42l73_probe,
.remove = cs42l73_remove,
.suspend = cs42l73_suspend,
.resume = cs42l73_resume,
.set_bias_level = cs42l73_set_bias_level,
.suspend_bias_off = true,

.dapm_widgets = cs42l73_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(cs42l73_dapm_widgets),
Expand Down
25 changes: 0 additions & 25 deletions sound/soc/codecs/da732x.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

struct da732x_priv {
struct regmap *regmap;
struct snd_soc_codec *codec;

unsigned int sysclk;
bool pll_en;
Expand Down Expand Up @@ -1508,31 +1507,7 @@ static int da732x_set_bias_level(struct snd_soc_codec *codec,
return 0;
}

static int da732x_probe(struct snd_soc_codec *codec)
{
struct da732x_priv *da732x = snd_soc_codec_get_drvdata(codec);
struct snd_soc_dapm_context *dapm = &codec->dapm;

da732x->codec = codec;

dapm->idle_bias_off = false;

da732x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int da732x_remove(struct snd_soc_codec *codec)
{

da732x_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_da732x = {
.probe = da732x_probe,
.remove = da732x_remove,
.set_bias_level = da732x_set_bias_level,
.controls = da732x_snd_controls,
.num_controls = ARRAY_SIZE(da732x_snd_controls),
Expand Down
30 changes: 1 addition & 29 deletions sound/soc/codecs/jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,41 +293,13 @@ static int jz4740_codec_dev_probe(struct snd_soc_codec *codec)
regmap_update_bits(jz4740_codec->regmap, JZ4740_REG_CODEC_1,
JZ4740_CODEC_1_SW2_ENABLE, JZ4740_CODEC_1_SW2_ENABLE);

jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static int jz4740_codec_dev_remove(struct snd_soc_codec *codec)
{
jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

#ifdef CONFIG_PM_SLEEP

static int jz4740_codec_suspend(struct snd_soc_codec *codec)
{
return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF);
}

static int jz4740_codec_resume(struct snd_soc_codec *codec)
{
return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
}

#else
#define jz4740_codec_suspend NULL
#define jz4740_codec_resume NULL
#endif

static struct snd_soc_codec_driver soc_codec_dev_jz4740_codec = {
.probe = jz4740_codec_dev_probe,
.remove = jz4740_codec_dev_remove,
.suspend = jz4740_codec_suspend,
.resume = jz4740_codec_resume,
.set_bias_level = jz4740_codec_set_bias_level,
.suspend_bias_off = true,

.controls = jz4740_codec_controls,
.num_controls = ARRAY_SIZE(jz4740_codec_controls),
Expand Down
24 changes: 1 addition & 23 deletions sound/soc/codecs/ml26124.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,41 +565,19 @@ static struct snd_soc_dai_driver ml26124_dai = {
.symmetric_rates = 1,
};

#ifdef CONFIG_PM
static int ml26124_suspend(struct snd_soc_codec *codec)
{
ml26124_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int ml26124_resume(struct snd_soc_codec *codec)
{
ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}
#else
#define ml26124_suspend NULL
#define ml26124_resume NULL
#endif

static int ml26124_probe(struct snd_soc_codec *codec)
{
/* Software Reset */
snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1);
snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0);

ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_ml26124 = {
.probe = ml26124_probe,
.suspend = ml26124_suspend,
.resume = ml26124_resume,
.set_bias_level = ml26124_set_bias_level,
.suspend_bias_off = true,
.dapm_widgets = ml26124_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(ml26124_dapm_widgets),
.dapm_routes = ml26124_intercon,
Expand Down
30 changes: 1 addition & 29 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,26 +1076,6 @@ static bool sgtl5000_readable(struct device *dev, unsigned int reg)
}
}

#ifdef CONFIG_SUSPEND
static int sgtl5000_suspend(struct snd_soc_codec *codec)
{
sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF);

return 0;
}

static int sgtl5000_resume(struct snd_soc_codec *codec)
{
/* Bring the codec back up to standby to enable regulators */
sgtl5000_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

return 0;
}
#else
#define sgtl5000_suspend NULL
#define sgtl5000_resume NULL
#endif /* CONFIG_SUSPEND */

/*
* sgtl5000 has 3 internal power supplies:
* 1. VAG, normally set to vdda/2
Expand Down Expand Up @@ -1355,11 +1335,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
*/
snd_soc_write(codec, SGTL5000_DAP_CTRL, 0);

/* leading to standby state */
ret = sgtl5000_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
if (ret)
goto err;

return 0;

err:
Expand All @@ -1376,8 +1351,6 @@ static int sgtl5000_remove(struct snd_soc_codec *codec)
{
struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);

sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF);

regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
sgtl5000->supplies);
regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
Expand All @@ -1390,9 +1363,8 @@ static int sgtl5000_remove(struct snd_soc_codec *codec)
static struct snd_soc_codec_driver sgtl5000_driver = {
.probe = sgtl5000_probe,
.remove = sgtl5000_remove,
.suspend = sgtl5000_suspend,
.resume = sgtl5000_resume,
.set_bias_level = sgtl5000_set_bias_level,
.suspend_bias_off = true,
.controls = sgtl5000_snd_controls,
.num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
.dapm_widgets = sgtl5000_dapm_widgets,
Expand Down
Loading

0 comments on commit 978d4dd

Please sign in to comment.