2 * sound/ubicom32/ubi32.h
3 * Common header file for all ubi32- sound drivers
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
27 #define SND_UBI32_DEBUG 0 // Debug flag
29 #include <linux/platform_device.h>
30 #include <asm/devtree.h>
31 #include <asm/audio.h>
32 #include <asm/ubi32-pcm.h>
34 struct ubi32_snd_priv;
36 typedef int (*set_channels_t)(struct ubi32_snd_priv *priv, int channels);
37 typedef int (*set_rate_t)(struct ubi32_snd_priv *priv, int rate);
39 struct ubi32_snd_priv {
41 * Any variables that are needed locally here but NOT in
42 * the VP itself should go in here.
44 struct snd_card *card;
48 * capture (1) or playback (0)
52 * DAC parameters. These are the parameters for the specific
53 * DAC we are driving. The I2S component can run at a range
54 * of frequencies, but the DAC may be limited. We may want
55 * to make this an array of some sort in the future?
57 * min/max_sample_rate if set to 0 are ignored.
63 * The size a period (group) of audio samples. The VP does
64 * not need to know this; each DMA transfer is made to be
69 spinlock_t ubi32_lock;
71 struct audio_regs *ar;
72 struct audio_dev_regs *adr;
80 * Operations which the base DAC driver can implement
82 set_channels_t set_channels;
88 struct ubi32pcm_platform_data *pdata;
91 * Private driver data (used for DAC driver control, etc)
96 #define snd_ubi32_priv_get_drv(priv) ((priv)->drvdata)
97 #define snd_ubi32_priv_set_drv(priv, data) (((priv)->drvdata) = (void *)(data))
99 extern int snd_ubi32_pcm_probe(struct ubi32_snd_priv *ubi32_priv, struct platform_device *pdev);
100 extern void snd_ubi32_pcm_remove(struct ubi32_snd_priv *ubi32_priv);