diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2013-01-11 11:01:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-11 18:54:57 -0500 |
commit | da2107d1e464811407675880e9ab78f057b7c9d6 (patch) | |
tree | d0dc3c8f18431196e186fbcf5f03af6f3052fb89 | |
parent | 9523fcdcc02e812f3a0f4849b3af1b295ad50470 (diff) |
ASoC: twl6040: Switch to use system workqueue for jack reporting
There's no need to create a queue for this anymore
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/twl6040.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 90b721e437a3..984911ba5807 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -75,7 +75,6 @@ struct twl6040_data { | |||
75 | u16 hf_right_step; | 75 | u16 hf_right_step; |
76 | struct twl6040_jack_data hs_jack; | 76 | struct twl6040_jack_data hs_jack; |
77 | struct snd_soc_codec *codec; | 77 | struct snd_soc_codec *codec; |
78 | struct workqueue_struct *workqueue; | ||
79 | struct mutex mutex; | 78 | struct mutex mutex; |
80 | }; | 79 | }; |
81 | 80 | ||
@@ -404,8 +403,7 @@ static irqreturn_t twl6040_audio_handler(int irq, void *data) | |||
404 | struct snd_soc_codec *codec = data; | 403 | struct snd_soc_codec *codec = data; |
405 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); | 404 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); |
406 | 405 | ||
407 | queue_delayed_work(priv->workqueue, &priv->hs_jack.work, | 406 | schedule_delayed_work(&priv->hs_jack.work, msecs_to_jiffies(200)); |
408 | msecs_to_jiffies(200)); | ||
409 | 407 | ||
410 | return IRQ_HANDLED; | 408 | return IRQ_HANDLED; |
411 | } | 409 | } |
@@ -1162,10 +1160,6 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1162 | return -EINVAL; | 1160 | return -EINVAL; |
1163 | } | 1161 | } |
1164 | 1162 | ||
1165 | priv->workqueue = alloc_workqueue("twl6040-codec", 0, 0); | ||
1166 | if (!priv->workqueue) | ||
1167 | return -ENOMEM; | ||
1168 | |||
1169 | INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work); | 1163 | INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work); |
1170 | 1164 | ||
1171 | mutex_init(&priv->mutex); | 1165 | mutex_init(&priv->mutex); |
@@ -1175,27 +1169,18 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1175 | "twl6040_irq_plug", codec); | 1169 | "twl6040_irq_plug", codec); |
1176 | if (ret) { | 1170 | if (ret) { |
1177 | dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); | 1171 | dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); |
1178 | goto err; | 1172 | return ret; |
1179 | } | 1173 | } |
1180 | 1174 | ||
1181 | twl6040_init_chip(codec); | 1175 | twl6040_init_chip(codec); |
1182 | 1176 | ||
1183 | /* power on device */ | 1177 | /* power on device */ |
1184 | ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1178 | return twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1185 | if (!ret) | ||
1186 | return 0; | ||
1187 | |||
1188 | err: | ||
1189 | destroy_workqueue(priv->workqueue); | ||
1190 | return ret; | ||
1191 | } | 1179 | } |
1192 | 1180 | ||
1193 | static int twl6040_remove(struct snd_soc_codec *codec) | 1181 | static int twl6040_remove(struct snd_soc_codec *codec) |
1194 | { | 1182 | { |
1195 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); | ||
1196 | |||
1197 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1183 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1198 | destroy_workqueue(priv->workqueue); | ||
1199 | 1184 | ||
1200 | return 0; | 1185 | return 0; |
1201 | } | 1186 | } |