Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260696
b: refs/heads/master
c: 2a433b9
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi committed Jul 7, 2011
1 parent 5064553 commit 691ffc5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 625cbe46bc97a82dcd9254b5bc01c8520d78b227
refs/heads/master: 2a433b9daff58c8ff231b879242a586371acc93f
19 changes: 14 additions & 5 deletions trunk/sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct twl6040_jack_data {

/* codec private data */
struct twl6040_data {
int plug_irq;
int codec_powered;
int pll;
int non_lp;
Expand Down Expand Up @@ -1527,6 +1528,8 @@ static int twl6040_probe(struct snd_soc_codec *codec)
{
struct twl6040_data *priv;
struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev);
struct platform_device *pdev = container_of(codec->dev,
struct platform_device, dev);
int ret = 0;

priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL);
Expand All @@ -1553,6 +1556,13 @@ static int twl6040_probe(struct snd_soc_codec *codec)
priv->hf_right_step = 1;
}

priv->plug_irq = platform_get_irq(pdev, 0);
if (priv->plug_irq < 0) {
dev_err(codec->dev, "invalid irq\n");
ret = -EINVAL;
goto work_err;
}

priv->sysclk_constraints = &hp_constraints;
priv->workqueue = create_singlethread_workqueue("twl6040-codec");
if (!priv->workqueue) {
Expand Down Expand Up @@ -1581,9 +1591,8 @@ static int twl6040_probe(struct snd_soc_codec *codec)
INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work);
INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work);

ret = twl6040_request_irq(codec->control_data, TWL6040_IRQ_PLUG,
twl6040_audio_handler, 0,
"twl6040_irq_plug", codec);
ret = request_threaded_irq(priv->plug_irq, NULL, twl6040_audio_handler,
0, "twl6040_irq_plug", codec);
if (ret) {
dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret);
goto plugirq_err;
Expand All @@ -1604,7 +1613,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
return 0;

bias_err:
twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec);
free_irq(priv->plug_irq, codec);
plugirq_err:
destroy_workqueue(priv->hs_workqueue);
hswq_err:
Expand All @@ -1621,7 +1630,7 @@ static int twl6040_remove(struct snd_soc_codec *codec)
struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);

twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF);
twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec);
free_irq(priv->plug_irq, codec);
destroy_workqueue(priv->workqueue);
destroy_workqueue(priv->hf_workqueue);
destroy_workqueue(priv->hs_workqueue);
Expand Down

0 comments on commit 691ffc5

Please sign in to comment.