Path: blob/master/sound/soc/fsl/pcm030-audio-fabric.c
10817 views
/*1* Phytec pcm030 driver for the PSC of the Freescale MPC52xx2* configured as AC97 interface3*4* Copyright 2008 Jon Smirl, Digispeaker5* Author: Jon Smirl <[email protected]>6*7* This file is licensed under the terms of the GNU General Public License8* version 2. This program is licensed "as is" without any warranty of any9* kind, whether express or implied.10*/1112#include <linux/init.h>13#include <linux/module.h>14#include <linux/interrupt.h>15#include <linux/device.h>16#include <linux/delay.h>17#include <linux/of_device.h>18#include <linux/of_platform.h>19#include <linux/dma-mapping.h>2021#include <sound/core.h>22#include <sound/pcm.h>23#include <sound/pcm_params.h>24#include <sound/initval.h>25#include <sound/soc.h>2627#include "mpc5200_dma.h"28#include "mpc5200_psc_ac97.h"29#include "../codecs/wm9712.h"3031#define DRV_NAME "pcm030-audio-fabric"3233static struct snd_soc_card card;3435static struct snd_soc_dai_link pcm030_fabric_dai[] = {36{37.name = "AC97",38.stream_name = "AC97 Analog",39.codec_dai_name = "wm9712-hifi",40.cpu_dai_name = "mpc5200-psc-ac97.0",41.platform_name = "mpc5200-pcm-audio",42.codec_name = "wm9712-codec",43},44{45.name = "AC97",46.stream_name = "AC97 IEC958",47.codec_dai_name = "wm9712-aux",48.cpu_dai_name = "mpc5200-psc-ac97.1",49.platform_name = "mpc5200-pcm-audio",50.codec_name = "wm9712-codec",51},52};5354static __init int pcm030_fabric_init(void)55{56struct platform_device *pdev;57int rc;5859if (!of_machine_is_compatible("phytec,pcm030"))60return -ENODEV;616263card.name = "pcm030";64card.dai_link = pcm030_fabric_dai;65card.num_links = ARRAY_SIZE(pcm030_fabric_dai);6667pdev = platform_device_alloc("soc-audio", 1);68if (!pdev) {69pr_err("pcm030_fabric_init: platform_device_alloc() failed\n");70return -ENODEV;71}7273platform_set_drvdata(pdev, &card);7475rc = platform_device_add(pdev);76if (rc) {77pr_err("pcm030_fabric_init: platform_device_add() failed\n");78platform_device_put(pdev);79return -ENODEV;80}81return 0;82}8384module_init(pcm030_fabric_init);858687MODULE_AUTHOR("Jon Smirl <[email protected]>");88MODULE_DESCRIPTION(DRV_NAME ": mpc5200 pcm030 fabric driver");89MODULE_LICENSE("GPL");90919293