~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to arch/arm/plat-omap/include/plat/omap-alsa.h

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * arch/arm/plat-omap/include/mach/omap-alsa.h
3
 
 *
4
 
 * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards.
5
 
 *
6
 
 * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
7
 
 *
8
 
 * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
9
 
 * Written by Daniel Petrini, David Cohen, Anderson Briglia
10
 
 *            {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
11
 
 *
12
 
 * This program is free software; you can redistribute it and/or modify it
13
 
 * under the terms of the GNU General Public License as published by the
14
 
 * Free Software Foundation; either version 2 of the License, or (at your
15
 
 * option) any later version.
16
 
 *
17
 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18
 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19
 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20
 
 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
 
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
 
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 
 *
28
 
 * You should have received a copy of the  GNU General Public License along
29
 
 * with this program; if not, write  to the Free Software Foundation, Inc.,
30
 
 * 675 Mass Ave, Cambridge, MA 02139, USA.
31
 
 *
32
 
 *  History
33
 
 *  -------
34
 
 *
35
 
 *  2005/07/25 INdT-10LE Kernel Team -  Alsa driver for omap osk,
36
 
 *                                      original version based in sa1100 driver
37
 
 *                                      and omap oss driver.
38
 
 */
39
 
 
40
 
#ifndef __OMAP_ALSA_H
41
 
#define __OMAP_ALSA_H
42
 
 
43
 
#include <plat/dma.h>
44
 
#include <sound/core.h>
45
 
#include <sound/pcm.h>
46
 
#include <plat/mcbsp.h>
47
 
#include <linux/platform_device.h>
48
 
 
49
 
#define DMA_BUF_SIZE    (1024 * 8)
50
 
 
51
 
/*
52
 
 * Buffer management for alsa and dma
53
 
 */
54
 
struct audio_stream {
55
 
        char *id;               /* identification string */
56
 
        int stream_id;          /* numeric identification */
57
 
        int dma_dev;            /* dma number of that device */
58
 
        int *lch;               /* Chain of channels this stream is linked to */
59
 
        char started;           /* to store if the chain was started or not */
60
 
        int dma_q_head;         /* DMA Channel Q Head */
61
 
        int dma_q_tail;         /* DMA Channel Q Tail */
62
 
        char dma_q_count;       /* DMA Channel Q Count */
63
 
        int active:1;           /* we are using this stream for transfer now */
64
 
        int period;             /* current transfer period */
65
 
        int periods;            /* current count of periods registerd in the DMA engine */
66
 
        spinlock_t dma_lock;    /* for locking in DMA operations */
67
 
        struct snd_pcm_substream *stream;       /* the pcm stream */
68
 
        unsigned linked:1;      /* dma channels linked */
69
 
        int offset;             /* store start position of the last period in the alsa buffer */
70
 
        int (*hw_start)(void);  /* interface to start HW interface, e.g. McBSP */
71
 
        int (*hw_stop)(void);   /* interface to stop HW interface, e.g. McBSP */
72
 
};
73
 
 
74
 
/*
75
 
 * Alsa card structure for aic23
76
 
 */
77
 
struct snd_card_omap_codec {
78
 
        struct snd_card *card;
79
 
        struct snd_pcm *pcm;
80
 
        long samplerate;
81
 
        struct audio_stream s[2];       /* playback & capture */
82
 
};
83
 
 
84
 
/* Codec specific information and function pointers.
85
 
 * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c)
86
 
 * are responsible for defining the function pointers.
87
 
 */
88
 
struct omap_alsa_codec_config {
89
 
        char    *name;
90
 
        struct  omap_mcbsp_reg_cfg *mcbsp_regs_alsa;
91
 
        struct  snd_pcm_hw_constraint_list *hw_constraints_rates;
92
 
        struct  snd_pcm_hardware *snd_omap_alsa_playback;
93
 
        struct  snd_pcm_hardware *snd_omap_alsa_capture;
94
 
        void    (*codec_configure_dev)(void);
95
 
        void    (*codec_set_samplerate)(long);
96
 
        void    (*codec_clock_setup)(void);
97
 
        int     (*codec_clock_on)(void);
98
 
        int     (*codec_clock_off)(void);
99
 
        int     (*get_default_samplerate)(void);
100
 
};
101
 
 
102
 
/*********** Mixer function prototypes *************************/
103
 
int snd_omap_mixer(struct snd_card_omap_codec *);
104
 
void snd_omap_init_mixer(void);
105
 
 
106
 
#ifdef CONFIG_PM
107
 
void snd_omap_suspend_mixer(void);
108
 
void snd_omap_resume_mixer(void);
109
 
#endif
110
 
 
111
 
int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config);
112
 
int snd_omap_alsa_remove(struct platform_device *pdev);
113
 
#ifdef CONFIG_PM
114
 
int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state);
115
 
int snd_omap_alsa_resume(struct platform_device *pdev);
116
 
#else
117
 
#define snd_omap_alsa_suspend   NULL
118
 
#define snd_omap_alsa_resume    NULL
119
 
#endif
120
 
 
121
 
void callback_omap_alsa_sound_dma(void *);
122
 
 
123
 
#endif