Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This update contains a fairly wide range of changes all over in sound
  subdirectory, mainly because of UAPI header moves by David and __dev*
  annotation removals by Bill.  Other highlights are:

   - Introduced the support for wallclock timestamps in ALSA PCM core

   - Add the poll loop implementation for HD-audio jack detection

   - Yet more VGA-switcheroo fixes for HD-audio

   - New VIA HD-audio codec support

   - More fixes on resource management in USB audio and MIDI drivers

   - More quirks for USB-audio ASUS Xonar U3, Reloop Play, Focusrite,
     Roland VG-99, etc

   - Add support for FastTrack C400 usb-audio

   - Clean ups in many drivers regarding firmware loading

   - Add PSC724 Ultiimate Edge support to ice1712

   - A few hdspm driver updates

   - New Stanton SCS.1d/1m FireWire driver

   - Standardisation of the logging in ASoC codes

   - DT and dmaengine support for ASoC Atmel

   - Support for Wolfson ADSP cores

   - New drivers for Freescale/iVeia P1022 and Maxim MAX98090

   - Lots of other ASoC driver fixes and developments"

Fix up trivial conflicts.  And go out on a limb and assume the dts file
'status' field of one of the conflicting things was supposed to be
"disabled", not "disable" like in pretty much all other cases.

* tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (341 commits)
  ALSA: hda - Move runtime PM check to runtime_idle callback
  ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522
  ALSA: hda - Avoid doubly suspend after vga switcheroo
  ALSA: usb-audio: Enable S/PDIF on the ASUS Xonar U3
  ALSA: hda - Check validity of CORB/RIRB WP reads
  ALSA: hda - use usleep_range in link reset and change timeout check
  ALSA: HDA: VIA: Add support for codec VT1808.
  ALSA: HDA: VIA Add support for codec VT1705CF.
  ASoC: codecs: remove __dev* attributes
  ASoC: utils: remove __dev* attributes
  ASoC: ux500: remove __dev* attributes
  ASoC: txx9: remove __dev* attributes
  ASoC: tegra: remove __dev* attributes
  ASoC: spear: remove __dev* attributes
  ASoC: sh: remove __dev* attributes
  ASoC: s6000: remove __dev* attributes
  ASoC: OMAP: remove __dev* attributes
  ASoC: nuc900: remove __dev* attributes
  ASoC: mxs: remove __dev* attributes
  ASoC: kirkwood: remove __dev* attributes
  ...
This commit is contained in:
Linus Torvalds
2012-12-13 11:51:23 -08:00
610 changed files with 15796 additions and 8515 deletions

View File

@ -433,9 +433,9 @@
/* chip-specific constructor /* chip-specific constructor
* (see "Management of Cards and Components") * (see "Management of Cards and Components")
*/ */
static int __devinit snd_mychip_create(struct snd_card *card, static int snd_mychip_create(struct snd_card *card,
struct pci_dev *pci, struct pci_dev *pci,
struct mychip **rchip) struct mychip **rchip)
{ {
struct mychip *chip; struct mychip *chip;
int err; int err;
@ -475,8 +475,8 @@
} }
/* constructor -- see "Constructor" sub-section */ /* constructor -- see "Constructor" sub-section */
static int __devinit snd_mychip_probe(struct pci_dev *pci, static int snd_mychip_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
static int dev; static int dev;
struct snd_card *card; struct snd_card *card;
@ -526,7 +526,7 @@
} }
/* destructor -- see the "Destructor" sub-section */ /* destructor -- see the "Destructor" sub-section */
static void __devexit snd_mychip_remove(struct pci_dev *pci) static void snd_mychip_remove(struct pci_dev *pci)
{ {
snd_card_free(pci_get_drvdata(pci)); snd_card_free(pci_get_drvdata(pci));
pci_set_drvdata(pci, NULL); pci_set_drvdata(pci, NULL);
@ -542,9 +542,8 @@
<para> <para>
The real constructor of PCI drivers is the <function>probe</function> callback. The real constructor of PCI drivers is the <function>probe</function> callback.
The <function>probe</function> callback and other component-constructors which are called The <function>probe</function> callback and other component-constructors which are called
from the <function>probe</function> callback should be defined with from the <function>probe</function> callback cannot be used with
the <parameter>__devinit</parameter> prefix. You the <parameter>__init</parameter> prefix
cannot use the <parameter>__init</parameter> prefix for them,
because any PCI device could be a hotplug device. because any PCI device could be a hotplug device.
</para> </para>
@ -728,7 +727,7 @@
<informalexample> <informalexample>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static void __devexit snd_mychip_remove(struct pci_dev *pci) static void snd_mychip_remove(struct pci_dev *pci)
{ {
snd_card_free(pci_get_drvdata(pci)); snd_card_free(pci_get_drvdata(pci));
pci_set_drvdata(pci, NULL); pci_set_drvdata(pci, NULL);
@ -1058,14 +1057,6 @@
components are released automatically by this call. components are released automatically by this call.
</para> </para>
<para>
As further notes, the destructors (both
<function>snd_mychip_dev_free</function> and
<function>snd_mychip_free</function>) cannot be defined with
the <parameter>__devexit</parameter> prefix, because they may be
called from the constructor, too, at the false path.
</para>
<para> <para>
For a device which allows hotplugging, you can use For a device which allows hotplugging, you can use
<function>snd_card_free_when_closed</function>. This one will <function>snd_card_free_when_closed</function>. This one will
@ -1120,9 +1111,9 @@
} }
/* chip-specific constructor */ /* chip-specific constructor */
static int __devinit snd_mychip_create(struct snd_card *card, static int snd_mychip_create(struct snd_card *card,
struct pci_dev *pci, struct pci_dev *pci,
struct mychip **rchip) struct mychip **rchip)
{ {
struct mychip *chip; struct mychip *chip;
int err; int err;
@ -1200,7 +1191,7 @@
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.id_table = snd_mychip_ids, .id_table = snd_mychip_ids,
.probe = snd_mychip_probe, .probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove), .remove = snd_mychip_remove,
}; };
/* module initialization */ /* module initialization */
@ -1464,11 +1455,6 @@
</informalexample> </informalexample>
</para> </para>
<para>
Again, remember that you cannot
use the <parameter>__devexit</parameter> prefix for this destructor.
</para>
<para> <para>
We didn't implement the hardware disabling part in the above. We didn't implement the hardware disabling part in the above.
If you need to do this, please note that the destructor may be If you need to do this, please note that the destructor may be
@ -1619,7 +1605,7 @@
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.id_table = snd_mychip_ids, .id_table = snd_mychip_ids,
.probe = snd_mychip_probe, .probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove), .remove = snd_mychip_remove,
}; };
]]> ]]>
</programlisting> </programlisting>
@ -1630,11 +1616,7 @@
The <structfield>probe</structfield> and The <structfield>probe</structfield> and
<structfield>remove</structfield> functions have already <structfield>remove</structfield> functions have already
been defined in the previous sections. been defined in the previous sections.
The <structfield>remove</structfield> function should The <structfield>name</structfield>
be defined with the
<function>__devexit_p()</function> macro, so that it's not
defined for built-in (and non-hot-pluggable) case. The
<structfield>name</structfield>
field is the name string of this device. Note that you must not field is the name string of this device. Note that you must not
use a slash <quote>/</quote> in this string. use a slash <quote>/</quote> in this string.
</para> </para>
@ -1665,9 +1647,7 @@
<para> <para>
Note that these module entries are tagged with Note that these module entries are tagged with
<parameter>__init</parameter> and <parameter>__init</parameter> and
<parameter>__exit</parameter> prefixes, not <parameter>__exit</parameter> prefixes.
<parameter>__devinit</parameter> nor
<parameter>__devexit</parameter>.
</para> </para>
<para> <para>
@ -1918,7 +1898,7 @@
*/ */
/* create a pcm device */ /* create a pcm device */
static int __devinit snd_mychip_new_pcm(struct mychip *chip) static int snd_mychip_new_pcm(struct mychip *chip)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
@ -1957,7 +1937,7 @@
<informalexample> <informalexample>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static int __devinit snd_mychip_new_pcm(struct mychip *chip) static int snd_mychip_new_pcm(struct mychip *chip)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
@ -2124,7 +2104,7 @@
.... ....
} }
static int __devinit snd_mychip_new_pcm(struct mychip *chip) static int snd_mychip_new_pcm(struct mychip *chip)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
.... ....
@ -3399,7 +3379,7 @@ struct _snd_pcm_runtime {
<title>Definition of a Control</title> <title>Definition of a Control</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static struct snd_kcontrol_new my_control __devinitdata = { static struct snd_kcontrol_new my_control = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Switch", .name = "PCM Playback Switch",
.index = 0, .index = 0,
@ -3414,13 +3394,6 @@ struct _snd_pcm_runtime {
</example> </example>
</para> </para>
<para>
Most likely the control is created via
<function>snd_ctl_new1()</function>, and in such a case, you can
add the <parameter>__devinitdata</parameter> prefix to the
definition as above.
</para>
<para> <para>
The <structfield>iface</structfield> field specifies the control The <structfield>iface</structfield> field specifies the control
type, <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>, which type, <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>, which
@ -3847,10 +3820,8 @@ struct _snd_pcm_runtime {
<para> <para>
<function>snd_ctl_new1()</function> allocates a new <function>snd_ctl_new1()</function> allocates a new
<structname>snd_kcontrol</structname> instance (that's why the definition <structname>snd_kcontrol</structname> instance,
of <parameter>my_control</parameter> can be with and <function>snd_ctl_add</function> assigns the given
the <parameter>__devinitdata</parameter>
prefix), and <function>snd_ctl_add</function> assigns the given
control component to the card. control component to the card.
</para> </para>
</section> </section>
@ -3896,7 +3867,7 @@ struct _snd_pcm_runtime {
<![CDATA[ <![CDATA[
static DECLARE_TLV_DB_SCALE(db_scale_my_control, -4050, 150, 0); static DECLARE_TLV_DB_SCALE(db_scale_my_control, -4050, 150, 0);
static struct snd_kcontrol_new my_control __devinitdata = { static struct snd_kcontrol_new my_control = {
... ...
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_TLV_READ, SNDRV_CTL_ELEM_ACCESS_TLV_READ,
@ -5761,8 +5732,8 @@ struct _snd_pcm_runtime {
<informalexample> <informalexample>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static int __devinit snd_mychip_probe(struct pci_dev *pci, static int snd_mychip_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
.... ....
struct snd_card *card; struct snd_card *card;
@ -5787,8 +5758,8 @@ struct _snd_pcm_runtime {
<informalexample> <informalexample>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static int __devinit snd_mychip_probe(struct pci_dev *pci, static int snd_mychip_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
.... ....
struct snd_card *card; struct snd_card *card;
@ -5825,7 +5796,7 @@ struct _snd_pcm_runtime {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.id_table = snd_my_ids, .id_table = snd_my_ids,
.probe = snd_my_probe, .probe = snd_my_probe,
.remove = __devexit_p(snd_my_remove), .remove = snd_my_remove,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = snd_my_suspend, .suspend = snd_my_suspend,
.resume = snd_my_resume, .resume = snd_my_resume,

View File

@ -0,0 +1,15 @@
* Atmel SSC driver.
Required properties:
- compatible: "atmel,at91rm9200-ssc" or "atmel,at91sam9g45-ssc"
- atmel,at91rm9200-ssc: support pdc transfer
- atmel,at91sam9g45-ssc: support dma transfer
- reg: Should contain SSC registers location and length
- interrupts: Should contain SSC interrupt
Example:
ssc0: ssc@fffbc000 {
compatible = "atmel,at91rm9200-ssc";
reg = <0xfffbc000 0x4000>;
interrupts = <14 4 5>;
};

View File

@ -0,0 +1,22 @@
AK4104 S/PDIF transmitter
This device supports SPI mode only.
Required properties:
- compatible : "asahi-kasei,ak4104"
- reg : The chip select number on the SPI bus
Optional properties:
- reset-gpio : a GPIO spec for the reset pin. If specified, it will be
deasserted before communication to the device starts.
Example:
spdif: ak4104@0 {
compatible = "asahi-kasei,ak4104";
reg = <0>;
spi-max-frequency = <5000000>;
};

View File

@ -0,0 +1,26 @@
* Atmel at91sam9g20ek wm8731 audio complex
Required properties:
- compatible: "atmel,at91sam9g20ek-wm8731-audio"
- atmel,model: The user-visible name of this sound complex.
- atmel,audio-routing: A list of the connections between audio components.
- atmel,ssc-controller: The phandle of the SSC controller
- atmel,audio-codec: The phandle of the WM8731 audio codec
Optional properties:
- pinctrl-names, pinctrl-0: Please refer to pinctrl-bindings.txt
Example:
sound {
compatible = "atmel,at91sam9g20ek-wm8731-audio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pck0_as_mck>;
atmel,model = "wm8731 @ AT91SAMG20EK";
atmel,audio-routing =
"Ext Spk", "LHPOUT",
"Int MIC", "MICIN";
atmel,ssc-controller = <&ssc0>;
atmel,audio-codec = <&wm8731>;
};

View File

@ -18,6 +18,8 @@ Optional properties:
- reset-gpio: a GPIO spec to define which pin is connected to the chip's - reset-gpio: a GPIO spec to define which pin is connected to the chip's
!RESET pin !RESET pin
- cirrus,amuteb-eq-bmutec: When given, the Codec's AMUTEB=BMUTEC flag
is enabled.
Examples: Examples:

View File

@ -12,7 +12,7 @@ Required properties:
Optional properties: Optional properties:
- ti,dmic: phandle for the OMAP dmic node if the machine have it connected - ti,dmic: phandle for the OMAP dmic node if the machine have it connected
- ti,jack_detection: Need to be set to <1> if the board capable to detect jack - ti,jack_detection: Need to be present if the board capable to detect jack
insertion, removal. insertion, removal.
Available audio endpoints for the audio-routing table: Available audio endpoints for the audio-routing table:
@ -59,7 +59,7 @@ sound {
compatible = "ti,abe-twl6040"; compatible = "ti,abe-twl6040";
ti,model = "SDP4430"; ti,model = "SDP4430";
ti,jack-detection = <1>; ti,jack-detection;
ti,mclk-freq = <38400000>; ti,mclk-freq = <38400000>;
ti,mcpdm = <&mcpdm>; ti,mcpdm = <&mcpdm>;

View File

@ -1905,7 +1905,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
vid - Vendor ID for the device (optional) vid - Vendor ID for the device (optional)
pid - Product ID for the device (optional) pid - Product ID for the device (optional)
nrpacks - Max. number of packets per URB (default: 8) nrpacks - Max. number of packets per URB (default: 8)
async_unlink - Use async unlink mode (default: yes)
device_setup - Device specific magic number (optional) device_setup - Device specific magic number (optional)
- Influence depends on the device - Influence depends on the device
- Default: 0x0000 - Default: 0x0000
@ -1917,8 +1916,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
NB: nrpacks parameter can be modified dynamically via sysfs. NB: nrpacks parameter can be modified dynamically via sysfs.
Don't put the value over 20. Changing via sysfs has no sanity Don't put the value over 20. Changing via sysfs has no sanity
check. check.
NB: async_unlink=0 would cause Oops. It remains just for
debugging purpose (if any).
NB: ignore_ctl_error=1 may help when you get an error at accessing NB: ignore_ctl_error=1 may help when you get an error at accessing
the mixer element such as URB error -22. This happens on some the mixer element such as URB error -22. This happens on some
buggy USB device or the controller. buggy USB device or the controller.

View File

@ -29,6 +29,7 @@
tcb0 = &tcb0; tcb0 = &tcb0;
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0; i2c0 = &i2c0;
ssc0 = &ssc0;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
@ -445,6 +446,13 @@
status = "disabled"; status = "disabled";
}; };
ssc0: ssc@fffbc000 {
compatible = "atmel,at91rm9200-ssc";
reg = <0xfffbc000 0x4000>;
interrupts = <14 4 5>;
status = "disabled";
};
adc0: adc@fffe0000 { adc0: adc@fffe0000 {
compatible = "atmel,at91sam9260-adc"; compatible = "atmel,at91sam9260-adc";
reg = <0xfffe0000 0x100>; reg = <0xfffe0000 0x100>;

View File

@ -25,6 +25,8 @@
gpio4 = &pioE; gpio4 = &pioE;
tcb0 = &tcb0; tcb0 = &tcb0;
i2c0 = &i2c0; i2c0 = &i2c0;
ssc0 = &ssc0;
ssc1 = &ssc1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
@ -362,6 +364,20 @@
status = "disabled"; status = "disabled";
}; };
ssc0: ssc@fff98000 {
compatible = "atmel,at91rm9200-ssc";
reg = <0xfff98000 0x4000>;
interrupts = <16 4 5>;
status = "disable";
};
ssc1: ssc@fff9c000 {
compatible = "atmel,at91rm9200-ssc";
reg = <0xfff9c000 0x4000>;
interrupts = <17 4 5>;
status = "disable";
};
macb0: ethernet@fffbc000 { macb0: ethernet@fffbc000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb"; compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffbc000 0x100>; reg = <0xfffbc000 0x100>;

View File

@ -30,6 +30,16 @@
ahb { ahb {
apb { apb {
pinctrl@fffff400 {
board {
pinctrl_pck0_as_mck: pck0_as_mck {
atmel,pins =
<2 1 0x2 0x0>; /* PC1 periph B */
};
};
};
dbgu: serial@fffff200 { dbgu: serial@fffff200 {
status = "okay"; status = "okay";
}; };
@ -81,6 +91,11 @@
}; };
}; };
}; };
ssc0: ssc@fffbc000 {
status = "okay";
pinctrl-0 = <&pinctrl_ssc0_tx>;
};
}; };
nand0: nand@40000000 { nand0: nand@40000000 {
@ -144,7 +159,7 @@
reg = <0x50>; reg = <0x50>;
}; };
wm8731@1b { wm8731: wm8731@1b {
compatible = "wm8731"; compatible = "wm8731";
reg = <0x1b>; reg = <0x1b>;
}; };
@ -169,4 +184,19 @@
gpio-key,wakeup; gpio-key,wakeup;
}; };
}; };
sound {
compatible = "atmel,at91sam9g20ek-wm8731-audio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pck0_as_mck>;
atmel,model = "wm8731 @ AT91SAMG20EK";
atmel,audio-routing =
"Ext Spk", "LHPOUT",
"Int Mic", "MICIN";
atmel,ssc-controller = <&ssc0>;
atmel,audio-codec = <&wm8731>;
};
}; };

View File

@ -31,6 +31,8 @@
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0; i2c0 = &i2c0;
i2c1 = &i2c1; i2c1 = &i2c1;
ssc0 = &ssc0;
ssc1 = &ssc1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
@ -419,6 +421,20 @@
status = "disabled"; status = "disabled";
}; };
ssc0: ssc@fff9c000 {
compatible = "atmel,at91sam9g45-ssc";
reg = <0xfff9c000 0x4000>;
interrupts = <16 4 5>;
status = "disable";
};
ssc1: ssc@fffa0000 {
compatible = "atmel,at91sam9g45-ssc";
reg = <0xfffa0000 0x4000>;
interrupts = <17 4 5>;
status = "disable";
};
adc0: adc@fffb0000 { adc0: adc@fffb0000 {
compatible = "atmel,at91sam9260-adc"; compatible = "atmel,at91sam9260-adc";
reg = <0xfffb0000 0x100>; reg = <0xfffb0000 0x100>;

View File

@ -30,6 +30,7 @@
i2c0 = &i2c0; i2c0 = &i2c0;
i2c1 = &i2c1; i2c1 = &i2c1;
i2c2 = &i2c2; i2c2 = &i2c2;
ssc0 = &ssc0;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
@ -87,6 +88,13 @@
interrupts = <1 4 7>; interrupts = <1 4 7>;
}; };
ssc0: ssc@f0010000 {
compatible = "atmel,at91sam9g45-ssc";
reg = <0xf0010000 0x4000>;
interrupts = <28 4 5>;
status = "disable";
};
tcb0: timer@f8008000 { tcb0: timer@f8008000 {
compatible = "atmel,at91sam9x5-tcb"; compatible = "atmel,at91sam9x5-tcb";
reg = <0xf8008000 0x100>; reg = <0xf8008000 0x100>;

View File

@ -184,9 +184,12 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID("pclk", "fffd0000.ssc", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "fffd4000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "fffd8000.ssc", &ssc2_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200.0", &twi_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200.0", &twi_clk),
/* fake hclk clock */ /* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),

View File

@ -752,7 +752,7 @@ static struct resource ssc0_resources[] = {
}; };
static struct platform_device at91rm9200_ssc0_device = { static struct platform_device at91rm9200_ssc0_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc0_dmamask, .dma_mask = &ssc0_dmamask,
@ -794,7 +794,7 @@ static struct resource ssc1_resources[] = {
}; };
static struct platform_device at91rm9200_ssc1_device = { static struct platform_device at91rm9200_ssc1_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &ssc1_dmamask, .dma_mask = &ssc1_dmamask,
@ -836,7 +836,7 @@ static struct resource ssc2_resources[] = {
}; };
static struct platform_device at91rm9200_ssc2_device = { static struct platform_device at91rm9200_ssc2_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 2, .id = 2,
.dev = { .dev = {
.dma_mask = &ssc2_dmamask, .dma_mask = &ssc2_dmamask,

View File

@ -210,7 +210,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc_clk),
CLKDEV_CON_DEV_ID("pclk", "fffbc000.ssc", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi_clk),
/* more usart lookup table for DT entries */ /* more usart lookup table for DT entries */

View File

@ -742,7 +742,7 @@ static struct resource ssc_resources[] = {
}; };
static struct platform_device at91sam9260_ssc_device = { static struct platform_device at91sam9260_ssc_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc_dmamask, .dma_mask = &ssc_dmamask,

View File

@ -174,9 +174,12 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID("pclk", "fffbc000.ssc", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "fffc0000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc2_clk),
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261.0", &twi_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261.0", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi_clk),

View File

@ -706,7 +706,7 @@ static struct resource ssc0_resources[] = {
}; };
static struct platform_device at91sam9261_ssc0_device = { static struct platform_device at91sam9261_ssc0_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc0_dmamask, .dma_mask = &ssc0_dmamask,
@ -748,7 +748,7 @@ static struct resource ssc1_resources[] = {
}; };
static struct platform_device at91sam9261_ssc1_device = { static struct platform_device at91sam9261_ssc1_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &ssc1_dmamask, .dma_mask = &ssc1_dmamask,
@ -790,7 +790,7 @@ static struct resource ssc2_resources[] = {
}; };
static struct platform_device at91sam9261_ssc2_device = { static struct platform_device at91sam9261_ssc2_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 2, .id = 2,
.dev = { .dev = {
.dma_mask = &ssc2_dmamask, .dma_mask = &ssc2_dmamask,

View File

@ -186,8 +186,10 @@ static struct clk *periph_clocks[] __initdata = {
static struct clk_lookup periph_clocks_lookups[] = { static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */ /* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk), CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),

View File

@ -1199,7 +1199,7 @@ static struct resource ssc0_resources[] = {
}; };
static struct platform_device at91sam9263_ssc0_device = { static struct platform_device at91sam9263_ssc0_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc0_dmamask, .dma_mask = &ssc0_dmamask,
@ -1241,7 +1241,7 @@ static struct resource ssc1_resources[] = {
}; };
static struct platform_device at91sam9263_ssc1_device = { static struct platform_device at91sam9263_ssc1_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &ssc1_dmamask, .dma_mask = &ssc1_dmamask,

View File

@ -239,8 +239,10 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi0_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "fffa0000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk), CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk), CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk), CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),

View File

@ -1459,7 +1459,7 @@ static struct resource ssc0_resources[] = {
}; };
static struct platform_device at91sam9g45_ssc0_device = { static struct platform_device at91sam9g45_ssc0_device = {
.name = "ssc", .name = "at91sam9g45_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc0_dmamask, .dma_mask = &ssc0_dmamask,
@ -1501,7 +1501,7 @@ static struct resource ssc1_resources[] = {
}; };
static struct platform_device at91sam9g45_ssc1_device = { static struct platform_device at91sam9g45_ssc1_device = {
.name = "ssc", .name = "at91sam9g45_ssc",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &ssc1_dmamask, .dma_mask = &ssc1_dmamask,

View File

@ -184,8 +184,10 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "fffc0000.ssc", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk),
CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioA", &pioA_clk),

View File

@ -832,7 +832,7 @@ static struct resource ssc0_resources[] = {
}; };
static struct platform_device at91sam9rl_ssc0_device = { static struct platform_device at91sam9rl_ssc0_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &ssc0_dmamask, .dma_mask = &ssc0_dmamask,
@ -874,7 +874,7 @@ static struct resource ssc1_resources[] = {
}; };
static struct platform_device at91sam9rl_ssc1_device = { static struct platform_device at91sam9rl_ssc1_device = {
.name = "ssc", .name = "at91rm9200_ssc",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &ssc1_dmamask, .dma_mask = &ssc1_dmamask,

View File

@ -233,6 +233,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("mci_clk", "f000c000.mmc", &mmc1_clk), CLKDEV_CON_DEV_ID("mci_clk", "f000c000.mmc", &mmc1_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk), CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk), CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk),
CLKDEV_CON_DEV_ID("pclk", "f0010000.ssc", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk), CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk), CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk), CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk),

View File

@ -353,6 +353,16 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
}, },
}; };
static struct platform_device sam9g20ek_audio_device = {
.name = "at91sam9g20ek-audio",
.id = -1,
};
static void __init ek_add_device_audio(void)
{
platform_device_register(&sam9g20ek_audio_device);
}
static void __init ek_board_init(void) static void __init ek_board_init(void)
{ {
@ -394,6 +404,7 @@ static void __init ek_board_init(void)
at91_set_B_periph(AT91_PIN_PC1, 0); at91_set_B_periph(AT91_PIN_PC1, 0);
/* SSC (for WM8731) */ /* SSC (for WM8731) */
at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
ek_add_device_audio();
} }
MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")

View File

@ -763,16 +763,19 @@ static u8 da850_iis_serializer_direction[] = {
}; };
static struct snd_platform_data da850_evm_snd_data = { static struct snd_platform_data da850_evm_snd_data = {
.tx_dma_offset = 0x2000, .tx_dma_offset = 0x2000,
.rx_dma_offset = 0x2000, .rx_dma_offset = 0x2000,
.op_mode = DAVINCI_MCASP_IIS_MODE, .op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
.tdm_slots = 2, .tdm_slots = 2,
.serial_dir = da850_iis_serializer_direction, .serial_dir = da850_iis_serializer_direction,
.asp_chan_q = EVENTQ_0, .asp_chan_q = EVENTQ_0,
.version = MCASP_VERSION_2, .ram_chan_q = EVENTQ_1,
.txnumevt = 1, .version = MCASP_VERSION_2,
.rxnumevt = 1, .txnumevt = 1,
.rxnumevt = 1,
.sram_size_playback = SZ_8K,
.sram_size_capture = SZ_8K,
}; };
static const short da850_evm_mcasp_pins[] __initconst = { static const short da850_evm_mcasp_pins[] __initconst = {
@ -1510,6 +1513,7 @@ static __init void da850_evm_init(void)
pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
ret); ret);
da850_evm_snd_data.sram_pool = sram_get_gen_pool();
da8xx_register_mcasp(0, &da850_evm_snd_data); da8xx_register_mcasp(0, &da850_evm_snd_data);
ret = davinci_cfg_reg_list(da850_lcdcntl_pins); ret = davinci_cfg_reg_list(da850_lcdcntl_pins);

View File

@ -147,7 +147,6 @@ static struct platform_device *armlex4210_devices[] __initdata = {
&s3c_device_hsmmc3, &s3c_device_hsmmc3,
&s3c_device_rtc, &s3c_device_rtc,
&s3c_device_wdt, &s3c_device_wdt,
&samsung_asoc_dma,
&armlex4210_smsc911x, &armlex4210_smsc911x,
&exynos4_device_ahci, &exynos4_device_ahci,
}; };

View File

@ -308,7 +308,6 @@ static struct platform_device *smdkv310_devices[] __initdata = {
&s5p_device_mfc_l, &s5p_device_mfc_l,
&s5p_device_mfc_r, &s5p_device_mfc_r,
&exynos4_device_spdif, &exynos4_device_spdif,
&samsung_asoc_dma,
&samsung_asoc_idma, &samsung_asoc_idma,
&s5p_device_fimd0, &s5p_device_fimd0,
&smdkv310_device_audio, &smdkv310_device_audio,

View File

@ -521,7 +521,6 @@ static struct platform_device *gta02_devices[] __initdata = {
&gta02_nor_flash, &gta02_nor_flash,
&s3c24xx_pwm_device, &s3c24xx_pwm_device,
&s3c_device_iis, &s3c_device_iis,
&samsung_asoc_dma,
&s3c_device_i2c0, &s3c_device_i2c0,
&gta02_dfbmcs320_device, &gta02_dfbmcs320_device,
&gta02_buttons_device, &gta02_buttons_device,

View File

@ -632,7 +632,6 @@ static struct platform_device *h1940_devices[] __initdata = {
&s3c_device_wdt, &s3c_device_wdt,
&s3c_device_i2c0, &s3c_device_i2c0,
&s3c_device_iis, &s3c_device_iis,
&samsung_asoc_dma,
&s3c_device_usbgadget, &s3c_device_usbgadget,
&h1940_device_leds, &h1940_device_leds,
&h1940_device_bluetooth, &h1940_device_bluetooth,

View File

@ -519,7 +519,6 @@ static struct platform_device *mini2440_devices[] __initdata = {
&s3c_device_iis, &s3c_device_iis,
&uda1340_codec, &uda1340_codec,
&mini2440_audio, &mini2440_audio,
&samsung_asoc_dma,
}; };
static void __init mini2440_map_io(void) static void __init mini2440_map_io(void)

View File

@ -712,7 +712,6 @@ static struct platform_device *rx1950_devices[] __initdata = {
&s3c_device_wdt, &s3c_device_wdt,
&s3c_device_i2c0, &s3c_device_i2c0,
&s3c_device_iis, &s3c_device_iis,
&samsung_asoc_dma,
&s3c_device_usbgadget, &s3c_device_usbgadget,
&s3c_device_rtc, &s3c_device_rtc,
&s3c_device_nand, &s3c_device_nand,

View File

@ -379,7 +379,6 @@ static struct platform_device *crag6410_devices[] __initdata = {
&s3c_device_timer[0], &s3c_device_timer[0],
&s3c64xx_device_iis0, &s3c64xx_device_iis0,
&s3c64xx_device_iis1, &s3c64xx_device_iis1,
&samsung_asoc_dma,
&samsung_device_keypad, &samsung_device_keypad,
&crag6410_gpio_keydev, &crag6410_gpio_keydev,
&crag6410_dm9k_device, &crag6410_dm9k_device,

View File

@ -275,7 +275,6 @@ static struct platform_device *smdk6410_devices[] __initdata = {
&s3c_device_fb, &s3c_device_fb,
&s3c_device_ohci, &s3c_device_ohci,
&s3c_device_usb_hsotg, &s3c_device_usb_hsotg,
&samsung_asoc_dma,
&s3c64xx_device_iisv4, &s3c64xx_device_iisv4,
&samsung_device_keypad, &samsung_device_keypad,

View File

@ -165,7 +165,6 @@ static struct platform_device *smdk6440_devices[] __initdata = {
&s3c_device_i2c1, &s3c_device_i2c1,
&s3c_device_ts, &s3c_device_ts,
&s3c_device_wdt, &s3c_device_wdt,
&samsung_asoc_dma,
&s5p6440_device_iis, &s5p6440_device_iis,
&s3c_device_fb, &s3c_device_fb,
&smdk6440_lcd_lte480wv, &smdk6440_lcd_lte480wv,

View File

@ -183,7 +183,6 @@ static struct platform_device *smdk6450_devices[] __initdata = {
&s3c_device_i2c1, &s3c_device_i2c1,
&s3c_device_ts, &s3c_device_ts,
&s3c_device_wdt, &s3c_device_wdt,
&samsung_asoc_dma,
&s5p6450_device_iis0, &s5p6450_device_iis0,
&s3c_device_fb, &s3c_device_fb,
&smdk6450_lcd_lte480wv, &smdk6450_lcd_lte480wv,

View File

@ -197,7 +197,6 @@ static struct platform_device *smdkc100_devices[] __initdata = {
&s3c_device_ts, &s3c_device_ts,
&s3c_device_wdt, &s3c_device_wdt,
&smdkc100_lcd_powerdev, &smdkc100_lcd_powerdev,
&samsung_asoc_dma,
&s5pc100_device_iis0, &s5pc100_device_iis0,
&samsung_device_keypad, &samsung_device_keypad,
&s5pc100_device_ac97, &s5pc100_device_ac97,

View File

@ -85,7 +85,6 @@ static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
}; };
static struct platform_device *smdkc110_devices[] __initdata = { static struct platform_device *smdkc110_devices[] __initdata = {
&samsung_asoc_dma,
&s5pv210_device_iis0, &s5pv210_device_iis0,
&s5pv210_device_ac97, &s5pv210_device_ac97,
&s5pv210_device_spdif, &s5pv210_device_spdif,

View File

@ -234,7 +234,6 @@ static struct platform_device *smdkv210_devices[] __initdata = {
&s5pv210_device_ac97, &s5pv210_device_ac97,
&s5pv210_device_iis0, &s5pv210_device_iis0,
&s5pv210_device_spdif, &s5pv210_device_spdif,
&samsung_asoc_dma,
&samsung_asoc_idma, &samsung_asoc_idma,
&samsung_device_keypad, &samsung_device_keypad,
&smdkv210_dm9000, &smdkv210_dm9000,

View File

@ -146,15 +146,6 @@ struct platform_device s3c_device_camif = {
/* ASOC DMA */ /* ASOC DMA */
struct platform_device samsung_asoc_dma = {
.name = "samsung-audio",
.id = -1,
.dev = {
.dma_mask = &samsung_device_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}
};
struct platform_device samsung_asoc_idma = { struct platform_device samsung_asoc_idma = {
.name = "samsung-idma", .name = "samsung-idma",
.id = -1, .id = -1,

View File

@ -132,7 +132,6 @@ extern struct platform_device exynos4_device_pcm1;
extern struct platform_device exynos4_device_pcm2; extern struct platform_device exynos4_device_pcm2;
extern struct platform_device exynos4_device_spdif; extern struct platform_device exynos4_device_spdif;
extern struct platform_device samsung_asoc_dma;
extern struct platform_device samsung_asoc_idma; extern struct platform_device samsung_asoc_idma;
extern struct platform_device samsung_device_keypad; extern struct platform_device samsung_device_keypad;

View File

@ -72,6 +72,16 @@ config INPUT_AD714X_SPI
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ad714x-spi. module will be called ad714x-spi.
config INPUT_ARIZONA_HAPTICS
tristate "Arizona haptics support"
depends on MFD_ARIZONA && SND_SOC
select INPUT_FF_MEMLESS
help
Say Y to enable support for the haptics module in Arizona CODECs.
To compile this driver as a module, choose M here: the
module will be called arizona-haptics.
config INPUT_BMA150 config INPUT_BMA150
tristate "BMA150/SMB380 acceleration sensor support" tristate "BMA150/SMB380 acceleration sensor support"
depends on I2C depends on I2C

View File

@ -14,6 +14,7 @@ obj-$(CONFIG_INPUT_ADXL34X) += adxl34x.o
obj-$(CONFIG_INPUT_ADXL34X_I2C) += adxl34x-i2c.o obj-$(CONFIG_INPUT_ADXL34X_I2C) += adxl34x-i2c.o
obj-$(CONFIG_INPUT_ADXL34X_SPI) += adxl34x-spi.o obj-$(CONFIG_INPUT_ADXL34X_SPI) += adxl34x-spi.o
obj-$(CONFIG_INPUT_APANEL) += apanel.o obj-$(CONFIG_INPUT_APANEL) += apanel.o
obj-$(CONFIG_INPUT_ARIZONA_HAPTICS) += arizona-haptics.o
obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o
obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
obj-$(CONFIG_INPUT_BFIN_ROTARY) += bfin_rotary.o obj-$(CONFIG_INPUT_BFIN_ROTARY) += bfin_rotary.o

View File

@ -0,0 +1,255 @@
/*
* Arizona haptics driver
*
* Copyright 2012 Wolfson Microelectronics plc
*
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <linux/mfd/arizona/core.h>
#include <linux/mfd/arizona/pdata.h>
#include <linux/mfd/arizona/registers.h>
struct arizona_haptics {
struct arizona *arizona;
struct input_dev *input_dev;
struct work_struct work;
struct mutex mutex;
u8 intensity;
};
static void arizona_haptics_work(struct work_struct *work)
{
struct arizona_haptics *haptics = container_of(work,
struct arizona_haptics,
work);
struct arizona *arizona = haptics->arizona;
struct mutex *dapm_mutex = &arizona->dapm->card->dapm_mutex;
int ret;
if (!haptics->arizona->dapm) {
dev_err(arizona->dev, "No DAPM context\n");
return;
}
if (haptics->intensity) {
ret = regmap_update_bits(arizona->regmap,
ARIZONA_HAPTICS_PHASE_2_INTENSITY,
ARIZONA_PHASE2_INTENSITY_MASK,
haptics->intensity);
if (ret != 0) {
dev_err(arizona->dev, "Failed to set intensity: %d\n",
ret);
return;
}
/* This enable sequence will be a noop if already enabled */
ret = regmap_update_bits(arizona->regmap,
ARIZONA_HAPTICS_CONTROL_1,
ARIZONA_HAP_CTRL_MASK,
1 << ARIZONA_HAP_CTRL_SHIFT);
if (ret != 0) {
dev_err(arizona->dev, "Failed to start haptics: %d\n",
ret);
return;
}
mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS");
if (ret != 0) {
dev_err(arizona->dev, "Failed to start HAPTICS: %d\n",
ret);
mutex_unlock(dapm_mutex);
return;
}
ret = snd_soc_dapm_sync(arizona->dapm);
if (ret != 0) {
dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
ret);
mutex_unlock(dapm_mutex);
return;
}
mutex_unlock(dapm_mutex);
} else {
/* This disable sequence will be a noop if already enabled */
mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS");
if (ret != 0) {
dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n",
ret);
mutex_unlock(dapm_mutex);
return;
}
ret = snd_soc_dapm_sync(arizona->dapm);
if (ret != 0) {
dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
ret);
mutex_unlock(dapm_mutex);
return;
}
mutex_unlock(dapm_mutex);
ret = regmap_update_bits(arizona->regmap,
ARIZONA_HAPTICS_CONTROL_1,
ARIZONA_HAP_CTRL_MASK,
1 << ARIZONA_HAP_CTRL_SHIFT);
if (ret != 0) {
dev_err(arizona->dev, "Failed to stop haptics: %d\n",
ret);
return;
}
}
}
static int arizona_haptics_play(struct input_dev *input, void *data,
struct ff_effect *effect)
{
struct arizona_haptics *haptics = input_get_drvdata(input);
struct arizona *arizona = haptics->arizona;
if (!arizona->dapm) {
dev_err(arizona->dev, "No DAPM context\n");
return -EBUSY;
}
if (effect->u.rumble.strong_magnitude) {
/* Scale the magnitude into the range the device supports */
if (arizona->pdata.hap_act) {
haptics->intensity =
effect->u.rumble.strong_magnitude >> 9;
if (effect->direction < 0x8000)
haptics->intensity += 0x7f;
} else {
haptics->intensity =
effect->u.rumble.strong_magnitude >> 8;
}
} else {
haptics->intensity = 0;
}
schedule_work(&haptics->work);
return 0;
}
static void arizona_haptics_close(struct input_dev *input)
{
struct arizona_haptics *haptics = input_get_drvdata(input);
struct mutex *dapm_mutex = &haptics->arizona->dapm->card->dapm_mutex;
cancel_work_sync(&haptics->work);
mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
if (haptics->arizona->dapm)
snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS");
mutex_unlock(dapm_mutex);
}
static int arizona_haptics_probe(struct platform_device *pdev)
{
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
struct arizona_haptics *haptics;
int ret;
haptics = devm_kzalloc(&pdev->dev, sizeof(*haptics), GFP_KERNEL);
if (!haptics)
return -ENOMEM;
haptics->arizona = arizona;
ret = regmap_update_bits(arizona->regmap, ARIZONA_HAPTICS_CONTROL_1,
ARIZONA_HAP_ACT, arizona->pdata.hap_act);
if (ret != 0) {
dev_err(arizona->dev, "Failed to set haptics actuator: %d\n",
ret);
return ret;
}
INIT_WORK(&haptics->work, arizona_haptics_work);
haptics->input_dev = input_allocate_device();
if (haptics->input_dev == NULL) {
dev_err(arizona->dev, "Failed to allocate input device\n");
return -ENOMEM;
}
input_set_drvdata(haptics->input_dev, haptics);
haptics->input_dev->name = "arizona:haptics";
haptics->input_dev->dev.parent = pdev->dev.parent;
haptics->input_dev->close = arizona_haptics_close;
__set_bit(FF_RUMBLE, haptics->input_dev->ffbit);
ret = input_ff_create_memless(haptics->input_dev, NULL,
arizona_haptics_play);
if (ret < 0) {
dev_err(arizona->dev, "input_ff_create_memless() failed: %d\n",
ret);
goto err_ialloc;
}
ret = input_register_device(haptics->input_dev);
if (ret < 0) {
dev_err(arizona->dev, "couldn't register input device: %d\n",
ret);
goto err_iff;
}
platform_set_drvdata(pdev, haptics);
return 0;
err_iff:
if (haptics->input_dev)
input_ff_destroy(haptics->input_dev);
err_ialloc:
input_free_device(haptics->input_dev);
return ret;
}
static int arizona_haptics_remove(struct platform_device *pdev)
{
struct arizona_haptics *haptics = platform_get_drvdata(pdev);
input_unregister_device(haptics->input_dev);
return 0;
}
static struct platform_driver arizona_haptics_driver = {
.probe = arizona_haptics_probe,
.remove = arizona_haptics_remove,
.driver = {
.name = "arizona-haptics",
.owner = THIS_MODULE,
},
};
module_platform_driver(arizona_haptics_driver);
MODULE_ALIAS("platform:arizona-haptics");
MODULE_DESCRIPTION("Arizona haptics driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");

View File

@ -272,6 +272,7 @@ static struct mfd_cell early_devs[] = {
static struct mfd_cell wm5102_devs[] = { static struct mfd_cell wm5102_devs[] = {
{ .name = "arizona-extcon" }, { .name = "arizona-extcon" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ .name = "wm5102-codec" }, { .name = "wm5102-codec" },
@ -280,6 +281,7 @@ static struct mfd_cell wm5102_devs[] = {
static struct mfd_cell wm5110_devs[] = { static struct mfd_cell wm5110_devs[] = {
{ .name = "arizona-extcon" }, { .name = "arizona-extcon" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ .name = "wm5110-codec" }, { .name = "wm5110-codec" },

View File

@ -401,13 +401,19 @@ static const struct reg_default wm1811_reva_patch[] = {
*/ */
static int wm8994_device_init(struct wm8994 *wm8994, int irq) static int wm8994_device_init(struct wm8994 *wm8994, int irq)
{ {
struct wm8994_pdata *pdata = wm8994->dev->platform_data; struct wm8994_pdata *pdata;
struct regmap_config *regmap_config; struct regmap_config *regmap_config;
const struct reg_default *regmap_patch = NULL; const struct reg_default *regmap_patch = NULL;
const char *devname; const char *devname;
int ret, i, patch_regs; int ret, i, patch_regs;
int pulls = 0; int pulls = 0;
if (dev_get_platdata(wm8994->dev)) {
pdata = dev_get_platdata(wm8994->dev);
wm8994->pdata = *pdata;
}
pdata = &wm8994->pdata;
dev_set_drvdata(wm8994->dev, wm8994); dev_set_drvdata(wm8994->dev, wm8994);
/* Add the on-chip regulators first for bootstrapping */ /* Add the on-chip regulators first for bootstrapping */
@ -604,25 +610,22 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
} }
} }
if (pdata) { wm8994->irq_base = pdata->irq_base;
wm8994->irq_base = pdata->irq_base; wm8994->gpio_base = pdata->gpio_base;
wm8994->gpio_base = pdata->gpio_base;
/* GPIO configuration is only applied if it's non-zero */ /* GPIO configuration is only applied if it's non-zero */
for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) { for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
if (pdata->gpio_defaults[i]) { if (pdata->gpio_defaults[i]) {
wm8994_set_bits(wm8994, WM8994_GPIO_1 + i, wm8994_set_bits(wm8994, WM8994_GPIO_1 + i,
0xffff, 0xffff, pdata->gpio_defaults[i]);
pdata->gpio_defaults[i]);
}
} }
wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven;
if (pdata->spkmode_pu)
pulls |= WM8994_SPKMODE_PU;
} }
wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven;
if (pdata->spkmode_pu)
pulls |= WM8994_SPKMODE_PU;
/* Disable unneeded pulls */ /* Disable unneeded pulls */
wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2, wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD | WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD |

View File

@ -18,6 +18,8 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
/* Serialize access to ssc_list and user count */ /* Serialize access to ssc_list and user count */
static DEFINE_SPINLOCK(user_lock); static DEFINE_SPINLOCK(user_lock);
static LIST_HEAD(ssc_list); static LIST_HEAD(ssc_list);
@ -29,7 +31,13 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
spin_lock(&user_lock); spin_lock(&user_lock);
list_for_each_entry(ssc, &ssc_list, list) { list_for_each_entry(ssc, &ssc_list, list) {
if (ssc->pdev->id == ssc_num) { if (ssc->pdev->dev.of_node) {
if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
== ssc_num) {
ssc_valid = 1;
break;
}
} else if (ssc->pdev->id == ssc_num) {
ssc_valid = 1; ssc_valid = 1;
break; break;
} }
@ -68,39 +76,93 @@ void ssc_free(struct ssc_device *ssc)
} }
EXPORT_SYMBOL(ssc_free); EXPORT_SYMBOL(ssc_free);
static int __init ssc_probe(struct platform_device *pdev) static struct atmel_ssc_platform_data at91rm9200_config = {
.use_dma = 0,
};
static struct atmel_ssc_platform_data at91sam9g45_config = {
.use_dma = 1,
};
static const struct platform_device_id atmel_ssc_devtypes[] = {
{
.name = "at91rm9200_ssc",
.driver_data = (unsigned long) &at91rm9200_config,
}, {
.name = "at91sam9g45_ssc",
.driver_data = (unsigned long) &at91sam9g45_config,
}, {
/* sentinel */
}
};
#ifdef CONFIG_OF
static const struct of_device_id atmel_ssc_dt_ids[] = {
{
.compatible = "atmel,at91rm9200-ssc",
.data = &at91rm9200_config,
}, {
.compatible = "atmel,at91sam9g45-ssc",
.data = &at91sam9g45_config,
}, {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(of, atmel_ssc_dt_ids);
#endif
static inline const struct atmel_ssc_platform_data * __init
atmel_ssc_get_driver_data(struct platform_device *pdev)
{
if (pdev->dev.of_node) {
const struct of_device_id *match;
match = of_match_node(atmel_ssc_dt_ids, pdev->dev.of_node);
if (match == NULL)
return NULL;
return match->data;
}
return (struct atmel_ssc_platform_data *)
platform_get_device_id(pdev)->driver_data;
}
static int ssc_probe(struct platform_device *pdev)
{ {
int retval = 0;
struct resource *regs; struct resource *regs;
struct ssc_device *ssc; struct ssc_device *ssc;
const struct atmel_ssc_platform_data *plat_dat;
ssc = kzalloc(sizeof(struct ssc_device), GFP_KERNEL); ssc = devm_kzalloc(&pdev->dev, sizeof(struct ssc_device), GFP_KERNEL);
if (!ssc) { if (!ssc) {
dev_dbg(&pdev->dev, "out of memory\n"); dev_dbg(&pdev->dev, "out of memory\n");
retval = -ENOMEM; return -ENOMEM;
goto out;
} }
ssc->pdev = pdev;
plat_dat = atmel_ssc_get_driver_data(pdev);
if (!plat_dat)
return -ENODEV;
ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) { if (!regs) {
dev_dbg(&pdev->dev, "no mmio resource defined\n"); dev_dbg(&pdev->dev, "no mmio resource defined\n");
retval = -ENXIO; return -ENXIO;
goto out_free;
} }
ssc->clk = clk_get(&pdev->dev, "pclk"); ssc->regs = devm_request_and_ioremap(&pdev->dev, regs);
if (IS_ERR(ssc->clk)) {
dev_dbg(&pdev->dev, "no pclk clock defined\n");
retval = -ENXIO;
goto out_free;
}
ssc->pdev = pdev;
ssc->regs = ioremap(regs->start, resource_size(regs));
if (!ssc->regs) { if (!ssc->regs) {
dev_dbg(&pdev->dev, "ioremap failed\n"); dev_dbg(&pdev->dev, "ioremap failed\n");
retval = -EINVAL; return -EINVAL;
goto out_clk; }
ssc->phybase = regs->start;
ssc->clk = devm_clk_get(&pdev->dev, "pclk");
if (IS_ERR(ssc->clk)) {
dev_dbg(&pdev->dev, "no pclk clock defined\n");
return -ENXIO;
} }
/* disable all interrupts */ /* disable all interrupts */
@ -112,8 +174,7 @@ static int __init ssc_probe(struct platform_device *pdev)
ssc->irq = platform_get_irq(pdev, 0); ssc->irq = platform_get_irq(pdev, 0);
if (!ssc->irq) { if (!ssc->irq) {
dev_dbg(&pdev->dev, "could not get irq\n"); dev_dbg(&pdev->dev, "could not get irq\n");
retval = -ENXIO; return -ENXIO;
goto out_unmap;
} }
spin_lock(&user_lock); spin_lock(&user_lock);
@ -125,16 +186,7 @@ static int __init ssc_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "Atmel SSC device at 0x%p (irq %d)\n", dev_info(&pdev->dev, "Atmel SSC device at 0x%p (irq %d)\n",
ssc->regs, ssc->irq); ssc->regs, ssc->irq);
goto out; return 0;
out_unmap:
iounmap(ssc->regs);
out_clk:
clk_put(ssc->clk);
out_free:
kfree(ssc);
out:
return retval;
} }
static int ssc_remove(struct platform_device *pdev) static int ssc_remove(struct platform_device *pdev)
@ -142,34 +194,23 @@ static int ssc_remove(struct platform_device *pdev)
struct ssc_device *ssc = platform_get_drvdata(pdev); struct ssc_device *ssc = platform_get_drvdata(pdev);
spin_lock(&user_lock); spin_lock(&user_lock);
iounmap(ssc->regs);
clk_put(ssc->clk);
list_del(&ssc->list); list_del(&ssc->list);
kfree(ssc);
spin_unlock(&user_lock); spin_unlock(&user_lock);
return 0; return 0;
} }
static struct platform_driver ssc_driver = { static struct platform_driver ssc_driver = {
.remove = ssc_remove,
.driver = { .driver = {
.name = "ssc", .name = "ssc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(atmel_ssc_dt_ids),
}, },
.id_table = atmel_ssc_devtypes,
.probe = ssc_probe,
.remove = ssc_remove,
}; };
module_platform_driver(ssc_driver);
static int __init ssc_init(void)
{
return platform_driver_probe(&ssc_driver, ssc_probe);
}
module_init(ssc_init);
static void __exit ssc_exit(void)
{
platform_driver_unregister(&ssc_driver);
}
module_exit(ssc_exit);
MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
MODULE_DESCRIPTION("SSC driver for Atmel AVR32 and AT91"); MODULE_DESCRIPTION("SSC driver for Atmel AVR32 and AT91");

View File

@ -5,10 +5,16 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/io.h> #include <linux/io.h>
struct atmel_ssc_platform_data {
int use_dma;
};
struct ssc_device { struct ssc_device {
struct list_head list; struct list_head list;
resource_size_t phybase;
void __iomem *regs; void __iomem *regs;
struct platform_device *pdev; struct platform_device *pdev;
struct atmel_ssc_platform_data *pdata;
struct clk *clk; struct clk *clk;
int user; int user;
int irq; int irq;

View File

@ -78,6 +78,8 @@ enum arizona_type {
#define ARIZONA_NUM_IRQ 50 #define ARIZONA_NUM_IRQ 50
struct snd_soc_dapm_context;
struct arizona { struct arizona {
struct regmap *regmap; struct regmap *regmap;
struct device *dev; struct device *dev;
@ -98,6 +100,8 @@ struct arizona {
struct mutex clk_lock; struct mutex clk_lock;
int clk32k_ref; int clk32k_ref;
struct snd_soc_dapm_context *dapm;
}; };
int arizona_clk32k_enable(struct arizona *arizona); int arizona_clk32k_enable(struct arizona *arizona);

View File

@ -62,6 +62,9 @@
#define ARIZONA_MAX_OUTPUT 6 #define ARIZONA_MAX_OUTPUT 6
#define ARIZONA_HAP_ACT_ERM 0
#define ARIZONA_HAP_ACT_LRA 2
#define ARIZONA_MAX_PDM_SPK 2 #define ARIZONA_MAX_PDM_SPK 2
struct regulator_init_data; struct regulator_init_data;
@ -114,6 +117,9 @@ struct arizona_pdata {
/** PDM speaker format */ /** PDM speaker format */
unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK]; unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
/** Haptic actuator type */
unsigned int hap_act;
}; };
#endif #endif

View File

@ -19,6 +19,8 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/mfd/wm8994/pdata.h>
enum wm8994_type { enum wm8994_type {
WM8994 = 0, WM8994 = 0,
WM8958 = 1, WM8958 = 1,
@ -55,6 +57,8 @@ struct regulator_bulk_data;
struct wm8994 { struct wm8994 {
struct mutex irq_lock; struct mutex irq_lock;
struct wm8994_pdata pdata;
enum wm8994_type type; enum wm8994_type type;
int revision; int revision;
int cust_id; int cust_id;

View File

@ -176,6 +176,11 @@ struct wm8994_pdata {
unsigned int lineout1fb:1; unsigned int lineout1fb:1;
unsigned int lineout2fb:1; unsigned int lineout2fb:1;
/* Delay between detecting a jack and starting microphone
* detect (specified in ms)
*/
int micdet_delay;
/* IRQ for microphone detection if brought out directly as a /* IRQ for microphone detection if brought out directly as a
* signal. * signal.
*/ */

View File

@ -38,12 +38,6 @@ struct samsung_i2s {
#define QUIRK_NEED_RSTCLR (1 << 3) #define QUIRK_NEED_RSTCLR (1 << 3)
/* Quirks of the I2S controller */ /* Quirks of the I2S controller */
u32 quirks; u32 quirks;
/*
* Array of clock names that can be used to generate I2S signals.
* Also corresponds to clocks of I2SMOD[10]
*/
const char **src_clk;
dma_addr_t idma_addr; dma_addr_t idma_addr;
}; };

View File

@ -16,12 +16,13 @@
#ifndef __DAVINCI_ASP_H #ifndef __DAVINCI_ASP_H
#define __DAVINCI_ASP_H #define __DAVINCI_ASP_H
#include <linux/genalloc.h>
struct snd_platform_data { struct snd_platform_data {
u32 tx_dma_offset; u32 tx_dma_offset;
u32 rx_dma_offset; u32 rx_dma_offset;
int asp_chan_q; /* event queue number for ASP channel */ int asp_chan_q; /* event queue number for ASP channel */
int ram_chan_q; /* event queue number for RAM channel */ int ram_chan_q; /* event queue number for RAM channel */
unsigned int codec_fmt;
/* /*
* Allowing this is more efficient and eliminates left and right swaps * Allowing this is more efficient and eliminates left and right swaps
* caused by underruns, but will swap the left and right channels * caused by underruns, but will swap the left and right channels
@ -30,6 +31,7 @@ struct snd_platform_data {
unsigned enable_channel_combine:1; unsigned enable_channel_combine:1;
unsigned sram_size_playback; unsigned sram_size_playback;
unsigned sram_size_capture; unsigned sram_size_capture;
struct gen_pool *sram_pool;
/* /*
* If McBSP peripheral gets the clock from an external pin, * If McBSP peripheral gets the clock from an external pin,

View File

@ -25,8 +25,34 @@
#ifndef _OMAP_TWL4030_H_ #ifndef _OMAP_TWL4030_H_
#define _OMAP_TWL4030_H_ #define _OMAP_TWL4030_H_
/* To select if only one channel is connected in a stereo port */
#define OMAP_TWL4030_LEFT (1 << 0)
#define OMAP_TWL4030_RIGHT (1 << 1)
struct omap_tw4030_pdata { struct omap_tw4030_pdata {
const char *card_name; const char *card_name;
/* Voice port is connected to McBSP3 */
bool voice_connected;
/* The driver will parse the connection flags if this flag is set */
bool custom_routing;
/* Flags to indicate connected audio ports. */
u8 has_hs;
u8 has_hf;
u8 has_predriv;
u8 has_carkit;
bool has_ear;
bool has_mainmic;
bool has_submic;
bool has_hsmic;
bool has_carkitmic;
bool has_digimic0;
bool has_digimic1;
u8 has_linein;
/* Jack detect GPIO or <= 0 if it is not implemented */
int jack_detect;
}; };
#endif /* _OMAP_TWL4030_H_ */ #endif /* _OMAP_TWL4030_H_ */

View File

@ -1,10 +0,0 @@
header-y += asequencer.h
header-y += asound.h
header-y += asound_fm.h
header-y += emu10k1.h
header-y += hdsp.h
header-y += hdspm.h
header-y += sb16_csp.h
header-y += sfnt_info.h
header-y += compress_params.h
header-y += compress_offload.h

View File

@ -22,294 +22,9 @@
#ifndef __SOUND_ASEQUENCER_H #ifndef __SOUND_ASEQUENCER_H
#define __SOUND_ASEQUENCER_H #define __SOUND_ASEQUENCER_H
#ifdef __KERNEL__
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <sound/asound.h> #include <sound/asound.h>
#endif #include <uapi/sound/asequencer.h>
/** version of the sequencer */
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
/**
* definition of sequencer event types
*/
/** system messages
* event data type = #snd_seq_result
*/
#define SNDRV_SEQ_EVENT_SYSTEM 0
#define SNDRV_SEQ_EVENT_RESULT 1
/** note messages (channel specific)
* event data type = #snd_seq_ev_note
*/
#define SNDRV_SEQ_EVENT_NOTE 5
#define SNDRV_SEQ_EVENT_NOTEON 6
#define SNDRV_SEQ_EVENT_NOTEOFF 7
#define SNDRV_SEQ_EVENT_KEYPRESS 8
/** control messages (channel specific)
* event data type = #snd_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_CONTROLLER 10
#define SNDRV_SEQ_EVENT_PGMCHANGE 11
#define SNDRV_SEQ_EVENT_CHANPRESS 12
#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
/** synchronisation messages
* event data type = #snd_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
/** timer messages
* event data type = snd_seq_ev_queue_control
*/
#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
/** others
* event data type = none
*/
#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
/** echo back, kernel private messages
* event data type = any type
*/
#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
/** system status messages (broadcast for subscribers)
* event data type = snd_seq_addr
*/
#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
/** port connection changes
* event data type = snd_seq_connect
*/
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
/* 70-89: synthesizer events - obsoleted */
/** user-defined events with fixed length
* event data type = any
*/
#define SNDRV_SEQ_EVENT_USR0 90
#define SNDRV_SEQ_EVENT_USR1 91
#define SNDRV_SEQ_EVENT_USR2 92
#define SNDRV_SEQ_EVENT_USR3 93
#define SNDRV_SEQ_EVENT_USR4 94
#define SNDRV_SEQ_EVENT_USR5 95
#define SNDRV_SEQ_EVENT_USR6 96
#define SNDRV_SEQ_EVENT_USR7 97
#define SNDRV_SEQ_EVENT_USR8 98
#define SNDRV_SEQ_EVENT_USR9 99
/* 100-118: instrument layer - obsoleted */
/* 119-129: reserved */
/* 130-139: variable length events
* event data type = snd_seq_ev_ext
* (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
*/
#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
/* 132-134: reserved */
#define SNDRV_SEQ_EVENT_USR_VAR0 135
#define SNDRV_SEQ_EVENT_USR_VAR1 136
#define SNDRV_SEQ_EVENT_USR_VAR2 137
#define SNDRV_SEQ_EVENT_USR_VAR3 138
#define SNDRV_SEQ_EVENT_USR_VAR4 139
/* 150-151: kernel events with quote - DO NOT use in user clients */
#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
/* 152-191: reserved */
/* 192-254: hardware specific events */
/* 255: special event */
#define SNDRV_SEQ_EVENT_NONE 255
typedef unsigned char snd_seq_event_type_t;
/** event address */
struct snd_seq_addr {
unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
};
/** port connection */
struct snd_seq_connect {
struct snd_seq_addr sender;
struct snd_seq_addr dest;
};
#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
/* event mode flag - NOTE: only 8 bits available! */
#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
/* note event */
struct snd_seq_ev_note {
unsigned char channel;
unsigned char note;
unsigned char velocity;
unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
};
/* controller event */
struct snd_seq_ev_ctrl {
unsigned char channel;
unsigned char unused1, unused2, unused3; /* pad */
unsigned int param;
signed int value;
};
/* generic set of bytes (12x8 bit) */
struct snd_seq_ev_raw8 {
unsigned char d[12]; /* 8 bit value */
};
/* generic set of integers (3x32 bit) */
struct snd_seq_ev_raw32 {
unsigned int d[3]; /* 32 bit value */
};
/* external stored data */
struct snd_seq_ev_ext {
unsigned int len; /* length of data */
void *ptr; /* pointer to data (note: maybe 64-bit) */
} __attribute__((packed));
struct snd_seq_result {
int event; /* processed event type */
int result;
};
struct snd_seq_real_time {
unsigned int tv_sec; /* seconds */
unsigned int tv_nsec; /* nanoseconds */
};
typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
union snd_seq_timestamp {
snd_seq_tick_time_t tick;
struct snd_seq_real_time time;
};
struct snd_seq_queue_skew {
unsigned int value;
unsigned int base;
};
/* queue timer control */
struct snd_seq_ev_queue_control {
unsigned char queue; /* affected queue */
unsigned char pad[3]; /* reserved */
union {
signed int value; /* affected value (e.g. tempo) */
union snd_seq_timestamp time; /* time */
unsigned int position; /* sync position */
struct snd_seq_queue_skew skew;
unsigned int d32[2];
unsigned char d8[8];
} param;
};
/* quoted event - inside the kernel only */
struct snd_seq_ev_quote {
struct snd_seq_addr origin; /* original sender */
unsigned short value; /* optional data */
struct snd_seq_event *event; /* quoted event */
} __attribute__((packed));
/* sequencer event */
struct snd_seq_event {
snd_seq_event_type_t type; /* event type */
unsigned char flags; /* event flags */
char tag;
unsigned char queue; /* schedule queue */
union snd_seq_timestamp time; /* schedule time */
struct snd_seq_addr source; /* source address */
struct snd_seq_addr dest; /* destination address */
union { /* event data... */
struct snd_seq_ev_note note;
struct snd_seq_ev_ctrl control;
struct snd_seq_ev_raw8 raw8;
struct snd_seq_ev_raw32 raw32;
struct snd_seq_ev_ext ext;
struct snd_seq_ev_queue_control queue;
union snd_seq_timestamp time;
struct snd_seq_addr addr;
struct snd_seq_connect connect;
struct snd_seq_result result;
struct snd_seq_ev_quote quote;
} data;
};
/*
* bounce event - stored as variable size data
*/
struct snd_seq_event_bounce {
int err;
struct snd_seq_event event;
/* external data follows here. */
};
#ifdef __KERNEL__
/* helper macro */ /* helper macro */
#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce))) #define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
@ -368,311 +83,4 @@ struct snd_seq_event_bounce {
/* queue sync port */ /* queue sync port */
#define snd_seq_queue_sync_port(q) ((q) + 16) #define snd_seq_queue_sync_port(q) ((q) + 16)
#endif /* __KERNEL__ */
/* system information */
struct snd_seq_system_info {
int queues; /* maximum queues count */
int clients; /* maximum clients count */
int ports; /* maximum ports per client */
int channels; /* maximum channels per port */
int cur_clients; /* current clients */
int cur_queues; /* current queues */
char reserved[24];
};
/* system running information */
struct snd_seq_running_info {
unsigned char client; /* client id */
unsigned char big_endian; /* 1 = big-endian */
unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
unsigned char pad; /* reserved */
unsigned char reserved[12];
};
/* known client numbers */
#define SNDRV_SEQ_CLIENT_SYSTEM 0
/* internal client numbers */
#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
/* client types */
typedef int __bitwise snd_seq_client_type_t;
#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
/* event filter flags */
#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
struct snd_seq_client_info {
int client; /* client number to inquire */
snd_seq_client_type_t type; /* client type */
char name[64]; /* client name */
unsigned int filter; /* filter flags */
unsigned char multicast_filter[8]; /* multicast filter bitmap */
unsigned char event_filter[32]; /* event filter bitmap */
int num_ports; /* RO: number of ports */
int event_lost; /* number of lost events */
char reserved[64]; /* for future use */
};
/* client pool size */
struct snd_seq_client_pool {
int client; /* client number to inquire */
int output_pool; /* outgoing (write) pool size */
int input_pool; /* incoming (read) pool size */
int output_room; /* minimum free pool size for select/blocking mode */
int output_free; /* unused size */
int input_free; /* unused size */
char reserved[64];
};
/* Remove events by specified criteria */
#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
struct snd_seq_remove_events {
unsigned int remove_mode; /* Flags that determine what gets removed */
union snd_seq_timestamp time;
unsigned char queue; /* Queue for REMOVE_DEST */
struct snd_seq_addr dest; /* Address for REMOVE_DEST */
unsigned char channel; /* Channel for REMOVE_DEST */
int type; /* For REMOVE_EVENT_TYPE */
char tag; /* Tag for REMOVE_TAG */
int reserved[10]; /* To allow for future binary compatibility */
};
/* known port numbers */
#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
/* port capabilities (32 bits) */
#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
/* port type */
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
/* other standards...*/
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
/*...*/
#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
/* misc. conditioning flags */
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
struct snd_seq_port_info {
struct snd_seq_addr addr; /* client/port numbers */
char name[64]; /* port name */
unsigned int capability; /* port capability bits */
unsigned int type; /* port type bits */
int midi_channels; /* channels per MIDI port */
int midi_voices; /* voices per MIDI port */
int synth_voices; /* voices per SYNTH port */
int read_use; /* R/O: subscribers for output (from this port) */
int write_use; /* R/O: subscribers for input (to this port) */
void *kernel; /* reserved for kernel use (must be NULL) */
unsigned int flags; /* misc. conditioning */
unsigned char time_queue; /* queue # for timestamping */
char reserved[59]; /* for future use */
};
/* queue flags */
#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
/* queue information */
struct snd_seq_queue_info {
int queue; /* queue id */
/*
* security settings, only owner of this queue can start/stop timer
* etc. if the queue is locked for other clients
*/
int owner; /* client id for owner of the queue */
unsigned locked:1; /* timing queue locked for other queues */
char name[64]; /* name of this queue */
unsigned int flags; /* flags */
char reserved[60]; /* for future use */
};
/* queue info/status */
struct snd_seq_queue_status {
int queue; /* queue id */
int events; /* read-only - queue size */
snd_seq_tick_time_t tick; /* current tick */
struct snd_seq_real_time time; /* current time */
int running; /* running state of queue */
int flags; /* various flags */
char reserved[64]; /* for the future */
};
/* queue tempo */
struct snd_seq_queue_tempo {
int queue; /* sequencer queue */
unsigned int tempo; /* current tempo, us/tick */
int ppq; /* time resolution, ticks/quarter */
unsigned int skew_value; /* queue skew */
unsigned int skew_base; /* queue skew base */
char reserved[24]; /* for the future */
};
/* sequencer timer sources */
#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
/* queue timer info */
struct snd_seq_queue_timer {
int queue; /* sequencer queue */
int type; /* source timer type */
union {
struct {
struct snd_timer_id id; /* ALSA's timer ID */
unsigned int resolution; /* resolution in Hz */
} alsa;
} u;
char reserved[64]; /* for the future use */
};
struct snd_seq_queue_client {
int queue; /* sequencer queue */
int client; /* sequencer client */
int used; /* queue is used with this client
(must be set for accepting events) */
/* per client watermarks */
char reserved[64]; /* for future use */
};
#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
struct snd_seq_port_subscribe {
struct snd_seq_addr sender; /* sender address */
struct snd_seq_addr dest; /* destination address */
unsigned int voices; /* number of voices to be allocated (0 = don't care) */
unsigned int flags; /* modes */
unsigned char queue; /* input time-stamp queue (optional) */
unsigned char pad[3]; /* reserved */
char reserved[64];
};
/* type of query subscription */
#define SNDRV_SEQ_QUERY_SUBS_READ 0
#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
struct snd_seq_query_subs {
struct snd_seq_addr root; /* client/port id to be searched */
int type; /* READ or WRITE */
int index; /* 0..N-1 */
int num_subs; /* R/O: number of subscriptions on this port */
struct snd_seq_addr addr; /* R/O: result */
unsigned char queue; /* R/O: result */
unsigned int flags; /* R/O: result */
char reserved[64]; /* for future use */
};
/*
* IOCTL commands
*/
#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
/* XXX
#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
*/
#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
#endif /* __SOUND_ASEQUENCER_H */ #endif /* __SOUND_ASEQUENCER_H */

View File

@ -19,13 +19,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
#ifndef __SOUND_ASOUND_H #ifndef __SOUND_ASOUND_H
#define __SOUND_ASOUND_H #define __SOUND_ASOUND_H
#include <linux/types.h>
#ifdef __KERNEL__
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <linux/time.h> #include <linux/time.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
@ -40,934 +36,5 @@
#endif #endif
#endif #endif
#endif /* __KERNEL__ **/ #include <uapi/sound/asound.h>
/*
* protocol version
*/
#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
(SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
(SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
/****************************************************************************
* *
* Digital audio interface *
* *
****************************************************************************/
struct snd_aes_iec958 {
unsigned char status[24]; /* AES/IEC958 channel status bits */
unsigned char subcode[147]; /* AES/IEC958 subcode bits */
unsigned char pad; /* nothing */
unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
};
/****************************************************************************
* *
* CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
* *
****************************************************************************/
struct snd_cea_861_aud_if {
unsigned char db1_ct_cc; /* coding type and channel count */
unsigned char db2_sf_ss; /* sample frequency and size */
unsigned char db3; /* not used, all zeros */
unsigned char db4_ca; /* channel allocation code */
unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
};
/****************************************************************************
* *
* Section for driver hardware dependent interface - /dev/snd/hw? *
* *
****************************************************************************/
#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
enum {
SNDRV_HWDEP_IFACE_OPL2 = 0,
SNDRV_HWDEP_IFACE_OPL3,
SNDRV_HWDEP_IFACE_OPL4,
SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
/* Don't forget to change the following: */
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
};
struct snd_hwdep_info {
unsigned int device; /* WR: device number */
int card; /* R: card number */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* hwdep name */
int iface; /* hwdep interface */
unsigned char reserved[64]; /* reserved for future */
};
/* generic DSP loader */
struct snd_hwdep_dsp_status {
unsigned int version; /* R: driver-specific version */
unsigned char id[32]; /* R: driver-specific ID string */
unsigned int num_dsps; /* R: number of DSP images to transfer */
unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
unsigned int chip_ready; /* R: 1 = initialization finished */
unsigned char reserved[16]; /* reserved for future use */
};
struct snd_hwdep_dsp_image {
unsigned int index; /* W: DSP index */
unsigned char name[64]; /* W: ID (e.g. file name) */
unsigned char __user *image; /* W: binary image */
size_t length; /* W: size of image in bytes */
unsigned long driver_data; /* W: driver-specific data */
};
#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
/*****************************************************************************
* *
* Digital Audio (PCM) interface - /dev/snd/pcm?? *
* *
*****************************************************************************/
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10)
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
enum {
SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
SNDRV_PCM_CLASS_MULTI, /* multichannel device */
SNDRV_PCM_CLASS_MODEM, /* software modem class */
SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
/* Don't forget to change the following: */
SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
};
enum {
SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
/* Don't forget to change the following: */
SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
};
enum {
SNDRV_PCM_STREAM_PLAYBACK = 0,
SNDRV_PCM_STREAM_CAPTURE,
SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
};
typedef int __bitwise snd_pcm_access_t;
#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
#endif
#ifdef SNDRV_BIG_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
#endif
typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
typedef int __bitwise snd_pcm_state_t;
#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
enum {
SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
};
union snd_pcm_sync_id {
unsigned char id[16];
unsigned short id16[8];
unsigned int id32[4];
};
struct snd_pcm_info {
unsigned int device; /* RO/WR (control): device number */
unsigned int subdevice; /* RO/WR (control): subdevice number */
int stream; /* RO/WR (control): stream direction */
int card; /* R: card number */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* name of this device */
unsigned char subname[32]; /* subdevice name */
int dev_class; /* SNDRV_PCM_CLASS_* */
int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
unsigned int subdevices_count;
unsigned int subdevices_avail;
union snd_pcm_sync_id sync; /* hardware synchronization ID */
unsigned char reserved[64]; /* reserved for future... */
};
typedef int snd_pcm_hw_param_t;
#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
* interrupts in us
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
* buffer
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
* in us
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
struct snd_interval {
unsigned int min, max;
unsigned int openmin:1,
openmax:1,
integer:1,
empty:1;
};
#define SNDRV_MASK_MAX 256
struct snd_mask {
__u32 bits[(SNDRV_MASK_MAX+31)/32];
};
struct snd_pcm_hw_params {
unsigned int flags;
struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
struct snd_mask mres[5]; /* reserved masks */
struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
struct snd_interval ires[9]; /* reserved intervals */
unsigned int rmask; /* W: requested masks */
unsigned int cmask; /* R: changed masks */
unsigned int info; /* R: Info flags for returned setup */
unsigned int msbits; /* R: used most significant bits */
unsigned int rate_num; /* R: rate numerator */
unsigned int rate_den; /* R: rate denominator */
snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
unsigned char reserved[64]; /* reserved for future */
};
enum {
SNDRV_PCM_TSTAMP_NONE = 0,
SNDRV_PCM_TSTAMP_ENABLE,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};
struct snd_pcm_sw_params {
int tstamp_mode; /* timestamp mode */
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; /* 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 */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
unsigned char reserved[64]; /* reserved for future */
};
struct snd_pcm_channel_info {
unsigned int channel;
__kernel_off_t offset; /* mmap offset */
unsigned int first; /* offset to first sample in bits */
unsigned int step; /* samples distance in bits */
};
struct snd_pcm_status {
snd_pcm_state_t state; /* stream state */
struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
struct timespec tstamp; /* reference timestamp */
snd_pcm_uframes_t appl_ptr; /* appl ptr */
snd_pcm_uframes_t hw_ptr; /* hw ptr */
snd_pcm_sframes_t delay; /* current delay in frames */
snd_pcm_uframes_t avail; /* number of frames available */
snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
snd_pcm_state_t suspended_state; /* suspended stream state */
unsigned char reserved[60]; /* must be filled with zero */
};
struct snd_pcm_mmap_status {
snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
int pad1; /* Needed for 64 bit alignment */
snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
struct timespec tstamp; /* Timestamp */
snd_pcm_state_t suspended_state; /* RO: suspended stream state */
};
struct snd_pcm_mmap_control {
snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
};
#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
struct snd_pcm_sync_ptr {
unsigned int flags;
union {
struct snd_pcm_mmap_status status;
unsigned char reserved[64];
} s;
union {
struct snd_pcm_mmap_control control;
unsigned char reserved[64];
} c;
};
struct snd_xferi {
snd_pcm_sframes_t result;
void __user *buf;
snd_pcm_uframes_t frames;
};
struct snd_xfern {
snd_pcm_sframes_t result;
void __user * __user *bufs;
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,
};
/* channel positions */
enum {
SNDRV_CHMAP_UNKNOWN = 0,
SNDRV_CHMAP_NA, /* N/A, silent */
SNDRV_CHMAP_MONO, /* mono stream */
/* this follows the alsa-lib mixer channel value + 3 */
SNDRV_CHMAP_FL, /* front left */
SNDRV_CHMAP_FR, /* front right */
SNDRV_CHMAP_RL, /* rear left */
SNDRV_CHMAP_RR, /* rear right */
SNDRV_CHMAP_FC, /* front center */
SNDRV_CHMAP_LFE, /* LFE */
SNDRV_CHMAP_SL, /* side left */
SNDRV_CHMAP_SR, /* side right */
SNDRV_CHMAP_RC, /* rear center */
/* new definitions */
SNDRV_CHMAP_FLC, /* front left center */
SNDRV_CHMAP_FRC, /* front right center */
SNDRV_CHMAP_RLC, /* rear left center */
SNDRV_CHMAP_RRC, /* rear right center */
SNDRV_CHMAP_FLW, /* front left wide */
SNDRV_CHMAP_FRW, /* front right wide */
SNDRV_CHMAP_FLH, /* front left high */
SNDRV_CHMAP_FCH, /* front center high */
SNDRV_CHMAP_FRH, /* front right high */
SNDRV_CHMAP_TC, /* top center */
SNDRV_CHMAP_TFL, /* top front left */
SNDRV_CHMAP_TFR, /* top front right */
SNDRV_CHMAP_TFC, /* top front center */
SNDRV_CHMAP_TRL, /* top rear left */
SNDRV_CHMAP_TRR, /* top rear right */
SNDRV_CHMAP_TRC, /* top rear center */
SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
};
#define SNDRV_CHMAP_POSITION_MASK 0xffff
#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
/*****************************************************************************
* *
* MIDI v1.0 interface *
* *
*****************************************************************************/
/*
* Raw MIDI section - /dev/snd/midi??
*/
#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
enum {
SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
SNDRV_RAWMIDI_STREAM_INPUT,
SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
};
#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
struct snd_rawmidi_info {
unsigned int device; /* RO/WR (control): device number */
unsigned int subdevice; /* RO/WR (control): subdevice number */
int stream; /* WR: stream */
int card; /* R: card number */
unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* name of device */
unsigned char subname[32]; /* name of active or selected subdevice */
unsigned int subdevices_count;
unsigned int subdevices_avail;
unsigned char reserved[64]; /* reserved for future use */
};
struct snd_rawmidi_params {
int stream;
size_t buffer_size; /* queue size in bytes */
size_t avail_min; /* minimum avail bytes for wakeup */
unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
unsigned char reserved[16]; /* reserved for future use */
};
struct snd_rawmidi_status {
int stream;
struct timespec tstamp; /* Timestamp */
size_t avail; /* available bytes */
size_t xruns; /* count of overruns since last status (in bytes) */
unsigned char reserved[16]; /* reserved for future use */
};
#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
/*
* Timer section - /dev/snd/timer
*/
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
enum {
SNDRV_TIMER_CLASS_NONE = -1,
SNDRV_TIMER_CLASS_SLAVE = 0,
SNDRV_TIMER_CLASS_GLOBAL,
SNDRV_TIMER_CLASS_CARD,
SNDRV_TIMER_CLASS_PCM,
SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
};
/* slave timer classes */
enum {
SNDRV_TIMER_SCLASS_NONE = 0,
SNDRV_TIMER_SCLASS_APPLICATION,
SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
};
/* global timers (device member) */
#define SNDRV_TIMER_GLOBAL_SYSTEM 0
#define SNDRV_TIMER_GLOBAL_RTC 1
#define SNDRV_TIMER_GLOBAL_HPET 2
#define SNDRV_TIMER_GLOBAL_HRTIMER 3
/* info flags */
#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
struct snd_timer_id {
int dev_class;
int dev_sclass;
int card;
int device;
int subdevice;
};
struct snd_timer_ginfo {
struct snd_timer_id tid; /* requested timer ID */
unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
int card; /* card number */
unsigned char id[64]; /* timer identification */
unsigned char name[80]; /* timer name */
unsigned long reserved0; /* reserved for future use */
unsigned long resolution; /* average period resolution in ns */
unsigned long resolution_min; /* minimal period resolution in ns */
unsigned long resolution_max; /* maximal period resolution in ns */
unsigned int clients; /* active timer clients */
unsigned char reserved[32];
};
struct snd_timer_gparams {
struct snd_timer_id tid; /* requested timer ID */
unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
unsigned char reserved[32];
};
struct snd_timer_gstatus {
struct snd_timer_id tid; /* requested timer ID */
unsigned long resolution; /* current period resolution in ns */
unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
unsigned char reserved[32];
};
struct snd_timer_select {
struct snd_timer_id id; /* bind to timer ID */
unsigned char reserved[32]; /* reserved */
};
struct snd_timer_info {
unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
int card; /* card number */
unsigned char id[64]; /* timer identificator */
unsigned char name[80]; /* timer name */
unsigned long reserved0; /* reserved for future use */
unsigned long resolution; /* average period resolution in ns */
unsigned char reserved[64]; /* reserved */
};
#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
struct snd_timer_params {
unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
unsigned int ticks; /* requested resolution in ticks */
unsigned int queue_size; /* total size of queue (32-1024) */
unsigned int reserved0; /* reserved, was: failure locations */
unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
unsigned char reserved[60]; /* reserved */
};
struct snd_timer_status {
struct timespec tstamp; /* Timestamp - last update */
unsigned int resolution; /* current period resolution in ns */
unsigned int lost; /* counter of master tick lost */
unsigned int overrun; /* count of read queue overruns */
unsigned int queue; /* used queue size */
unsigned char reserved[64]; /* reserved */
};
#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
/* The following four ioctls are changed since 1.0.9 due to confliction */
#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
struct snd_timer_read {
unsigned int resolution;
unsigned int ticks;
};
enum {
SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
SNDRV_TIMER_EVENT_TICK, /* val = ticks */
SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
SNDRV_TIMER_EVENT_STOP, /* val = 0 */
SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
/* master timer events for slave timer instances */
SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
};
struct snd_timer_tread {
int event;
struct timespec tstamp;
unsigned int val;
};
/****************************************************************************
* *
* Section for driver control interface - /dev/snd/control? *
* *
****************************************************************************/
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
struct snd_ctl_card_info {
int card; /* card number */
int pad; /* reserved for future (was type) */
unsigned char id[16]; /* ID of card (user selectable) */
unsigned char driver[16]; /* Driver name */
unsigned char name[32]; /* Short name of soundcard */
unsigned char longname[80]; /* name + info text about soundcard */
unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
unsigned char mixername[80]; /* visual mixer identification */
unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
};
typedef int __bitwise snd_ctl_elem_type_t;
#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
typedef int __bitwise snd_ctl_elem_iface_t;
#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
#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 */
/* 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 */
#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
struct snd_ctl_elem_id {
unsigned int numid; /* numeric identifier, zero = invalid */
snd_ctl_elem_iface_t iface; /* interface identifier */
unsigned int device; /* device/client number */
unsigned int subdevice; /* subdevice (substream) number */
unsigned char name[44]; /* ASCII name of item */
unsigned int index; /* index of item */
};
struct snd_ctl_elem_list {
unsigned int offset; /* W: first element ID to get */
unsigned int space; /* W: count of element IDs to get */
unsigned int used; /* R: count of element IDs set */
unsigned int count; /* R: count of all elements */
struct snd_ctl_elem_id __user *pids; /* R: IDs */
unsigned char reserved[50];
};
struct snd_ctl_elem_info {
struct snd_ctl_elem_id id; /* W: element ID */
snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
unsigned int count; /* count of values */
__kernel_pid_t owner; /* owner's PID of this control */
union {
struct {
long min; /* R: minimum value */
long max; /* R: maximum value */
long step; /* R: step (0 variable) */
} integer;
struct {
long long min; /* R: minimum value */
long long max; /* R: maximum value */
long long step; /* R: step (0 variable) */
} integer64;
struct {
unsigned int items; /* R: number of items */
unsigned int item; /* W: item number */
char name[64]; /* R: value name */
__u64 names_ptr; /* W: names list (ELEM_ADD only) */
unsigned int names_length;
} enumerated;
unsigned char reserved[128];
} value;
union {
unsigned short d[4]; /* dimensions */
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: indirect access - obsoleted */
union {
union {
long value[128];
long *value_ptr; /* obsoleted */
} integer;
union {
long long value[64];
long long *value_ptr; /* obsoleted */
} integer64;
union {
unsigned int item[128];
unsigned int *item_ptr; /* obsoleted */
} enumerated;
union {
unsigned char data[512];
unsigned char *data_ptr; /* obsoleted */
} bytes;
struct snd_aes_iec958 iec958;
} value; /* RO */
struct timespec tstamp;
unsigned char reserved[128-sizeof(struct timespec)];
};
struct snd_ctl_tlv {
unsigned int numid; /* control element numeric identification */
unsigned int length; /* in bytes aligned to 4 */
unsigned int tlv[0]; /* first TLV */
};
#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
/*
* Read interface.
*/
enum sndrv_ctl_event_type {
SNDRV_CTL_EVENT_ELEM = 0,
SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
};
#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
struct snd_ctl_event {
int type; /* event type - SNDRV_CTL_EVENT_* */
union {
struct {
unsigned int mask;
struct snd_ctl_elem_id id;
} elem;
unsigned char data8[60];
} data;
};
/*
* Control names
*/
#define SNDRV_CTL_NAME_NONE ""
#define SNDRV_CTL_NAME_PLAYBACK "Playback "
#define SNDRV_CTL_NAME_CAPTURE "Capture "
#define SNDRV_CTL_NAME_IEC958_NONE ""
#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
#endif /* __SOUND_ASOUND_H */ #endif /* __SOUND_ASOUND_H */

View File

@ -19,6 +19,7 @@
struct cs4271_platform_data { struct cs4271_platform_data {
int gpio_nreset; /* GPIO driving Reset pin, if any */ int gpio_nreset; /* GPIO driving Reset pin, if any */
int amutec_eq_bmutec:1; /* flag to enable AMUTEC=BMUTEC */
}; };
#endif /* __CS4271_H */ #endif /* __CS4271_H */

View File

@ -1,8 +1,3 @@
#ifndef __SOUND_EMU10K1_H
#define __SOUND_EMU10K1_H
#include <linux/types.h>
/* /*
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>, * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
* Creative Labs, Inc. * Creative Labs, Inc.
@ -24,8 +19,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
#ifndef __SOUND_EMU10K1_H
#define __SOUND_EMU10K1_H
#ifdef __KERNEL__
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
@ -36,8 +32,10 @@
#include <sound/timer.h> #include <sound/timer.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/firmware.h>
#include <asm/io.h> #include <asm/io.h>
#include <uapi/sound/emu10k1.h>
/* ------------------- DEFINES -------------------- */ /* ------------------- DEFINES -------------------- */
@ -1788,6 +1786,8 @@ struct snd_emu10k1 {
unsigned int efx_voices_mask[2]; unsigned int efx_voices_mask[2];
unsigned int next_free_voice; unsigned int next_free_voice;
const struct firmware *firmware;
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
unsigned int *saved_ptr; unsigned int *saved_ptr;
unsigned int *saved_gpr; unsigned int *saved_gpr;
@ -1796,6 +1796,7 @@ struct snd_emu10k1 {
unsigned int *saved_icode; unsigned int *saved_icode;
unsigned int *p16v_saved; unsigned int *p16v_saved;
unsigned int saved_a_iocfg, saved_hcfg; unsigned int saved_a_iocfg, saved_hcfg;
bool suspend;
#endif #endif
}; };
@ -1899,350 +1900,4 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_irq *irq); struct snd_emu10k1_fx8010_irq *irq);
#endif /* __KERNEL__ */
/*
* ---- FX8010 ----
*/
#define EMU10K1_CARD_CREATIVE 0x00000000
#define EMU10K1_CARD_EMUAPS 0x00000001
#define EMU10K1_FX8010_PCM_COUNT 8
/* instruction set */
#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
#define iACC3 0x06 /* R = A + X + Y ; saturation */
#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
#define iANDXOR 0x08 /* R = (A & X) ^ Y */
#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
/* GPRs */
#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
/* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
#define C_00000000 0x40
#define C_00000001 0x41
#define C_00000002 0x42
#define C_00000003 0x43
#define C_00000004 0x44
#define C_00000008 0x45
#define C_00000010 0x46
#define C_00000020 0x47
#define C_00000100 0x48
#define C_00010000 0x49
#define C_00080000 0x4a
#define C_10000000 0x4b
#define C_20000000 0x4c
#define C_40000000 0x4d
#define C_80000000 0x4e
#define C_7fffffff 0x4f
#define C_ffffffff 0x50
#define C_fffffffe 0x51
#define C_c0000000 0x52
#define C_4f1bbcdc 0x53
#define C_5a7ef9db 0x54
#define C_00100000 0x55 /* ?? */
#define GPR_ACCU 0x56 /* ACCUM, accumulator */
#define GPR_COND 0x57 /* CCR, condition register */
#define GPR_NOISE0 0x58 /* noise source */
#define GPR_NOISE1 0x59 /* noise source */
#define GPR_IRQ 0x5a /* IRQ register */
#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
#define A_GPR(x) (A_FXGPREGBASE + (x))
/* cc_reg constants */
#define CC_REG_NORMALIZED C_00000001
#define CC_REG_BORROW C_00000002
#define CC_REG_MINUS C_00000004
#define CC_REG_ZERO C_00000008
#define CC_REG_SATURATE C_00000010
#define CC_REG_NONZERO C_00000100
/* FX buses */
#define FXBUS_PCM_LEFT 0x00
#define FXBUS_PCM_RIGHT 0x01
#define FXBUS_PCM_LEFT_REAR 0x02
#define FXBUS_PCM_RIGHT_REAR 0x03
#define FXBUS_MIDI_LEFT 0x04
#define FXBUS_MIDI_RIGHT 0x05
#define FXBUS_PCM_CENTER 0x06
#define FXBUS_PCM_LFE 0x07
#define FXBUS_PCM_LEFT_FRONT 0x08
#define FXBUS_PCM_RIGHT_FRONT 0x09
#define FXBUS_MIDI_REVERB 0x0c
#define FXBUS_MIDI_CHORUS 0x0d
#define FXBUS_PCM_LEFT_SIDE 0x0e
#define FXBUS_PCM_RIGHT_SIDE 0x0f
#define FXBUS_PT_LEFT 0x14
#define FXBUS_PT_RIGHT 0x15
/* Inputs */
#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
/* Outputs */
#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
#define EXTOUT_ACENTER 0x11 /* Analog Center */
#define EXTOUT_ALFE 0x12 /* Analog LFE */
/* Audigy Inputs */
#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
#define A_EXTIN_LINE2_R 0x09 /* right */
#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
#define A_EXTIN_ADC_R 0x0b /* right */
#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
#define A_EXTIN_AUX2_R 0x0d /* - right */
/* Audigiy Outputs */
#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
#define A_EXTOUT_FRONT_R 0x01 /* right */
#define A_EXTOUT_CENTER 0x02 /* digital front center */
#define A_EXTOUT_LFE 0x03 /* digital front lfe */
#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
#define A_EXTOUT_REAR_R 0x07 /* right */
#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
#define A_EXTOUT_AFRONT_R 0x09 /* right */
#define A_EXTOUT_ACENTER 0x0a /* analog center */
#define A_EXTOUT_ALFE 0x0b /* analog LFE */
#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
#define A_EXTOUT_AREAR_R 0x0f /* right */
#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
#define A_EXTOUT_AC97_R 0x11 /* right */
#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
/* Audigy constants */
#define A_C_00000000 0xc0
#define A_C_00000001 0xc1
#define A_C_00000002 0xc2
#define A_C_00000003 0xc3
#define A_C_00000004 0xc4
#define A_C_00000008 0xc5
#define A_C_00000010 0xc6
#define A_C_00000020 0xc7
#define A_C_00000100 0xc8
#define A_C_00010000 0xc9
#define A_C_00000800 0xca
#define A_C_10000000 0xcb
#define A_C_20000000 0xcc
#define A_C_40000000 0xcd
#define A_C_80000000 0xce
#define A_C_7fffffff 0xcf
#define A_C_ffffffff 0xd0
#define A_C_fffffffe 0xd1
#define A_C_c0000000 0xd2
#define A_C_4f1bbcdc 0xd3
#define A_C_5a7ef9db 0xd4
#define A_C_00100000 0xd5
#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
#define A_GPR_COND 0xd7 /* CCR, condition register */
#define A_GPR_NOISE0 0xd8 /* noise source */
#define A_GPR_NOISE1 0xd9 /* noise source */
#define A_GPR_IRQ 0xda /* IRQ register */
#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
/* definitions for debug register */
#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
/* tank memory address line */
#ifndef __KERNEL__
#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
#endif
struct snd_emu10k1_fx8010_info {
unsigned int internal_tram_size; /* in samples */
unsigned int external_tram_size; /* in samples */
char fxbus_names[16][32]; /* names of FXBUSes */
char extin_names[16][32]; /* names of external inputs */
char extout_names[32][32]; /* names of external outputs */
unsigned int gpr_controls; /* count of GPR controls */
};
#define EMU10K1_GPR_TRANSLATION_NONE 0
#define EMU10K1_GPR_TRANSLATION_TABLE100 1
#define EMU10K1_GPR_TRANSLATION_BASS 2
#define EMU10K1_GPR_TRANSLATION_TREBLE 3
#define EMU10K1_GPR_TRANSLATION_ONOFF 4
struct snd_emu10k1_fx8010_control_gpr {
struct snd_ctl_elem_id id; /* full control ID definition */
unsigned int vcount; /* visible count */
unsigned int count; /* count of GPR (1..16) */
unsigned short gpr[32]; /* GPR number(s) */
unsigned int value[32]; /* initial values */
unsigned int min; /* minimum range */
unsigned int max; /* maximum range */
unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
const unsigned int *tlv;
};
/* old ABI without TLV support */
struct snd_emu10k1_fx8010_control_old_gpr {
struct snd_ctl_elem_id id;
unsigned int vcount;
unsigned int count;
unsigned short gpr[32];
unsigned int value[32];
unsigned int min;
unsigned int max;
unsigned int translation;
};
struct snd_emu10k1_fx8010_code {
char name[128];
DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
__u32 __user *gpr_map; /* initializers */
unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
unsigned int gpr_del_control_count; /* count of GPR controls to remove */
struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
unsigned int gpr_list_control_count; /* count of GPR controls to list */
unsigned int gpr_list_control_total; /* total count of GPR controls */
struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
__u32 __user *tram_data_map; /* data initializers */
__u32 __user *tram_addr_map; /* map initializers */
DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
__u32 __user *code; /* one instruction - 64 bits */
};
struct snd_emu10k1_fx8010_tram {
unsigned int address; /* 31.bit == 1 -> external TRAM */
unsigned int size; /* size in samples (4 bytes) */
unsigned int *samples; /* pointer to samples (20-bit) */
/* NULL->clear memory */
};
struct snd_emu10k1_fx8010_pcm_rec {
unsigned int substream; /* substream number */
unsigned int res1; /* reserved */
unsigned int channels; /* 16-bit channels count, zero = remove this substream */
unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
unsigned int buffer_size; /* count of buffered samples */
unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
unsigned char pad; /* reserved */
unsigned char etram[32]; /* external TRAM address & data (one per channel) */
unsigned int res2; /* reserved */
};
#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
/* typedefs for compatibility to user-space */
typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
#endif /* __SOUND_EMU10K1_H */ #endif /* __SOUND_EMU10K1_H */

View File

@ -71,6 +71,8 @@ struct snd_pcm_ops {
int (*prepare)(struct snd_pcm_substream *substream); int (*prepare)(struct snd_pcm_substream *substream);
int (*trigger)(struct snd_pcm_substream *substream, int cmd); int (*trigger)(struct snd_pcm_substream *substream, int cmd);
snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
int (*wall_clock)(struct snd_pcm_substream *substream,
struct timespec *audio_ts);
int (*copy)(struct snd_pcm_substream *substream, int channel, int (*copy)(struct snd_pcm_substream *substream, int channel,
snd_pcm_uframes_t pos, snd_pcm_uframes_t pos,
void __user *buf, snd_pcm_uframes_t count); void __user *buf, snd_pcm_uframes_t count);
@ -281,6 +283,7 @@ struct snd_pcm_runtime {
unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */ unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
u64 hw_ptr_wrap; /* offset for hw_ptr due to boundary wrap-around */
/* -- HW params -- */ /* -- HW params -- */
snd_pcm_access_t access; /* access mode */ snd_pcm_access_t access; /* access mode */

View File

@ -1,6 +1,3 @@
#ifndef __SOUND_SB16_CSP_H
#define __SOUND_SB16_CSP_H
/* /*
* Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
* Takashi Iwai <tiwai@suse.de> * Takashi Iwai <tiwai@suse.de>
@ -22,106 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
#ifndef __SOUND_SB16_CSP_H
#define __SOUND_SB16_CSP_H
/* CSP modes */
#define SNDRV_SB_CSP_MODE_NONE 0x00
#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
/* CSP load flags */
#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
/* CSP sample width */
#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
/* CSP channels */
#define SNDRV_SB_CSP_MONO 0x01
#define SNDRV_SB_CSP_STEREO 0x02
/* CSP rates */
#define SNDRV_SB_CSP_RATE_8000 0x01
#define SNDRV_SB_CSP_RATE_11025 0x02
#define SNDRV_SB_CSP_RATE_22050 0x04
#define SNDRV_SB_CSP_RATE_44100 0x08
#define SNDRV_SB_CSP_RATE_ALL 0x0f
/* CSP running state */
#define SNDRV_SB_CSP_ST_IDLE 0x00
#define SNDRV_SB_CSP_ST_LOADED 0x01
#define SNDRV_SB_CSP_ST_RUNNING 0x02
#define SNDRV_SB_CSP_ST_PAUSED 0x04
#define SNDRV_SB_CSP_ST_AUTO 0x08
#define SNDRV_SB_CSP_ST_QSOUND 0x10
/* maximum QSound value (180 degrees right) */
#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
/* maximum microcode RIFF file size */
#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
/* microcode header */
struct snd_sb_csp_mc_header {
char codec_name[16]; /* id name of codec */
unsigned short func_req; /* requested function */
};
/* microcode to be loaded */
struct snd_sb_csp_microcode {
struct snd_sb_csp_mc_header info;
unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
};
/* start CSP with sample_width in mono/stereo */
struct snd_sb_csp_start {
int sample_width; /* sample width, look above */
int channels; /* channels, look above */
};
/* CSP information */
struct snd_sb_csp_info {
char codec_name[16]; /* id name of codec */
unsigned short func_nr; /* function number */
unsigned int acc_format; /* accepted PCM formats */
unsigned short acc_channels; /* accepted channels */
unsigned short acc_width; /* accepted sample width */
unsigned short acc_rates; /* accepted sample rates */
unsigned short csp_mode; /* CSP mode, see above */
unsigned short run_channels; /* current channels */
unsigned short run_width; /* current sample width */
unsigned short version; /* version id: 0x10 - 0x1f */
unsigned short state; /* state bits */
};
/* HWDEP controls */
/* get CSP information */
#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
/* load microcode to CSP */
/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
* defined for some architectures like MIPS, and it leads to build errors.
* (x86 and co have 14-bit size, thus it's valid, though.)
* As a workaround for skipping the size-limit check, here we don't use the
* normal _IOW() macro but _IOC() with the manual argument.
*/
#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
_IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
/* unload microcode from CSP */
#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
/* start CSP */
#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
/* stop CSP */
#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
/* pause CSP and DMA transfer */
#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
/* restart CSP and DMA transfer */
#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
#ifdef __KERNEL__
#include <sound/sb.h> #include <sound/sb.h>
#include <sound/hwdep.h> #include <sound/hwdep.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <uapi/sound/sb16_csp.h>
struct snd_sb_csp; struct snd_sb_csp;
@ -183,6 +87,4 @@ struct snd_sb_csp {
}; };
int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
#endif
#endif /* __SOUND_SB16_CSP */ #endif /* __SOUND_SB16_CSP */

View File

@ -47,8 +47,8 @@
/* D: clock selecter if master mode */ /* D: clock selecter if master mode */
#define SH_FSI_CLK_MASK 0x0000F000 #define SH_FSI_CLK_MASK 0x0000F000
#define SH_FSI_CLK_EXTERNAL (1 << 12) #define SH_FSI_CLK_EXTERNAL (0 << 12)
#define SH_FSI_CLK_CPG (2 << 12) /* FSIxCK + FSI-DIV */ #define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
/* /*
* set_rate return value * set_rate return value

View File

@ -26,6 +26,7 @@ struct aic32x4_pdata {
u32 power_cfg; u32 power_cfg;
u32 micpga_routing; u32 micpga_routing;
bool swapdacs; bool swapdacs;
int rstn_gpio;
}; };
#endif #endif

View File

@ -27,12 +27,6 @@
#include <sound/hwdep.h> #include <sound/hwdep.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
#if !defined(CONFIG_USE_VXLOADER) && !defined(CONFIG_SND_VX_LIB) /* built-in kernel */
#define SND_VX_FW_LOADER /* use the standard firmware loader */
#endif
#endif
struct firmware; struct firmware;
struct device; struct device;

View File

@ -1 +1,11 @@
# UAPI Header export list # UAPI Header export list
header-y += asequencer.h
header-y += asound.h
header-y += asound_fm.h
header-y += compress_offload.h
header-y += compress_params.h
header-y += emu10k1.h
header-y += hdsp.h
header-y += hdspm.h
header-y += sb16_csp.h
header-y += sfnt_info.h

View File

@ -0,0 +1,614 @@
/*
* Main header file for the ALSA sequencer
* Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
* (c) 1998-1999 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 _UAPI__SOUND_ASEQUENCER_H
#define _UAPI__SOUND_ASEQUENCER_H
/** version of the sequencer */
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
/**
* definition of sequencer event types
*/
/** system messages
* event data type = #snd_seq_result
*/
#define SNDRV_SEQ_EVENT_SYSTEM 0
#define SNDRV_SEQ_EVENT_RESULT 1
/** note messages (channel specific)
* event data type = #snd_seq_ev_note
*/
#define SNDRV_SEQ_EVENT_NOTE 5
#define SNDRV_SEQ_EVENT_NOTEON 6
#define SNDRV_SEQ_EVENT_NOTEOFF 7
#define SNDRV_SEQ_EVENT_KEYPRESS 8
/** control messages (channel specific)
* event data type = #snd_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_CONTROLLER 10
#define SNDRV_SEQ_EVENT_PGMCHANGE 11
#define SNDRV_SEQ_EVENT_CHANPRESS 12
#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
/** synchronisation messages
* event data type = #snd_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
/** timer messages
* event data type = snd_seq_ev_queue_control
*/
#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
/** others
* event data type = none
*/
#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
/** echo back, kernel private messages
* event data type = any type
*/
#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
/** system status messages (broadcast for subscribers)
* event data type = snd_seq_addr
*/
#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
/** port connection changes
* event data type = snd_seq_connect
*/
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
/* 70-89: synthesizer events - obsoleted */
/** user-defined events with fixed length
* event data type = any
*/
#define SNDRV_SEQ_EVENT_USR0 90
#define SNDRV_SEQ_EVENT_USR1 91
#define SNDRV_SEQ_EVENT_USR2 92
#define SNDRV_SEQ_EVENT_USR3 93
#define SNDRV_SEQ_EVENT_USR4 94
#define SNDRV_SEQ_EVENT_USR5 95
#define SNDRV_SEQ_EVENT_USR6 96
#define SNDRV_SEQ_EVENT_USR7 97
#define SNDRV_SEQ_EVENT_USR8 98
#define SNDRV_SEQ_EVENT_USR9 99
/* 100-118: instrument layer - obsoleted */
/* 119-129: reserved */
/* 130-139: variable length events
* event data type = snd_seq_ev_ext
* (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
*/
#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
/* 132-134: reserved */
#define SNDRV_SEQ_EVENT_USR_VAR0 135
#define SNDRV_SEQ_EVENT_USR_VAR1 136
#define SNDRV_SEQ_EVENT_USR_VAR2 137
#define SNDRV_SEQ_EVENT_USR_VAR3 138
#define SNDRV_SEQ_EVENT_USR_VAR4 139
/* 150-151: kernel events with quote - DO NOT use in user clients */
#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
/* 152-191: reserved */
/* 192-254: hardware specific events */
/* 255: special event */
#define SNDRV_SEQ_EVENT_NONE 255
typedef unsigned char snd_seq_event_type_t;
/** event address */
struct snd_seq_addr {
unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
};
/** port connection */
struct snd_seq_connect {
struct snd_seq_addr sender;
struct snd_seq_addr dest;
};
#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
/* event mode flag - NOTE: only 8 bits available! */
#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
/* note event */
struct snd_seq_ev_note {
unsigned char channel;
unsigned char note;
unsigned char velocity;
unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
};
/* controller event */
struct snd_seq_ev_ctrl {
unsigned char channel;
unsigned char unused1, unused2, unused3; /* pad */
unsigned int param;
signed int value;
};
/* generic set of bytes (12x8 bit) */
struct snd_seq_ev_raw8 {
unsigned char d[12]; /* 8 bit value */
};
/* generic set of integers (3x32 bit) */
struct snd_seq_ev_raw32 {
unsigned int d[3]; /* 32 bit value */
};
/* external stored data */
struct snd_seq_ev_ext {
unsigned int len; /* length of data */
void *ptr; /* pointer to data (note: maybe 64-bit) */
} __attribute__((packed));
struct snd_seq_result {
int event; /* processed event type */
int result;
};
struct snd_seq_real_time {
unsigned int tv_sec; /* seconds */
unsigned int tv_nsec; /* nanoseconds */
};
typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
union snd_seq_timestamp {
snd_seq_tick_time_t tick;
struct snd_seq_real_time time;
};
struct snd_seq_queue_skew {
unsigned int value;
unsigned int base;
};
/* queue timer control */
struct snd_seq_ev_queue_control {
unsigned char queue; /* affected queue */
unsigned char pad[3]; /* reserved */
union {
signed int value; /* affected value (e.g. tempo) */
union snd_seq_timestamp time; /* time */
unsigned int position; /* sync position */
struct snd_seq_queue_skew skew;
unsigned int d32[2];
unsigned char d8[8];
} param;
};
/* quoted event - inside the kernel only */
struct snd_seq_ev_quote {
struct snd_seq_addr origin; /* original sender */
unsigned short value; /* optional data */
struct snd_seq_event *event; /* quoted event */
} __attribute__((packed));
/* sequencer event */
struct snd_seq_event {
snd_seq_event_type_t type; /* event type */
unsigned char flags; /* event flags */
char tag;
unsigned char queue; /* schedule queue */
union snd_seq_timestamp time; /* schedule time */
struct snd_seq_addr source; /* source address */
struct snd_seq_addr dest; /* destination address */
union { /* event data... */
struct snd_seq_ev_note note;
struct snd_seq_ev_ctrl control;
struct snd_seq_ev_raw8 raw8;
struct snd_seq_ev_raw32 raw32;
struct snd_seq_ev_ext ext;
struct snd_seq_ev_queue_control queue;
union snd_seq_timestamp time;
struct snd_seq_addr addr;
struct snd_seq_connect connect;
struct snd_seq_result result;
struct snd_seq_ev_quote quote;
} data;
};
/*
* bounce event - stored as variable size data
*/
struct snd_seq_event_bounce {
int err;
struct snd_seq_event event;
/* external data follows here. */
};
/* system information */
struct snd_seq_system_info {
int queues; /* maximum queues count */
int clients; /* maximum clients count */
int ports; /* maximum ports per client */
int channels; /* maximum channels per port */
int cur_clients; /* current clients */
int cur_queues; /* current queues */
char reserved[24];
};
/* system running information */
struct snd_seq_running_info {
unsigned char client; /* client id */
unsigned char big_endian; /* 1 = big-endian */
unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
unsigned char pad; /* reserved */
unsigned char reserved[12];
};
/* known client numbers */
#define SNDRV_SEQ_CLIENT_SYSTEM 0
/* internal client numbers */
#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
/* client types */
typedef int __bitwise snd_seq_client_type_t;
#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
/* event filter flags */
#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
struct snd_seq_client_info {
int client; /* client number to inquire */
snd_seq_client_type_t type; /* client type */
char name[64]; /* client name */
unsigned int filter; /* filter flags */
unsigned char multicast_filter[8]; /* multicast filter bitmap */
unsigned char event_filter[32]; /* event filter bitmap */
int num_ports; /* RO: number of ports */
int event_lost; /* number of lost events */
char reserved[64]; /* for future use */
};
/* client pool size */
struct snd_seq_client_pool {
int client; /* client number to inquire */
int output_pool; /* outgoing (write) pool size */
int input_pool; /* incoming (read) pool size */
int output_room; /* minimum free pool size for select/blocking mode */
int output_free; /* unused size */
int input_free; /* unused size */
char reserved[64];
};
/* Remove events by specified criteria */
#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
struct snd_seq_remove_events {
unsigned int remove_mode; /* Flags that determine what gets removed */
union snd_seq_timestamp time;
unsigned char queue; /* Queue for REMOVE_DEST */
struct snd_seq_addr dest; /* Address for REMOVE_DEST */
unsigned char channel; /* Channel for REMOVE_DEST */
int type; /* For REMOVE_EVENT_TYPE */
char tag; /* Tag for REMOVE_TAG */
int reserved[10]; /* To allow for future binary compatibility */
};
/* known port numbers */
#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
/* port capabilities (32 bits) */
#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
/* port type */
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
/* other standards...*/
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
/*...*/
#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
/* misc. conditioning flags */
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
struct snd_seq_port_info {
struct snd_seq_addr addr; /* client/port numbers */
char name[64]; /* port name */
unsigned int capability; /* port capability bits */
unsigned int type; /* port type bits */
int midi_channels; /* channels per MIDI port */
int midi_voices; /* voices per MIDI port */
int synth_voices; /* voices per SYNTH port */
int read_use; /* R/O: subscribers for output (from this port) */
int write_use; /* R/O: subscribers for input (to this port) */
void *kernel; /* reserved for kernel use (must be NULL) */
unsigned int flags; /* misc. conditioning */
unsigned char time_queue; /* queue # for timestamping */
char reserved[59]; /* for future use */
};
/* queue flags */
#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
/* queue information */
struct snd_seq_queue_info {
int queue; /* queue id */
/*
* security settings, only owner of this queue can start/stop timer
* etc. if the queue is locked for other clients
*/
int owner; /* client id for owner of the queue */
unsigned locked:1; /* timing queue locked for other queues */
char name[64]; /* name of this queue */
unsigned int flags; /* flags */
char reserved[60]; /* for future use */
};
/* queue info/status */
struct snd_seq_queue_status {
int queue; /* queue id */
int events; /* read-only - queue size */
snd_seq_tick_time_t tick; /* current tick */
struct snd_seq_real_time time; /* current time */
int running; /* running state of queue */
int flags; /* various flags */
char reserved[64]; /* for the future */
};
/* queue tempo */
struct snd_seq_queue_tempo {
int queue; /* sequencer queue */
unsigned int tempo; /* current tempo, us/tick */
int ppq; /* time resolution, ticks/quarter */
unsigned int skew_value; /* queue skew */
unsigned int skew_base; /* queue skew base */
char reserved[24]; /* for the future */
};
/* sequencer timer sources */
#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
/* queue timer info */
struct snd_seq_queue_timer {
int queue; /* sequencer queue */
int type; /* source timer type */
union {
struct {
struct snd_timer_id id; /* ALSA's timer ID */
unsigned int resolution; /* resolution in Hz */
} alsa;
} u;
char reserved[64]; /* for the future use */
};
struct snd_seq_queue_client {
int queue; /* sequencer queue */
int client; /* sequencer client */
int used; /* queue is used with this client
(must be set for accepting events) */
/* per client watermarks */
char reserved[64]; /* for future use */
};
#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
struct snd_seq_port_subscribe {
struct snd_seq_addr sender; /* sender address */
struct snd_seq_addr dest; /* destination address */
unsigned int voices; /* number of voices to be allocated (0 = don't care) */
unsigned int flags; /* modes */
unsigned char queue; /* input time-stamp queue (optional) */
unsigned char pad[3]; /* reserved */
char reserved[64];
};
/* type of query subscription */
#define SNDRV_SEQ_QUERY_SUBS_READ 0
#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
struct snd_seq_query_subs {
struct snd_seq_addr root; /* client/port id to be searched */
int type; /* READ or WRITE */
int index; /* 0..N-1 */
int num_subs; /* R/O: number of subscriptions on this port */
struct snd_seq_addr addr; /* R/O: result */
unsigned char queue; /* R/O: result */
unsigned int flags; /* R/O: result */
char reserved[64]; /* for future use */
};
/*
* IOCTL commands
*/
#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
/* XXX
#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
*/
#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
#endif /* _UAPI__SOUND_ASEQUENCER_H */

971
include/uapi/sound/asound.h Normal file
View File

@ -0,0 +1,971 @@
/*
* Advanced Linux Sound Architecture - ALSA - Driver
* Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
* Abramo Bagnara <abramo@alsa-project.org>
*
*
* 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 _UAPI__SOUND_ASOUND_H
#define _UAPI__SOUND_ASOUND_H
#include <linux/types.h>
/*
* protocol version
*/
#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
(SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
(SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
/****************************************************************************
* *
* Digital audio interface *
* *
****************************************************************************/
struct snd_aes_iec958 {
unsigned char status[24]; /* AES/IEC958 channel status bits */
unsigned char subcode[147]; /* AES/IEC958 subcode bits */
unsigned char pad; /* nothing */
unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
};
/****************************************************************************
* *
* CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
* *
****************************************************************************/
struct snd_cea_861_aud_if {
unsigned char db1_ct_cc; /* coding type and channel count */
unsigned char db2_sf_ss; /* sample frequency and size */
unsigned char db3; /* not used, all zeros */
unsigned char db4_ca; /* channel allocation code */
unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
};
/****************************************************************************
* *
* Section for driver hardware dependent interface - /dev/snd/hw? *
* *
****************************************************************************/
#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
enum {
SNDRV_HWDEP_IFACE_OPL2 = 0,
SNDRV_HWDEP_IFACE_OPL3,
SNDRV_HWDEP_IFACE_OPL4,
SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
/* Don't forget to change the following: */
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
};
struct snd_hwdep_info {
unsigned int device; /* WR: device number */
int card; /* R: card number */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* hwdep name */
int iface; /* hwdep interface */
unsigned char reserved[64]; /* reserved for future */
};
/* generic DSP loader */
struct snd_hwdep_dsp_status {
unsigned int version; /* R: driver-specific version */
unsigned char id[32]; /* R: driver-specific ID string */
unsigned int num_dsps; /* R: number of DSP images to transfer */
unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
unsigned int chip_ready; /* R: 1 = initialization finished */
unsigned char reserved[16]; /* reserved for future use */
};
struct snd_hwdep_dsp_image {
unsigned int index; /* W: DSP index */
unsigned char name[64]; /* W: ID (e.g. file name) */
unsigned char __user *image; /* W: binary image */
size_t length; /* W: size of image in bytes */
unsigned long driver_data; /* W: driver-specific data */
};
#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
/*****************************************************************************
* *
* Digital Audio (PCM) interface - /dev/snd/pcm?? *
* *
*****************************************************************************/
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
enum {
SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
SNDRV_PCM_CLASS_MULTI, /* multichannel device */
SNDRV_PCM_CLASS_MODEM, /* software modem class */
SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
/* Don't forget to change the following: */
SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
};
enum {
SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
/* Don't forget to change the following: */
SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
};
enum {
SNDRV_PCM_STREAM_PLAYBACK = 0,
SNDRV_PCM_STREAM_CAPTURE,
SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
};
typedef int __bitwise snd_pcm_access_t;
#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
#endif
#ifdef SNDRV_BIG_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
#endif
typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
typedef int __bitwise snd_pcm_state_t;
#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
enum {
SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
};
union snd_pcm_sync_id {
unsigned char id[16];
unsigned short id16[8];
unsigned int id32[4];
};
struct snd_pcm_info {
unsigned int device; /* RO/WR (control): device number */
unsigned int subdevice; /* RO/WR (control): subdevice number */
int stream; /* RO/WR (control): stream direction */
int card; /* R: card number */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* name of this device */
unsigned char subname[32]; /* subdevice name */
int dev_class; /* SNDRV_PCM_CLASS_* */
int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
unsigned int subdevices_count;
unsigned int subdevices_avail;
union snd_pcm_sync_id sync; /* hardware synchronization ID */
unsigned char reserved[64]; /* reserved for future... */
};
typedef int snd_pcm_hw_param_t;
#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
* interrupts in us
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
* interrupts
*/
#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
* buffer
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
* in us
*/
#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
struct snd_interval {
unsigned int min, max;
unsigned int openmin:1,
openmax:1,
integer:1,
empty:1;
};
#define SNDRV_MASK_MAX 256
struct snd_mask {
__u32 bits[(SNDRV_MASK_MAX+31)/32];
};
struct snd_pcm_hw_params {
unsigned int flags;
struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
struct snd_mask mres[5]; /* reserved masks */
struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
struct snd_interval ires[9]; /* reserved intervals */
unsigned int rmask; /* W: requested masks */
unsigned int cmask; /* R: changed masks */
unsigned int info; /* R: Info flags for returned setup */
unsigned int msbits; /* R: used most significant bits */
unsigned int rate_num; /* R: rate numerator */
unsigned int rate_den; /* R: rate denominator */
snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
unsigned char reserved[64]; /* reserved for future */
};
enum {
SNDRV_PCM_TSTAMP_NONE = 0,
SNDRV_PCM_TSTAMP_ENABLE,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};
struct snd_pcm_sw_params {
int tstamp_mode; /* timestamp mode */
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; /* 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 */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
unsigned char reserved[64]; /* reserved for future */
};
struct snd_pcm_channel_info {
unsigned int channel;
__kernel_off_t offset; /* mmap offset */
unsigned int first; /* offset to first sample in bits */
unsigned int step; /* samples distance in bits */
};
struct snd_pcm_status {
snd_pcm_state_t state; /* stream state */
struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
struct timespec tstamp; /* reference timestamp */
snd_pcm_uframes_t appl_ptr; /* appl ptr */
snd_pcm_uframes_t hw_ptr; /* hw ptr */
snd_pcm_sframes_t delay; /* current delay in frames */
snd_pcm_uframes_t avail; /* number of frames available */
snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
snd_pcm_state_t suspended_state; /* suspended stream state */
__u32 reserved_alignment; /* must be filled with zero */
struct timespec audio_tstamp; /* from sample counter or wall clock */
unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */
};
struct snd_pcm_mmap_status {
snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
int pad1; /* Needed for 64 bit alignment */
snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
struct timespec tstamp; /* Timestamp */
snd_pcm_state_t suspended_state; /* RO: suspended stream state */
struct timespec audio_tstamp; /* from sample counter or wall clock */
};
struct snd_pcm_mmap_control {
snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
};
#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
struct snd_pcm_sync_ptr {
unsigned int flags;
union {
struct snd_pcm_mmap_status status;
unsigned char reserved[64];
} s;
union {
struct snd_pcm_mmap_control control;
unsigned char reserved[64];
} c;
};
struct snd_xferi {
snd_pcm_sframes_t result;
void __user *buf;
snd_pcm_uframes_t frames;
};
struct snd_xfern {
snd_pcm_sframes_t result;
void __user * __user *bufs;
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,
};
/* channel positions */
enum {
SNDRV_CHMAP_UNKNOWN = 0,
SNDRV_CHMAP_NA, /* N/A, silent */
SNDRV_CHMAP_MONO, /* mono stream */
/* this follows the alsa-lib mixer channel value + 3 */
SNDRV_CHMAP_FL, /* front left */
SNDRV_CHMAP_FR, /* front right */
SNDRV_CHMAP_RL, /* rear left */
SNDRV_CHMAP_RR, /* rear right */
SNDRV_CHMAP_FC, /* front center */
SNDRV_CHMAP_LFE, /* LFE */
SNDRV_CHMAP_SL, /* side left */
SNDRV_CHMAP_SR, /* side right */
SNDRV_CHMAP_RC, /* rear center */
/* new definitions */
SNDRV_CHMAP_FLC, /* front left center */
SNDRV_CHMAP_FRC, /* front right center */
SNDRV_CHMAP_RLC, /* rear left center */
SNDRV_CHMAP_RRC, /* rear right center */
SNDRV_CHMAP_FLW, /* front left wide */
SNDRV_CHMAP_FRW, /* front right wide */
SNDRV_CHMAP_FLH, /* front left high */
SNDRV_CHMAP_FCH, /* front center high */
SNDRV_CHMAP_FRH, /* front right high */
SNDRV_CHMAP_TC, /* top center */
SNDRV_CHMAP_TFL, /* top front left */
SNDRV_CHMAP_TFR, /* top front right */
SNDRV_CHMAP_TFC, /* top front center */
SNDRV_CHMAP_TRL, /* top rear left */
SNDRV_CHMAP_TRR, /* top rear right */
SNDRV_CHMAP_TRC, /* top rear center */
/* new definitions for UAC2 */
SNDRV_CHMAP_TFLC, /* top front left center */
SNDRV_CHMAP_TFRC, /* top front right center */
SNDRV_CHMAP_TSL, /* top side left */
SNDRV_CHMAP_TSR, /* top side right */
SNDRV_CHMAP_LLFE, /* left LFE */
SNDRV_CHMAP_RLFE, /* right LFE */
SNDRV_CHMAP_BC, /* bottom center */
SNDRV_CHMAP_BLC, /* bottom left center */
SNDRV_CHMAP_BRC, /* bottom right center */
SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
};
#define SNDRV_CHMAP_POSITION_MASK 0xffff
#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
/*****************************************************************************
* *
* MIDI v1.0 interface *
* *
*****************************************************************************/
/*
* Raw MIDI section - /dev/snd/midi??
*/
#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
enum {
SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
SNDRV_RAWMIDI_STREAM_INPUT,
SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
};
#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
struct snd_rawmidi_info {
unsigned int device; /* RO/WR (control): device number */
unsigned int subdevice; /* RO/WR (control): subdevice number */
int stream; /* WR: stream */
int card; /* R: card number */
unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
unsigned char id[64]; /* ID (user selectable) */
unsigned char name[80]; /* name of device */
unsigned char subname[32]; /* name of active or selected subdevice */
unsigned int subdevices_count;
unsigned int subdevices_avail;
unsigned char reserved[64]; /* reserved for future use */
};
struct snd_rawmidi_params {
int stream;
size_t buffer_size; /* queue size in bytes */
size_t avail_min; /* minimum avail bytes for wakeup */
unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
unsigned char reserved[16]; /* reserved for future use */
};
struct snd_rawmidi_status {
int stream;
struct timespec tstamp; /* Timestamp */
size_t avail; /* available bytes */
size_t xruns; /* count of overruns since last status (in bytes) */
unsigned char reserved[16]; /* reserved for future use */
};
#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
/*
* Timer section - /dev/snd/timer
*/
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
enum {
SNDRV_TIMER_CLASS_NONE = -1,
SNDRV_TIMER_CLASS_SLAVE = 0,
SNDRV_TIMER_CLASS_GLOBAL,
SNDRV_TIMER_CLASS_CARD,
SNDRV_TIMER_CLASS_PCM,
SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
};
/* slave timer classes */
enum {
SNDRV_TIMER_SCLASS_NONE = 0,
SNDRV_TIMER_SCLASS_APPLICATION,
SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
};
/* global timers (device member) */
#define SNDRV_TIMER_GLOBAL_SYSTEM 0
#define SNDRV_TIMER_GLOBAL_RTC 1
#define SNDRV_TIMER_GLOBAL_HPET 2
#define SNDRV_TIMER_GLOBAL_HRTIMER 3
/* info flags */
#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
struct snd_timer_id {
int dev_class;
int dev_sclass;
int card;
int device;
int subdevice;
};
struct snd_timer_ginfo {
struct snd_timer_id tid; /* requested timer ID */
unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
int card; /* card number */
unsigned char id[64]; /* timer identification */
unsigned char name[80]; /* timer name */
unsigned long reserved0; /* reserved for future use */
unsigned long resolution; /* average period resolution in ns */
unsigned long resolution_min; /* minimal period resolution in ns */
unsigned long resolution_max; /* maximal period resolution in ns */
unsigned int clients; /* active timer clients */
unsigned char reserved[32];
};
struct snd_timer_gparams {
struct snd_timer_id tid; /* requested timer ID */
unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
unsigned char reserved[32];
};
struct snd_timer_gstatus {
struct snd_timer_id tid; /* requested timer ID */
unsigned long resolution; /* current period resolution in ns */
unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
unsigned char reserved[32];
};
struct snd_timer_select {
struct snd_timer_id id; /* bind to timer ID */
unsigned char reserved[32]; /* reserved */
};
struct snd_timer_info {
unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
int card; /* card number */
unsigned char id[64]; /* timer identificator */
unsigned char name[80]; /* timer name */
unsigned long reserved0; /* reserved for future use */
unsigned long resolution; /* average period resolution in ns */
unsigned char reserved[64]; /* reserved */
};
#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
struct snd_timer_params {
unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
unsigned int ticks; /* requested resolution in ticks */
unsigned int queue_size; /* total size of queue (32-1024) */
unsigned int reserved0; /* reserved, was: failure locations */
unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
unsigned char reserved[60]; /* reserved */
};
struct snd_timer_status {
struct timespec tstamp; /* Timestamp - last update */
unsigned int resolution; /* current period resolution in ns */
unsigned int lost; /* counter of master tick lost */
unsigned int overrun; /* count of read queue overruns */
unsigned int queue; /* used queue size */
unsigned char reserved[64]; /* reserved */
};
#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
/* The following four ioctls are changed since 1.0.9 due to confliction */
#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
struct snd_timer_read {
unsigned int resolution;
unsigned int ticks;
};
enum {
SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
SNDRV_TIMER_EVENT_TICK, /* val = ticks */
SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
SNDRV_TIMER_EVENT_STOP, /* val = 0 */
SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
/* master timer events for slave timer instances */
SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
};
struct snd_timer_tread {
int event;
struct timespec tstamp;
unsigned int val;
};
/****************************************************************************
* *
* Section for driver control interface - /dev/snd/control? *
* *
****************************************************************************/
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
struct snd_ctl_card_info {
int card; /* card number */
int pad; /* reserved for future (was type) */
unsigned char id[16]; /* ID of card (user selectable) */
unsigned char driver[16]; /* Driver name */
unsigned char name[32]; /* Short name of soundcard */
unsigned char longname[80]; /* name + info text about soundcard */
unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
unsigned char mixername[80]; /* visual mixer identification */
unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
};
typedef int __bitwise snd_ctl_elem_type_t;
#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
typedef int __bitwise snd_ctl_elem_iface_t;
#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
#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 */
/* 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 */
#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
struct snd_ctl_elem_id {
unsigned int numid; /* numeric identifier, zero = invalid */
snd_ctl_elem_iface_t iface; /* interface identifier */
unsigned int device; /* device/client number */
unsigned int subdevice; /* subdevice (substream) number */
unsigned char name[44]; /* ASCII name of item */
unsigned int index; /* index of item */
};
struct snd_ctl_elem_list {
unsigned int offset; /* W: first element ID to get */
unsigned int space; /* W: count of element IDs to get */
unsigned int used; /* R: count of element IDs set */
unsigned int count; /* R: count of all elements */
struct snd_ctl_elem_id __user *pids; /* R: IDs */
unsigned char reserved[50];
};
struct snd_ctl_elem_info {
struct snd_ctl_elem_id id; /* W: element ID */
snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
unsigned int count; /* count of values */
__kernel_pid_t owner; /* owner's PID of this control */
union {
struct {
long min; /* R: minimum value */
long max; /* R: maximum value */
long step; /* R: step (0 variable) */
} integer;
struct {
long long min; /* R: minimum value */
long long max; /* R: maximum value */
long long step; /* R: step (0 variable) */
} integer64;
struct {
unsigned int items; /* R: number of items */
unsigned int item; /* W: item number */
char name[64]; /* R: value name */
__u64 names_ptr; /* W: names list (ELEM_ADD only) */
unsigned int names_length;
} enumerated;
unsigned char reserved[128];
} value;
union {
unsigned short d[4]; /* dimensions */
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: indirect access - obsoleted */
union {
union {
long value[128];
long *value_ptr; /* obsoleted */
} integer;
union {
long long value[64];
long long *value_ptr; /* obsoleted */
} integer64;
union {
unsigned int item[128];
unsigned int *item_ptr; /* obsoleted */
} enumerated;
union {
unsigned char data[512];
unsigned char *data_ptr; /* obsoleted */
} bytes;
struct snd_aes_iec958 iec958;
} value; /* RO */
struct timespec tstamp;
unsigned char reserved[128-sizeof(struct timespec)];
};
struct snd_ctl_tlv {
unsigned int numid; /* control element numeric identification */
unsigned int length; /* in bytes aligned to 4 */
unsigned int tlv[0]; /* first TLV */
};
#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
/*
* Read interface.
*/
enum sndrv_ctl_event_type {
SNDRV_CTL_EVENT_ELEM = 0,
SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
};
#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
struct snd_ctl_event {
int type; /* event type - SNDRV_CTL_EVENT_* */
union {
struct {
unsigned int mask;
struct snd_ctl_elem_id id;
} elem;
unsigned char data8[60];
} data;
};
/*
* Control names
*/
#define SNDRV_CTL_NAME_NONE ""
#define SNDRV_CTL_NAME_PLAYBACK "Playback "
#define SNDRV_CTL_NAME_CAPTURE "Capture "
#define SNDRV_CTL_NAME_IEC958_NONE ""
#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
#endif /* _UAPI__SOUND_ASOUND_H */

View File

@ -0,0 +1,373 @@
/*
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
* Creative Labs, Inc.
* Definitions for EMU10K1 (SB Live!) chips
*
*
* 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 _UAPI__SOUND_EMU10K1_H
#define _UAPI__SOUND_EMU10K1_H
#include <linux/types.h>
/*
* ---- FX8010 ----
*/
#define EMU10K1_CARD_CREATIVE 0x00000000
#define EMU10K1_CARD_EMUAPS 0x00000001
#define EMU10K1_FX8010_PCM_COUNT 8
/* instruction set */
#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
#define iACC3 0x06 /* R = A + X + Y ; saturation */
#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
#define iANDXOR 0x08 /* R = (A & X) ^ Y */
#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
/* GPRs */
#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
/* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
#define C_00000000 0x40
#define C_00000001 0x41
#define C_00000002 0x42
#define C_00000003 0x43
#define C_00000004 0x44
#define C_00000008 0x45
#define C_00000010 0x46
#define C_00000020 0x47
#define C_00000100 0x48
#define C_00010000 0x49
#define C_00080000 0x4a
#define C_10000000 0x4b
#define C_20000000 0x4c
#define C_40000000 0x4d
#define C_80000000 0x4e
#define C_7fffffff 0x4f
#define C_ffffffff 0x50
#define C_fffffffe 0x51
#define C_c0000000 0x52
#define C_4f1bbcdc 0x53
#define C_5a7ef9db 0x54
#define C_00100000 0x55 /* ?? */
#define GPR_ACCU 0x56 /* ACCUM, accumulator */
#define GPR_COND 0x57 /* CCR, condition register */
#define GPR_NOISE0 0x58 /* noise source */
#define GPR_NOISE1 0x59 /* noise source */
#define GPR_IRQ 0x5a /* IRQ register */
#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
#define A_GPR(x) (A_FXGPREGBASE + (x))
/* cc_reg constants */
#define CC_REG_NORMALIZED C_00000001
#define CC_REG_BORROW C_00000002
#define CC_REG_MINUS C_00000004
#define CC_REG_ZERO C_00000008
#define CC_REG_SATURATE C_00000010
#define CC_REG_NONZERO C_00000100
/* FX buses */
#define FXBUS_PCM_LEFT 0x00
#define FXBUS_PCM_RIGHT 0x01
#define FXBUS_PCM_LEFT_REAR 0x02
#define FXBUS_PCM_RIGHT_REAR 0x03
#define FXBUS_MIDI_LEFT 0x04
#define FXBUS_MIDI_RIGHT 0x05
#define FXBUS_PCM_CENTER 0x06
#define FXBUS_PCM_LFE 0x07
#define FXBUS_PCM_LEFT_FRONT 0x08
#define FXBUS_PCM_RIGHT_FRONT 0x09
#define FXBUS_MIDI_REVERB 0x0c
#define FXBUS_MIDI_CHORUS 0x0d
#define FXBUS_PCM_LEFT_SIDE 0x0e
#define FXBUS_PCM_RIGHT_SIDE 0x0f
#define FXBUS_PT_LEFT 0x14
#define FXBUS_PT_RIGHT 0x15
/* Inputs */
#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
/* Outputs */
#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
#define EXTOUT_ACENTER 0x11 /* Analog Center */
#define EXTOUT_ALFE 0x12 /* Analog LFE */
/* Audigy Inputs */
#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
#define A_EXTIN_LINE2_R 0x09 /* right */
#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
#define A_EXTIN_ADC_R 0x0b /* right */
#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
#define A_EXTIN_AUX2_R 0x0d /* - right */
/* Audigiy Outputs */
#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
#define A_EXTOUT_FRONT_R 0x01 /* right */
#define A_EXTOUT_CENTER 0x02 /* digital front center */
#define A_EXTOUT_LFE 0x03 /* digital front lfe */
#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
#define A_EXTOUT_REAR_R 0x07 /* right */
#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
#define A_EXTOUT_AFRONT_R 0x09 /* right */
#define A_EXTOUT_ACENTER 0x0a /* analog center */
#define A_EXTOUT_ALFE 0x0b /* analog LFE */
#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
#define A_EXTOUT_AREAR_R 0x0f /* right */
#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
#define A_EXTOUT_AC97_R 0x11 /* right */
#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
/* Audigy constants */
#define A_C_00000000 0xc0
#define A_C_00000001 0xc1
#define A_C_00000002 0xc2
#define A_C_00000003 0xc3
#define A_C_00000004 0xc4
#define A_C_00000008 0xc5
#define A_C_00000010 0xc6
#define A_C_00000020 0xc7
#define A_C_00000100 0xc8
#define A_C_00010000 0xc9
#define A_C_00000800 0xca
#define A_C_10000000 0xcb
#define A_C_20000000 0xcc
#define A_C_40000000 0xcd
#define A_C_80000000 0xce
#define A_C_7fffffff 0xcf
#define A_C_ffffffff 0xd0
#define A_C_fffffffe 0xd1
#define A_C_c0000000 0xd2
#define A_C_4f1bbcdc 0xd3
#define A_C_5a7ef9db 0xd4
#define A_C_00100000 0xd5
#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
#define A_GPR_COND 0xd7 /* CCR, condition register */
#define A_GPR_NOISE0 0xd8 /* noise source */
#define A_GPR_NOISE1 0xd9 /* noise source */
#define A_GPR_IRQ 0xda /* IRQ register */
#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
/* definitions for debug register */
#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
/* tank memory address line */
#ifndef __KERNEL__
#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
#endif
struct snd_emu10k1_fx8010_info {
unsigned int internal_tram_size; /* in samples */
unsigned int external_tram_size; /* in samples */
char fxbus_names[16][32]; /* names of FXBUSes */
char extin_names[16][32]; /* names of external inputs */
char extout_names[32][32]; /* names of external outputs */
unsigned int gpr_controls; /* count of GPR controls */
};
#define EMU10K1_GPR_TRANSLATION_NONE 0
#define EMU10K1_GPR_TRANSLATION_TABLE100 1
#define EMU10K1_GPR_TRANSLATION_BASS 2
#define EMU10K1_GPR_TRANSLATION_TREBLE 3
#define EMU10K1_GPR_TRANSLATION_ONOFF 4
struct snd_emu10k1_fx8010_control_gpr {
struct snd_ctl_elem_id id; /* full control ID definition */
unsigned int vcount; /* visible count */
unsigned int count; /* count of GPR (1..16) */
unsigned short gpr[32]; /* GPR number(s) */
unsigned int value[32]; /* initial values */
unsigned int min; /* minimum range */
unsigned int max; /* maximum range */
unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
const unsigned int *tlv;
};
/* old ABI without TLV support */
struct snd_emu10k1_fx8010_control_old_gpr {
struct snd_ctl_elem_id id;
unsigned int vcount;
unsigned int count;
unsigned short gpr[32];
unsigned int value[32];
unsigned int min;
unsigned int max;
unsigned int translation;
};
struct snd_emu10k1_fx8010_code {
char name[128];
DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
__u32 __user *gpr_map; /* initializers */
unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
unsigned int gpr_del_control_count; /* count of GPR controls to remove */
struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
unsigned int gpr_list_control_count; /* count of GPR controls to list */
unsigned int gpr_list_control_total; /* total count of GPR controls */
struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
__u32 __user *tram_data_map; /* data initializers */
__u32 __user *tram_addr_map; /* map initializers */
DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
__u32 __user *code; /* one instruction - 64 bits */
};
struct snd_emu10k1_fx8010_tram {
unsigned int address; /* 31.bit == 1 -> external TRAM */
unsigned int size; /* size in samples (4 bytes) */
unsigned int *samples; /* pointer to samples (20-bit) */
/* NULL->clear memory */
};
struct snd_emu10k1_fx8010_pcm_rec {
unsigned int substream; /* substream number */
unsigned int res1; /* reserved */
unsigned int channels; /* 16-bit channels count, zero = remove this substream */
unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
unsigned int buffer_size; /* count of buffered samples */
unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
unsigned char pad; /* reserved */
unsigned char etram[32]; /* external TRAM address & data (one per channel) */
unsigned int res2; /* reserved */
};
#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
/* typedefs for compatibility to user-space */
typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
#endif /* _UAPI__SOUND_EMU10K1_H */

View File

@ -0,0 +1,122 @@
/*
* Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
* Takashi Iwai <tiwai@suse.de>
*
* SB16ASP/AWE32 CSP control
*
* 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 _UAPI__SOUND_SB16_CSP_H
#define _UAPI__SOUND_SB16_CSP_H
/* CSP modes */
#define SNDRV_SB_CSP_MODE_NONE 0x00
#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
/* CSP load flags */
#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
/* CSP sample width */
#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
/* CSP channels */
#define SNDRV_SB_CSP_MONO 0x01
#define SNDRV_SB_CSP_STEREO 0x02
/* CSP rates */
#define SNDRV_SB_CSP_RATE_8000 0x01
#define SNDRV_SB_CSP_RATE_11025 0x02
#define SNDRV_SB_CSP_RATE_22050 0x04
#define SNDRV_SB_CSP_RATE_44100 0x08
#define SNDRV_SB_CSP_RATE_ALL 0x0f
/* CSP running state */
#define SNDRV_SB_CSP_ST_IDLE 0x00
#define SNDRV_SB_CSP_ST_LOADED 0x01
#define SNDRV_SB_CSP_ST_RUNNING 0x02
#define SNDRV_SB_CSP_ST_PAUSED 0x04
#define SNDRV_SB_CSP_ST_AUTO 0x08
#define SNDRV_SB_CSP_ST_QSOUND 0x10
/* maximum QSound value (180 degrees right) */
#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
/* maximum microcode RIFF file size */
#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
/* microcode header */
struct snd_sb_csp_mc_header {
char codec_name[16]; /* id name of codec */
unsigned short func_req; /* requested function */
};
/* microcode to be loaded */
struct snd_sb_csp_microcode {
struct snd_sb_csp_mc_header info;
unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
};
/* start CSP with sample_width in mono/stereo */
struct snd_sb_csp_start {
int sample_width; /* sample width, look above */
int channels; /* channels, look above */
};
/* CSP information */
struct snd_sb_csp_info {
char codec_name[16]; /* id name of codec */
unsigned short func_nr; /* function number */
unsigned int acc_format; /* accepted PCM formats */
unsigned short acc_channels; /* accepted channels */
unsigned short acc_width; /* accepted sample width */
unsigned short acc_rates; /* accepted sample rates */
unsigned short csp_mode; /* CSP mode, see above */
unsigned short run_channels; /* current channels */
unsigned short run_width; /* current sample width */
unsigned short version; /* version id: 0x10 - 0x1f */
unsigned short state; /* state bits */
};
/* HWDEP controls */
/* get CSP information */
#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
/* load microcode to CSP */
/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
* defined for some architectures like MIPS, and it leads to build errors.
* (x86 and co have 14-bit size, thus it's valid, though.)
* As a workaround for skipping the size-limit check, here we don't use the
* normal _IOW() macro but _IOC() with the manual argument.
*/
#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
_IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
/* unload microcode from CSP */
#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
/* start CSP */
#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
/* stop CSP */
#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
/* pause CSP and DMA transfer */
#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
/* restart CSP and DMA transfer */
#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
#endif /* _UAPI__SOUND_SB16_CSP_H */

View File

@ -786,7 +786,7 @@ static int aaci_resume(struct amba_device *dev)
#endif #endif
static struct ac97_pcm ac97_defs[] __devinitdata = { static struct ac97_pcm ac97_defs[] = {
[0] = { /* Front PCM */ [0] = { /* Front PCM */
.exclusive = 1, .exclusive = 1,
.r = { .r = {
@ -832,7 +832,7 @@ static struct snd_ac97_bus_ops aaci_bus_ops = {
.read = aaci_ac97_read, .read = aaci_ac97_read,
}; };
static int __devinit aaci_probe_ac97(struct aaci *aaci) static int aaci_probe_ac97(struct aaci *aaci)
{ {
struct snd_ac97_template ac97_template; struct snd_ac97_template ac97_template;
struct snd_ac97_bus *ac97_bus; struct snd_ac97_bus *ac97_bus;
@ -893,7 +893,7 @@ static void aaci_free_card(struct snd_card *card)
iounmap(aaci->base); iounmap(aaci->base);
} }
static struct aaci * __devinit aaci_init_card(struct amba_device *dev) static struct aaci *aaci_init_card(struct amba_device *dev)
{ {
struct aaci *aaci; struct aaci *aaci;
struct snd_card *card; struct snd_card *card;
@ -926,7 +926,7 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev)
return aaci; return aaci;
} }
static int __devinit aaci_init_pcm(struct aaci *aaci) static int aaci_init_pcm(struct aaci *aaci)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int ret; int ret;
@ -948,7 +948,7 @@ static int __devinit aaci_init_pcm(struct aaci *aaci)
return ret; return ret;
} }
static unsigned int __devinit aaci_size_fifo(struct aaci *aaci) static unsigned int aaci_size_fifo(struct aaci *aaci)
{ {
struct aaci_runtime *aacirun = &aaci->playback; struct aaci_runtime *aacirun = &aaci->playback;
int i; int i;
@ -984,8 +984,8 @@ static unsigned int __devinit aaci_size_fifo(struct aaci *aaci)
return i; return i;
} }
static int __devinit aaci_probe(struct amba_device *dev, static int aaci_probe(struct amba_device *dev,
const struct amba_id *id) const struct amba_id *id)
{ {
struct aaci *aaci; struct aaci *aaci;
int ret, i; int ret, i;
@ -1072,7 +1072,7 @@ static int __devinit aaci_probe(struct amba_device *dev,
return ret; return ret;
} }
static int __devexit aaci_remove(struct amba_device *dev) static int aaci_remove(struct amba_device *dev)
{ {
struct snd_card *card = amba_get_drvdata(dev); struct snd_card *card = amba_get_drvdata(dev);
@ -1104,7 +1104,7 @@ static struct amba_driver aaci_driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
}, },
.probe = aaci_probe, .probe = aaci_probe,
.remove = __devexit_p(aaci_remove), .remove = aaci_remove,
.suspend = aaci_suspend, .suspend = aaci_suspend,
.resume = aaci_resume, .resume = aaci_resume,
.id_table = aaci_ids, .id_table = aaci_ids,

View File

@ -314,7 +314,7 @@ int pxa2xx_ac97_hw_resume(void)
EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume); EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
#endif #endif
int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev) int pxa2xx_ac97_hw_probe(struct platform_device *dev)
{ {
int ret; int ret;
pxa2xx_audio_ops_t *pdata = dev->dev.platform_data; pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;

View File

@ -163,7 +163,7 @@ static int pxa2xx_ac97_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume); static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume);
#endif #endif
static int __devinit pxa2xx_ac97_probe(struct platform_device *dev) static int pxa2xx_ac97_probe(struct platform_device *dev)
{ {
struct snd_card *card; struct snd_card *card;
struct snd_ac97_bus *ac97_bus; struct snd_ac97_bus *ac97_bus;
@ -224,7 +224,7 @@ err_dev:
return ret; return ret;
} }
static int __devexit pxa2xx_ac97_remove(struct platform_device *dev) static int pxa2xx_ac97_remove(struct platform_device *dev)
{ {
struct snd_card *card = platform_get_drvdata(dev); struct snd_card *card = platform_get_drvdata(dev);
@ -239,7 +239,7 @@ static int __devexit pxa2xx_ac97_remove(struct platform_device *dev)
static struct platform_driver pxa2xx_ac97_driver = { static struct platform_driver pxa2xx_ac97_driver = {
.probe = pxa2xx_ac97_probe, .probe = pxa2xx_ac97_probe,
.remove = __devexit_p(pxa2xx_ac97_remove), .remove = pxa2xx_ac97_remove,
.driver = { .driver = {
.name = "pxa2xx-ac97", .name = "pxa2xx-ac97",
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -309,7 +309,7 @@ static struct snd_pcm_ops atmel_abdac_ops = {
.pointer = atmel_abdac_pointer, .pointer = atmel_abdac_pointer,
}; };
static int __devinit atmel_abdac_pcm_new(struct atmel_abdac *dac) static int atmel_abdac_pcm_new(struct atmel_abdac *dac)
{ {
struct snd_pcm_hardware hw = atmel_abdac_hw; struct snd_pcm_hardware hw = atmel_abdac_hw;
struct snd_pcm *pcm; struct snd_pcm *pcm;
@ -386,7 +386,7 @@ static int set_sample_rates(struct atmel_abdac *dac)
return retval; return retval;
} }
static int __devinit atmel_abdac_probe(struct platform_device *pdev) static int atmel_abdac_probe(struct platform_device *pdev)
{ {
struct snd_card *card; struct snd_card *card;
struct atmel_abdac *dac; struct atmel_abdac *dac;
@ -567,7 +567,7 @@ static SIMPLE_DEV_PM_OPS(atmel_abdac_pm, atmel_abdac_suspend, atmel_abdac_resume
#define ATMEL_ABDAC_PM_OPS NULL #define ATMEL_ABDAC_PM_OPS NULL
#endif #endif
static int __devexit atmel_abdac_remove(struct platform_device *pdev) static int atmel_abdac_remove(struct platform_device *pdev)
{ {
struct snd_card *card = platform_get_drvdata(pdev); struct snd_card *card = platform_get_drvdata(pdev);
struct atmel_abdac *dac = get_dac(card); struct atmel_abdac *dac = get_dac(card);
@ -589,7 +589,7 @@ static int __devexit atmel_abdac_remove(struct platform_device *pdev)
} }
static struct platform_driver atmel_abdac_driver = { static struct platform_driver atmel_abdac_driver = {
.remove = __devexit_p(atmel_abdac_remove), .remove = atmel_abdac_remove,
.driver = { .driver = {
.name = "atmel_abdac", .name = "atmel_abdac",
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -728,7 +728,7 @@ static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
return retval; return retval;
} }
static struct ac97_pcm at91_ac97_pcm_defs[] __devinitdata = { static struct ac97_pcm at91_ac97_pcm_defs[] = {
/* Playback */ /* Playback */
{ {
.exclusive = 1, .exclusive = 1,
@ -756,7 +756,7 @@ static struct ac97_pcm at91_ac97_pcm_defs[] __devinitdata = {
}, },
}; };
static int __devinit atmel_ac97c_pcm_new(struct atmel_ac97c *chip) static int atmel_ac97c_pcm_new(struct atmel_ac97c *chip)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
struct snd_pcm_hardware hw = atmel_ac97c_hw; struct snd_pcm_hardware hw = atmel_ac97c_hw;
@ -902,7 +902,7 @@ static void atmel_ac97c_reset(struct atmel_ac97c *chip)
} }
} }
static int __devinit atmel_ac97c_probe(struct platform_device *pdev) static int atmel_ac97c_probe(struct platform_device *pdev)
{ {
struct snd_card *card; struct snd_card *card;
struct atmel_ac97c *chip; struct atmel_ac97c *chip;
@ -1168,7 +1168,7 @@ static SIMPLE_DEV_PM_OPS(atmel_ac97c_pm, atmel_ac97c_suspend, atmel_ac97c_resume
#define ATMEL_AC97C_PM_OPS NULL #define ATMEL_AC97C_PM_OPS NULL
#endif #endif
static int __devexit atmel_ac97c_remove(struct platform_device *pdev) static int atmel_ac97c_remove(struct platform_device *pdev)
{ {
struct snd_card *card = platform_get_drvdata(pdev); struct snd_card *card = platform_get_drvdata(pdev);
struct atmel_ac97c *chip = get_chip(card); struct atmel_ac97c *chip = get_chip(card);
@ -1205,7 +1205,7 @@ static int __devexit atmel_ac97c_remove(struct platform_device *pdev)
} }
static struct platform_driver atmel_ac97c_driver = { static struct platform_driver atmel_ac97c_driver = {
.remove = __devexit_p(atmel_ac97c_remove), .remove = atmel_ac97c_remove,
.driver = { .driver = {
.name = "atmel_ac97c", .name = "atmel_ac97c",
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -199,12 +199,13 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames) snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames)
{ {
struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
int stream = snd_pcm_plug_stream(plug); int stream;
if (snd_BUG_ON(!plug)) if (snd_BUG_ON(!plug))
return -ENXIO; return -ENXIO;
if (drv_frames == 0) if (drv_frames == 0)
return 0; return 0;
stream = snd_pcm_plug_stream(plug);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) { if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
plugin = snd_pcm_plug_last(plug); plugin = snd_pcm_plug_last(plug);
while (plugin && drv_frames > 0) { while (plugin && drv_frames > 0) {
@ -230,13 +231,14 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
{ {
struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
snd_pcm_sframes_t frames; snd_pcm_sframes_t frames;
int stream = snd_pcm_plug_stream(plug); int stream;
if (snd_BUG_ON(!plug)) if (snd_BUG_ON(!plug))
return -ENXIO; return -ENXIO;
if (clt_frames == 0) if (clt_frames == 0)
return 0; return 0;
frames = clt_frames; frames = clt_frames;
stream = snd_pcm_plug_stream(plug);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) { if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
plugin = snd_pcm_plug_first(plug); plugin = snd_pcm_plug_first(plug);
while (plugin && frames > 0) { while (plugin && frames > 0) {

View File

@ -981,8 +981,7 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))); PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)));
kfree(runtime->hw_constraints.rules); kfree(runtime->hw_constraints.rules);
#ifdef CONFIG_SND_PCM_XRUN_DEBUG #ifdef CONFIG_SND_PCM_XRUN_DEBUG
if (runtime->hwptr_log) kfree(runtime->hwptr_log);
kfree(runtime->hwptr_log);
#endif #endif
kfree(runtime); kfree(runtime);
substream->runtime = NULL; substream->runtime = NULL;

View File

@ -190,7 +190,9 @@ struct snd_pcm_status32 {
u32 avail_max; u32 avail_max;
u32 overrange; u32 overrange;
s32 suspended_state; s32 suspended_state;
unsigned char reserved[60]; u32 reserved_alignment;
struct compat_timespec audio_tstamp;
unsigned char reserved[56-sizeof(struct compat_timespec)];
} __attribute__((packed)); } __attribute__((packed));
@ -205,17 +207,16 @@ static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream,
return err; return err;
if (put_user(status.state, &src->state) || if (put_user(status.state, &src->state) ||
put_user(status.trigger_tstamp.tv_sec, &src->trigger_tstamp.tv_sec) || compat_put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) ||
put_user(status.trigger_tstamp.tv_nsec, &src->trigger_tstamp.tv_nsec) || compat_put_timespec(&status.tstamp, &src->tstamp) ||
put_user(status.tstamp.tv_sec, &src->tstamp.tv_sec) ||
put_user(status.tstamp.tv_nsec, &src->tstamp.tv_nsec) ||
put_user(status.appl_ptr, &src->appl_ptr) || put_user(status.appl_ptr, &src->appl_ptr) ||
put_user(status.hw_ptr, &src->hw_ptr) || put_user(status.hw_ptr, &src->hw_ptr) ||
put_user(status.delay, &src->delay) || put_user(status.delay, &src->delay) ||
put_user(status.avail, &src->avail) || put_user(status.avail, &src->avail) ||
put_user(status.avail_max, &src->avail_max) || put_user(status.avail_max, &src->avail_max) ||
put_user(status.overrange, &src->overrange) || put_user(status.overrange, &src->overrange) ||
put_user(status.suspended_state, &src->suspended_state)) put_user(status.suspended_state, &src->suspended_state) ||
compat_put_timespec(&status.audio_tstamp, &src->audio_tstamp))
return -EFAULT; return -EFAULT;
return err; return err;
@ -364,6 +365,7 @@ struct snd_pcm_mmap_status32 {
u32 hw_ptr; u32 hw_ptr;
struct compat_timespec tstamp; struct compat_timespec tstamp;
s32 suspended_state; s32 suspended_state;
struct compat_timespec audio_tstamp;
} __attribute__((packed)); } __attribute__((packed));
struct snd_pcm_mmap_control32 { struct snd_pcm_mmap_control32 {
@ -426,12 +428,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream,
sstatus.hw_ptr = status->hw_ptr % boundary; sstatus.hw_ptr = status->hw_ptr % boundary;
sstatus.tstamp = status->tstamp; sstatus.tstamp = status->tstamp;
sstatus.suspended_state = status->suspended_state; sstatus.suspended_state = status->suspended_state;
sstatus.audio_tstamp = status->audio_tstamp;
snd_pcm_stream_unlock_irq(substream); snd_pcm_stream_unlock_irq(substream);
if (put_user(sstatus.state, &src->s.status.state) || if (put_user(sstatus.state, &src->s.status.state) ||
put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) || put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) ||
put_user(sstatus.tstamp.tv_sec, &src->s.status.tstamp.tv_sec) || compat_put_timespec(&sstatus.tstamp, &src->s.status.tstamp) ||
put_user(sstatus.tstamp.tv_nsec, &src->s.status.tstamp.tv_nsec) ||
put_user(sstatus.suspended_state, &src->s.status.suspended_state) || put_user(sstatus.suspended_state, &src->s.status.suspended_state) ||
compat_put_timespec(&sstatus.audio_tstamp,
&src->s.status.audio_tstamp) ||
put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) || put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) ||
put_user(scontrol.avail_min, &src->c.control.avail_min)) put_user(scontrol.avail_min, &src->c.control.avail_min))
return -EFAULT; return -EFAULT;

View File

@ -316,6 +316,8 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
unsigned long jdelta; unsigned long jdelta;
unsigned long curr_jiffies; unsigned long curr_jiffies;
struct timespec curr_tstamp; struct timespec curr_tstamp;
struct timespec audio_tstamp;
int crossed_boundary = 0;
old_hw_ptr = runtime->status->hw_ptr; old_hw_ptr = runtime->status->hw_ptr;
@ -327,9 +329,14 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
*/ */
pos = substream->ops->pointer(substream); pos = substream->ops->pointer(substream);
curr_jiffies = jiffies; curr_jiffies = jiffies;
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) {
snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp); snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp);
if ((runtime->hw.info & SNDRV_PCM_INFO_HAS_WALL_CLOCK) &&
(substream->ops->wall_clock))
substream->ops->wall_clock(substream, &audio_tstamp);
}
if (pos == SNDRV_PCM_POS_XRUN) { if (pos == SNDRV_PCM_POS_XRUN) {
xrun(substream); xrun(substream);
return -EPIPE; return -EPIPE;
@ -360,8 +367,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
hdelta = curr_jiffies - runtime->hw_ptr_jiffies; hdelta = curr_jiffies - runtime->hw_ptr_jiffies;
if (hdelta > runtime->hw_ptr_buffer_jiffies/2) { if (hdelta > runtime->hw_ptr_buffer_jiffies/2) {
hw_base += runtime->buffer_size; hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) if (hw_base >= runtime->boundary) {
hw_base = 0; hw_base = 0;
crossed_boundary++;
}
new_hw_ptr = hw_base + pos; new_hw_ptr = hw_base + pos;
goto __delta; goto __delta;
} }
@ -371,8 +380,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
/* pointer crosses the end of the ring buffer */ /* pointer crosses the end of the ring buffer */
if (new_hw_ptr < old_hw_ptr) { if (new_hw_ptr < old_hw_ptr) {
hw_base += runtime->buffer_size; hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) if (hw_base >= runtime->boundary) {
hw_base = 0; hw_base = 0;
crossed_boundary++;
}
new_hw_ptr = hw_base + pos; new_hw_ptr = hw_base + pos;
} }
__delta: __delta:
@ -410,8 +421,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
while (hdelta > xrun_threshold) { while (hdelta > xrun_threshold) {
delta += runtime->buffer_size; delta += runtime->buffer_size;
hw_base += runtime->buffer_size; hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) if (hw_base >= runtime->boundary) {
hw_base = 0; hw_base = 0;
crossed_boundary++;
}
new_hw_ptr = hw_base + pos; new_hw_ptr = hw_base + pos;
hdelta -= runtime->hw_ptr_buffer_jiffies; hdelta -= runtime->hw_ptr_buffer_jiffies;
} }
@ -456,8 +469,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
/* the delta value is small or zero in most cases */ /* the delta value is small or zero in most cases */
while (delta > 0) { while (delta > 0) {
new_hw_ptr += runtime->period_size; new_hw_ptr += runtime->period_size;
if (new_hw_ptr >= runtime->boundary) if (new_hw_ptr >= runtime->boundary) {
new_hw_ptr -= runtime->boundary; new_hw_ptr -= runtime->boundary;
crossed_boundary--;
}
delta--; delta--;
} }
/* align hw_base to buffer_size */ /* align hw_base to buffer_size */
@ -507,9 +522,35 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
runtime->hw_ptr_base = hw_base; runtime->hw_ptr_base = hw_base;
runtime->status->hw_ptr = new_hw_ptr; runtime->status->hw_ptr = new_hw_ptr;
runtime->hw_ptr_jiffies = curr_jiffies; runtime->hw_ptr_jiffies = curr_jiffies;
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) if (crossed_boundary) {
snd_BUG_ON(crossed_boundary != 1);
runtime->hw_ptr_wrap += runtime->boundary;
}
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) {
runtime->status->tstamp = curr_tstamp; runtime->status->tstamp = curr_tstamp;
if (!(runtime->hw.info & SNDRV_PCM_INFO_HAS_WALL_CLOCK)) {
/*
* no wall clock available, provide audio timestamp
* derived from pointer position+delay
*/
u64 audio_frames, audio_nsecs;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
audio_frames = runtime->hw_ptr_wrap
+ runtime->status->hw_ptr
- runtime->delay;
else
audio_frames = runtime->hw_ptr_wrap
+ runtime->status->hw_ptr
+ runtime->delay;
audio_nsecs = div_u64(audio_frames * 1000000000LL,
runtime->rate);
audio_tstamp = ns_to_timespec(audio_nsecs);
}
runtime->status->audio_tstamp = audio_tstamp;
}
return snd_pcm_update_state(substream, runtime); return snd_pcm_update_state(substream, runtime);
} }
@ -1661,8 +1702,10 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
if (snd_pcm_running(substream) && if (snd_pcm_running(substream) &&
snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_update_hw_ptr(substream) >= 0)
runtime->status->hw_ptr %= runtime->buffer_size; runtime->status->hw_ptr %= runtime->buffer_size;
else else {
runtime->status->hw_ptr = 0; runtime->status->hw_ptr = 0;
runtime->hw_ptr_wrap = 0;
}
snd_pcm_stream_unlock_irqrestore(substream, flags); snd_pcm_stream_unlock_irqrestore(substream, flags);
return 0; return 0;
} }

View File

@ -602,6 +602,8 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
snd_pcm_update_hw_ptr(substream); snd_pcm_update_hw_ptr(substream);
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) { if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) {
status->tstamp = runtime->status->tstamp; status->tstamp = runtime->status->tstamp;
status->audio_tstamp =
runtime->status->audio_tstamp;
goto _tstamp_end; goto _tstamp_end;
} }
} }
@ -1998,7 +2000,7 @@ int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
if (runtime->dma_bytes) { if (runtime->dma_bytes) {
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, runtime->dma_bytes); err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, runtime->dma_bytes);
if (err < 0) if (err < 0)
return -EINVAL; return err;
} }
if (!(hw->rates & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))) { if (!(hw->rates & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))) {

View File

@ -14,6 +14,7 @@ config SND_OPL4_LIB
config SND_VX_LIB config SND_VX_LIB
tristate tristate
select FW_LOADER
select SND_HWDEP select SND_HWDEP
select SND_PCM select SND_PCM
@ -35,7 +36,6 @@ config SND_PCSP
tristate "PC-Speaker support (READ HELP!)" tristate "PC-Speaker support (READ HELP!)"
depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS
depends on INPUT depends on INPUT
depends on EXPERIMENTAL
select SND_PCM select SND_PCM
help help
If you don't have a sound card in your computer, you can include a If you don't have a sound card in your computer, you can include a

View File

@ -120,7 +120,6 @@ struct loopback_pcm {
unsigned int last_drift; unsigned int last_drift;
unsigned long last_jiffies; unsigned long last_jiffies;
struct timer_list timer; struct timer_list timer;
spinlock_t timer_lock;
}; };
static struct platform_device *devices[SNDRV_CARDS]; static struct platform_device *devices[SNDRV_CARDS];
@ -166,12 +165,12 @@ static inline unsigned int get_rate_shift(struct loopback_pcm *dpcm)
return get_setup(dpcm)->rate_shift; return get_setup(dpcm)->rate_shift;
} }
/* call in cable->lock */
static void loopback_timer_start(struct loopback_pcm *dpcm) static void loopback_timer_start(struct loopback_pcm *dpcm)
{ {
unsigned long tick; unsigned long tick;
unsigned int rate_shift = get_rate_shift(dpcm); unsigned int rate_shift = get_rate_shift(dpcm);
spin_lock(&dpcm->timer_lock);
if (rate_shift != dpcm->pcm_rate_shift) { if (rate_shift != dpcm->pcm_rate_shift) {
dpcm->pcm_rate_shift = rate_shift; dpcm->pcm_rate_shift = rate_shift;
dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size); dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size);
@ -184,15 +183,13 @@ static void loopback_timer_start(struct loopback_pcm *dpcm)
tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps; tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps;
dpcm->timer.expires = jiffies + tick; dpcm->timer.expires = jiffies + tick;
add_timer(&dpcm->timer); add_timer(&dpcm->timer);
spin_unlock(&dpcm->timer_lock);
} }
/* call in cable->lock */
static inline void loopback_timer_stop(struct loopback_pcm *dpcm) static inline void loopback_timer_stop(struct loopback_pcm *dpcm)
{ {
spin_lock(&dpcm->timer_lock);
del_timer(&dpcm->timer); del_timer(&dpcm->timer);
dpcm->timer.expires = 0; dpcm->timer.expires = 0;
spin_unlock(&dpcm->timer_lock);
} }
#define CABLE_VALID_PLAYBACK (1 << SNDRV_PCM_STREAM_PLAYBACK) #define CABLE_VALID_PLAYBACK (1 << SNDRV_PCM_STREAM_PLAYBACK)
@ -274,8 +271,8 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
spin_lock(&cable->lock); spin_lock(&cable->lock);
cable->running |= stream; cable->running |= stream;
cable->pause &= ~stream; cable->pause &= ~stream;
spin_unlock(&cable->lock);
loopback_timer_start(dpcm); loopback_timer_start(dpcm);
spin_unlock(&cable->lock);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
loopback_active_notify(dpcm); loopback_active_notify(dpcm);
break; break;
@ -283,23 +280,23 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
spin_lock(&cable->lock); spin_lock(&cable->lock);
cable->running &= ~stream; cable->running &= ~stream;
cable->pause &= ~stream; cable->pause &= ~stream;
spin_unlock(&cable->lock);
loopback_timer_stop(dpcm); loopback_timer_stop(dpcm);
spin_unlock(&cable->lock);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
loopback_active_notify(dpcm); loopback_active_notify(dpcm);
break; break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
spin_lock(&cable->lock); spin_lock(&cable->lock);
cable->pause |= stream; cable->pause |= stream;
spin_unlock(&cable->lock);
loopback_timer_stop(dpcm); loopback_timer_stop(dpcm);
spin_unlock(&cable->lock);
break; break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
spin_lock(&cable->lock); spin_lock(&cable->lock);
dpcm->last_jiffies = jiffies; dpcm->last_jiffies = jiffies;
cable->pause &= ~stream; cable->pause &= ~stream;
spin_unlock(&cable->lock);
loopback_timer_start(dpcm); loopback_timer_start(dpcm);
spin_unlock(&cable->lock);
break; break;
default: default:
return -EINVAL; return -EINVAL;
@ -477,6 +474,7 @@ static inline void bytepos_finish(struct loopback_pcm *dpcm,
dpcm->buf_pos %= dpcm->pcm_buffer_size; dpcm->buf_pos %= dpcm->pcm_buffer_size;
} }
/* call in cable->lock */
static unsigned int loopback_pos_update(struct loopback_cable *cable) static unsigned int loopback_pos_update(struct loopback_cable *cable)
{ {
struct loopback_pcm *dpcm_play = struct loopback_pcm *dpcm_play =
@ -485,9 +483,7 @@ static unsigned int loopback_pos_update(struct loopback_cable *cable)
cable->streams[SNDRV_PCM_STREAM_CAPTURE]; cable->streams[SNDRV_PCM_STREAM_CAPTURE];
unsigned long delta_play = 0, delta_capt = 0; unsigned long delta_play = 0, delta_capt = 0;
unsigned int running, count1, count2; unsigned int running, count1, count2;
unsigned long flags;
spin_lock_irqsave(&cable->lock, flags);
running = cable->running ^ cable->pause; running = cable->running ^ cable->pause;
if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) { if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) {
delta_play = jiffies - dpcm_play->last_jiffies; delta_play = jiffies - dpcm_play->last_jiffies;
@ -529,32 +525,39 @@ static unsigned int loopback_pos_update(struct loopback_cable *cable)
bytepos_finish(dpcm_play, count1); bytepos_finish(dpcm_play, count1);
bytepos_finish(dpcm_capt, count1); bytepos_finish(dpcm_capt, count1);
unlock: unlock:
spin_unlock_irqrestore(&cable->lock, flags);
return running; return running;
} }
static void loopback_timer_function(unsigned long data) static void loopback_timer_function(unsigned long data)
{ {
struct loopback_pcm *dpcm = (struct loopback_pcm *)data; struct loopback_pcm *dpcm = (struct loopback_pcm *)data;
unsigned int running; unsigned long flags;
running = loopback_pos_update(dpcm->cable); spin_lock_irqsave(&dpcm->cable->lock, flags);
if (running & (1 << dpcm->substream->stream)) { if (loopback_pos_update(dpcm->cable) & (1 << dpcm->substream->stream)) {
loopback_timer_start(dpcm); loopback_timer_start(dpcm);
if (dpcm->period_update_pending) { if (dpcm->period_update_pending) {
dpcm->period_update_pending = 0; dpcm->period_update_pending = 0;
spin_unlock_irqrestore(&dpcm->cable->lock, flags);
/* need to unlock before calling below */
snd_pcm_period_elapsed(dpcm->substream); snd_pcm_period_elapsed(dpcm->substream);
return;
} }
} }
spin_unlock_irqrestore(&dpcm->cable->lock, flags);
} }
static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream) static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct loopback_pcm *dpcm = runtime->private_data; struct loopback_pcm *dpcm = runtime->private_data;
snd_pcm_uframes_t pos;
spin_lock(&dpcm->cable->lock);
loopback_pos_update(dpcm->cable); loopback_pos_update(dpcm->cable);
return bytes_to_frames(runtime, dpcm->buf_pos); pos = dpcm->buf_pos;
spin_unlock(&dpcm->cable->lock);
return bytes_to_frames(runtime, pos);
} }
static struct snd_pcm_hardware loopback_pcm_hardware = static struct snd_pcm_hardware loopback_pcm_hardware =
@ -672,7 +675,6 @@ static int loopback_open(struct snd_pcm_substream *substream)
dpcm->substream = substream; dpcm->substream = substream;
setup_timer(&dpcm->timer, loopback_timer_function, setup_timer(&dpcm->timer, loopback_timer_function,
(unsigned long)dpcm); (unsigned long)dpcm);
spin_lock_init(&dpcm->timer_lock);
cable = loopback->cables[substream->number][dev]; cable = loopback->cables[substream->number][dev];
if (!cable) { if (!cable) {
@ -772,8 +774,8 @@ static struct snd_pcm_ops loopback_capture_ops = {
.mmap = snd_pcm_lib_mmap_vmalloc, .mmap = snd_pcm_lib_mmap_vmalloc,
}; };
static int __devinit loopback_pcm_new(struct loopback *loopback, static int loopback_pcm_new(struct loopback *loopback,
int device, int substreams) int device, int substreams)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
@ -947,7 +949,7 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol,
return 0; return 0;
} }
static struct snd_kcontrol_new loopback_controls[] __devinitdata = { static struct snd_kcontrol_new loopback_controls[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_PCM, .iface = SNDRV_CTL_ELEM_IFACE_PCM,
.name = "PCM Rate Shift 100000", .name = "PCM Rate Shift 100000",
@ -996,7 +998,7 @@ static struct snd_kcontrol_new loopback_controls[] __devinitdata = {
} }
}; };
static int __devinit loopback_mixer_new(struct loopback *loopback, int notify) static int loopback_mixer_new(struct loopback *loopback, int notify)
{ {
struct snd_card *card = loopback->card; struct snd_card *card = loopback->card;
struct snd_pcm *pcm; struct snd_pcm *pcm;
@ -1109,7 +1111,7 @@ static void print_cable_info(struct snd_info_entry *entry,
mutex_unlock(&loopback->cable_lock); mutex_unlock(&loopback->cable_lock);
} }
static int __devinit loopback_proc_new(struct loopback *loopback, int cidx) static int loopback_proc_new(struct loopback *loopback, int cidx)
{ {
char name[32]; char name[32];
struct snd_info_entry *entry; struct snd_info_entry *entry;
@ -1130,7 +1132,7 @@ static int __devinit loopback_proc_new(struct loopback *loopback, int cidx)
#endif #endif
static int __devinit loopback_probe(struct platform_device *devptr) static int loopback_probe(struct platform_device *devptr)
{ {
struct snd_card *card; struct snd_card *card;
struct loopback *loopback; struct loopback *loopback;
@ -1175,7 +1177,7 @@ static int __devinit loopback_probe(struct platform_device *devptr)
return err; return err;
} }
static int __devexit loopback_remove(struct platform_device *devptr) static int loopback_remove(struct platform_device *devptr)
{ {
snd_card_free(platform_get_drvdata(devptr)); snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL); platform_set_drvdata(devptr, NULL);
@ -1213,7 +1215,7 @@ static SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume);
static struct platform_driver loopback_driver = { static struct platform_driver loopback_driver = {
.probe = loopback_probe, .probe = loopback_probe,
.remove = __devexit_p(loopback_remove), .remove = loopback_remove,
.driver = { .driver = {
.name = SND_LOOPBACK_DRIVER, .name = SND_LOOPBACK_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -134,6 +134,9 @@ struct snd_dummy {
spinlock_t mixer_lock; spinlock_t mixer_lock;
int mixer_volume[MIXER_ADDR_LAST+1][2]; int mixer_volume[MIXER_ADDR_LAST+1][2];
int capture_source[MIXER_ADDR_LAST+1][2]; int capture_source[MIXER_ADDR_LAST+1][2];
int iobox;
struct snd_kcontrol *cd_volume_ctl;
struct snd_kcontrol *cd_switch_ctl;
const struct dummy_timer_ops *timer_ops; const struct dummy_timer_ops *timer_ops;
}; };
@ -685,8 +688,8 @@ static struct snd_pcm_ops dummy_pcm_ops_no_buf = {
.page = dummy_pcm_page, .page = dummy_pcm_page,
}; };
static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device, static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
int substreams) int substreams)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
struct snd_pcm_ops *ops; struct snd_pcm_ops *ops;
@ -817,6 +820,57 @@ static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
return change; return change;
} }
static int snd_dummy_iobox_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info)
{
const char *const names[] = { "None", "CD Player" };
return snd_ctl_enum_info(info, 1, 2, names);
}
static int snd_dummy_iobox_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
value->value.enumerated.item[0] = dummy->iobox;
return 0;
}
static int snd_dummy_iobox_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int changed;
if (value->value.enumerated.item[0] > 1)
return -EINVAL;
changed = value->value.enumerated.item[0] != dummy->iobox;
if (changed) {
dummy->iobox = value->value.enumerated.item[0];
if (dummy->iobox) {
dummy->cd_volume_ctl->vd[0].access &=
~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
dummy->cd_switch_ctl->vd[0].access &=
~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
} else {
dummy->cd_volume_ctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_INACTIVE;
dummy->cd_switch_ctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_INACTIVE;
}
snd_ctl_notify(dummy->card, SNDRV_CTL_EVENT_MASK_INFO,
&dummy->cd_volume_ctl->id);
snd_ctl_notify(dummy->card, SNDRV_CTL_EVENT_MASK_INFO,
&dummy->cd_switch_ctl->id);
}
return changed;
}
static struct snd_kcontrol_new snd_dummy_controls[] = { static struct snd_kcontrol_new snd_dummy_controls[] = {
DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER), DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER), DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
@ -827,22 +881,37 @@ DUMMY_CAPSRC("Line Capture Switch", 0, MIXER_ADDR_LINE),
DUMMY_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC), DUMMY_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC),
DUMMY_CAPSRC("Mic Capture Switch", 0, MIXER_ADDR_MIC), DUMMY_CAPSRC("Mic Capture Switch", 0, MIXER_ADDR_MIC),
DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD), DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD) DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD),
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "External I/O Box",
.info = snd_dummy_iobox_info,
.get = snd_dummy_iobox_get,
.put = snd_dummy_iobox_put,
},
}; };
static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy) static int snd_card_dummy_new_mixer(struct snd_dummy *dummy)
{ {
struct snd_card *card = dummy->card; struct snd_card *card = dummy->card;
struct snd_kcontrol *kcontrol;
unsigned int idx; unsigned int idx;
int err; int err;
spin_lock_init(&dummy->mixer_lock); spin_lock_init(&dummy->mixer_lock);
strcpy(card->mixername, "Dummy Mixer"); strcpy(card->mixername, "Dummy Mixer");
dummy->iobox = 1;
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) { for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy)); kcontrol = snd_ctl_new1(&snd_dummy_controls[idx], dummy);
err = snd_ctl_add(card, kcontrol);
if (err < 0) if (err < 0)
return err; return err;
if (!strcmp(kcontrol->id.name, "CD Volume"))
dummy->cd_volume_ctl = kcontrol;
else if (!strcmp(kcontrol->id.name, "CD Capture Switch"))
dummy->cd_switch_ctl = kcontrol;
} }
return 0; return 0;
} }
@ -962,7 +1031,7 @@ static void dummy_proc_write(struct snd_info_entry *entry,
} }
} }
static void __devinit dummy_proc_init(struct snd_dummy *chip) static void dummy_proc_init(struct snd_dummy *chip)
{ {
struct snd_info_entry *entry; struct snd_info_entry *entry;
@ -977,7 +1046,7 @@ static void __devinit dummy_proc_init(struct snd_dummy *chip)
#define dummy_proc_init(x) #define dummy_proc_init(x)
#endif /* CONFIG_SND_DEBUG && CONFIG_PROC_FS */ #endif /* CONFIG_SND_DEBUG && CONFIG_PROC_FS */
static int __devinit snd_dummy_probe(struct platform_device *devptr) static int snd_dummy_probe(struct platform_device *devptr)
{ {
struct snd_card *card; struct snd_card *card;
struct snd_dummy *dummy; struct snd_dummy *dummy;
@ -1057,7 +1126,7 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
return err; return err;
} }
static int __devexit snd_dummy_remove(struct platform_device *devptr) static int snd_dummy_remove(struct platform_device *devptr)
{ {
snd_card_free(platform_get_drvdata(devptr)); snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL); platform_set_drvdata(devptr, NULL);
@ -1093,7 +1162,7 @@ static SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume);
static struct platform_driver snd_dummy_driver = { static struct platform_driver snd_dummy_driver = {
.probe = snd_dummy_probe, .probe = snd_dummy_probe,
.remove = __devexit_p(snd_dummy_remove), .remove = snd_dummy_remove,
.driver = { .driver = {
.name = SND_DUMMY_DRIVER, .name = SND_DUMMY_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -1063,7 +1063,7 @@ snd_ml403_ac97cr_codec_write(struct snd_ac97 *ac97, unsigned short reg,
return; return;
} }
static int __devinit static int
snd_ml403_ac97cr_chip_init(struct snd_ml403_ac97cr *ml403_ac97cr) snd_ml403_ac97cr_chip_init(struct snd_ml403_ac97cr *ml403_ac97cr)
{ {
unsigned long end_time; unsigned long end_time;
@ -1108,7 +1108,7 @@ static int snd_ml403_ac97cr_dev_free(struct snd_device *snddev)
return snd_ml403_ac97cr_free(ml403_ac97cr); return snd_ml403_ac97cr_free(ml403_ac97cr);
} }
static int __devinit static int
snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
struct snd_ml403_ac97cr **rml403_ac97cr) struct snd_ml403_ac97cr **rml403_ac97cr)
{ {
@ -1204,7 +1204,7 @@ static void snd_ml403_ac97cr_mixer_free(struct snd_ac97 *ac97)
PDEBUG(INIT_INFO, "mixer_free(): (done)\n"); PDEBUG(INIT_INFO, "mixer_free(): (done)\n");
} }
static int __devinit static int
snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr) snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr)
{ {
struct snd_ac97_bus *bus; struct snd_ac97_bus *bus;
@ -1237,7 +1237,7 @@ snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr)
return err; return err;
} }
static int __devinit static int
snd_ml403_ac97cr_pcm(struct snd_ml403_ac97cr *ml403_ac97cr, int device, snd_ml403_ac97cr_pcm(struct snd_ml403_ac97cr *ml403_ac97cr, int device,
struct snd_pcm **rpcm) struct snd_pcm **rpcm)
{ {
@ -1268,7 +1268,7 @@ snd_ml403_ac97cr_pcm(struct snd_ml403_ac97cr *ml403_ac97cr, int device,
return 0; return 0;
} }
static int __devinit snd_ml403_ac97cr_probe(struct platform_device *pfdev) static int snd_ml403_ac97cr_probe(struct platform_device *pfdev)
{ {
struct snd_card *card; struct snd_card *card;
struct snd_ml403_ac97cr *ml403_ac97cr = NULL; struct snd_ml403_ac97cr *ml403_ac97cr = NULL;

View File

@ -100,7 +100,7 @@ static int snd_mpu401_create(int dev, struct snd_card **rcard)
return err; return err;
} }
static int __devinit snd_mpu401_probe(struct platform_device *devptr) static int snd_mpu401_probe(struct platform_device *devptr)
{ {
int dev = devptr->id; int dev = devptr->id;
int err; int err;
@ -126,7 +126,7 @@ static int __devinit snd_mpu401_probe(struct platform_device *devptr)
return 0; return 0;
} }
static int __devexit snd_mpu401_remove(struct platform_device *devptr) static int snd_mpu401_remove(struct platform_device *devptr)
{ {
snd_card_free(platform_get_drvdata(devptr)); snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL); platform_set_drvdata(devptr, NULL);
@ -137,7 +137,7 @@ static int __devexit snd_mpu401_remove(struct platform_device *devptr)
static struct platform_driver snd_mpu401_driver = { static struct platform_driver snd_mpu401_driver = {
.probe = snd_mpu401_probe, .probe = snd_mpu401_probe,
.remove = __devexit_p(snd_mpu401_remove), .remove = snd_mpu401_remove,
.driver = { .driver = {
.name = SND_MPU401_DRIVER, .name = SND_MPU401_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,
@ -156,8 +156,8 @@ static struct pnp_device_id snd_mpu401_pnpids[] = {
MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids); MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids);
static int __devinit snd_mpu401_pnp(int dev, struct pnp_dev *device, static int snd_mpu401_pnp(int dev, struct pnp_dev *device,
const struct pnp_device_id *id) const struct pnp_device_id *id)
{ {
if (!pnp_port_valid(device, 0) || if (!pnp_port_valid(device, 0) ||
pnp_port_flags(device, 0) & IORESOURCE_DISABLED) { pnp_port_flags(device, 0) & IORESOURCE_DISABLED) {
@ -182,8 +182,8 @@ static int __devinit snd_mpu401_pnp(int dev, struct pnp_dev *device,
return 0; return 0;
} }
static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev, static int snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
const struct pnp_device_id *id) const struct pnp_device_id *id)
{ {
static int dev; static int dev;
struct snd_card *card; struct snd_card *card;
@ -211,7 +211,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
return -ENODEV; return -ENODEV;
} }
static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev) static void snd_mpu401_pnp_remove(struct pnp_dev *dev)
{ {
struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev); struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev);
@ -223,7 +223,7 @@ static struct pnp_driver snd_mpu401_pnp_driver = {
.name = "mpu401", .name = "mpu401",
.id_table = snd_mpu401_pnpids, .id_table = snd_mpu401_pnpids,
.probe = snd_mpu401_pnp_probe, .probe = snd_mpu401_pnp_probe,
.remove = __devexit_p(snd_mpu401_pnp_remove), .remove = snd_mpu401_pnp_remove,
}; };
#else #else
static struct pnp_driver snd_mpu401_pnp_driver; static struct pnp_driver snd_mpu401_pnp_driver;

View File

@ -583,7 +583,7 @@ static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id)
/* /*
* get ISA resources * get ISA resources
*/ */
static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard) static int snd_mtpav_get_ISA(struct mtpav *mcard)
{ {
if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port); snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port);
@ -619,8 +619,8 @@ static struct snd_rawmidi_ops snd_mtpav_input = {
* get RAWMIDI resources * get RAWMIDI resources
*/ */
static void __devinit snd_mtpav_set_name(struct mtpav *chip, static void snd_mtpav_set_name(struct mtpav *chip,
struct snd_rawmidi_substream *substream) struct snd_rawmidi_substream *substream)
{ {
if (substream->number >= 0 && substream->number < chip->num_ports) if (substream->number >= 0 && substream->number < chip->num_ports)
sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1); sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1);
@ -634,7 +634,7 @@ static void __devinit snd_mtpav_set_name(struct mtpav *chip,
strcpy(substream->name, "MTP broadcast"); strcpy(substream->name, "MTP broadcast");
} }
static int __devinit snd_mtpav_get_RAWMIDI(struct mtpav *mcard) static int snd_mtpav_get_RAWMIDI(struct mtpav *mcard)
{ {
int rval; int rval;
struct snd_rawmidi *rawmidi; struct snd_rawmidi *rawmidi;
@ -691,7 +691,7 @@ static void snd_mtpav_free(struct snd_card *card)
/* /*
*/ */
static int __devinit snd_mtpav_probe(struct platform_device *dev) static int snd_mtpav_probe(struct platform_device *dev)
{ {
struct snd_card *card; struct snd_card *card;
int err; int err;
@ -746,7 +746,7 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
return err; return err;
} }
static int __devexit snd_mtpav_remove(struct platform_device *devptr) static int snd_mtpav_remove(struct platform_device *devptr)
{ {
snd_card_free(platform_get_drvdata(devptr)); snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL); platform_set_drvdata(devptr, NULL);
@ -757,7 +757,7 @@ static int __devexit snd_mtpav_remove(struct platform_device *devptr)
static struct platform_driver snd_mtpav_driver = { static struct platform_driver snd_mtpav_driver = {
.probe = snd_mtpav_probe, .probe = snd_mtpav_probe,
.remove = __devexit_p(snd_mtpav_remove), .remove = snd_mtpav_remove,
.driver = { .driver = {
.name = SND_MTPAV_DRIVER, .name = SND_MTPAV_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -83,9 +83,9 @@ static int snd_mts64_free(struct mts64 *mts)
return 0; return 0;
} }
static int __devinit snd_mts64_create(struct snd_card *card, static int snd_mts64_create(struct snd_card *card,
struct pardevice *pardev, struct pardevice *pardev,
struct mts64 **rchip) struct mts64 **rchip)
{ {
struct mts64 *mts; struct mts64 *mts;
@ -214,7 +214,7 @@ static int mts64_device_ready(struct parport *p)
* 0 init ok * 0 init ok
* -EIO failure * -EIO failure
*/ */
static int __devinit mts64_device_init(struct parport *p) static int mts64_device_init(struct parport *p)
{ {
int i; int i;
@ -290,7 +290,7 @@ static u8 mts64_map_midi_input(u8 c)
* 0 device found * 0 device found
* -ENODEV no device * -ENODEV no device
*/ */
static int __devinit mts64_probe(struct parport *p) static int mts64_probe(struct parport *p)
{ {
u8 c; u8 c;
@ -483,7 +483,7 @@ __out:
return changed; return changed;
} }
static struct snd_kcontrol_new mts64_ctl_smpte_switch __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_switch = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Playback Switch", .name = "SMPTE Playback Switch",
.index = 0, .index = 0,
@ -556,7 +556,7 @@ static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl,
return changed; return changed;
} }
static struct snd_kcontrol_new mts64_ctl_smpte_time_hours __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_time_hours = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Time Hours", .name = "SMPTE Time Hours",
.index = 0, .index = 0,
@ -567,7 +567,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_hours __devinitdata = {
.put = snd_mts64_ctl_smpte_time_put .put = snd_mts64_ctl_smpte_time_put
}; };
static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Time Minutes", .name = "SMPTE Time Minutes",
.index = 0, .index = 0,
@ -578,7 +578,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes __devinitdata = {
.put = snd_mts64_ctl_smpte_time_put .put = snd_mts64_ctl_smpte_time_put
}; };
static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Time Seconds", .name = "SMPTE Time Seconds",
.index = 0, .index = 0,
@ -589,7 +589,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds __devinitdata = {
.put = snd_mts64_ctl_smpte_time_put .put = snd_mts64_ctl_smpte_time_put
}; };
static struct snd_kcontrol_new mts64_ctl_smpte_time_frames __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_time_frames = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Time Frames", .name = "SMPTE Time Frames",
.index = 0, .index = 0,
@ -651,7 +651,7 @@ static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl,
return changed; return changed;
} }
static struct snd_kcontrol_new mts64_ctl_smpte_fps __devinitdata = { static struct snd_kcontrol_new mts64_ctl_smpte_fps = {
.iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
.name = "SMPTE Fps", .name = "SMPTE Fps",
.index = 0, .index = 0,
@ -663,11 +663,11 @@ static struct snd_kcontrol_new mts64_ctl_smpte_fps __devinitdata = {
}; };
static int __devinit snd_mts64_ctl_create(struct snd_card *card, static int snd_mts64_ctl_create(struct snd_card *card,
struct mts64 *mts) struct mts64 *mts)
{ {
int err, i; int err, i;
static struct snd_kcontrol_new *control[] __devinitdata = { static struct snd_kcontrol_new *control[] = {
&mts64_ctl_smpte_switch, &mts64_ctl_smpte_switch,
&mts64_ctl_smpte_time_hours, &mts64_ctl_smpte_time_hours,
&mts64_ctl_smpte_time_minutes, &mts64_ctl_smpte_time_minutes,
@ -774,7 +774,7 @@ static struct snd_rawmidi_ops snd_mts64_rawmidi_input_ops = {
}; };
/* Create and initialize the rawmidi component */ /* Create and initialize the rawmidi component */
static int __devinit snd_mts64_rawmidi_create(struct snd_card *card) static int snd_mts64_rawmidi_create(struct snd_card *card)
{ {
struct mts64 *mts = card->private_data; struct mts64 *mts = card->private_data;
struct snd_rawmidi *rmidi; struct snd_rawmidi *rmidi;
@ -860,7 +860,7 @@ __out:
spin_unlock(&mts->lock); spin_unlock(&mts->lock);
} }
static int __devinit snd_mts64_probe_port(struct parport *p) static int snd_mts64_probe_port(struct parport *p)
{ {
struct pardevice *pardev; struct pardevice *pardev;
int res; int res;
@ -884,7 +884,7 @@ static int __devinit snd_mts64_probe_port(struct parport *p)
return res; return res;
} }
static void __devinit snd_mts64_attach(struct parport *p) static void snd_mts64_attach(struct parport *p)
{ {
struct platform_device *device; struct platform_device *device;
@ -940,7 +940,7 @@ static void snd_mts64_card_private_free(struct snd_card *card)
snd_mts64_free(mts); snd_mts64_free(mts);
} }
static int __devinit snd_mts64_probe(struct platform_device *pdev) static int snd_mts64_probe(struct platform_device *pdev)
{ {
struct pardevice *pardev; struct pardevice *pardev;
struct parport *p; struct parport *p;
@ -1025,7 +1025,7 @@ __err:
return err; return err;
} }
static int __devexit snd_mts64_remove(struct platform_device *pdev) static int snd_mts64_remove(struct platform_device *pdev)
{ {
struct snd_card *card = platform_get_drvdata(pdev); struct snd_card *card = platform_get_drvdata(pdev);
@ -1038,7 +1038,7 @@ static int __devexit snd_mts64_remove(struct platform_device *pdev)
static struct platform_driver snd_mts64_driver = { static struct platform_driver snd_mts64_driver = {
.probe = snd_mts64_probe, .probe = snd_mts64_probe,
.remove = __devexit_p(snd_mts64_remove), .remove = snd_mts64_remove,
.driver = { .driver = {
.name = PLATFORM_DRIVER, .name = PLATFORM_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@ -39,7 +39,7 @@ MODULE_PARM_DESC(nopcm, "Disable PC-Speaker PCM sound. Only beeps remain.");
struct snd_pcsp pcsp_chip; struct snd_pcsp pcsp_chip;
static int __devinit snd_pcsp_create(struct snd_card *card) static int snd_pcsp_create(struct snd_card *card)
{ {
static struct snd_device_ops ops = { }; static struct snd_device_ops ops = { };
struct timespec tp; struct timespec tp;
@ -93,7 +93,7 @@ static int __devinit snd_pcsp_create(struct snd_card *card)
return 0; return 0;
} }
static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev) static int snd_card_pcsp_probe(int devnum, struct device *dev)
{ {
struct snd_card *card; struct snd_card *card;
int err; int err;
@ -142,7 +142,7 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
return 0; return 0;
} }
static int __devinit alsa_card_pcsp_init(struct device *dev) static int alsa_card_pcsp_init(struct device *dev)
{ {
int err; int err;
@ -161,12 +161,12 @@ static int __devinit alsa_card_pcsp_init(struct device *dev)
return 0; return 0;
} }
static void __devexit alsa_card_pcsp_exit(struct snd_pcsp *chip) static void alsa_card_pcsp_exit(struct snd_pcsp *chip)
{ {
snd_card_free(chip->card); snd_card_free(chip->card);
} }
static int __devinit pcsp_probe(struct platform_device *dev) static int pcsp_probe(struct platform_device *dev)
{ {
int err; int err;
@ -184,7 +184,7 @@ static int __devinit pcsp_probe(struct platform_device *dev)
return 0; return 0;
} }
static int __devexit pcsp_remove(struct platform_device *dev) static int pcsp_remove(struct platform_device *dev)
{ {
struct snd_pcsp *chip = platform_get_drvdata(dev); struct snd_pcsp *chip = platform_get_drvdata(dev);
alsa_card_pcsp_exit(chip); alsa_card_pcsp_exit(chip);
@ -227,7 +227,7 @@ static struct platform_driver pcsp_platform_driver = {
.pm = PCSP_PM_OPS, .pm = PCSP_PM_OPS,
}, },
.probe = pcsp_probe, .probe = pcsp_probe,
.remove = __devexit_p(pcsp_remove), .remove = pcsp_remove,
.shutdown = pcsp_shutdown, .shutdown = pcsp_shutdown,
}; };

View File

@ -77,7 +77,7 @@ static int pcspkr_input_event(struct input_dev *dev, unsigned int type,
return 0; return 0;
} }
int __devinit pcspkr_input_init(struct input_dev **rdev, struct device *dev) int pcspkr_input_init(struct input_dev **rdev, struct device *dev)
{ {
int err; int err;

View File

@ -7,7 +7,7 @@
#ifndef __PCSP_INPUT_H__ #ifndef __PCSP_INPUT_H__
#define __PCSP_INPUT_H__ #define __PCSP_INPUT_H__
int __devinit pcspkr_input_init(struct input_dev **rdev, struct device *dev); int pcspkr_input_init(struct input_dev **rdev, struct device *dev);
int pcspkr_input_remove(struct input_dev *dev); int pcspkr_input_remove(struct input_dev *dev);
void pcspkr_stop_sound(void); void pcspkr_stop_sound(void);

View File

@ -334,7 +334,7 @@ static struct snd_pcm_ops snd_pcsp_playback_ops = {
.pointer = snd_pcsp_playback_pointer, .pointer = snd_pcsp_playback_pointer,
}; };
int __devinit snd_pcsp_new_pcm(struct snd_pcsp *chip) int snd_pcsp_new_pcm(struct snd_pcsp *chip)
{ {
int err; int err;

View File

@ -119,17 +119,17 @@ static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol,
.put = pcsp_##ctl_type##_put, \ .put = pcsp_##ctl_type##_put, \
} }
static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_pcm[] = { static struct snd_kcontrol_new snd_pcsp_controls_pcm[] = {
PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), PCSP_MIXER_CONTROL(enable, "Master Playback Switch"),
PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"),
}; };
static struct snd_kcontrol_new __devinitdata snd_pcsp_controls_spkr[] = { static struct snd_kcontrol_new snd_pcsp_controls_spkr[] = {
PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"), PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"),
}; };
static int __devinit snd_pcsp_ctls_add(struct snd_pcsp *chip, static int snd_pcsp_ctls_add(struct snd_pcsp *chip,
struct snd_kcontrol_new *ctls, int num) struct snd_kcontrol_new *ctls, int num)
{ {
int i, err; int i, err;
struct snd_card *card = chip->card; struct snd_card *card = chip->card;
@ -141,7 +141,7 @@ static int __devinit snd_pcsp_ctls_add(struct snd_pcsp *chip,
return 0; return 0;
} }
int __devinit snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm) int snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm)
{ {
int err; int err;
struct snd_card *card = chip->card; struct snd_card *card = chip->card;

View File

@ -96,9 +96,9 @@ static int portman_free(struct portman *pm)
return 0; return 0;
} }
static int __devinit portman_create(struct snd_card *card, static int portman_create(struct snd_card *card,
struct pardevice *pardev, struct pardevice *pardev,
struct portman **rchip) struct portman **rchip)
{ {
struct portman *pm; struct portman *pm;
@ -561,7 +561,7 @@ static struct snd_rawmidi_ops snd_portman_midi_input = {
}; };
/* Create and initialize the rawmidi component */ /* Create and initialize the rawmidi component */
static int __devinit snd_portman_rawmidi_create(struct snd_card *card) static int snd_portman_rawmidi_create(struct snd_card *card)
{ {
struct portman *pm = card->private_data; struct portman *pm = card->private_data;
struct snd_rawmidi *rmidi; struct snd_rawmidi *rmidi;
@ -648,7 +648,7 @@ static void snd_portman_interrupt(void *userdata)
spin_unlock(&pm->reg_lock); spin_unlock(&pm->reg_lock);
} }
static int __devinit snd_portman_probe_port(struct parport *p) static int snd_portman_probe_port(struct parport *p)
{ {
struct pardevice *pardev; struct pardevice *pardev;
int res; int res;
@ -672,7 +672,7 @@ static int __devinit snd_portman_probe_port(struct parport *p)
return res ? -EIO : 0; return res ? -EIO : 0;
} }
static void __devinit snd_portman_attach(struct parport *p) static void snd_portman_attach(struct parport *p)
{ {
struct platform_device *device; struct platform_device *device;
@ -728,7 +728,7 @@ static void snd_portman_card_private_free(struct snd_card *card)
portman_free(pm); portman_free(pm);
} }
static int __devinit snd_portman_probe(struct platform_device *pdev) static int snd_portman_probe(struct platform_device *pdev)
{ {
struct pardevice *pardev; struct pardevice *pardev;
struct parport *p; struct parport *p;
@ -814,7 +814,7 @@ __err:
return err; return err;
} }
static int __devexit snd_portman_remove(struct platform_device *pdev) static int snd_portman_remove(struct platform_device *pdev)
{ {
struct snd_card *card = platform_get_drvdata(pdev); struct snd_card *card = platform_get_drvdata(pdev);
@ -827,7 +827,7 @@ static int __devexit snd_portman_remove(struct platform_device *pdev)
static struct platform_driver snd_portman_driver = { static struct platform_driver snd_portman_driver = {
.probe = snd_portman_probe, .probe = snd_portman_probe,
.remove = __devexit_p(snd_portman_remove), .remove = snd_portman_remove,
.driver = { .driver = {
.name = PLATFORM_DRIVER, .name = PLATFORM_DRIVER,
.owner = THIS_MODULE, .owner = THIS_MODULE,

Some files were not shown because too many files have changed in this diff Show More