summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRavindra Lokhande <rlokhande@nvidia.com>2011-07-25 20:49:10 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-07-25 18:47:57 -0700
commit4392e8a699c52b7a1a8120a8f05bbd649cbd57f8 (patch)
treec444bb7e022f1841417d3c65c23aa83c6b3958db /sound
parenta36baae3aa112e166584484dec9d6520e5e5cee6 (diff)
tegra: alsa: fix headset detection after bootup
if headset is connected during bootup then it was not detected, need to call handler function first time inorder to get status of jack detection during bootup. Change-Id: I39537ac071413717c34e0b13c8527a040c82521e Reviewed-on: http://git-master/r/43063 Tested-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Tested-by: Gerrit_Virtual_Submit
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/max98088.c23
-rw-r--r--sound/soc/tegra/tegra_soc_max98088.c2
2 files changed, 14 insertions, 11 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index f397035f4728..ccde1ec3ce88 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -63,6 +63,7 @@ struct max98088_priv {
unsigned int mic1pre;
unsigned int mic2pre;
unsigned int extmic_mode;
+ int irq;
struct snd_soc_jack *headset_jack;
};
@@ -2063,15 +2064,6 @@ static int max98088_resume(struct platform_device *pdev)
#define max98088_resume NULL
#endif
-int max98088_headset_detect(struct snd_soc_codec *codec,
- struct snd_soc_jack *jack)
-{
- struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
- max98088->headset_jack = jack;
- return 0;
-}
-EXPORT_SYMBOL_GPL(max98088_headset_detect);
-
static int max98088_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
@@ -2233,6 +2225,18 @@ static irqreturn_t max98088_jack_handler(int irq, void *data)
return IRQ_HANDLED;
}
+int max98088_headset_detect(struct snd_soc_codec *codec,
+ struct snd_soc_jack *jack)
+{
+ struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
+ max98088->headset_jack = jack;
+
+ max98088_jack_handler(max98088->irq, codec);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(max98088_headset_detect);
+
static int max98088_remove(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
@@ -2302,6 +2306,7 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
codec->reg_cache = &max98088->reg_cache;
codec->volatile_register = max98088_volatile_register;
+ max98088->irq = i2c->irq;
if (i2c->irq) {
/* audio interrupt */
ret = request_threaded_irq(i2c->irq, NULL,
diff --git a/sound/soc/tegra/tegra_soc_max98088.c b/sound/soc/tegra/tegra_soc_max98088.c
index 5b15760fa7a5..c6d3a758cee3 100644
--- a/sound/soc/tegra/tegra_soc_max98088.c
+++ b/sound/soc/tegra/tegra_soc_max98088.c
@@ -303,8 +303,6 @@ void tegra_ext_control(struct snd_soc_codec *codec, int new_con)
audio_data->codec_con = new_con;
- snd_soc_dapm_enable_pin(codec, "Headphone");
-
/* signal a DAPM event */
snd_soc_dapm_sync(codec);