Commit d0893571 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'for-2.6.38' of...

Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc
parents 9d01df06 1435b940
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <sound/tlv.h> #include <sound/tlv.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <trace/events/asoc.h>
#include "88pm860x-codec.h" #include "88pm860x-codec.h"
...@@ -1262,6 +1263,12 @@ static irqreturn_t pm860x_codec_handler(int irq, void *data) ...@@ -1262,6 +1263,12 @@ static irqreturn_t pm860x_codec_handler(int irq, void *data)
mask = pm860x->det.hs_shrt | pm860x->det.hook_det | pm860x->det.lo_shrt mask = pm860x->det.hs_shrt | pm860x->det.hook_det | pm860x->det.lo_shrt
| pm860x->det.hp_det; | pm860x->det.hp_det;
#ifndef CONFIG_SND_SOC_88PM860X
if (status & (HEADSET_STATUS | MIC_STATUS | SHORT_HS1 | SHORT_HS2 |
SHORT_LO1 | SHORT_LO2))
trace_snd_soc_jack_irq(dev_name(pm860x->codec->dev));
#endif
if ((pm860x->det.hp_det & SND_JACK_HEADPHONE) if ((pm860x->det.hp_det & SND_JACK_HEADPHONE)
&& (status & HEADSET_STATUS)) && (status & HEADSET_STATUS))
report |= SND_JACK_HEADPHONE; report |= SND_JACK_HEADPHONE;
......
...@@ -78,6 +78,7 @@ config SND_SOC_ALL_CODECS ...@@ -78,6 +78,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_WM8990 if I2C select SND_SOC_WM8990 if I2C
select SND_SOC_WM8993 if I2C select SND_SOC_WM8993 if I2C
select SND_SOC_WM8994 if MFD_WM8994 select SND_SOC_WM8994 if MFD_WM8994
select SND_SOC_WM8995 if SND_SOC_I2C_AND_SPI
select SND_SOC_WM9081 if I2C select SND_SOC_WM9081 if I2C
select SND_SOC_WM9090 if I2C select SND_SOC_WM9090 if I2C
select SND_SOC_WM9705 if SND_SOC_AC97_BUS select SND_SOC_WM9705 if SND_SOC_AC97_BUS
...@@ -306,6 +307,9 @@ config SND_SOC_WM8993 ...@@ -306,6 +307,9 @@ config SND_SOC_WM8993
config SND_SOC_WM8994 config SND_SOC_WM8994
tristate tristate
config SND_SOC_WM8995
tristate
config SND_SOC_WM9081 config SND_SOC_WM9081
tristate tristate
......
...@@ -62,6 +62,7 @@ snd-soc-wm8988-objs := wm8988.o ...@@ -62,6 +62,7 @@ snd-soc-wm8988-objs := wm8988.o
snd-soc-wm8990-objs := wm8990.o snd-soc-wm8990-objs := wm8990.o
snd-soc-wm8993-objs := wm8993.o snd-soc-wm8993-objs := wm8993.o
snd-soc-wm8994-objs := wm8994.o wm8994-tables.o snd-soc-wm8994-objs := wm8994.o wm8994-tables.o
snd-soc-wm8995-objs := wm8995.o
snd-soc-wm9081-objs := wm9081.o snd-soc-wm9081-objs := wm9081.o
snd-soc-wm9705-objs := wm9705.o snd-soc-wm9705-objs := wm9705.o
snd-soc-wm9712-objs := wm9712.o snd-soc-wm9712-objs := wm9712.o
...@@ -140,6 +141,7 @@ obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o ...@@ -140,6 +141,7 @@ obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o
obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o
obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o
obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o
obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o
obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o
obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o
obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/tlv.h> #include <sound/tlv.h>
#include <trace/events/asoc.h>
#include "wm8350.h" #include "wm8350.h"
...@@ -53,6 +54,7 @@ struct wm8350_output { ...@@ -53,6 +54,7 @@ struct wm8350_output {
struct wm8350_jack_data { struct wm8350_jack_data {
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
struct delayed_work work;
int report; int report;
int short_report; int short_report;
}; };
...@@ -1335,45 +1337,69 @@ static int wm8350_resume(struct snd_soc_codec *codec) ...@@ -1335,45 +1337,69 @@ static int wm8350_resume(struct snd_soc_codec *codec)
return 0; return 0;
} }
static irqreturn_t wm8350_hp_jack_handler(int irq, void *data) static void wm8350_hp_work(struct wm8350_data *priv,
struct wm8350_jack_data *jack,
u16 mask)
{ {
struct wm8350_data *priv = data;
struct wm8350 *wm8350 = priv->codec.control_data; struct wm8350 *wm8350 = priv->codec.control_data;
u16 reg; u16 reg;
int report; int report;
int mask;
reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS);
if (reg & mask)
report = jack->report;
else
report = 0;
snd_soc_jack_report(jack->jack, report, jack->report);
}
static void wm8350_hpl_work(struct work_struct *work)
{
struct wm8350_data *priv =
container_of(work, struct wm8350_data, hpl.work.work);
wm8350_hp_work(priv, &priv->hpl, WM8350_JACK_L_LVL);
}
static void wm8350_hpr_work(struct work_struct *work)
{
struct wm8350_data *priv =
container_of(work, struct wm8350_data, hpr.work.work);
wm8350_hp_work(priv, &priv->hpr, WM8350_JACK_R_LVL);
}
static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
{
struct wm8350_data *priv = data;
struct wm8350 *wm8350 = priv->codec.control_data;
struct wm8350_jack_data *jack = NULL; struct wm8350_jack_data *jack = NULL;
switch (irq - wm8350->irq_base) { switch (irq - wm8350->irq_base) {
case WM8350_IRQ_CODEC_JCK_DET_L: case WM8350_IRQ_CODEC_JCK_DET_L:
#ifndef CONFIG_SND_SOC_WM8350_MODULE
trace_snd_soc_jack_irq("WM8350 HPL");
#endif
jack = &priv->hpl; jack = &priv->hpl;
mask = WM8350_JACK_L_LVL;
break; break;
case WM8350_IRQ_CODEC_JCK_DET_R: case WM8350_IRQ_CODEC_JCK_DET_R:
#ifndef CONFIG_SND_SOC_WM8350_MODULE
trace_snd_soc_jack_irq("WM8350 HPR");
#endif
jack = &priv->hpr; jack = &priv->hpr;
mask = WM8350_JACK_R_LVL;
break; break;
default: default:
BUG(); BUG();
} }
if (!jack->jack) { if (device_may_wakeup(wm8350->dev))
dev_warn(wm8350->dev, "Jack interrupt called with no jack\n"); pm_wakeup_event(wm8350->dev, 250);
return IRQ_NONE;
}
/* Debounce */ schedule_delayed_work(&jack->work, 200);
msleep(200);
reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS);
if (reg & mask)
report = jack->report;
else
report = 0;
snd_soc_jack_report(jack->jack, report, jack->report);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1437,6 +1463,8 @@ static irqreturn_t wm8350_mic_handler(int irq, void *data) ...@@ -1437,6 +1463,8 @@ static irqreturn_t wm8350_mic_handler(int irq, void *data)
u16 reg; u16 reg;
int report = 0; int report = 0;
trace_snd_soc_jack_irq("WM8350 mic");
reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS); reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS);
if (reg & WM8350_JACK_MICSCD_LVL) if (reg & WM8350_JACK_MICSCD_LVL)
report |= priv->mic.short_report; report |= priv->mic.short_report;
...@@ -1552,6 +1580,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) ...@@ -1552,6 +1580,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8350_pga_work); INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8350_pga_work);
INIT_DELAYED_WORK(&priv->hpl.work, wm8350_hpl_work);
INIT_DELAYED_WORK(&priv->hpr.work, wm8350_hpr_work);
/* Enable the codec */ /* Enable the codec */
wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
...@@ -1641,6 +1671,9 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) ...@@ -1641,6 +1671,9 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec)
priv->hpr.jack = NULL; priv->hpr.jack = NULL;
priv->mic.jack = NULL; priv->mic.jack = NULL;
cancel_delayed_work_sync(&priv->hpl.work);
cancel_delayed_work_sync(&priv->hpr.work);
/* if there was any work waiting then we run it now and /* if there was any work waiting then we run it now and
* wait for its completion */ * wait for its completion */
flush_delayed_work_sync(&codec->dapm.delayed_work); flush_delayed_work_sync(&codec->dapm.delayed_work);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/wm8903.h> #include <sound/wm8903.h>
#include <trace/events/asoc.h>
#include "wm8903.h" #include "wm8903.h"
...@@ -1533,6 +1534,11 @@ static irqreturn_t wm8903_irq(int irq, void *data) ...@@ -1533,6 +1534,11 @@ static irqreturn_t wm8903_irq(int irq, void *data)
mic_report = wm8903->mic_last_report; mic_report = wm8903->mic_last_report;
int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1); int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1);
#ifndef CONFIG_SND_SOC_WM8903_MODULE
if (int_val & (WM8903_MICSHRT_EINT | WM8903_MICDET_EINT))
trace_snd_soc_jack_irq(dev_name(codec->dev));
#endif
if (int_val & WM8903_MICSHRT_EINT) { if (int_val & WM8903_MICSHRT_EINT) {
dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol); dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/tlv.h> #include <sound/tlv.h>
#include <sound/wm8962.h> #include <sound/wm8962.h>
#include <trace/events/asoc.h>
#include "wm8962.h" #include "wm8962.h"
...@@ -3353,6 +3354,10 @@ static irqreturn_t wm8962_irq(int irq, void *data) ...@@ -3353,6 +3354,10 @@ static irqreturn_t wm8962_irq(int irq, void *data)
if (active & (WM8962_MICSCD_EINT | WM8962_MICD_EINT)) { if (active & (WM8962_MICSCD_EINT | WM8962_MICD_EINT)) {
dev_dbg(codec->dev, "Microphone event detected\n"); dev_dbg(codec->dev, "Microphone event detected\n");
#ifndef CONFIG_SOUND_SOC_WM862_MODULE
trace_snd_soc_jack_irq(dev_name(codec->dev));
#endif
pm_wakeup_event(codec->dev, 300); pm_wakeup_event(codec->dev, 300);
schedule_delayed_work(&wm8962->mic_work, schedule_delayed_work(&wm8962->mic_work,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/tlv.h> #include <sound/tlv.h>
#include <trace/events/asoc.h>
#include <linux/mfd/wm8994/core.h> #include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/registers.h> #include <linux/mfd/wm8994/registers.h>
...@@ -2755,6 +2756,8 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data) ...@@ -2755,6 +2756,8 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data)
int reg; int reg;
int report; int report;
trace_snd_soc_jack_irq(dev_name(codec->dev));
reg = snd_soc_read(codec, WM8994_INTERRUPT_RAW_STATUS_2); reg = snd_soc_read(codec, WM8994_INTERRUPT_RAW_STATUS_2);
if (reg < 0) { if (reg < 0) {
dev_err(codec->dev, "Failed to read microphone status: %d\n", dev_err(codec->dev, "Failed to read microphone status: %d\n",
...@@ -2901,6 +2904,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) ...@@ -2901,6 +2904,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
goto out; goto out;
} }
trace_snd_soc_jack_irq(dev_name(codec->dev));
if (wm8994->jack_cb) if (wm8994->jack_cb)
wm8994->jack_cb(reg, wm8994->jack_cb_data); wm8994->jack_cb(reg, wm8994->jack_cb_data);
else else
......
This diff is collapsed.
This diff is collapsed.
...@@ -131,7 +131,7 @@ static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd) ...@@ -131,7 +131,7 @@ static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
/* Headset jack detection */ /* Headset jack detection */
ret = snd_soc_jack_new(&goni, "Headset Jack", ret = snd_soc_jack_new(codec, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT, SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT,
&jack); &jack);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment