On Wed, Jan 19, 2011 at 01:50:05PM -0700, Stephen Warren wrote:
-static int __init harmony_soc_modinit(void) +static __devinit int tegra_snd_harmony_probe(struct platform_device *pdev)
Unrelated change...
- if (!machine_is_harmony()) {
pr_err(PREFIX "Not running on Tegra Harmony!\n");
return -ENODEV;
- if (pdev->id != 0) {
dev_err(&pdev->dev, "ID %d out of range\n", pdev->id);
return -EINVAL;
- }
- pdata = pdev->dev.platform_data;
- if (!pdata) {
dev_err(&pdev->dev, "no platform data supplied\n");
return -EINVAL;
Unless you have more than one sound card your device ID should be -1. I'd also be inclined to keep the machine_is_harmony() check here for paranoia.
With the recently added exposure of snd_soc_register_card() you *should* just be able allocate a regular platform device with a regular name in your arch/arm code and then register that directly with the ASoC core - something like:
int __devinit harmony_audio_probe(struct platform_device *pdev) { /* Do GPIO stuff */
card->dev = &pdev->dev; snd_soc_register_card(&snd_soc_harmony);
/* Error handling */ }
ought to do the trick, and is much neater and more idiomatic than the soc-audio stuff.