Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux教程 >> ASoC的platform

ASoC的platform

日期:2017/2/7 14:38:58      編輯:Linux教程
  /kernel/sound/soc/soc-core.c
  /*soc-core.c -- ALSA SoC Audio Layer*/
  /* probes a new socdev */ static int soc_probe(struct platform_device *pdev) { int ret = 0; struct snd_soc_device *socdev = platform_get_drvdata(pdev);//得到在platform_device中添加的數據 struct snd_soc_card *card = socdev->card;   //三角關系??? /* Bodge while we push things out of socdev */ card->socdev = socdev; /* Bodge while we unpick instantiation */ card->dev = &pdev->dev;
  ret = snd_soc_register_card(card); //注冊snd_soc_card if (ret != 0) { dev_err(&pdev->dev, "Failed to register card\n"); return ret; } return 0; }
  /* ASoC platform driver */ static struct platform_driver soc_driver = { .driver = { .name = "soc-audio", .owner = THIS_MODULE, .pm = &soc_pm_ops, }, .probe = soc_probe, .remove = soc_remove, }; static int __init snd_soc_init(void) { return platform_driver_register(&soc_driver); } module_init(snd_soc_init);

Copyright © Windows教程網 All Rights Reserved