Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193370
b: refs/heads/master
c: f06bce9
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Mar 22, 2010
1 parent 487fb7d commit c7cacd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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: 2f14430af52fff08ed1987a3cee612e133a6b82f
refs/heads/master: f06bce9c8c54354ea4ff96852bd92e10204c8cfb
24 changes: 18 additions & 6 deletions trunk/sound/soc/codecs/wm8350.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,8 @@ static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
* @jack: jack to report detection events on
* @report: value to report
*
* Enables the headphone jack detection of the WM8350.
* Enables the headphone jack detection of the WM8350. If no report
* is specified then detection is disabled.
*/
int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which,
struct snd_soc_jack *jack, int report)
Expand Down Expand Up @@ -1422,8 +1423,12 @@ int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which,
return -EINVAL;
}

wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA);
wm8350_set_bits(wm8350, WM8350_JACK_DETECT, ena);
if (report) {
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA);
wm8350_set_bits(wm8350, WM8350_JACK_DETECT, ena);
} else {
wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, ena);
}

/* Sync status */
wm8350_hp_jack_handler(irq + wm8350->irq_base, priv);
Expand Down Expand Up @@ -1459,7 +1464,8 @@ static irqreturn_t wm8350_mic_handler(int irq, void *data)
* @detect_report: value to report when presence detected
* @short_report: value to report when microphone short detected
*
* Enables the microphone jack detection of the WM8350.
* Enables the microphone jack detection of the WM8350. If both reports
* are specified as zero then detection is disabled.
*/
int wm8350_mic_jack_detect(struct snd_soc_codec *codec,
struct snd_soc_jack *jack,
Expand All @@ -1472,8 +1478,14 @@ int wm8350_mic_jack_detect(struct snd_soc_codec *codec,
priv->mic.report = detect_report;
priv->mic.short_report = short_report;

wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA);
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_1, WM8350_MIC_DET_ENA);
if (detect_report || short_report) {
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_TOCLK_ENA);
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_1,
WM8350_MIC_DET_ENA);
} else {
wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_1,
WM8350_MIC_DET_ENA);
}

return 0;
}
Expand Down

0 comments on commit c7cacd7

Please sign in to comment.