~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to sound/soc/omap/zoom2.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
        .num_links = ARRAY_SIZE(zoom2_dai),
240
240
};
241
241
 
242
 
static struct platform_device *zoom2_snd_device;
243
 
 
244
 
static int __init zoom2_soc_init(void)
 
242
static int __devinit zoom2_soc_probe(struct platform_device *pdev)
245
243
{
 
244
        struct snd_soc_card *card = &snd_soc_zoom2;
246
245
        int ret;
247
246
 
248
 
        if (!machine_is_omap_zoom2())
249
 
                return -ENODEV;
250
 
        printk(KERN_INFO "Zoom2 SoC init\n");
251
 
 
252
 
        zoom2_snd_device = platform_device_alloc("soc-audio", -1);
253
 
        if (!zoom2_snd_device) {
254
 
                printk(KERN_ERR "Platform device allocation failed\n");
255
 
                return -ENOMEM;
256
 
        }
257
 
 
258
 
        platform_set_drvdata(zoom2_snd_device, &snd_soc_zoom2);
259
 
        ret = platform_device_add(zoom2_snd_device);
260
 
        if (ret)
261
 
                goto err1;
 
247
        pr_info("Zoom2 SoC init\n");
 
248
 
 
249
        card->dev = &pdev->dev;
262
250
 
263
251
        BUG_ON(gpio_request(ZOOM2_HEADSET_MUX_GPIO, "hs_mux") < 0);
264
252
        gpio_direction_output(ZOOM2_HEADSET_MUX_GPIO, 0);
266
254
        BUG_ON(gpio_request(ZOOM2_HEADSET_EXTMUTE_GPIO, "ext_mute") < 0);
267
255
        gpio_direction_output(ZOOM2_HEADSET_EXTMUTE_GPIO, 0);
268
256
 
 
257
        ret = snd_soc_register_card(card);
 
258
        if (ret) {
 
259
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
 
260
                        ret);
 
261
                goto err;
 
262
        }
 
263
 
269
264
        return 0;
270
265
 
271
 
err1:
272
 
        printk(KERN_ERR "Unable to add platform device\n");
273
 
        platform_device_put(zoom2_snd_device);
 
266
err:
 
267
        gpio_free(ZOOM2_HEADSET_MUX_GPIO);
 
268
        gpio_free(ZOOM2_HEADSET_EXTMUTE_GPIO);
274
269
 
275
270
        return ret;
276
271
}
 
272
 
 
273
static int __devexit zoom2_soc_remove(struct platform_device *pdev)
 
274
{
 
275
        struct snd_soc_card *card = platform_get_drvdata(pdev);
 
276
 
 
277
        snd_soc_unregister_card(card);
 
278
 
 
279
        gpio_free(ZOOM2_HEADSET_MUX_GPIO);
 
280
        gpio_free(ZOOM2_HEADSET_EXTMUTE_GPIO);
 
281
 
 
282
        return 0;
 
283
}
 
284
 
 
285
static struct platform_driver zoom2_driver = {
 
286
        .driver = {
 
287
                .name = "zoom2-soc-audio",
 
288
                .owner = THIS_MODULE,
 
289
        },
 
290
 
 
291
        .probe = zoom2_soc_probe,
 
292
        .remove = __devexit_p(zoom2_soc_remove),
 
293
};
 
294
 
 
295
static int __init zoom2_soc_init(void)
 
296
{
 
297
        return platform_driver_register(&zoom2_driver);
 
298
}
277
299
module_init(zoom2_soc_init);
278
300
 
279
301
static void __exit zoom2_soc_exit(void)
280
302
{
281
 
        gpio_free(ZOOM2_HEADSET_MUX_GPIO);
282
 
        gpio_free(ZOOM2_HEADSET_EXTMUTE_GPIO);
283
 
 
284
 
        platform_device_unregister(zoom2_snd_device);
 
303
        platform_driver_unregister(&zoom2_driver);
285
304
}
286
305
module_exit(zoom2_soc_exit);
287
306
 
288
307
MODULE_AUTHOR("Misael Lopez Cruz <x0052729@ti.com>");
289
308
MODULE_DESCRIPTION("ALSA SoC Zoom2");
290
309
MODULE_LICENSE("GPL");
291
 
 
 
310
MODULE_ALIAS("platform:zoom2-soc-audio");