Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342706
b: refs/heads/master
c: 5619d76
h: refs/heads/master
v: v3
  • Loading branch information
Ashish Chavan authored and Mark Brown committed Oct 17, 2012
1 parent 72149f5 commit ef76a52
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e82aaa751180e43326747483396bdf381e702de
refs/heads/master: 5619d76dcbf56d560e235d33123e2850dd810227
39 changes: 26 additions & 13 deletions trunk/sound/soc/codecs/da9055.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,17 @@ static const struct snd_kcontrol_new da9055_dapm_mixoutr_controls[] = {
6, 1, 0),
};

/* Headphone Output Enable */
static const struct snd_kcontrol_new da9055_dapm_hp_l_control =
SOC_DAPM_SINGLE("Switch", DA9055_HP_L_CTRL, 3, 1, 0);

static const struct snd_kcontrol_new da9055_dapm_hp_r_control =
SOC_DAPM_SINGLE("Switch", DA9055_HP_R_CTRL, 3, 1, 0);

/* Lineout Output Enable */
static const struct snd_kcontrol_new da9055_dapm_lineout_control =
SOC_DAPM_SINGLE("Switch", DA9055_LINE_CTRL, 3, 1, 0);

/* DAPM widgets */
static const struct snd_soc_dapm_widget da9055_dapm_widgets[] = {
/* Input Side */
Expand Down Expand Up @@ -797,6 +808,14 @@ static const struct snd_soc_dapm_widget da9055_dapm_widgets[] = {
&da9055_dapm_mixoutr_controls[0],
ARRAY_SIZE(da9055_dapm_mixoutr_controls)),

/* Output Enable Switches */
SND_SOC_DAPM_SWITCH("Headphone Left Enable", SND_SOC_NOPM, 0, 0,
&da9055_dapm_hp_l_control),
SND_SOC_DAPM_SWITCH("Headphone Right Enable", SND_SOC_NOPM, 0, 0,
&da9055_dapm_hp_r_control),
SND_SOC_DAPM_SWITCH("Lineout Enable", SND_SOC_NOPM, 0, 0,
&da9055_dapm_lineout_control),

/* Output PGAs */
SND_SOC_DAPM_PGA("MIXOUT Left", DA9055_MIXOUT_L_CTRL, 7, 0, NULL, 0),
SND_SOC_DAPM_PGA("MIXOUT Right", DA9055_MIXOUT_R_CTRL, 7, 0, NULL, 0),
Expand Down Expand Up @@ -882,17 +901,20 @@ static const struct snd_soc_dapm_route da9055_audio_map[] = {
{"Out Mixer Right", "DAC Right Switch", "DAC Right"},

{"MIXOUT Left", NULL, "Out Mixer Left"},
{"Headphone Left", NULL, "MIXOUT Left"},
{"Headphone Left Enable", "Switch", "MIXOUT Left"},
{"Headphone Left", NULL, "Headphone Left Enable"},
{"Headphone Left", NULL, "Charge Pump"},
{"HPL", NULL, "Headphone Left"},

{"MIXOUT Right", NULL, "Out Mixer Right"},
{"Headphone Right", NULL, "MIXOUT Right"},
{"Headphone Right Enable", "Switch", "MIXOUT Right"},
{"Headphone Right", NULL, "Headphone Right Enable"},
{"Headphone Right", NULL, "Charge Pump"},
{"HPR", NULL, "Headphone Right"},

{"MIXOUT Right", NULL, "Out Mixer Right"},
{"Lineout", NULL, "MIXOUT Right"},
{"Lineout Enable", "Switch", "MIXOUT Right"},
{"Lineout", NULL, "Lineout Enable"},
{"LINE", NULL, "Lineout"},
};

Expand Down Expand Up @@ -1374,8 +1396,7 @@ static int da9055_probe(struct snd_soc_codec *codec)
DA9055_GAIN_RAMPING_EN, DA9055_GAIN_RAMPING_EN);

/*
* There are two separate control bits for input and output mixers as
* well as headphone and line outs.
* There are two separate control bits for input and output mixers.
* One to enable corresponding amplifier and other to enable its
* output. As amplifier bits are related to power control, they are
* being managed by DAPM while other (non power related) bits are
Expand All @@ -1391,14 +1412,6 @@ static int da9055_probe(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, DA9055_MIXOUT_R_CTRL,
DA9055_MIXOUT_R_MIX_EN, DA9055_MIXOUT_R_MIX_EN);

snd_soc_update_bits(codec, DA9055_HP_L_CTRL,
DA9055_HP_L_AMP_OE, DA9055_HP_L_AMP_OE);
snd_soc_update_bits(codec, DA9055_HP_R_CTRL,
DA9055_HP_R_AMP_OE, DA9055_HP_R_AMP_OE);

snd_soc_update_bits(codec, DA9055_LINE_CTRL,
DA9055_LINE_AMP_OE, DA9055_LINE_AMP_OE);

/* Set this as per your system configuration */
snd_soc_write(codec, DA9055_PLL_CTRL, DA9055_PLL_INDIV_10_20_MHZ);

Expand Down

0 comments on commit ef76a52

Please sign in to comment.