diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-04 12:52:26 -0400 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-07 07:23:22 -0400 |
commit | 2a433b9daff58c8ff231b879242a586371acc93f (patch) | |
tree | c19f0aaa428669d3c14bf09020db02d1a39b14e9 /sound | |
parent | 625cbe46bc97a82dcd9254b5bc01c8520d78b227 (diff) |
ASoC: twl6040: Do not use wrapper for irq request
The twl6040_request_irq/free_irq inline functions are going
to be removed, so replace them with direct calls.
The irq number is provided by the core driver via resource.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/twl6040.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 014504180ff8..14e3a58d1af5 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -76,6 +76,7 @@ struct twl6040_jack_data { | |||
76 | 76 | ||
77 | /* codec private data */ | 77 | /* codec private data */ |
78 | struct twl6040_data { | 78 | struct twl6040_data { |
79 | int plug_irq; | ||
79 | int codec_powered; | 80 | int codec_powered; |
80 | int pll; | 81 | int pll; |
81 | int non_lp; | 82 | int non_lp; |
@@ -1527,6 +1528,8 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1527 | { | 1528 | { |
1528 | struct twl6040_data *priv; | 1529 | struct twl6040_data *priv; |
1529 | struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); | 1530 | struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); |
1531 | struct platform_device *pdev = container_of(codec->dev, | ||
1532 | struct platform_device, dev); | ||
1530 | int ret = 0; | 1533 | int ret = 0; |
1531 | 1534 | ||
1532 | priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); | 1535 | priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); |
@@ -1553,6 +1556,13 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1553 | priv->hf_right_step = 1; | 1556 | priv->hf_right_step = 1; |
1554 | } | 1557 | } |
1555 | 1558 | ||
1559 | priv->plug_irq = platform_get_irq(pdev, 0); | ||
1560 | if (priv->plug_irq < 0) { | ||
1561 | dev_err(codec->dev, "invalid irq\n"); | ||
1562 | ret = -EINVAL; | ||
1563 | goto work_err; | ||
1564 | } | ||
1565 | |||
1556 | priv->sysclk_constraints = &hp_constraints; | 1566 | priv->sysclk_constraints = &hp_constraints; |
1557 | priv->workqueue = create_singlethread_workqueue("twl6040-codec"); | 1567 | priv->workqueue = create_singlethread_workqueue("twl6040-codec"); |
1558 | if (!priv->workqueue) { | 1568 | if (!priv->workqueue) { |
@@ -1581,9 +1591,8 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1581 | INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work); | 1591 | INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work); |
1582 | INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work); | 1592 | INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work); |
1583 | 1593 | ||
1584 | ret = twl6040_request_irq(codec->control_data, TWL6040_IRQ_PLUG, | 1594 | ret = request_threaded_irq(priv->plug_irq, NULL, twl6040_audio_handler, |
1585 | twl6040_audio_handler, 0, | 1595 | 0, "twl6040_irq_plug", codec); |
1586 | "twl6040_irq_plug", codec); | ||
1587 | if (ret) { | 1596 | if (ret) { |
1588 | dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); | 1597 | dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); |
1589 | goto plugirq_err; | 1598 | goto plugirq_err; |
@@ -1604,7 +1613,7 @@ static int twl6040_probe(struct snd_soc_codec *codec) | |||
1604 | return 0; | 1613 | return 0; |
1605 | 1614 | ||
1606 | bias_err: | 1615 | bias_err: |
1607 | twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); | 1616 | free_irq(priv->plug_irq, codec); |
1608 | plugirq_err: | 1617 | plugirq_err: |
1609 | destroy_workqueue(priv->hs_workqueue); | 1618 | destroy_workqueue(priv->hs_workqueue); |
1610 | hswq_err: | 1619 | hswq_err: |
@@ -1621,7 +1630,7 @@ static int twl6040_remove(struct snd_soc_codec *codec) | |||
1621 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); | 1630 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); |
1622 | 1631 | ||
1623 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1632 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1624 | twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); | 1633 | free_irq(priv->plug_irq, codec); |
1625 | destroy_workqueue(priv->workqueue); | 1634 | destroy_workqueue(priv->workqueue); |
1626 | destroy_workqueue(priv->hf_workqueue); | 1635 | destroy_workqueue(priv->hf_workqueue); |
1627 | destroy_workqueue(priv->hs_workqueue); | 1636 | destroy_workqueue(priv->hs_workqueue); |