alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: preetam <preetamsashankreddy@gmail.com>
To: alsa-devel@alsa-project.org
Subject: platform driver clarification in twl6040 codec driver
Date: Thu, 05 May 2011 11:28:27 +0530	[thread overview]
Message-ID: <4DC23C83.1010800@gmail.com> (raw)

Hai,

I am building an ALSA ASoC driver based on the original twl6040 driver 
on omap 4 panda board. I notice that there is a platform_device being 
created in the machine driver which is getting bound to the 
platform_driver created by the alsa soc core. i.e  "soc-audio".

sound/soc/omap/sd4430.c
================
     sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
     if (!sdp4430_snd_device) {
         printk(KERN_ERR "Platform device allocation failed\n");
         return -ENOMEM;
     }

     snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai));

     platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);

     ret = platform_device_add(sdp4430_snd_device);

soc-core.c
======
     static struct platform_driver soc_driver = {
         .driver        = {
             .name        = "soc-audio",
             .owner        = THIS_MODULE,
             .pm        = &soc_pm_ops,
         },
         .probe        = soc_probe,
         .remove        = soc_remove,
     };

However, I fail to understand, how the platform_driver in the twl6040.c 
file gets bound and who calls its probe.
sound/soc/codecs/twl6040.c
=================
     static struct platform_driver twl6040_codec_driver = {
         .driver = {
             .name = "twl6040-codec",
             .owner = THIS_MODULE,
         },
         .probe = twl6040_codec_probe,
         .remove = __devexit_p(twl6040_codec_remove),
     };

I have used the same model for my codec device driver and the probe 
function in the codec driver under platform_driver never gets invoked.

Can anyone give me a clarification on this?

Regards,
Preetam

                 reply	other threads:[~2011-05-05  5:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DC23C83.1010800@gmail.com \
    --to=preetamsashankreddy@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).