All of lore.kernel.org
 help / color / mirror / Atom feed
* asoc device probing and dai question
@ 2010-12-02 11:01 Koul, Vinod
  2010-12-02 11:07 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Koul, Vinod @ 2010-12-02 11:01 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org; +Cc: Harsha, Priya, Mark Brown, Liam Girdwood

Hi,

In our driver, the machine probe creates the soc-audio device. I am adding the 
codec and platform device in my soc-device. But the probe for the codec doesn't 
get called unless we add the cpu and codec dais in the machine probe. I saw the 
soc-core code and looks like it checks if cpu and codec dais are registerd if so 
then only proceeds and calls the codec probe.

So should I continue to register the dai for both cpu and codec in machine 
probe. I didn't see other driver in soc/ doing this, so did I miss something.

Code:
In m/c driver... (the m/c driver probe is called by kernel when it finds this 
device, and I register it as a platform device)

/* Audio machine driver */
static struct snd_soc_card snd_soc_intelmid_card = {
        .name = "intel_mid_sound_card",
        .platform = &intelmid_soc_platform,
        .dai_link = intelmid_msic_dai,
        .num_links = 1,
};

/* Audio subsystem */
static struct snd_soc_device intelmid_snd_devdata = {
        .card = &snd_soc_intelmid_card,
        .codec_dev = &intel_msic_codec,
};
int __devinit snd_intelmid_mc_probe(struct platform_device *pdev)
{
        int ret_val;

        snd_printk(KERN_DEBUG "snd_intelmad_probe called\n");

        ret_val = snd_soc_register_dais(mid_bsp_dai, ARRAY_SIZE(mid_bsp_dai));
        ret_val = snd_soc_register_dais(intel_msic_dais, ARRAY_SIZE(intel_msic_dais));

        intelmid_snd_device = platform_device_alloc("soc-audio", -1);
        if (!intelmid_snd_device) {
                snd_printk(KERN_ERR "Platform device allocation failed\n");
                return -ENOMEM;
        }

        platform_set_drvdata(intelmid_snd_device, &intelmid_snd_devdata);
        
        intelmid_snd_devdata.dev = &intelmid_snd_device->dev;

        ret_val = platform_device_add(intelmid_snd_device);
        if (ret_val) {
                snd_printk(KERN_ERR "Unable to add platform device\n");
                platform_device_put(intelmid_snd_device);
        }
        return ret_val;
}

In platform init (note I don't have probe for platform)
static int __init intel_mid_soc_platform_init(void)
{
        snd_printk(KERN_DEBUG "intel_mid_soc_platform_init called\n");
        return snd_soc_register_platform(&intelmid_soc_platform);
}

Thanks
Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-12-02 11:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 11:01 asoc device probing and dai question Koul, Vinod
2010-12-02 11:07 ` Mark Brown
2010-12-02 11:23   ` Koul, Vinod
2010-12-02 11:25     ` Mark Brown
2010-12-02 11:38       ` Koul, Vinod
2010-12-02 11:47         ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.