summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorGary Zhang <b13634@freescale.com>2012-10-26 16:16:56 +0800
committerGary Zhang <b13634@freescale.com>2012-10-29 10:24:02 +0800
commit00eacde5d2e53a93aa3a719ce7e1acd682823511 (patch)
tree602198710ec00b644e67c8339c158fc26653511e /sound
parent206c9b97c2ff7ebacc12cd0ccd85eb9a6fbad22f (diff)
ENGR00231321-2 wm8962: enhance audio driver
1. correct indent issue 2. when driver is unloaded, remove disable clock operateion and free irq Signed-off-by: Gary Zhang <b13634@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/imx/imx-wm8962.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/sound/soc/imx/imx-wm8962.c b/sound/soc/imx/imx-wm8962.c
index b13f68f2647b..04aca39ab2d5 100644
--- a/sound/soc/imx/imx-wm8962.c
+++ b/sound/soc/imx/imx-wm8962.c
@@ -324,25 +324,25 @@ static int imx_wm8962_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_sync(&codec->dapm);
if (plat->hp_gpio != -1) {
- priv->hp_irq = gpio_to_irq(plat->hp_gpio);
-
- ret = request_irq(priv->hp_irq,
- imx_headphone_detect_handler,
- IRQ_TYPE_EDGE_BOTH, pdev->name, priv);
-
- if (ret < 0) {
- ret = -EINVAL;
- return ret;
- }
-
- ret = driver_create_file(pdev->dev.driver,
- &driver_attr_headphone);
- if (ret < 0) {
- ret = -EINVAL;
- return ret;
- }
+ priv->hp_irq = gpio_to_irq(plat->hp_gpio);
+
+ ret = request_irq(priv->hp_irq,
+ imx_headphone_detect_handler,
+ IRQ_TYPE_EDGE_BOTH, pdev->name, priv);
+
+ if (ret < 0) {
+ ret = -EINVAL;
+ return ret;
}
+ ret = driver_create_file(pdev->dev.driver,
+ &driver_attr_headphone);
+ if (ret < 0) {
+ ret = -EINVAL;
+ return ret;
+ }
+ }
+
if (plat->mic_gpio != -1) {
priv->amic_irq = gpio_to_irq(plat->mic_gpio);
@@ -447,12 +447,16 @@ static int __devinit imx_wm8962_probe(struct platform_device *pdev)
static int __devexit imx_wm8962_remove(struct platform_device *pdev)
{
struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
-
- plat->clock_enable(0);
+ struct imx_priv *priv = &card_priv;
if (plat->finit)
plat->finit();
+ if (priv->hp_irq)
+ free_irq(priv->hp_irq, priv);
+ if (priv->amic_irq)
+ free_irq(priv->amic_irq, priv);
+
return 0;
}