提交 e1a9c987 编写于 作者: L Linus Torvalds

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa: (299 commits)
  [ALSA] version 1.0.16rc2
  [ALSA] hda: fix Mic in as output
  [ALSA] emu10k1 - Another EMU0404 Board ID
  [ALSA] emu10k1 - Fix kthread handling at resume
  [ALSA] emu10k1: General cleanup, add new locks, fix alsa bug#3501, kernel bug#9304.
  [ALSA] emu10k1 - Use enum for emu_model types
  [ALSA] emu10k1 - Don't create emu1010 controls for non-emu boards
  [ALSA] emu10k1 - 1616(M) cardbus improvements
  [ALSA] snd:emu10k1: E-Mu updates. Fixes to firmware loading and support for 0404.
  [ALSA] emu10k1: Add comments regarding E-Mu ins and outs.
  [ALSA] oxygen: revert SPI clock frequency change for AK4396/WM8785
  [ALSA] es1938 - improve capture hw pointer reads
  [ALSA] HDA-Intel - Add support for Intel SCH
  [ALSA] hda: Add GPIO mute support to STAC9205
  [ALSA] hda-codec - Add Dell T3400 support
  [ALSA] hda-codec - Add model for HP DV9553EG laptop
  [ALSA] hda-codec - Control SPDIF as slave
  [ALSA] hda_intel: ALSA HD Audio patch for Intel ICH10 DeviceID's
  [ALSA] Fix Oops with PCM OSS sync
  [ALSA] hda-codec - Add speaker automute to ALC262 HP models
  ...
ASoC currently supports the three main Digital Audio Interfaces (DAI) found on
SoC controllers and portable audio CODECS today, namely AC97, I2S and PCM.
SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM.
AC97
......@@ -25,7 +25,7 @@ left/right clock (LRC) synchronise the link. I2S is flexible in that either the
controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock
usually varies depending on the sample rate and the master system clock
(SYSCLK). LRCLK is the same as the sample rate. A few devices support separate
ADC and DAC LRCLK's, this allows for simultaneous capture and playback at
ADC and DAC LRCLKs, this allows for simultaneous capture and playback at
different sample rates.
I2S has several different operating modes:-
......@@ -35,7 +35,7 @@ I2S has several different operating modes:-
o Left Justified - MSB is transmitted on transition of LRC.
o Right Justified - MSB is transmitted sample size BCLK's before LRC
o Right Justified - MSB is transmitted sample size BCLKs before LRC
transition.
PCM
......
......@@ -13,7 +13,7 @@ or SYSCLK). This audio master clock can be derived from a number of sources
(e.g. crystal, PLL, CPU clock) and is responsible for producing the correct
audio playback and capture sample rates.
Some master clocks (e.g. PLL's and CPU based clocks) are configurable in that
Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that
their speed can be altered by software (depending on the system use and to save
power). Other master clocks are fixed at a set frequency (i.e. crystals).
......@@ -41,11 +41,11 @@ BCLK = LRC * x
BCLK = LRC * Channels * Word Size
This relationship depends on the codec or SoC CPU in particular. In general
it's best to configure BCLK to the lowest possible speed (depending on your
rate, number of channels and wordsize) to save on power.
it is best to configure BCLK to the lowest possible speed (depending on your
rate, number of channels and word size) to save on power.
It's also desirable to use the codec (if possible) to drive (or master) the
audio clocks as it's usually gives more accurate sample rates than the CPU.
It is also desirable to use the codec (if possible) to drive (or master) the
audio clocks as it usually gives more accurate sample rates than the CPU.
......@@ -9,7 +9,7 @@ code should be added to the platform and machine drivers respectively.
Each codec driver *must* provide the following features:-
1) Codec DAI and PCM configuration
2) Codec control IO - using I2C, 3 Wire(SPI) or both API's
2) Codec control IO - using I2C, 3 Wire(SPI) or both APIs
3) Mixers and audio controls
4) Codec audio operations
......@@ -19,7 +19,7 @@ Optionally, codec drivers can also provide:-
6) DAPM event handler.
7) DAC Digital mute control.
It's probably best to use this guide in conjunction with the existing codec
Its probably best to use this guide in conjunction with the existing codec
driver code in sound/soc/codecs/
ASoC Codec driver breakdown
......@@ -27,8 +27,8 @@ ASoC Codec driver breakdown
1 - Codec DAI and PCM configuration
-----------------------------------
Each codec driver must have a struct snd_soc_codec_dai to define it's DAI and
PCM's capabilities and operations. This struct is exported so that it can be
Each codec driver must have a struct snd_soc_codec_dai to define its DAI and
PCM capabilities and operations. This struct is exported so that it can be
registered with the core by your machine driver.
e.g.
......@@ -67,18 +67,18 @@ EXPORT_SYMBOL_GPL(wm8731_dai);
2 - Codec control IO
--------------------
The codec can usually be controlled via an I2C or SPI style interface (AC97
combines control with data in the DAI). The codec drivers will have to provide
functions to read and write the codec registers along with supplying a register
cache:-
The codec can usually be controlled via an I2C or SPI style interface
(AC97 combines control with data in the DAI). The codec drivers provide
functions to read and write the codec registers along with supplying a
register cache:-
/* IO control data and register cache */
void *control_data; /* codec control (i2c/3wire) data */
void *reg_cache;
void *control_data; /* codec control (i2c/3wire) data */
void *reg_cache;
Codec read/write should do any data formatting and call the hardware read write
below to perform the IO. These functions are called by the core and alsa when
performing DAPM or changing the mixer:-
Codec read/write should do any data formatting and call the hardware
read write below to perform the IO. These functions are called by the
core and ALSA when performing DAPM or changing the mixer:-
unsigned int (*read)(struct snd_soc_codec *, unsigned int);
int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
......@@ -131,7 +131,7 @@ Defines a stereo enumerated control
4 - Codec Audio Operations
--------------------------
The codec driver also supports the following alsa operations:-
The codec driver also supports the following ALSA operations:-
/* SoC audio ops */
struct snd_soc_ops {
......@@ -142,15 +142,15 @@ struct snd_soc_ops {
int (*prepare)(struct snd_pcm_substream *);
};
Please refer to the alsa driver PCM documentation for details.
Please refer to the ALSA driver PCM documentation for details.
http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm
5 - DAPM description.
---------------------
The Dynamic Audio Power Management description describes the codec's power
components, their relationships and registers to the ASoC core. Please read
dapm.txt for details of building the description.
The Dynamic Audio Power Management description describes the codec power
components and their relationships and registers to the ASoC core.
Please read dapm.txt for details of building the description.
Please also see the examples in other codec drivers.
......@@ -158,8 +158,8 @@ Please also see the examples in other codec drivers.
6 - DAPM event handler
----------------------
This function is a callback that handles codec domain PM calls and system
domain PM calls (e.g. suspend and resume). It's used to put the codec to sleep
when not in use.
domain PM calls (e.g. suspend and resume). It is used to put the codec
to sleep when not in use.
Power states:-
......@@ -175,13 +175,14 @@ Power states:-
SNDRV_CTL_POWER_D3cold: /* Everything Off, without power */
7 - Codec DAC digital mute control.
------------------------------------
Most codecs have a digital mute before the DAC's that can be used to minimise
any system noise. The mute stops any digital data from entering the DAC.
7 - Codec DAC digital mute control
----------------------------------
Most codecs have a digital mute before the DACs that can be used to
minimise any system noise. The mute stops any digital data from
entering the DAC.
A callback can be created that is called by the core for each codec DAI when the
mute is applied or freed.
A callback can be created that is called by the core for each codec DAI
when the mute is applied or freed.
i.e.
......
......@@ -4,20 +4,20 @@ Dynamic Audio Power Management for Portable Devices
1. Description
==============
Dynamic Audio Power Management (DAPM) is designed to allow portable Linux devices
to use the minimum amount of power within the audio subsystem at all times. It
is independent of other kernel PM and as such, can easily co-exist with the
other PM systems.
Dynamic Audio Power Management (DAPM) is designed to allow portable
Linux devices to use the minimum amount of power within the audio
subsystem at all times. It is independent of other kernel PM and as
such, can easily co-exist with the other PM systems.
DAPM is also completely transparent to all user space applications as all power
switching is done within the ASoC core. No code changes or recompiling are
required for user space applications. DAPM makes power switching decisions based
upon any audio stream (capture/playback) activity and audio mixer settings
within the device.
DAPM is also completely transparent to all user space applications as
all power switching is done within the ASoC core. No code changes or
recompiling are required for user space applications. DAPM makes power
switching decisions based upon any audio stream (capture/playback)
activity and audio mixer settings within the device.
DAPM spans the whole machine. It covers power control within the entire audio
subsystem, this includes internal codec power blocks and machine level power
systems.
DAPM spans the whole machine. It covers power control within the entire
audio subsystem, this includes internal codec power blocks and machine
level power systems.
There are 4 power domains within DAPM
......@@ -34,7 +34,7 @@ There are 4 power domains within DAPM
Automatically set when mixer and mux settings are changed by the user.
e.g. alsamixer, amixer.
4. Stream domain - DAC's and ADC's.
4. Stream domain - DACs and ADCs.
Enabled and disabled when stream playback/capture is started and
stopped respectively. e.g. aplay, arecord.
......@@ -51,7 +51,7 @@ widgets hereafter.
Audio DAPM widgets fall into a number of types:-
o Mixer - Mixes several analog signals into a single analog signal.
o Mux - An analog switch that outputs only 1 of it's inputs.
o Mux - An analog switch that outputs only one of many inputs.
o PGA - A programmable gain amplifier or attenuation widget.
o ADC - Analog to Digital Converter
o DAC - Digital to Analog Converter
......@@ -78,14 +78,14 @@ parameters for stream name and kcontrols.
2.1 Stream Domain Widgets
-------------------------
Stream Widgets relate to the stream power domain and only consist of ADC's
(analog to digital converters) and DAC's (digital to analog converters).
Stream Widgets relate to the stream power domain and only consist of ADCs
(analog to digital converters) and DACs (digital to analog converters).
Stream widgets have the following format:-
SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert),
NOTE: the stream name must match the corresponding stream name in your codecs
NOTE: the stream name must match the corresponding stream name in your codec
snd_soc_codec_dai.
e.g. stream widgets for HiFi playback and capture
......@@ -97,7 +97,7 @@ SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1),
2.2 Path Domain Widgets
-----------------------
Path domain widgets have a ability to control or effect the audio signal or
Path domain widgets have a ability to control or affect the audio signal or
audio paths within the audio subsystem. They have the following form:-
SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls)
......@@ -149,7 +149,7 @@ SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias),
2.4 Codec Domain
----------------
The Codec power domain has no widgets and is handled by the codecs DAPM event
The codec power domain has no widgets and is handled by the codecs DAPM event
handler. This handler is called when the codec powerstate is changed wrt to any
stream event or by kernel PM events.
......@@ -158,8 +158,8 @@ stream event or by kernel PM events.
-------------------
Sometimes widgets exist in the codec or machine audio map that don't have any
corresponding register bit for power control. In this case it's necessary to
create a virtual widget - a widget with no control bits e.g.
corresponding soft power control. In this case it is necessary to create
a virtual widget - a widget with no control bits e.g.
SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0),
......@@ -172,13 +172,14 @@ subsystem individually with a call to snd_soc_dapm_new_control().
3. Codec Widget Interconnections
================================
Widgets are connected to each other within the codec and machine by audio
paths (called interconnections). Each interconnection must be defined in order
to create a map of all audio paths between widgets.
Widgets are connected to each other within the codec and machine by audio paths
(called interconnections). Each interconnection must be defined in order to
create a map of all audio paths between widgets.
This is easiest with a diagram of the codec (and schematic of the machine audio
system), as it requires joining widgets together via their audio signal paths.
i.e. from the WM8731 codec's output mixer (wm8731.c)
e.g., from the WM8731 output mixer (wm8731.c)
The WM8731 output mixer has 3 inputs (sources)
......
......@@ -16,7 +16,7 @@ struct snd_soc_machine {
int (*remove)(struct platform_device *pdev);
/* the pre and post PM functions are used to do any PM work before and
* after the codec and DAI's do any PM work. */
* after the codec and DAIs do any PM work. */
int (*suspend_pre)(struct platform_device *pdev, pm_message_t state);
int (*suspend_post)(struct platform_device *pdev, pm_message_t state);
int (*resume_pre)(struct platform_device *pdev);
......@@ -38,7 +38,7 @@ probe/remove are optional. Do any machine specific probe here.
suspend()/resume()
------------------
The machine driver has pre and post versions of suspend and resume to take care
of any machine audio tasks that have to be done before or after the codec, DAI's
of any machine audio tasks that have to be done before or after the codec, DAIs
and DMA is suspended and resumed. Optional.
......@@ -49,10 +49,10 @@ The machine specific audio operations can be set here. Again this is optional.
Machine DAI Configuration
-------------------------
The machine DAI configuration glues all the codec and CPU DAI's together. It can
The machine DAI configuration glues all the codec and CPU DAIs together. It can
also be used to set up the DAI system clock and for any machine related DAI
initialisation e.g. the machine audio map can be connected to the codec audio
map, unconnnected codec pins can be set as such. Please see corgi.c, spitz.c
map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c
for examples.
struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
......@@ -67,7 +67,7 @@ static struct snd_soc_dai_link corgi_dai = {
.ops = &corgi_ops,
};
struct snd_soc_machine then sets up the machine with it's DAI's. e.g.
struct snd_soc_machine then sets up the machine with it's DAIs. e.g.
/* corgi audio machine driver */
static struct snd_soc_machine snd_soc_machine_corgi = {
......@@ -110,4 +110,4 @@ details.
Machine Controls
----------------
Machine specific audio mixer controls can be added in the dai init function.
\ No newline at end of file
Machine specific audio mixer controls can be added in the DAI init function.
ALSA SoC Layer
==============
The overall project goal of the ALSA System on Chip (ASoC) layer is to provide
better ALSA support for embedded system-on-chip processors (e.g. pxa2xx, au1x00,
iMX, etc) and portable audio codecs. Currently there is some support in the
kernel for SoC audio, however it has some limitations:-
The overall project goal of the ALSA System on Chip (ASoC) layer is to
provide better ALSA support for embedded system-on-chip processors (e.g.
pxa2xx, au1x00, iMX, etc) and portable audio codecs. Prior to the ASoC
subsystem there was some support in the kernel for SoC audio, however it
had some limitations:-
* Currently, codec drivers are often tightly coupled to the underlying SoC
CPU. This is not ideal and leads to code duplication i.e. Linux now has 4
different wm8731 drivers for 4 different SoC platforms.
* Codec drivers were often tightly coupled to the underlying SoC
CPU. This is not ideal and leads to code duplication - for example,
Linux had different wm8731 drivers for 4 different SoC platforms.
* There is no standard method to signal user initiated audio events (e.g.
* There was no standard method to signal user initiated audio events (e.g.
Headphone/Mic insertion, Headphone/Mic detection after an insertion
event). These are quite common events on portable devices and often require
machine specific code to re-route audio, enable amps, etc., after such an
event.
* Current drivers tend to power up the entire codec when playing
(or recording) audio. This is fine for a PC, but tends to waste a lot of
power on portable devices. There is also no support for saving power via
changing codec oversampling rates, bias currents, etc.
* Drivers tended to power up the entire codec when playing (or
recording) audio. This is fine for a PC, but tends to waste a lot of
power on portable devices. There was also no support for saving
power via changing codec oversampling rates, bias currents, etc.
ASoC Design
......@@ -31,12 +32,13 @@ features :-
* Codec independence. Allows reuse of codec drivers on other platforms
and machines.
* Easy I2S/PCM audio interface setup between codec and SoC. Each SoC interface
and codec registers it's audio interface capabilities with the core and are
subsequently matched and configured when the application hw params are known.
* Easy I2S/PCM audio interface setup between codec and SoC. Each SoC
interface and codec registers it's audio interface capabilities with the
core and are subsequently matched and configured when the application
hardware parameters are known.
* Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to
it's minimum power state at all times. This includes powering up/down
its minimum power state at all times. This includes powering up/down
internal power blocks depending on the internal codec audio routing and any
active streams.
......@@ -45,16 +47,16 @@ features :-
signals the codec when to change power states.
* Machine specific controls: Allow machines to add controls to the sound card
(e.g. volume control for speaker amp).
(e.g. volume control for speaker amplifier).
To achieve all this, ASoC basically splits an embedded audio system into 3
components :-
* Codec driver: The codec driver is platform independent and contains audio
controls, audio interface capabilities, codec dapm definition and codec IO
controls, audio interface capabilities, codec DAPM definition and codec IO
functions.
* Platform driver: The platform driver contains the audio dma engine and audio
* Platform driver: The platform driver contains the audio DMA engine and audio
interface drivers (e.g. I2S, AC97, PCM) for that platform.
* Machine driver: The machine driver handles any machine specific controls and
......@@ -81,4 +83,4 @@ machine.txt: Machine driver internals.
pop_clicks.txt: How to minimise audio artifacts.
clocking.txt: ASoC clocking for best power performance.
\ No newline at end of file
clocking.txt: ASoC clocking for best power performance.
......@@ -8,7 +8,7 @@ specific code.
Audio DMA
=========
The platform DMA driver optionally supports the following alsa operations:-
The platform DMA driver optionally supports the following ALSA operations:-
/* SoC audio ops */
struct snd_soc_ops {
......@@ -38,7 +38,7 @@ struct snd_soc_platform {
struct snd_pcm_ops *pcm_ops;
};
Please refer to the alsa driver documentation for details of audio DMA.
Please refer to the ALSA driver documentation for details of audio DMA.
http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c436.htm
An example DMA driver is soc/pxa/pxa2xx-pcm.c
......@@ -52,7 +52,7 @@ Each SoC DAI driver must provide the following features:-
1) Digital audio interface (DAI) description
2) Digital audio interface configuration
3) PCM's description
4) Sysclk configuration
4) SYSCLK configuration
5) Suspend and resume (optional)
Please see codec.txt for a description of items 1 - 4.
......@@ -15,11 +15,11 @@ click every time a component power state is changed.
Minimising Playback Pops and Clicks
===================================
Playback pops in portable audio subsystems cannot be completely eliminated atm,
however future audio codec hardware will have better pop and click suppression.
Pops can be reduced within playback by powering the audio components in a
specific order. This order is different for startup and shutdown and follows
some basic rules:-
Playback pops in portable audio subsystems cannot be completely eliminated
currently, however future audio codec hardware will have better pop and click
suppression. Pops can be reduced within playback by powering the audio
components in a specific order. This order is different for startup and
shutdown and follows some basic rules:-
Startup Order :- DAC --> Mixers --> Output PGA --> Digital Unmute
......
......@@ -3571,6 +3571,9 @@ S: Maintained
SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT
P: Liam Girdwood
M: liam.girdwood@wolfsonmicro.com
P: Mark Brown
M: broonie@opensource.wolfsonmicro.com
T: git opensource.wolfsonmicro.com/linux-2.6-asoc
L: alsa-devel@alsa-project.org (subscribers-only)
S: Supported
......
......@@ -27,7 +27,6 @@
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/ac97_codec.h>
......
......@@ -33,7 +33,6 @@
#include <linux/pci.h>
#include <asm/delay.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
......
......@@ -21,7 +21,6 @@
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/module.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
......
......@@ -38,7 +38,6 @@
#include <media/ir-common.h>
#include <media/ir-kbd-i2c.h>
#include <media/videobuf-dma-sg.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE)
......
......@@ -24,7 +24,6 @@
#include <linux/utsname.h>
#include <linux/device.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
......
......@@ -31,7 +31,6 @@
#include <asm/arch/hardware.h>
#include <asm/irq.h>
#include <sound/driver.h>
#include <sound/core.h>
/* master codec clock source */
......
......@@ -40,7 +40,6 @@
#ifndef __OMAP_ALSA_H
#define __OMAP_ALSA_H
#include <sound/driver.h>
#include <asm/arch/dma.h>
#include <sound/core.h>
#include <sound/pcm.h>
......
#ifndef __ASM_ARCH_AUDIO_H__
#define __ASM_ARCH_AUDIO_H__
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
......
......@@ -48,7 +48,7 @@
#define AD1848_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
#define AD1848_PIN_CTRL 0x0a /* pin control */
#define AD1848_TEST_INIT 0x0b /* test and initialization */
#define AD1848_MISC_INFO 0x0c /* miscellaneaous information */
#define AD1848_MISC_INFO 0x0c /* miscellaneous information */
#define AD1848_LOOPBACK 0x0d /* loopback control */
#define AD1848_DATA_UPR_CNT 0x0e /* playback/capture upper base count */
#define AD1848_DATA_LWR_CNT 0x0f /* playback/capture lower base count */
......
/*
* Advanced Linux Sound Architecture
*
* FM (OPL2/3) Instrument Format
* Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SOUND_AINSTR_FM_H
#define __SOUND_AINSTR_FM_H
#ifndef __KERNEL__
#include <asm/types.h>
#include <asm/byteorder.h>
#endif
/*
* share types (share ID 1)
*/
#define FM_SHARE_FILE 0
/*
* FM operator
*/
struct fm_operator {
unsigned char am_vib;
unsigned char ksl_level;
unsigned char attack_decay;
unsigned char sustain_release;
unsigned char wave_select;
};
/*
* Instrument
*/
#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
struct fm_instrument {
unsigned int share_id[4]; /* share id - zero = no sharing */
unsigned char type; /* instrument type */
struct fm_operator op[4];
unsigned char feedback_connection[2];
unsigned char echo_delay;
unsigned char echo_atten;
unsigned char chorus_spread;
unsigned char trnsps;
unsigned char fix_dur;
unsigned char modes;
unsigned char fix_key;
};
/*
*
* Kernel <-> user space
* Hardware (CPU) independent section
*
* * = zero or more
* + = one or more
*
* fm_xinstrument FM_STRU_INSTR
*
*/
#define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
/*
* FM operator
*/
struct fm_xoperator {
__u8 am_vib;
__u8 ksl_level;
__u8 attack_decay;
__u8 sustain_release;
__u8 wave_select;
};
/*
* Instrument
*/
struct fm_xinstrument {
__u32 stype; /* structure type */
__u32 share_id[4]; /* share id - zero = no sharing */
__u8 type; /* instrument type */
struct fm_xoperator op[4]; /* fm operators */
__u8 feedback_connection[2];
__u8 echo_delay;
__u8 echo_atten;
__u8 chorus_spread;
__u8 trnsps;
__u8 fix_dur;
__u8 modes;
__u8 fix_key;
};
#ifdef __KERNEL__
#include "seq_instr.h"
int snd_seq_fm_init(struct snd_seq_kinstr_ops * ops,
struct snd_seq_kinstr_ops * next);
#endif
/* typedefs for compatibility to user-space */
typedef struct fm_xoperator fm_xoperator_t;
typedef struct fm_xinstrument fm_xinstrument_t;
#endif /* __SOUND_AINSTR_FM_H */
/*
* Advanced Linux Sound Architecture
*
* GF1 (GUS) Patch Instrument Format
* Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SOUND_AINSTR_GF1_H
#define __SOUND_AINSTR_GF1_H
#ifndef __KERNEL__
#include <asm/types.h>
#include <asm/byteorder.h>
#endif
/*
* share types (share ID 1)
*/
#define GF1_SHARE_FILE 0
/*
* wave formats
*/
#define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */
#define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */
#define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */
#define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
#define GF1_WAVE_LOOP 0x0008 /* loop mode */
#define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */
#define GF1_WAVE_STEREO 0x0100 /* stereo mode */
#define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */
/*
* Wavetable definitions
*/
struct gf1_wave {
unsigned int share_id[4]; /* share id - zero = no sharing */
unsigned int format; /* wave format */
struct {
unsigned int number; /* some other ID for this instrument */
unsigned int memory; /* begin of waveform in onboard memory */
unsigned char *ptr; /* pointer to waveform in system memory */
} address;
unsigned int size; /* size of waveform in samples */
unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned short loop_repeat; /* loop repeat - 0 = forever */
unsigned char flags; /* GF1 patch flags */
unsigned char pad;
unsigned int sample_rate; /* sample rate in Hz */
unsigned int low_frequency; /* low frequency range */
unsigned int high_frequency; /* high frequency range */
unsigned int root_frequency; /* root frequency range */
signed short tune;
unsigned char balance;
unsigned char envelope_rate[6];
unsigned char envelope_offset[6];
unsigned char tremolo_sweep;
unsigned char tremolo_rate;
unsigned char tremolo_depth;
unsigned char vibrato_sweep;
unsigned char vibrato_rate;
unsigned char vibrato_depth;
unsigned short scale_frequency;
unsigned short scale_factor; /* 0-2048 or 0-2 */
struct gf1_wave *next;
};
/*
* Instrument
*/
#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
#define IWFFFF_EFFECT_NONE 0
#define IWFFFF_EFFECT_REVERB 1
#define IWFFFF_EFFECT_CHORUS 2
#define IWFFFF_EFFECT_ECHO 3
struct gf1_instrument {
unsigned short exclusion;
unsigned short exclusion_group; /* 0 - none, 1-65535 */
unsigned char effect1; /* effect 1 */
unsigned char effect1_depth; /* 0-127 */
unsigned char effect2; /* effect 2 */
unsigned char effect2_depth; /* 0-127 */
struct gf1_wave *wave; /* first waveform */
};
/*
*
* Kernel <-> user space
* Hardware (CPU) independent section
*
* * = zero or more
* + = one or more
*
* gf1_xinstrument IWFFFF_STRU_INSTR
* +gf1_xwave IWFFFF_STRU_WAVE
*
*/
#define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
#define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
/*
* Wavetable definitions
*/
struct gf1_xwave {
__u32 stype; /* structure type */
__u32 share_id[4]; /* share id - zero = no sharing */
__u32 format; /* wave format */
__u32 size; /* size of waveform in samples */
__u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u16 loop_repeat; /* loop repeat - 0 = forever */
__u8 flags; /* GF1 patch flags */
__u8 pad;
__u32 sample_rate; /* sample rate in Hz */
__u32 low_frequency; /* low frequency range */
__u32 high_frequency; /* high frequency range */
__u32 root_frequency; /* root frequency range */
__s16 tune;
__u8 balance;
__u8 envelope_rate[6];
__u8 envelope_offset[6];
__u8 tremolo_sweep;
__u8 tremolo_rate;
__u8 tremolo_depth;
__u8 vibrato_sweep;
__u8 vibrato_rate;
__u8 vibrato_depth;
__u16 scale_frequency;
__u16 scale_factor; /* 0-2048 or 0-2 */
};
/*
* Instrument
*/
struct gf1_xinstrument {
__u32 stype;
__u16 exclusion;
__u16 exclusion_group; /* 0 - none, 1-65535 */
__u8 effect1; /* effect 1 */
__u8 effect1_depth; /* 0-127 */
__u8 effect2; /* effect 2 */
__u8 effect2_depth; /* 0-127 */
};
/*
* Instrument info
*/
#define GF1_INFO_ENVELOPE (1<<0)
#define GF1_INFO_TREMOLO (1<<1)
#define GF1_INFO_VIBRATO (1<<2)
struct gf1_info {
unsigned char flags; /* supported wave flags */
unsigned char pad[3];
unsigned int features; /* supported features */
unsigned int max8_len; /* maximum 8-bit wave length */
unsigned int max16_len; /* maximum 16-bit wave length */
};
#ifdef __KERNEL__
#include "seq_instr.h"
struct snd_gf1_ops {
void *private_data;
int (*info)(void *private_data, struct gf1_info *info);
int (*put_sample)(void *private_data, struct gf1_wave *wave,
char __user *data, long len, int atomic);
int (*get_sample)(void *private_data, struct gf1_wave *wave,
char __user *data, long len, int atomic);
int (*remove_sample)(void *private_data, struct gf1_wave *wave,
int atomic);
void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
struct snd_seq_kinstr_ops kops;
};
int snd_seq_gf1_init(struct snd_gf1_ops *ops,
void *private_data,
struct snd_seq_kinstr_ops *next);
#endif
/* typedefs for compatibility to user-space */
typedef struct gf1_xwave gf1_xwave_t;
typedef struct gf1_xinstrument gf1_xinstrument_t;
#endif /* __SOUND_AINSTR_GF1_H */
/*
* Advanced Linux Sound Architecture
*
* InterWave FFFF Instrument Format
* Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SOUND_AINSTR_IW_H
#define __SOUND_AINSTR_IW_H
#ifndef __KERNEL__
#include <asm/types.h>
#include <asm/byteorder.h>
#endif
/*
* share types (share ID 1)
*/
#define IWFFFF_SHARE_FILE 0
/*
* wave formats
*/
#define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */
#define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */
#define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */
#define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
#define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */
#define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */
#define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */
#define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */
#define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */
#define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */
/*
* Wavetable definitions
*/
struct iwffff_wave {
unsigned int share_id[4]; /* share id - zero = no sharing */
unsigned int format; /* wave format */
struct {
unsigned int number; /* some other ID for this wave */
unsigned int memory; /* begin of waveform in onboard memory */
unsigned char *ptr; /* pointer to waveform in system memory */
} address;
unsigned int size; /* size of waveform in samples */
unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned short loop_repeat; /* loop repeat - 0 = forever */
unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */
unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */
unsigned char low_note; /* lower frequency range for this waveform */
unsigned char high_note; /* higher frequency range for this waveform */
unsigned char pad;
struct iwffff_wave *next;
};
/*
* Layer
*/
#define IWFFFF_LFO_SHAPE_TRIANGLE 0
#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1
struct iwffff_lfo {
unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */
signed short depth; /* volume +- (0-255) 0.48675dB/step */
signed short sweep; /* 0 - 950 deciseconds */
unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */
unsigned char delay; /* 0 - 255 deciseconds */
};
#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */
#define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */
#define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */
#define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */
#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */
#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */
struct iwffff_env_point {
unsigned short offset;
unsigned short rate;
};
struct iwffff_env_record {
unsigned short nattack;
unsigned short nrelease;
unsigned short sustain_offset;
unsigned short sustain_rate;
unsigned short release_rate;
unsigned char hirange;
unsigned char pad;
struct iwffff_env_record *next;
/* points are stored here */
/* count of points = nattack + nrelease */
};
struct iwffff_env {
unsigned char flags;
unsigned char mode;
unsigned char index;
unsigned char pad;
struct iwffff_env_record *record;
};
#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */
#define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */
#define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */
#define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */
#define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */
#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */
#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */
struct iwffff_layer {
unsigned char flags;
unsigned char velocity_mode;
unsigned char layer_event;
unsigned char low_range; /* range for layer based */
unsigned char high_range; /* on either velocity or frequency */
unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */
unsigned char pan_freq_scale; /* position based on frequency (0-127) */
unsigned char attenuation; /* 0-127 (no corresponding midi controller) */
struct iwffff_lfo tremolo; /* tremolo effect */
struct iwffff_lfo vibrato; /* vibrato effect */
unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
unsigned char freq_center; /* center for keyboard frequency scaling */
unsigned char pad;
struct iwffff_env penv; /* pitch envelope */
struct iwffff_env venv; /* volume envelope */
struct iwffff_wave *wave;
struct iwffff_layer *next;
};
/*
* Instrument
*/
#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
#define IWFFFF_LAYER_NONE 0x0000 /* not layered */
#define IWFFFF_LAYER_ON 0x0001 /* layered */
#define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */
#define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */
#define IWFFFF_EFFECT_NONE 0
#define IWFFFF_EFFECT_REVERB 1
#define IWFFFF_EFFECT_CHORUS 2
#define IWFFFF_EFFECT_ECHO 3
struct iwffff_instrument {
unsigned short exclusion;
unsigned short layer_type;
unsigned short exclusion_group; /* 0 - none, 1-65535 */
unsigned char effect1; /* effect 1 */
unsigned char effect1_depth; /* 0-127 */
unsigned char effect2; /* effect 2 */
unsigned char effect2_depth; /* 0-127 */
struct iwffff_layer *layer; /* first layer */
};
/*
*
* Kernel <-> user space
* Hardware (CPU) independent section
*
* * = zero or more
* + = one or more
*
* iwffff_xinstrument IWFFFF_STRU_INSTR
* +iwffff_xlayer IWFFFF_STRU_LAYER
* *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo)
* *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato)
* +iwffff_xwave IWFFFF_STRU_WAVE
*
*/
#define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
#define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P')
#define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V')
#define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R')
#define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
/*
* Wavetable definitions
*/
struct iwffff_xwave {
__u32 stype; /* structure type */
__u32 share_id[4]; /* share id - zero = no sharing */
__u32 format; /* wave format */
__u32 offset; /* offset to ROM (address) */
__u32 size; /* size of waveform in samples */
__u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u16 loop_repeat; /* loop repeat - 0 = forever */
__u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */
__u8 attenuation; /* 0 - 127 (no corresponding midi controller) */
__u8 low_note; /* lower frequency range for this waveform */
__u8 high_note; /* higher frequency range for this waveform */
__u8 pad;
};
/*
* Layer
*/
struct iwffff_xlfo {
__u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */
__s16 depth; /* volume +- (0-255) 0.48675dB/step */
__s16 sweep; /* 0 - 950 deciseconds */
__u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */
__u8 delay; /* 0 - 255 deciseconds */
};
struct iwffff_xenv_point {
__u16 offset;
__u16 rate;
};
struct iwffff_xenv_record {
__u32 stype;
__u16 nattack;
__u16 nrelease;
__u16 sustain_offset;
__u16 sustain_rate;
__u16 release_rate;
__u8 hirange;
__u8 pad;
/* points are stored here.. */
/* count of points = nattack + nrelease */
};
struct iwffff_xenv {
__u8 flags;
__u8 mode;
__u8 index;
__u8 pad;
};
struct iwffff_xlayer {
__u32 stype;
__u8 flags;
__u8 velocity_mode;
__u8 layer_event;
__u8 low_range; /* range for layer based */
__u8 high_range; /* on either velocity or frequency */
__u8 pan; /* pan offset from CC1 (0 left - 127 right) */
__u8 pan_freq_scale; /* position based on frequency (0-127) */
__u8 attenuation; /* 0-127 (no corresponding midi controller) */
struct iwffff_xlfo tremolo; /* tremolo effect */
struct iwffff_xlfo vibrato; /* vibrato effect */
__u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
__u8 freq_center; /* center for keyboard frequency scaling */
__u8 pad;
struct iwffff_xenv penv; /* pitch envelope */
struct iwffff_xenv venv; /* volume envelope */
};
/*
* Instrument
*/
struct iwffff_xinstrument {
__u32 stype;
__u16 exclusion;
__u16 layer_type;
__u16 exclusion_group; /* 0 - none, 1-65535 */
__u8 effect1; /* effect 1 */
__u8 effect1_depth; /* 0-127 */
__u8 effect2; /* effect 2 */
__u8 effect2_depth; /* 0-127 */
};
/*
* ROM support
* InterWave ROMs are Little-Endian (x86)
*/
#define IWFFFF_ROM_HDR_SIZE 512
struct iwffff_rom_header {
__u8 iwave[8];
__u8 revision;
__u8 series_number;
__u8 series_name[16];
__u8 date[10];
__u16 vendor_revision_major;
__u16 vendor_revision_minor;
__u32 rom_size;
__u8 copyright[128];
__u8 vendor_name[64];
__u8 description[128];
};
/*
* Instrument info
*/
#define IWFFFF_INFO_LFO_VIBRATO (1<<0)
#define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1)
#define IWFFFF_INFO_LFO_TREMOLO (1<<2)
#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3)
struct iwffff_info {
unsigned int format; /* supported format bits */
unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */
unsigned int lfos; /* LFO effects */
unsigned int max8_len; /* maximum 8-bit wave length */
unsigned int max16_len; /* maximum 16-bit wave length */
};
#ifdef __KERNEL__
#include "seq_instr.h"
struct snd_iwffff_ops {
void *private_data;
int (*info)(void *private_data, struct iwffff_info *info);
int (*put_sample)(void *private_data, struct iwffff_wave *wave,
char __user *data, long len, int atomic);
int (*get_sample)(void *private_data, struct iwffff_wave *wave,
char __user *data, long len, int atomic);
int (*remove_sample)(void *private_data, struct iwffff_wave *wave,
int atomic);
void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
struct snd_seq_kinstr_ops kops;
};
int snd_seq_iwffff_init(struct snd_iwffff_ops *ops,
void *private_data,
struct snd_seq_kinstr_ops *next);
#endif
/* typedefs for compatibility to user-space */
typedef struct iwffff_xwave iwffff_xwave_t;
typedef struct iwffff_xlfo iwffff_xlfo_t;
typedef struct iwffff_xenv_point iwffff_xenv_point_t;
typedef struct iwffff_xenv_record iwffff_xenv_record_t;
typedef struct iwffff_xenv iwffff_xenv_t;
typedef struct iwffff_xlayer iwffff_xlayer_t;
typedef struct iwffff_xinstrument iwffff_xinstrument_t;
typedef struct iwffff_rom_header iwffff_rom_header_t;
typedef struct iwffff_info iwffff_info_t;
#endif /* __SOUND_AINSTR_IW_H */
/*
* Advanced Linux Sound Architecture
*
* Simple (MOD player) Instrument Format
* Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SOUND_AINSTR_SIMPLE_H
#define __SOUND_AINSTR_SIMPLE_H
#ifndef __KERNEL__
#include <asm/types.h>
#include <asm/byteorder.h>
#endif
/*
* share types (share ID 1)
*/
#define SIMPLE_SHARE_FILE 0
/*
* wave formats
*/
#define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */
#define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */
#define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */
#define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
#define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */
#define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */
#define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */
#define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */
/*
* instrument effects
*/
#define SIMPLE_EFFECT_NONE 0
#define SIMPLE_EFFECT_REVERB 1
#define SIMPLE_EFFECT_CHORUS 2
#define SIMPLE_EFFECT_ECHO 3
/*
* instrument info
*/
struct simple_instrument_info {
unsigned int format; /* supported format bits */
unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */
unsigned int max8_len; /* maximum 8-bit wave length */
unsigned int max16_len; /* maximum 16-bit wave length */
};
/*
* Instrument
*/
struct simple_instrument {
unsigned int share_id[4]; /* share id - zero = no sharing */
unsigned int format; /* wave format */
struct {
unsigned int number; /* some other ID for this instrument */
unsigned int memory; /* begin of waveform in onboard memory */
unsigned char *ptr; /* pointer to waveform in system memory */
} address;
unsigned int size; /* size of waveform in samples */
unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */
unsigned short loop_repeat; /* loop repeat - 0 = forever */
unsigned char effect1; /* effect 1 */
unsigned char effect1_depth; /* 0-127 */
unsigned char effect2; /* effect 2 */
unsigned char effect2_depth; /* 0-127 */
};
/*
*
* Kernel <-> user space
* Hardware (CPU) independent section
*
* * = zero or more
* + = one or more
*
* simple_xinstrument SIMPLE_STRU_INSTR
*
*/
#define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
/*
* Instrument
*/
struct simple_xinstrument {
__u32 stype;
__u32 share_id[4]; /* share id - zero = no sharing */
__u32 format; /* wave format */
__u32 size; /* size of waveform in samples */
__u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
__u16 loop_repeat; /* loop repeat - 0 = forever */
__u8 effect1; /* effect 1 */
__u8 effect1_depth; /* 0-127 */
__u8 effect2; /* effect 2 */
__u8 effect2_depth; /* 0-127 */
};
#ifdef __KERNEL__
#include "seq_instr.h"
struct snd_simple_ops {
void *private_data;
int (*info)(void *private_data, struct simple_instrument_info *info);
int (*put_sample)(void *private_data, struct simple_instrument *instr,
char __user *data, long len, int atomic);
int (*get_sample)(void *private_data, struct simple_instrument *instr,
char __user *data, long len, int atomic);
int (*remove_sample)(void *private_data, struct simple_instrument *instr,
int atomic);
void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
struct snd_seq_kinstr_ops kops;
};
int snd_seq_simple_init(struct snd_simple_ops *ops,
void *private_data,
struct snd_seq_kinstr_ops *next);
#endif
/* typedefs for compatibility to user-space */
typedef struct simple_xinstrument simple_xinstrument_t;
#endif /* __SOUND_AINSTR_SIMPLE_H */
......@@ -68,7 +68,7 @@ struct snd_akm4xxx {
enum {
SND_AK4524, SND_AK4528, SND_AK4529,
SND_AK4355, SND_AK4358, SND_AK4381,
SND_AK5365
SND_AK5365, NON_AKM
} type;
/* (array) information of combined codecs */
......
......@@ -110,18 +110,7 @@
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
/** synthesizer events
* event data type = snd_seq_eve_sample_control
*/
#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
#define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */
#define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */
#define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */
#define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */
#define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */
#define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */
#define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */
/* 70-89: synthesizer events - obsoleted */
/** user-defined events with fixed length
* event data type = any
......@@ -137,28 +126,7 @@
#define SNDRV_SEQ_EVENT_USR8 98
#define SNDRV_SEQ_EVENT_USR9 99
/** instrument layer
* variable length data can be passed directly to the driver
*/
#define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */
#define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */
#define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */
#define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */
#define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */
#define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */
#define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */
#define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */
#define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */
#define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */
#define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */
#define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */
#define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */
#define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */
#define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */
#define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */
/* 100-118: instrument layer - obsoleted */
/* 119-129: reserved */
/* 130-139: variable length events
......@@ -258,78 +226,6 @@ struct snd_seq_ev_ext {
void *ptr; /* pointer to data (note: maybe 64-bit) */
} __attribute__((packed));
/* Instrument cluster type */
typedef unsigned int snd_seq_instr_cluster_t;
/* Instrument type */
struct snd_seq_instr {
snd_seq_instr_cluster_t cluster;
unsigned int std; /* the upper byte means a private instrument (owner - client #) */
unsigned short bank;
unsigned short prg;
};
/* sample number */
struct snd_seq_ev_sample {
unsigned int std;
unsigned short bank;
unsigned short prg;
};
/* sample cluster */
struct snd_seq_ev_cluster {
snd_seq_instr_cluster_t cluster;
};
/* sample position */
typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */
/* sample stop mode */
enum {
SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
};
/* sample frequency */
typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */
/* sample volume control; if any value is set to -1 == do not change */
struct snd_seq_ev_volume {
signed short volume; /* range: 0-16383 */
signed short lr; /* left-right balance; range: 0-16383 */
signed short fr; /* front-rear balance; range: 0-16383 */
signed short du; /* down-up balance; range: 0-16383 */
};
/* simple loop redefinition */
struct snd_seq_ev_loop {
unsigned int start; /* loop start (in samples) * 16 */
unsigned int end; /* loop end (in samples) * 16 */
};
struct snd_seq_ev_sample_control {
unsigned char channel;
unsigned char unused1, unused2, unused3; /* pad */
union {
struct snd_seq_ev_sample sample;
struct snd_seq_ev_cluster cluster;
snd_seq_position_t position;
int stop_mode;
snd_seq_frequency_t frequency;
struct snd_seq_ev_volume volume;
struct snd_seq_ev_loop loop;
unsigned char raw8[8];
} param;
};
/* INSTR_BEGIN event */
struct snd_seq_ev_instr_begin {
int timeout; /* zero = forever, otherwise timeout in ms */
};
struct snd_seq_result {
int event; /* processed event type */
int result;
......@@ -399,8 +295,6 @@ struct snd_seq_event {
struct snd_seq_addr addr;
struct snd_seq_connect connect;
struct snd_seq_result result;
struct snd_seq_ev_instr_begin instr_begin;
struct snd_seq_ev_sample_control sample;
struct snd_seq_ev_quote quote;
} data;
};
......@@ -441,8 +335,6 @@ struct snd_seq_event_bounce {
#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
/* fixed length events: 0-99 */
#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
/* instrument layer events: 100-129 */
#define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
/* variable length events: 130-139 */
#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
/* reserved for kernel */
......@@ -737,136 +629,6 @@ struct snd_seq_query_subs {
};
/*
* Instrument abstraction layer
* - based on events
*/
/* instrument types */
#define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */
#define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */
/* instrument ASCII identifiers */
#define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1"
#define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2"
#define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave"
#define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont"
#define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"
#define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF"
#define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"
#define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4"
/* instrument types */
#define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */
#define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */
#define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */
#define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */
#define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */
#define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */
#define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */
#define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */
/* put commands */
#define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0
#define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1
#define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2
#define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3
#define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4
/* get commands */
#define SNDRV_SEQ_INSTR_GET_CMD_FULL 0
#define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1
/* query flags */
#define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)
/* free commands */
#define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0
#define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1
#define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2
#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
/* size of ROM/RAM */
typedef unsigned int snd_seq_instr_size_t;
/* INSTR_INFO */
struct snd_seq_instr_info {
int result; /* operation result */
unsigned int formats[8]; /* bitmap of supported formats */
int ram_count; /* count of RAM banks */
snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
int rom_count; /* count of ROM banks */
snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
char reserved[128];
};
/* INSTR_STATUS */
struct snd_seq_instr_status {
int result; /* operation result */
snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */
int instrument_count; /* count of downloaded instruments */
char reserved[128];
};
/* INSTR_FORMAT_INFO */
struct snd_seq_instr_format_info {
char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
unsigned int len; /* max data length (without this structure) */
};
struct snd_seq_instr_format_info_result {
int result; /* operation result */
char format[16]; /* format identifier */
unsigned int len; /* filled data length (without this structure) */
};
/* instrument data */
struct snd_seq_instr_data {
char name[32]; /* instrument name */
char reserved[16]; /* for the future use */
int type; /* instrument type */
union {
char format[16]; /* format identifier */
struct snd_seq_instr alias;
} data;
};
/* INSTR_PUT/GET, data are stored in one block (extended), header + data */
struct snd_seq_instr_header {
union {
struct snd_seq_instr instr;
snd_seq_instr_cluster_t cluster;
} id; /* instrument identifier */
unsigned int cmd; /* get/put/free command */
unsigned int flags; /* query flags (only for get) */
unsigned int len; /* real instrument data length (without header) */
int result; /* operation result */
char reserved[16]; /* for the future */
struct snd_seq_instr_data data; /* instrument data (for put/get result) */
};
/* INSTR_CLUSTER_SET */
struct snd_seq_instr_cluster_set {
snd_seq_instr_cluster_t cluster; /* cluster identifier */
char name[32]; /* cluster name */
int priority; /* cluster priority */
char reserved[64]; /* for the future use */
};
/* INSTR_CLUSTER_GET */
struct snd_seq_instr_cluster_get {
snd_seq_instr_cluster_t cluster; /* cluster identifier */
char name[32]; /* cluster name */
int priority; /* cluster priority */
char reserved[64]; /* for the future use */
};
/*
* IOCTL commands
*/
......
......@@ -95,7 +95,7 @@ enum {
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
/* Don't forget to change the following: */
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_HDA
};
struct snd_hwdep_info {
......@@ -138,7 +138,7 @@ enum {
* *
*****************************************************************************/
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
......@@ -354,8 +354,8 @@ struct snd_pcm_hw_params {
enum {
SNDRV_PCM_TSTAMP_NONE = 0,
SNDRV_PCM_TSTAMP_MMAP,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
SNDRV_PCM_TSTAMP_ENABLE,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};
struct snd_pcm_sw_params {
......@@ -363,7 +363,7 @@ struct snd_pcm_sw_params {
unsigned int period_step;
unsigned int sleep_min; /* min ticks to sleep */
snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
......@@ -434,10 +434,17 @@ struct snd_xfern {
snd_pcm_uframes_t frames;
};
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
};
enum {
SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int),
SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
......@@ -689,7 +696,7 @@ struct snd_timer_tread {
* *
****************************************************************************/
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
struct snd_ctl_card_info {
int card; /* card number */
......@@ -738,8 +745,7 @@ typedef int __bitwise snd_ctl_elem_iface_t;
#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
#define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */
#define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */
/* bits 30 and 31 are obsoleted (for indirect access) */
/* for further details see the ACPI and PCI power management specification */
#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
......@@ -793,30 +799,30 @@ struct snd_ctl_elem_info {
} value;
union {
unsigned short d[4]; /* dimensions */
unsigned short *d_ptr; /* indirect */
unsigned short *d_ptr; /* indirect - obsoleted */
} dimen;
unsigned char reserved[64-4*sizeof(unsigned short)];
};
struct snd_ctl_elem_value {
struct snd_ctl_elem_id id; /* W: element ID */
unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */
unsigned int indirect: 1; /* W: indirect access - obsoleted */
union {
union {
long value[128];
long *value_ptr;
long *value_ptr; /* obsoleted */
} integer;
union {
long long value[64];
long long *value_ptr;
long long *value_ptr; /* obsoleted */
} integer64;
union {
unsigned int item[128];
unsigned int *item_ptr;
unsigned int *item_ptr; /* obsoleted */
} enumerated;
union {
unsigned char data[512];
unsigned char *data_ptr;
unsigned char *data_ptr; /* obsoleted */
} bytes;
struct snd_aes_iec958 iec958;
} value; /* RO */
......
......@@ -104,6 +104,8 @@ struct snd_dm_fm_params {
#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
/* for OPL3 only */
#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
/* SBI patch management */
#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
......@@ -112,4 +114,21 @@ struct snd_dm_fm_params {
#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
/*
* Patch Record - fixed size for write
*/
#define FM_KEY_SBI "SBI\032"
#define FM_KEY_2OP "2OP\032"
#define FM_KEY_4OP "4OP\032"
struct sbi_patch {
unsigned char prog;
unsigned char bank;
char key[4];
char name[25];
char extension[7];
unsigned char data[32];
};
#endif /* __SOUND_ASOUND_FM_H */
......@@ -22,12 +22,22 @@
*
*/
#include <linux/module.h>
#include <linux/sched.h> /* wake_up() */
#include <linux/mutex.h> /* struct mutex */
#include <linux/rwsem.h> /* struct rw_semaphore */
#include <linux/pm.h> /* pm_message_t */
#include <linux/device.h>
/* number of supported soundcards */
#ifdef CONFIG_SND_DYNAMIC_MINORS
#define SNDRV_CARDS 32
#else
#define SNDRV_CARDS 8 /* don't change - minor numbers */
#endif
#define CONFIG_SND_MAJOR 116 /* standard configuration */
/* forward declarations */
#ifdef CONFIG_PCI
struct pci_dev;
......
......@@ -45,7 +45,7 @@
#define CS4231_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
#define CS4231_PIN_CTRL 0x0a /* pin control */
#define CS4231_TEST_INIT 0x0b /* test and initialization */
#define CS4231_MISC_INFO 0x0c /* miscellaneaous information */
#define CS4231_MISC_INFO 0x0c /* miscellaneous information */
#define CS4231_LOOPBACK 0x0d /* loopback control */
#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */
#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */
......
......@@ -1708,9 +1708,6 @@ struct snd_cs46xx {
struct gameport *gameport;
#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
int current_gpio;
#endif
#ifdef CONFIG_SND_CS46XX_NEW_DSP
struct mutex spos_mutex;
......
#ifndef __SOUND_DRIVER_H
#define __SOUND_DRIVER_H
/*
* Main header file for the ALSA driver
* Copyright (c) 1994-2000 by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifdef ALSA_BUILD
#include "config.h"
#endif
/* number of supported soundcards */
#ifdef CONFIG_SND_DYNAMIC_MINORS
#define SNDRV_CARDS 32
#else
#define SNDRV_CARDS 8 /* don't change - minor numbers */
#endif
#ifndef CONFIG_SND_MAJOR /* standard configuration */
#define CONFIG_SND_MAJOR 116
#endif
#ifndef CONFIG_SND_DEBUG
#undef CONFIG_SND_DEBUG_MEMORY
#endif
#ifdef ALSA_BUILD
#include "adriver.h"
#endif
#include <linux/module.h>
#endif /* __SOUND_DRIVER_H */
#warning "This file is deprecated"
此差异已折叠。
......@@ -27,13 +27,8 @@
#include "timer.h"
#include "seq_midi_emul.h"
#include "seq_device.h"
#include "ainstr_iw.h"
#include "ainstr_gf1.h"
#include "ainstr_simple.h"
#include <asm/io.h>
#define SNDRV_SEQ_DEV_ID_GUS "gus-synth"
/* IO ports */
#define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x)
......@@ -234,16 +229,6 @@ struct snd_gus_port {
struct snd_gus_voice;
struct snd_gus_sample_ops {
void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position);
void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode);
void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq);
void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume);
void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop);
void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position);
void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data);
};
#define SNDRV_GF1_VOICE_TYPE_PCM 0
#define SNDRV_GF1_VOICE_TYPE_SYNTH 1
#define SNDRV_GF1_VOICE_TYPE_MIDI 2
......@@ -284,12 +269,8 @@ struct snd_gus_voice {
struct snd_gus_sample_ops *sample_ops;
struct snd_seq_instr instr;
/* running status / registers */
struct snd_seq_ev_volume sample_volume;
unsigned short fc_register;
unsigned short fc_lfo;
unsigned short gf1_volume;
......@@ -382,10 +363,6 @@ struct snd_gf1 {
int seq_client;
struct snd_gus_port seq_ports[4];
struct snd_seq_kinstr_list *ilist;
struct snd_iwffff_ops iwffff_ops;
struct snd_gf1_ops gf1_ops;
struct snd_simple_ops simple_ops;
/* timer */
......@@ -458,8 +435,6 @@ struct snd_gus_card {
struct snd_rawmidi_substream *midi_substream_output;
struct snd_rawmidi_substream *midi_substream_input;
struct snd_seq_device *seq_dev;
spinlock_t reg_lock;
spinlock_t voice_alloc;
spinlock_t active_voice_lock;
......@@ -647,48 +622,10 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus);
int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi);
#if 0
extern void snd_engine_instrument_register(unsigned short mode,
struct _SND_INSTRUMENT_VOICE_COMMANDS *voice_cmds,
struct _SND_INSTRUMENT_NOTE_COMMANDS *note_cmds,
struct _SND_INSTRUMENT_CHANNEL_COMMANDS *channel_cmds);
extern int snd_engine_instrument_register_ask(unsigned short mode);
#endif
/* gus_dram.c */
int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
unsigned int addr, unsigned int size);
int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
unsigned int addr, unsigned int size, int rom);
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
/* gus_sample.c */
void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p);
/* gus_simple.c */
void snd_gf1_simple_init(struct snd_gus_voice *voice);
/* gus_instr.c */
int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave,
char __user *data, long len, int atomic);
int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave,
char __user *data, long len, int atomic);
int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave,
int atomic);
int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave,
char __user *data, long len, int atomic);
int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave,
char __user *data, long len, int atomic);
int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave,
int atomic);
int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr,
char __user *data, long len, int atomic);
int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr,
char __user *data, long len, int atomic);
int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr,
int atomic);
#endif /* CONFIG_SND_SEQUENCER */
#endif /* __SOUND_GUS_H */
......@@ -100,8 +100,10 @@ int snd_info_minor_unregister(void);
extern struct snd_info_entry *snd_seq_root;
#ifdef CONFIG_SND_OSSEMUL
extern struct snd_info_entry *snd_oss_root;
void snd_card_info_read_oss(struct snd_info_buffer *buffer);
#else
#define snd_oss_root NULL
static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {}
#endif
int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...) __attribute__ ((format (printf, 2, 3)));
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -30,6 +30,7 @@ struct snd_tea575x;
struct snd_tea575x_ops {
void (*write)(struct snd_tea575x *tea, unsigned int val);
unsigned int (*read)(struct snd_tea575x *tea);
void (*mute)(struct snd_tea575x *tea, unsigned int mute);
};
struct snd_tea575x {
......
此差异已折叠。
/* include/version.h. Generated by alsa/ksync script. */
#define CONFIG_SND_VERSION "1.0.15"
#define CONFIG_SND_DATE " (Tue Nov 20 19:16:42 2007 UTC)"
#define CONFIG_SND_VERSION "1.0.16rc2"
#define CONFIG_SND_DATE " (Thu Jan 31 16:40:16 2008 UTC)"
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册