mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits) ASoC: twl6040 - Add method to query optimum PDM_DL1 gain ALSA: hda - Fix the lost power-setup of seconary pins after PM resume ALSA: usb-audio: add Yamaha MOX6/MOX8 support ALSA: virtuoso: add S/PDIF input support for all Xonars ALSA: ice1724 - Support for ooAoo SQ210a ALSA: ice1724 - Allow card info based on model only ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations ALSA: hdspm - Provide unique driver id based on card serial ASoC: Dynamically allocate the rtd device for a non-empty release() ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs ALSA: hda - Use auto-parser for HP laptops with cx20459 codec ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info() ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref() ALSA: hda/cirrus - support for iMac12,2 model ASoC: cx20442: add bias control over a platform provided regulator ALSA: usb-audio - Avoid flood of frame-active debug messages ALSA: snd-usb-us122l: Delete calls to preempt_disable mfd: Put WM8994 into cache only mode when suspending ... Fix up trivial conflicts in: - arch/arm/mach-s3c64xx/mach-crag6410.c: renamed speyside_wm8962 to tobermory, added littlemill right next to it - drivers/base/regmap/{regcache.c,regmap.c}: duplicate diff that had already come in with other changes in the regmap tree
This commit is contained in:
commit
a429638cac
|
@ -404,7 +404,7 @@
|
|||
/* SNDRV_CARDS: maximum number of cards supported by this module */
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
|
||||
/* definition of the chip-specific record */
|
||||
struct mychip {
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
NVIDIA Tegra audio complex
|
||||
|
||||
Required properties:
|
||||
- compatible : "nvidia,tegra-audio-wm8903"
|
||||
- nvidia,model : The user-visible name of this sound complex.
|
||||
- nvidia,audio-routing : A list of the connections between audio components.
|
||||
Each entry is a pair of strings, the first being the connection's sink,
|
||||
the second being the connection's source. Valid names for sources and
|
||||
sinks are the WM8903's pins, and the jacks on the board:
|
||||
|
||||
WM8903 pins:
|
||||
|
||||
* IN1L
|
||||
* IN1R
|
||||
* IN2L
|
||||
* IN2R
|
||||
* IN3L
|
||||
* IN3R
|
||||
* DMICDAT
|
||||
* HPOUTL
|
||||
* HPOUTR
|
||||
* LINEOUTL
|
||||
* LINEOUTR
|
||||
* LOP
|
||||
* LON
|
||||
* ROP
|
||||
* RON
|
||||
* MICBIAS
|
||||
|
||||
Board connectors:
|
||||
|
||||
* Headphone Jack
|
||||
* Int Spk
|
||||
* Mic Jack
|
||||
|
||||
- nvidia,i2s-controller : The phandle of the Tegra I2S1 controller
|
||||
- nvidia,audio-codec : The phandle of the WM8903 audio codec
|
||||
|
||||
Optional properties:
|
||||
- nvidia,spkr-en-gpios : The GPIO that enables the speakers
|
||||
- nvidia,hp-mute-gpios : The GPIO that mutes the headphones
|
||||
- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
|
||||
- nvidia,int-mic-en-gpios : The GPIO that enables the internal microphone
|
||||
- nvidia,ext-mic-en-gpios : The GPIO that enables the external microphone
|
||||
|
||||
Example:
|
||||
|
||||
sound {
|
||||
compatible = "nvidia,tegra-audio-wm8903-harmony",
|
||||
"nvidia,tegra-audio-wm8903"
|
||||
nvidia,model = "tegra-wm8903-harmony";
|
||||
|
||||
nvidia,audio-routing =
|
||||
"Headphone Jack", "HPOUTR",
|
||||
"Headphone Jack", "HPOUTL",
|
||||
"Int Spk", "ROP",
|
||||
"Int Spk", "RON",
|
||||
"Int Spk", "LOP",
|
||||
"Int Spk", "LON",
|
||||
"Mic Jack", "MICBIAS",
|
||||
"IN1L", "Mic Jack";
|
||||
|
||||
nvidia,i2s-controller = <&i2s1>;
|
||||
nvidia,audio-codec = <&wm8903>;
|
||||
|
||||
nvidia,spkr-en-gpios = <&codec 2 0>;
|
||||
nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
|
||||
nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */
|
||||
nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */
|
||||
};
|
||||
|
12
Documentation/devicetree/bindings/sound/tegra20-das.txt
Normal file
12
Documentation/devicetree/bindings/sound/tegra20-das.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
NVIDIA Tegra 20 DAS (Digital Audio Switch) controller
|
||||
|
||||
Required properties:
|
||||
- compatible : "nvidia,tegra20-das"
|
||||
- reg : Should contain DAS registers location and length
|
||||
|
||||
Example:
|
||||
|
||||
das@70000c00 {
|
||||
compatible = "nvidia,tegra20-das";
|
||||
reg = <0x70000c00 0x80>;
|
||||
};
|
17
Documentation/devicetree/bindings/sound/tegra20-i2s.txt
Normal file
17
Documentation/devicetree/bindings/sound/tegra20-i2s.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
NVIDIA Tegra 20 I2S controller
|
||||
|
||||
Required properties:
|
||||
- compatible : "nvidia,tegra20-i2s"
|
||||
- reg : Should contain I2S registers location and length
|
||||
- interrupts : Should contain I2S interrupt
|
||||
- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
|
||||
request selector for this I2S controller
|
||||
|
||||
Example:
|
||||
|
||||
i2s@70002800 {
|
||||
compatible = "nvidia,tegra20-i2s";
|
||||
reg = <0x70002800 0x200>;
|
||||
interrupts = < 45 >;
|
||||
nvidia,dma-request-selector = < &apbdma 2 >;
|
||||
};
|
50
Documentation/devicetree/bindings/sound/wm8903.txt
Normal file
50
Documentation/devicetree/bindings/sound/wm8903.txt
Normal file
|
@ -0,0 +1,50 @@
|
|||
WM8903 audio CODEC
|
||||
|
||||
This device supports I2C only.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "wlf,wm8903"
|
||||
|
||||
- reg : the I2C address of the device.
|
||||
|
||||
- gpio-controller : Indicates this device is a GPIO controller.
|
||||
|
||||
- #gpio-cells : Should be two. The first cell is the pin number and the
|
||||
second cell is used to specify optional parameters (currently unused).
|
||||
|
||||
Optional properties:
|
||||
|
||||
- interrupts : The interrupt line the codec is connected to.
|
||||
|
||||
- micdet-cfg : Default register value for R6 (Mic Bias). If absent, the
|
||||
default is 0.
|
||||
|
||||
- micdet-delay : The debounce delay for microphone detection in mS. If
|
||||
absent, the default is 100.
|
||||
|
||||
- gpio-cfg : A list of GPIO configuration register values. The list must
|
||||
be 5 entries long. If absent, no configuration of these registers is
|
||||
performed. If any entry has the value 0xffffffff, that GPIO's
|
||||
configuration will not be modified.
|
||||
|
||||
Example:
|
||||
|
||||
codec: wm8903@1a {
|
||||
compatible = "wlf,wm8903";
|
||||
reg = <0x1a>;
|
||||
interrupts = < 347 >;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
micdet-cfg = <0>;
|
||||
micdet-delay = <100>;
|
||||
gpio-cfg = <
|
||||
0x0600 /* DMIC_LR, output */
|
||||
0x0680 /* DMIC_DAT, input */
|
||||
0x0000 /* GPIO, output, low */
|
||||
0x0200 /* Interrupt, output */
|
||||
0x01a0 /* BCLK, input, active high */
|
||||
>;
|
||||
};
|
18
Documentation/devicetree/bindings/sound/wm8994.txt
Normal file
18
Documentation/devicetree/bindings/sound/wm8994.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
WM1811/WM8994/WM8958 audio CODEC
|
||||
|
||||
These devices support both I2C and SPI (configured with pin strapping
|
||||
on the board).
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "wlf,wm1811", "wlf,wm8994", "wlf,wm8958"
|
||||
|
||||
- reg : the I2C address of the device for I2C, the chip select
|
||||
number for SPI.
|
||||
|
||||
Example:
|
||||
|
||||
codec: wm8994@1a {
|
||||
compatible = "wlf,wm8994";
|
||||
reg = <0x1a>;
|
||||
};
|
|
@ -42,4 +42,5 @@ sirf SiRF Technology, Inc.
|
|||
st STMicroelectronics
|
||||
stericsson ST-Ericsson
|
||||
ti Texas Instruments
|
||||
wlf Wolfson Microelectronics
|
||||
xlnx Xilinx
|
||||
|
|
|
@ -42,19 +42,7 @@ ALC260
|
|||
|
||||
ALC262
|
||||
======
|
||||
fujitsu Fujitsu Laptop
|
||||
benq Benq ED8
|
||||
benq-t31 Benq T31
|
||||
hippo Hippo (ATI) with jack detection, Sony UX-90s
|
||||
hippo_1 Hippo (Benq) with jack detection
|
||||
toshiba-s06 Toshiba S06
|
||||
toshiba-rx1 Toshiba RX1
|
||||
tyan Tyan Thunder n6650W (S2915-E)
|
||||
ultra Samsung Q1 Ultra Vista model
|
||||
lenovo-3000 Lenovo 3000 y410
|
||||
nec NEC Versa S9100
|
||||
basic fixed pin assignment w/o SPDIF
|
||||
auto auto-config reading BIOS (default)
|
||||
N/A
|
||||
|
||||
ALC267/268
|
||||
==========
|
||||
|
@ -350,7 +338,6 @@ STAC92HD83*
|
|||
mic-ref Reference board with power management for ports
|
||||
dell-s14 Dell laptop
|
||||
dell-vostro-3500 Dell Vostro 3500 laptop
|
||||
hp HP laptops with (inverted) mute-LED
|
||||
hp-dv7-4000 HP dv-7 4000
|
||||
auto BIOS setup (default)
|
||||
|
||||
|
|
188
Documentation/sound/alsa/compress_offload.txt
Normal file
188
Documentation/sound/alsa/compress_offload.txt
Normal file
|
@ -0,0 +1,188 @@
|
|||
compress_offload.txt
|
||||
=====================
|
||||
Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
Vinod Koul <vinod.koul@linux.intel.com>
|
||||
|
||||
Overview
|
||||
|
||||
Since its early days, the ALSA API was defined with PCM support or
|
||||
constant bitrates payloads such as IEC61937 in mind. Arguments and
|
||||
returned values in frames are the norm, making it a challenge to
|
||||
extend the existing API to compressed data streams.
|
||||
|
||||
In recent years, audio digital signal processors (DSP) were integrated
|
||||
in system-on-chip designs, and DSPs are also integrated in audio
|
||||
codecs. Processing compressed data on such DSPs results in a dramatic
|
||||
reduction of power consumption compared to host-based
|
||||
processing. Support for such hardware has not been very good in Linux,
|
||||
mostly because of a lack of a generic API available in the mainline
|
||||
kernel.
|
||||
|
||||
Rather than requiring a compability break with an API change of the
|
||||
ALSA PCM interface, a new 'Compressed Data' API is introduced to
|
||||
provide a control and data-streaming interface for audio DSPs.
|
||||
|
||||
The design of this API was inspired by the 2-year experience with the
|
||||
Intel Moorestown SOC, with many corrections required to upstream the
|
||||
API in the mainline kernel instead of the staging tree and make it
|
||||
usable by others.
|
||||
|
||||
Requirements
|
||||
|
||||
The main requirements are:
|
||||
|
||||
- separation between byte counts and time. Compressed formats may have
|
||||
a header per file, per frame, or no header at all. The payload size
|
||||
may vary from frame-to-frame. As a result, it is not possible to
|
||||
estimate reliably the duration of audio buffers when handling
|
||||
compressed data. Dedicated mechanisms are required to allow for
|
||||
reliable audio-video synchronization, which requires precise
|
||||
reporting of the number of samples rendered at any given time.
|
||||
|
||||
- Handling of multiple formats. PCM data only requires a specification
|
||||
of the sampling rate, number of channels and bits per sample. In
|
||||
contrast, compressed data comes in a variety of formats. Audio DSPs
|
||||
may also provide support for a limited number of audio encoders and
|
||||
decoders embedded in firmware, or may support more choices through
|
||||
dynamic download of libraries.
|
||||
|
||||
- Focus on main formats. This API provides support for the most
|
||||
popular formats used for audio and video capture and playback. It is
|
||||
likely that as audio compression technology advances, new formats
|
||||
will be added.
|
||||
|
||||
- Handling of multiple configurations. Even for a given format like
|
||||
AAC, some implementations may support AAC multichannel but HE-AAC
|
||||
stereo. Likewise WMA10 level M3 may require too much memory and cpu
|
||||
cycles. The new API needs to provide a generic way of listing these
|
||||
formats.
|
||||
|
||||
- Rendering/Grabbing only. This API does not provide any means of
|
||||
hardware acceleration, where PCM samples are provided back to
|
||||
user-space for additional processing. This API focuses instead on
|
||||
streaming compressed data to a DSP, with the assumption that the
|
||||
decoded samples are routed to a physical output or logical back-end.
|
||||
|
||||
- Complexity hiding. Existing user-space multimedia frameworks all
|
||||
have existing enums/structures for each compressed format. This new
|
||||
API assumes the existence of a platform-specific compatibility layer
|
||||
to expose, translate and make use of the capabilities of the audio
|
||||
DSP, eg. Android HAL or PulseAudio sinks. By construction, regular
|
||||
applications are not supposed to make use of this API.
|
||||
|
||||
|
||||
Design
|
||||
|
||||
The new API shares a number of concepts with with the PCM API for flow
|
||||
control. Start, pause, resume, drain and stop commands have the same
|
||||
semantics no matter what the content is.
|
||||
|
||||
The concept of memory ring buffer divided in a set of fragments is
|
||||
borrowed from the ALSA PCM API. However, only sizes in bytes can be
|
||||
specified.
|
||||
|
||||
Seeks/trick modes are assumed to be handled by the host.
|
||||
|
||||
The notion of rewinds/forwards is not supported. Data committed to the
|
||||
ring buffer cannot be invalidated, except when dropping all buffers.
|
||||
|
||||
The Compressed Data API does not make any assumptions on how the data
|
||||
is transmitted to the audio DSP. DMA transfers from main memory to an
|
||||
embedded audio cluster or to a SPI interface for external DSPs are
|
||||
possible. As in the ALSA PCM case, a core set of routines is exposed;
|
||||
each driver implementer will have to write support for a set of
|
||||
mandatory routines and possibly make use of optional ones.
|
||||
|
||||
The main additions are
|
||||
|
||||
- get_caps
|
||||
This routine returns the list of audio formats supported. Querying the
|
||||
codecs on a capture stream will return encoders, decoders will be
|
||||
listed for playback streams.
|
||||
|
||||
- get_codec_caps For each codec, this routine returns a list of
|
||||
capabilities. The intent is to make sure all the capabilities
|
||||
correspond to valid settings, and to minimize the risks of
|
||||
configuration failures. For example, for a complex codec such as AAC,
|
||||
the number of channels supported may depend on a specific profile. If
|
||||
the capabilities were exposed with a single descriptor, it may happen
|
||||
that a specific combination of profiles/channels/formats may not be
|
||||
supported. Likewise, embedded DSPs have limited memory and cpu cycles,
|
||||
it is likely that some implementations make the list of capabilities
|
||||
dynamic and dependent on existing workloads. In addition to codec
|
||||
settings, this routine returns the minimum buffer size handled by the
|
||||
implementation. This information can be a function of the DMA buffer
|
||||
sizes, the number of bytes required to synchronize, etc, and can be
|
||||
used by userspace to define how much needs to be written in the ring
|
||||
buffer before playback can start.
|
||||
|
||||
- set_params
|
||||
This routine sets the configuration chosen for a specific codec. The
|
||||
most important field in the parameters is the codec type; in most
|
||||
cases decoders will ignore other fields, while encoders will strictly
|
||||
comply to the settings
|
||||
|
||||
- get_params
|
||||
This routines returns the actual settings used by the DSP. Changes to
|
||||
the settings should remain the exception.
|
||||
|
||||
- get_timestamp
|
||||
The timestamp becomes a multiple field structure. It lists the number
|
||||
of bytes transferred, the number of samples processed and the number
|
||||
of samples rendered/grabbed. All these values can be used to determine
|
||||
the avarage bitrate, figure out if the ring buffer needs to be
|
||||
refilled or the delay due to decoding/encoding/io on the DSP.
|
||||
|
||||
Note that the list of codecs/profiles/modes was derived from the
|
||||
OpenMAX AL specification instead of reinventing the wheel.
|
||||
Modifications include:
|
||||
- Addition of FLAC and IEC formats
|
||||
- Merge of encoder/decoder capabilities
|
||||
- Profiles/modes listed as bitmasks to make descriptors more compact
|
||||
- Addition of set_params for decoders (missing in OpenMAX AL)
|
||||
- Addition of AMR/AMR-WB encoding modes (missing in OpenMAX AL)
|
||||
- Addition of format information for WMA
|
||||
- Addition of encoding options when required (derived from OpenMAX IL)
|
||||
- Addition of rateControlSupported (missing in OpenMAX AL)
|
||||
|
||||
Not supported:
|
||||
|
||||
- Support for VoIP/circuit-switched calls is not the target of this
|
||||
API. Support for dynamic bit-rate changes would require a tight
|
||||
coupling between the DSP and the host stack, limiting power savings.
|
||||
|
||||
- Packet-loss concealment is not supported. This would require an
|
||||
additional interface to let the decoder synthesize data when frames
|
||||
are lost during transmission. This may be added in the future.
|
||||
|
||||
- Volume control/routing is not handled by this API. Devices exposing a
|
||||
compressed data interface will be considered as regular ALSA devices;
|
||||
volume changes and routing information will be provided with regular
|
||||
ALSA kcontrols.
|
||||
|
||||
- Embedded audio effects. Such effects should be enabled in the same
|
||||
manner, no matter if the input was PCM or compressed.
|
||||
|
||||
- multichannel IEC encoding. Unclear if this is required.
|
||||
|
||||
- Encoding/decoding acceleration is not supported as mentioned
|
||||
above. It is possible to route the output of a decoder to a capture
|
||||
stream, or even implement transcoding capabilities. This routing
|
||||
would be enabled with ALSA kcontrols.
|
||||
|
||||
- Audio policy/resource management. This API does not provide any
|
||||
hooks to query the utilization of the audio DSP, nor any premption
|
||||
mechanisms.
|
||||
|
||||
- No notion of underun/overrun. Since the bytes written are compressed
|
||||
in nature and data written/read doesn't translate directly to
|
||||
rendered output in time, this does not deal with underrun/overun and
|
||||
maybe dealt in user-library
|
||||
|
||||
Credits:
|
||||
- Mark Brown and Liam Girdwood for discussions on the need for this API
|
||||
- Harsha Priya for her work on intel_sst compressed API
|
||||
- Rakesh Ughreja for valuable feedback
|
||||
- Sing Nallasellan, Sikkandar Madar and Prasanna Samaga for
|
||||
demonstrating and quantifying the benefits of audio offload on a
|
||||
real platform.
|
|
@ -537,6 +537,7 @@ F: sound/soc/codecs/adau*
|
|||
F: sound/soc/codecs/adav*
|
||||
F: sound/soc/codecs/ad1*
|
||||
F: sound/soc/codecs/ssm*
|
||||
F: sound/soc/codecs/sigmadsp.*
|
||||
|
||||
ANALOG DEVICES INC ASOC DRIVERS
|
||||
L: uclinux-dist-devel@blackfin.uclinux.org
|
||||
|
|
|
@ -156,6 +156,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
|
|||
else
|
||||
/* The FIFO has 128 locations */
|
||||
pdata->buffer_size = 0x80;
|
||||
} else if (oh->class->rev == MCBSP_CONFIG_TYPE4) {
|
||||
/* The FIFO has 128 locations for all instances */
|
||||
pdata->buffer_size = 0x80;
|
||||
}
|
||||
|
||||
if (oh->class->rev >= MCBSP_CONFIG_TYPE3)
|
||||
|
|
|
@ -435,6 +435,14 @@ static struct platform_device corgiled_device = {
|
|||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Corgi Audio
|
||||
*/
|
||||
static struct platform_device corgi_audio_device = {
|
||||
.name = "corgi-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/*
|
||||
* MMC/SD Device
|
||||
*
|
||||
|
@ -641,6 +649,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
&corgifb_device,
|
||||
&corgikbd_device,
|
||||
&corgiled_device,
|
||||
&corgi_audio_device,
|
||||
&sharpsl_nand_device,
|
||||
&sharpsl_rom_device,
|
||||
};
|
||||
|
|
|
@ -528,12 +528,18 @@ static struct platform_device e740_t7l66xb_device = {
|
|||
.resource = eseries_tmio_resources,
|
||||
};
|
||||
|
||||
static struct platform_device e740_audio_device = {
|
||||
.name = "e740-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
static struct platform_device *e740_devices[] __initdata = {
|
||||
&e740_fb_device,
|
||||
&e740_t7l66xb_device,
|
||||
&e7xx_gpio_vbus,
|
||||
&e740_audio_device,
|
||||
};
|
||||
|
||||
static void __init e740_init(void)
|
||||
|
@ -722,12 +728,18 @@ static struct platform_device e750_tc6393xb_device = {
|
|||
.resource = eseries_tmio_resources,
|
||||
};
|
||||
|
||||
static struct platform_device e750_audio_device = {
|
||||
.name = "e750-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
static struct platform_device *e750_devices[] __initdata = {
|
||||
&e750_fb_device,
|
||||
&e750_tc6393xb_device,
|
||||
&e7xx_gpio_vbus,
|
||||
&e750_audio_device,
|
||||
};
|
||||
|
||||
static void __init e750_init(void)
|
||||
|
@ -929,12 +941,18 @@ static struct platform_device e800_tc6393xb_device = {
|
|||
.resource = eseries_tmio_resources,
|
||||
};
|
||||
|
||||
static struct platform_device e800_audio_device = {
|
||||
.name = "e800-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
static struct platform_device *e800_devices[] __initdata = {
|
||||
&e800_fb_device,
|
||||
&e800_tc6393xb_device,
|
||||
&e800_gpio_vbus,
|
||||
&e800_audio_device,
|
||||
};
|
||||
|
||||
static void __init e800_init(void)
|
||||
|
|
|
@ -158,6 +158,11 @@ static struct scoop_pcmcia_config poodle_pcmcia_config = {
|
|||
EXPORT_SYMBOL(poodle_scoop_device);
|
||||
|
||||
|
||||
static struct platform_device poodle_audio_device = {
|
||||
.name = "poodle-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/* LoCoMo device */
|
||||
static struct resource locomo_resources[] = {
|
||||
[0] = {
|
||||
|
@ -407,6 +412,7 @@ static struct platform_device sharpsl_rom_device = {
|
|||
static struct platform_device *devices[] __initdata = {
|
||||
&poodle_locomo_device,
|
||||
&poodle_scoop_device,
|
||||
&poodle_audio_device,
|
||||
&sharpsl_nand_device,
|
||||
&sharpsl_rom_device,
|
||||
};
|
||||
|
|
|
@ -593,10 +593,16 @@ static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
|
|||
.udc_command = sg2_udc_command,
|
||||
};
|
||||
|
||||
static struct platform_device imote2_audio_device = {
|
||||
.name = "imote2-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
static struct platform_device *imote2_devices[] = {
|
||||
&stargate2_flash_device,
|
||||
&imote2_leds,
|
||||
&sht15,
|
||||
&imote2_audio_device,
|
||||
};
|
||||
|
||||
static void __init imote2_init(void)
|
||||
|
|
|
@ -889,6 +889,11 @@ static struct platform_device wm9712_device = {
|
|||
.id = -1,
|
||||
};
|
||||
|
||||
static struct platform_device tosa_audio_device = {
|
||||
.name = "tosa-audio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
&tosascoop_device,
|
||||
&tosascoop_jc_device,
|
||||
|
@ -901,6 +906,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
&sharpsl_rom_device,
|
||||
&wm9712_device,
|
||||
&tosa_gpio_vbus,
|
||||
&tosa_audio_device,
|
||||
};
|
||||
|
||||
static void tosa_poweroff(void)
|
||||
|
|
|
@ -286,8 +286,8 @@ static struct platform_device lowland_device = {
|
|||
.id = -1,
|
||||
};
|
||||
|
||||
static struct platform_device speyside_wm8962_device = {
|
||||
.name = "speyside-wm8962",
|
||||
static struct platform_device tobermory_device = {
|
||||
.name = "tobermory",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
|
@ -347,7 +347,7 @@ static struct platform_device *crag6410_devices[] __initdata = {
|
|||
&crag6410_lcd_powerdev,
|
||||
&crag6410_backlight_device,
|
||||
&speyside_device,
|
||||
&speyside_wm8962_device,
|
||||
&tobermory_device,
|
||||
&littlemill_device,
|
||||
&lowland_device,
|
||||
&wallvdd_device,
|
||||
|
|
|
@ -762,9 +762,22 @@ static struct platform_device fsi_device = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct platform_device fsi_ak4643_device = {
|
||||
.name = "sh_fsi2_a_ak4643",
|
||||
static struct fsi_ak4642_info fsi2_ak4643_info = {
|
||||
.name = "AK4643",
|
||||
.card = "FSI2A-AK4643",
|
||||
.cpu_dai = "fsia-dai",
|
||||
.codec = "ak4642-codec.0-0013",
|
||||
.platform = "sh_fsi2",
|
||||
.id = FSI_PORT_A,
|
||||
};
|
||||
|
||||
static struct platform_device fsi_ak4643_device = {
|
||||
.name = "fsi-ak4642-audio",
|
||||
.dev = {
|
||||
.platform_data = &fsi_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
|
||||
.icb[0] = {
|
||||
.marker_icb = 30,
|
||||
|
|
|
@ -990,8 +990,20 @@ static struct platform_device fsi_device = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct fsi_ak4642_info fsi2_ak4643_info = {
|
||||
.name = "AK4643",
|
||||
.card = "FSI2A-AK4643",
|
||||
.cpu_dai = "fsia-dai",
|
||||
.codec = "ak4642-codec.0-0013",
|
||||
.platform = "sh_fsi2",
|
||||
.id = FSI_PORT_A,
|
||||
};
|
||||
|
||||
static struct platform_device fsi_ak4643_device = {
|
||||
.name = "sh_fsi2_a_ak4643",
|
||||
.name = "fsi-ak4642-audio",
|
||||
.dev = {
|
||||
.platform_data = &fsi2_ak4643_info,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -90,11 +90,11 @@ static struct wm8903_platform_data harmony_wm8903_pdata = {
|
|||
.micdet_delay = 100,
|
||||
.gpio_base = HARMONY_GPIO_WM8903(0),
|
||||
.gpio_cfg = {
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
0,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
0,
|
||||
WM8903_GPIO_CONFIG_ZERO,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -172,11 +172,11 @@ static struct wm8903_platform_data wm8903_pdata = {
|
|||
.micdet_delay = 100,
|
||||
.gpio_base = SEABOARD_GPIO_WM8903(0),
|
||||
.gpio_cfg = {
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
0,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
WM8903_GPIO_NO_CONFIG,
|
||||
0,
|
||||
WM8903_GPIO_CONFIG_ZERO,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -303,8 +303,20 @@ static struct platform_device fsi_device = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct fsi_ak4642_info fsi_ak4642_info = {
|
||||
.name = "AK4642",
|
||||
.card = "FSIA-AK4642",
|
||||
.cpu_dai = "fsia-dai",
|
||||
.codec = "ak4642-codec.0-0012",
|
||||
.platform = "sh_fsi.0",
|
||||
.id = FSI_PORT_A,
|
||||
};
|
||||
|
||||
static struct platform_device fsi_ak4642_device = {
|
||||
.name = "sh_fsi_a_ak4642",
|
||||
.name = "fsi-ak4642-audio",
|
||||
.dev = {
|
||||
.platform_data = &fsi_ak4642_info,
|
||||
},
|
||||
};
|
||||
|
||||
/* KEYSC in SoC (Needs SW33-2 set to ON) */
|
||||
|
|
|
@ -145,18 +145,6 @@ config ISCSI_IBFT
|
|||
detect iSCSI boot parameters dynamically during system boot, say Y.
|
||||
Otherwise, say N.
|
||||
|
||||
config SIGMA
|
||||
tristate "SigmaStudio firmware loader"
|
||||
depends on I2C
|
||||
select CRC32
|
||||
default n
|
||||
help
|
||||
Enable helper functions for working with Analog Devices SigmaDSP
|
||||
parts and binary firmwares produced by Analog Devices SigmaStudio.
|
||||
|
||||
If unsure, say N here. Drivers that need these helpers will select
|
||||
this option automatically.
|
||||
|
||||
source "drivers/firmware/google/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -12,6 +12,5 @@ obj-$(CONFIG_DMIID) += dmi-id.o
|
|||
obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
|
||||
obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
|
||||
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
|
||||
obj-$(CONFIG_SIGMA) += sigma.o
|
||||
|
||||
obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
|
||||
|
|
|
@ -505,6 +505,7 @@ config MFD_WM8994
|
|||
bool "Support Wolfson Microelectronics WM8994"
|
||||
select MFD_CORE
|
||||
select REGMAP_I2C
|
||||
select REGMAP_IRQ
|
||||
depends on I2C=y && GENERIC_HARDIRQS
|
||||
help
|
||||
The WM8994 is a highly integrated hi-fi CODEC designed for
|
||||
|
|
|
@ -31,7 +31,7 @@ wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o
|
|||
wm8350-objs += wm8350-irq.o
|
||||
obj-$(CONFIG_MFD_WM8350) += wm8350.o
|
||||
obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o
|
||||
obj-$(CONFIG_MFD_WM8994) += wm8994-core.o wm8994-irq.o
|
||||
obj-$(CONFIG_MFD_WM8994) += wm8994-core.o wm8994-irq.o wm8994-regmap.o
|
||||
|
||||
obj-$(CONFIG_TPS6105X) += tps6105x.o
|
||||
obj-$(CONFIG_TPS65010) += tps65010.o
|
||||
|
|
|
@ -28,11 +28,7 @@
|
|||
#include <linux/mfd/wm8994/pdata.h>
|
||||
#include <linux/mfd/wm8994/registers.h>
|
||||
|
||||
static int wm8994_read(struct wm8994 *wm8994, unsigned short reg,
|
||||
int bytes, void *dest)
|
||||
{
|
||||
return regmap_raw_read(wm8994->regmap, reg, dest, bytes);
|
||||
}
|
||||
#include "wm8994.h"
|
||||
|
||||
/**
|
||||
* wm8994_reg_read: Read a single WM8994 register.
|
||||
|
@ -68,12 +64,6 @@ int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
|
|||
return regmap_bulk_read(wm8994->regmap, reg, buf, count);
|
||||
}
|
||||
|
||||
static int wm8994_write(struct wm8994 *wm8994, unsigned short reg,
|
||||
int bytes, const void *src)
|
||||
{
|
||||
return regmap_raw_write(wm8994->regmap, reg, src, bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* wm8994_reg_write: Write a single WM8994 register.
|
||||
*
|
||||
|
@ -252,6 +242,20 @@ static int wm8994_suspend(struct device *dev)
|
|||
break;
|
||||
}
|
||||
|
||||
switch (wm8994->type) {
|
||||
case WM1811:
|
||||
ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to read jackdet: %d\n", ret);
|
||||
} else if (ret & WM1811_JACKDET_MODE_MASK) {
|
||||
dev_dbg(dev, "CODEC still active, ignoring suspend\n");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Disable LDO pulldowns while the device is suspended if we
|
||||
* don't know that something will be driving them. */
|
||||
if (!wm8994->ldo_ena_always_driven)
|
||||
|
@ -259,25 +263,14 @@ static int wm8994_suspend(struct device *dev)
|
|||
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
|
||||
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD);
|
||||
|
||||
/* GPIO configuration state is saved here since we may be configuring
|
||||
* the GPIO alternate functions even if we're not using the gpiolib
|
||||
* driver for them.
|
||||
*/
|
||||
ret = wm8994_read(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2,
|
||||
&wm8994->gpio_regs);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to save GPIO registers: %d\n", ret);
|
||||
|
||||
/* For similar reasons we also stash the regulator states */
|
||||
ret = wm8994_read(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
|
||||
&wm8994->ldo_regs);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to save LDO registers: %d\n", ret);
|
||||
|
||||
/* Explicitly put the device into reset in case regulators
|
||||
* don't get disabled in order to ensure consistent restart.
|
||||
*/
|
||||
wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET, 0x8994);
|
||||
wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET,
|
||||
wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET));
|
||||
|
||||
regcache_cache_only(wm8994->regmap, true);
|
||||
regcache_mark_dirty(wm8994->regmap);
|
||||
|
||||
wm8994->suspended = true;
|
||||
|
||||
|
@ -294,7 +287,7 @@ static int wm8994_suspend(struct device *dev)
|
|||
static int wm8994_resume(struct device *dev)
|
||||
{
|
||||
struct wm8994 *wm8994 = dev_get_drvdata(dev);
|
||||
int ret, i;
|
||||
int ret;
|
||||
|
||||
/* We may have lied to the PM core about suspending */
|
||||
if (!wm8994->suspended)
|
||||
|
@ -307,27 +300,13 @@ static int wm8994_resume(struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Write register at a time as we use the cache on the CPU so store
|
||||
* it in native endian.
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
|
||||
ret = wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK
|
||||
+ i, wm8994->irq_masks_cur[i]);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to restore interrupt masks: %d\n",
|
||||
ret);
|
||||
regcache_cache_only(wm8994->regmap, false);
|
||||
ret = regcache_sync(wm8994->regmap);
|
||||
if (ret != 0) {
|
||||
dev_err(dev, "Failed to restore register map: %d\n", ret);
|
||||
goto err_enable;
|
||||
}
|
||||
|
||||
ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
|
||||
&wm8994->ldo_regs);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to restore LDO registers: %d\n", ret);
|
||||
|
||||
ret = wm8994_write(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2,
|
||||
&wm8994->gpio_regs);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);
|
||||
|
||||
/* Disable LDO pulldowns while the device is active */
|
||||
wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
|
||||
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
|
||||
|
@ -336,6 +315,11 @@ static int wm8994_resume(struct device *dev)
|
|||
wm8994->suspended = false;
|
||||
|
||||
return 0;
|
||||
|
||||
err_enable:
|
||||
regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -361,19 +345,16 @@ static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
|
|||
}
|
||||
#endif
|
||||
|
||||
static struct regmap_config wm8994_regmap_config = {
|
||||
.reg_bits = 16,
|
||||
.val_bits = 16,
|
||||
};
|
||||
|
||||
/*
|
||||
* Instantiate the generic non-control parts of the device.
|
||||
*/
|
||||
static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
||||
{
|
||||
struct wm8994_pdata *pdata = wm8994->dev->platform_data;
|
||||
struct regmap_config *regmap_config;
|
||||
const char *devname;
|
||||
int ret, i;
|
||||
int pulls = 0;
|
||||
|
||||
dev_set_drvdata(wm8994->dev, wm8994);
|
||||
|
||||
|
@ -402,9 +383,9 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
|||
goto err_regmap;
|
||||
}
|
||||
|
||||
wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) *
|
||||
wm8994->num_supplies,
|
||||
GFP_KERNEL);
|
||||
wm8994->supplies = devm_kzalloc(wm8994->dev,
|
||||
sizeof(struct regulator_bulk_data) *
|
||||
wm8994->num_supplies, GFP_KERNEL);
|
||||
if (!wm8994->supplies) {
|
||||
ret = -ENOMEM;
|
||||
goto err_regmap;
|
||||
|
@ -432,7 +413,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
|||
wm8994->supplies);
|
||||
if (ret != 0) {
|
||||
dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
|
||||
goto err_supplies;
|
||||
goto err_regmap;
|
||||
}
|
||||
|
||||
ret = regulator_bulk_enable(wm8994->num_supplies,
|
||||
|
@ -482,25 +463,54 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
|||
ret);
|
||||
goto err_enable;
|
||||
}
|
||||
wm8994->revision = ret;
|
||||
|
||||
switch (wm8994->type) {
|
||||
case WM8994:
|
||||
switch (ret) {
|
||||
switch (wm8994->revision) {
|
||||
case 0:
|
||||
case 1:
|
||||
dev_warn(wm8994->dev,
|
||||
"revision %c not fully supported\n",
|
||||
'A' + ret);
|
||||
'A' + wm8994->revision);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WM1811:
|
||||
/* Revision C did not change the relevant layer */
|
||||
if (wm8994->revision > 1)
|
||||
wm8994->revision++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
dev_info(wm8994->dev, "%s revision %c\n", devname, 'A' + ret);
|
||||
dev_info(wm8994->dev, "%s revision %c\n", devname,
|
||||
'A' + wm8994->revision);
|
||||
|
||||
switch (wm8994->type) {
|
||||
case WM1811:
|
||||
regmap_config = &wm1811_regmap_config;
|
||||
break;
|
||||
case WM8994:
|
||||
regmap_config = &wm8994_regmap_config;
|
||||
break;
|
||||
case WM8958:
|
||||
regmap_config = &wm8958_regmap_config;
|
||||
break;
|
||||
default:
|
||||
dev_err(wm8994->dev, "Unknown device type %d\n", wm8994->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = regmap_reinit_cache(wm8994->regmap, regmap_config);
|
||||
if (ret != 0) {
|
||||
dev_err(wm8994->dev, "Failed to reinit register cache: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (pdata) {
|
||||
wm8994->irq_base = pdata->irq_base;
|
||||
|
@ -516,12 +526,16 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
|||
}
|
||||
|
||||
wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven;
|
||||
|
||||
if (pdata->spkmode_pu)
|
||||
pulls |= WM8994_SPKMODE_PU;
|
||||
}
|
||||
|
||||
/* Disable LDO pulldowns while the device is active */
|
||||
/* Disable unneeded pulls */
|
||||
wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
|
||||
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
|
||||
0);
|
||||
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD |
|
||||
WM8994_SPKMODE_PU | WM8994_CSNADDR_PD,
|
||||
pulls);
|
||||
|
||||
/* In some system designs where the regulators are not in use,
|
||||
* we can achieve a small reduction in leakage currents by
|
||||
|
@ -560,12 +574,9 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
|
|||
wm8994->supplies);
|
||||
err_get:
|
||||
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
|
||||
err_supplies:
|
||||
kfree(wm8994->supplies);
|
||||
err_regmap:
|
||||
regmap_exit(wm8994->regmap);
|
||||
mfd_remove_devices(wm8994->dev);
|
||||
kfree(wm8994);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -577,18 +588,24 @@ static void wm8994_device_exit(struct wm8994 *wm8994)
|
|||
regulator_bulk_disable(wm8994->num_supplies,
|
||||
wm8994->supplies);
|
||||
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
|
||||
kfree(wm8994->supplies);
|
||||
regmap_exit(wm8994->regmap);
|
||||
kfree(wm8994);
|
||||
}
|
||||
|
||||
static const struct of_device_id wm8994_of_match[] = {
|
||||
{ .compatible = "wlf,wm1811", },
|
||||
{ .compatible = "wlf,wm8994", },
|
||||
{ .compatible = "wlf,wm8958", },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, wm8994_of_match);
|
||||
|
||||
static int wm8994_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct wm8994 *wm8994;
|
||||
int ret;
|
||||
|
||||
wm8994 = kzalloc(sizeof(struct wm8994), GFP_KERNEL);
|
||||
wm8994 = devm_kzalloc(&i2c->dev, sizeof(struct wm8994), GFP_KERNEL);
|
||||
if (wm8994 == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -597,12 +614,11 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
|
|||
wm8994->irq = i2c->irq;
|
||||
wm8994->type = id->driver_data;
|
||||
|
||||
wm8994->regmap = regmap_init_i2c(i2c, &wm8994_regmap_config);
|
||||
wm8994->regmap = regmap_init_i2c(i2c, &wm8994_base_regmap_config);
|
||||
if (IS_ERR(wm8994->regmap)) {
|
||||
ret = PTR_ERR(wm8994->regmap);
|
||||
dev_err(wm8994->dev, "Failed to allocate register map: %d\n",
|
||||
ret);
|
||||
kfree(wm8994);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -620,6 +636,7 @@ static int wm8994_i2c_remove(struct i2c_client *i2c)
|
|||
|
||||
static const struct i2c_device_id wm8994_i2c_id[] = {
|
||||
{ "wm1811", WM1811 },
|
||||
{ "wm1811a", WM1811 },
|
||||
{ "wm8994", WM8994 },
|
||||
{ "wm8958", WM8958 },
|
||||
{ }
|
||||
|
@ -634,6 +651,7 @@ static struct i2c_driver wm8994_i2c_driver = {
|
|||
.name = "wm8994",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &wm8994_pm_ops,
|
||||
.of_match_table = wm8994_of_match,
|
||||
},
|
||||
.probe = wm8994_i2c_probe,
|
||||
.remove = wm8994_i2c_remove,
|
||||
|
|
|
@ -18,248 +18,127 @@
|
|||
#include <linux/irq.h>
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <linux/mfd/wm8994/core.h>
|
||||
#include <linux/mfd/wm8994/registers.h>
|
||||
|
||||
#include <linux/delay.h>
|
||||
|
||||
struct wm8994_irq_data {
|
||||
int reg;
|
||||
int mask;
|
||||
};
|
||||
|
||||
static struct wm8994_irq_data wm8994_irqs[] = {
|
||||
static struct regmap_irq wm8994_irqs[] = {
|
||||
[WM8994_IRQ_TEMP_SHUT] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_TEMP_SHUT_EINT,
|
||||
},
|
||||
[WM8994_IRQ_MIC1_DET] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_MIC1_DET_EINT,
|
||||
},
|
||||
[WM8994_IRQ_MIC1_SHRT] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_MIC1_SHRT_EINT,
|
||||
},
|
||||
[WM8994_IRQ_MIC2_DET] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_MIC2_DET_EINT,
|
||||
},
|
||||
[WM8994_IRQ_MIC2_SHRT] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_MIC2_SHRT_EINT,
|
||||
},
|
||||
[WM8994_IRQ_FLL1_LOCK] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_FLL1_LOCK_EINT,
|
||||
},
|
||||
[WM8994_IRQ_FLL2_LOCK] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_FLL2_LOCK_EINT,
|
||||
},
|
||||
[WM8994_IRQ_SRC1_LOCK] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_SRC1_LOCK_EINT,
|
||||
},
|
||||
[WM8994_IRQ_SRC2_LOCK] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_SRC2_LOCK_EINT,
|
||||
},
|
||||
[WM8994_IRQ_AIF1DRC1_SIG_DET] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_AIF1DRC1_SIG_DET,
|
||||
},
|
||||
[WM8994_IRQ_AIF1DRC2_SIG_DET] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_AIF1DRC2_SIG_DET_EINT,
|
||||
},
|
||||
[WM8994_IRQ_AIF2DRC_SIG_DET] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_AIF2DRC_SIG_DET_EINT,
|
||||
},
|
||||
[WM8994_IRQ_FIFOS_ERR] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_FIFOS_ERR_EINT,
|
||||
},
|
||||
[WM8994_IRQ_WSEQ_DONE] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_WSEQ_DONE_EINT,
|
||||
},
|
||||
[WM8994_IRQ_DCS_DONE] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_DCS_DONE_EINT,
|
||||
},
|
||||
[WM8994_IRQ_TEMP_WARN] = {
|
||||
.reg = 2,
|
||||
.reg_offset = 1,
|
||||
.mask = WM8994_TEMP_WARN_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(1)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP1_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(2)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP2_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(3)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP3_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(4)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP4_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(5)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP5_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(6)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP6_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(7)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP7_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(8)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP8_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(9)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP8_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(10)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP10_EINT,
|
||||
},
|
||||
[WM8994_IRQ_GPIO(11)] = {
|
||||
.reg = 1,
|
||||
.mask = WM8994_GP11_EINT,
|
||||
},
|
||||
};
|
||||
|
||||
static inline int irq_data_to_status_reg(struct wm8994_irq_data *irq_data)
|
||||
{
|
||||
return WM8994_INTERRUPT_STATUS_1 - 1 + irq_data->reg;
|
||||
}
|
||||
static struct regmap_irq_chip wm8994_irq_chip = {
|
||||
.name = "wm8994",
|
||||
.irqs = wm8994_irqs,
|
||||
.num_irqs = ARRAY_SIZE(wm8994_irqs),
|
||||
|
||||
static inline int irq_data_to_mask_reg(struct wm8994_irq_data *irq_data)
|
||||
{
|
||||
return WM8994_INTERRUPT_STATUS_1_MASK - 1 + irq_data->reg;
|
||||
}
|
||||
|
||||
static inline struct wm8994_irq_data *irq_to_wm8994_irq(struct wm8994 *wm8994,
|
||||
int irq)
|
||||
{
|
||||
return &wm8994_irqs[irq - wm8994->irq_base];
|
||||
}
|
||||
|
||||
static void wm8994_irq_lock(struct irq_data *data)
|
||||
{
|
||||
struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
|
||||
|
||||
mutex_lock(&wm8994->irq_lock);
|
||||
}
|
||||
|
||||
static void wm8994_irq_sync_unlock(struct irq_data *data)
|
||||
{
|
||||
struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
|
||||
/* If there's been a change in the mask write it back
|
||||
* to the hardware. */
|
||||
if (wm8994->irq_masks_cur[i] != wm8994->irq_masks_cache[i]) {
|
||||
wm8994->irq_masks_cache[i] = wm8994->irq_masks_cur[i];
|
||||
wm8994_reg_write(wm8994,
|
||||
WM8994_INTERRUPT_STATUS_1_MASK + i,
|
||||
wm8994->irq_masks_cur[i]);
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&wm8994->irq_lock);
|
||||
}
|
||||
|
||||
static void wm8994_irq_enable(struct irq_data *data)
|
||||
{
|
||||
struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
|
||||
struct wm8994_irq_data *irq_data = irq_to_wm8994_irq(wm8994,
|
||||
data->irq);
|
||||
|
||||
wm8994->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask;
|
||||
}
|
||||
|
||||
static void wm8994_irq_disable(struct irq_data *data)
|
||||
{
|
||||
struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
|
||||
struct wm8994_irq_data *irq_data = irq_to_wm8994_irq(wm8994,
|
||||
data->irq);
|
||||
|
||||
wm8994->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
|
||||
}
|
||||
|
||||
static struct irq_chip wm8994_irq_chip = {
|
||||
.name = "wm8994",
|
||||
.irq_bus_lock = wm8994_irq_lock,
|
||||
.irq_bus_sync_unlock = wm8994_irq_sync_unlock,
|
||||
.irq_disable = wm8994_irq_disable,
|
||||
.irq_enable = wm8994_irq_enable,
|
||||
.num_regs = 2,
|
||||
.status_base = WM8994_INTERRUPT_STATUS_1,
|
||||
.mask_base = WM8994_INTERRUPT_STATUS_1_MASK,
|
||||
.ack_base = WM8994_INTERRUPT_STATUS_1,
|
||||
};
|
||||
|
||||
/* The processing of the primary interrupt occurs in a thread so that
|
||||
* we can interact with the device over I2C or SPI. */
|
||||
static irqreturn_t wm8994_irq_thread(int irq, void *data)
|
||||
{
|
||||
struct wm8994 *wm8994 = data;
|
||||
unsigned int i;
|
||||
u16 status[WM8994_NUM_IRQ_REGS];
|
||||
int ret;
|
||||
|
||||
ret = wm8994_bulk_read(wm8994, WM8994_INTERRUPT_STATUS_1,
|
||||
WM8994_NUM_IRQ_REGS, status);
|
||||
if (ret < 0) {
|
||||
dev_err(wm8994->dev, "Failed to read interrupt status: %d\n",
|
||||
ret);
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
/* Bit swap and apply masking */
|
||||
for (i = 0; i < WM8994_NUM_IRQ_REGS; i++) {
|
||||
status[i] = be16_to_cpu(status[i]);
|
||||
status[i] &= ~wm8994->irq_masks_cur[i];
|
||||
}
|
||||
|
||||
/* Ack any unmasked IRQs */
|
||||
for (i = 0; i < ARRAY_SIZE(status); i++) {
|
||||
if (status[i])
|
||||
wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1 + i,
|
||||
status[i]);
|
||||
}
|
||||
|
||||
/* Report */
|
||||
for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) {
|
||||
if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask)
|
||||
handle_nested_irq(wm8994->irq_base + i);
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
int wm8994_irq_init(struct wm8994 *wm8994)
|
||||
{
|
||||
int i, cur_irq, ret;
|
||||
|
||||
mutex_init(&wm8994->irq_lock);
|
||||
|
||||
/* Mask the individual interrupt sources */
|
||||
for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
|
||||
wm8994->irq_masks_cur[i] = 0xffff;
|
||||
wm8994->irq_masks_cache[i] = 0xffff;
|
||||
wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK + i,
|
||||
0xffff);
|
||||
}
|
||||
int ret;
|
||||
|
||||
if (!wm8994->irq) {
|
||||
dev_warn(wm8994->dev,
|
||||
|
@ -274,30 +153,12 @@ int wm8994_irq_init(struct wm8994 *wm8994)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Register them with genirq */
|
||||
for (cur_irq = wm8994->irq_base;
|
||||
cur_irq < ARRAY_SIZE(wm8994_irqs) + wm8994->irq_base;
|
||||
cur_irq++) {
|
||||
irq_set_chip_data(cur_irq, wm8994);
|
||||
irq_set_chip_and_handler(cur_irq, &wm8994_irq_chip,
|
||||
handle_edge_irq);
|
||||
irq_set_nested_thread(cur_irq, 1);
|
||||
|
||||
/* ARM needs us to explicitly flag the IRQ as valid
|
||||
* and will set them noprobe when we do so. */
|
||||
#ifdef CONFIG_ARM
|
||||
set_irq_flags(cur_irq, IRQF_VALID);
|
||||
#else
|
||||
irq_set_noprobe(cur_irq);
|
||||
#endif
|
||||
}
|
||||
|
||||
ret = request_threaded_irq(wm8994->irq, NULL, wm8994_irq_thread,
|
||||
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
|
||||
"wm8994", wm8994);
|
||||
ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq,
|
||||
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
|
||||
wm8994->irq_base, &wm8994_irq_chip,
|
||||
&wm8994->irq_data);
|
||||
if (ret != 0) {
|
||||
dev_err(wm8994->dev, "Failed to request IRQ %d: %d\n",
|
||||
wm8994->irq, ret);
|
||||
dev_err(wm8994->dev, "Failed to register IRQ chip: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -309,6 +170,5 @@ int wm8994_irq_init(struct wm8994 *wm8994)
|
|||
|
||||
void wm8994_irq_exit(struct wm8994 *wm8994)
|
||||
{
|
||||
if (wm8994->irq)
|
||||
free_irq(wm8994->irq, wm8994);
|
||||
regmap_del_irq_chip(wm8994->irq, wm8994->irq_data);
|
||||
}
|
||||
|
|
1238
drivers/mfd/wm8994-regmap.c
Normal file
1238
drivers/mfd/wm8994-regmap.c
Normal file
File diff suppressed because it is too large
Load diff
25
drivers/mfd/wm8994.h
Normal file
25
drivers/mfd/wm8994.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* wm8994.h -- WM8994 MFD internals
|
||||
*
|
||||
* Copyright 2011 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 as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MFD_WM8994_H__
|
||||
#define __MFD_WM8994_H__
|
||||
|
||||
#include <linux/regmap.h>
|
||||
|
||||
extern struct regmap_config wm1811_regmap_config;
|
||||
extern struct regmap_config wm8994_regmap_config;
|
||||
extern struct regmap_config wm8958_regmap_config;
|
||||
extern struct regmap_config wm8994_base_regmap_config;
|
||||
|
||||
#endif
|
|
@ -15,6 +15,7 @@
|
|||
#ifndef __MFD_WM8994_CORE_H__
|
||||
#define __MFD_WM8994_CORE_H__
|
||||
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
enum wm8994_type {
|
||||
|
@ -55,6 +56,7 @@ struct wm8994 {
|
|||
struct mutex irq_lock;
|
||||
|
||||
enum wm8994_type type;
|
||||
int revision;
|
||||
|
||||
struct device *dev;
|
||||
struct regmap *regmap;
|
||||
|
@ -65,13 +67,10 @@ struct wm8994 {
|
|||
int irq_base;
|
||||
|
||||
int irq;
|
||||
u16 irq_masks_cur[WM8994_NUM_IRQ_REGS];
|
||||
u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
|
||||
struct regmap_irq_chip_data *irq_data;
|
||||
|
||||
/* Used over suspend/resume */
|
||||
bool suspended;
|
||||
u16 ldo_regs[WM8994_NUM_LDO_REGS];
|
||||
u16 gpio_regs[WM8994_NUM_GPIO_REGS];
|
||||
|
||||
struct regulator_dev *dbvdd;
|
||||
int num_supplies;
|
||||
|
|
|
@ -23,7 +23,7 @@ struct wm8994_ldo_pdata {
|
|||
int enable;
|
||||
|
||||
const char *supply;
|
||||
struct regulator_init_data *init_data;
|
||||
const struct regulator_init_data *init_data;
|
||||
};
|
||||
|
||||
#define WM8994_CONFIGURE_GPIO 0x10000
|
||||
|
@ -113,6 +113,23 @@ struct wm8958_enh_eq_cfg {
|
|||
u16 regs[WM8958_ENH_EQ_REGS];
|
||||
};
|
||||
|
||||
/**
|
||||
* Microphone detection rates, used to tune response rates and power
|
||||
* consumption for WM8958/WM1811 microphone detection.
|
||||
*
|
||||
* @sysclk: System clock rate to use this configuration for.
|
||||
* @idle: True if this configuration should use when no accessory is detected,
|
||||
* false otherwise.
|
||||
* @start: Value for MICD_BIAS_START_TIME register field (not shifted).
|
||||
* @rate: Value for MICD_RATE register field (not shifted).
|
||||
*/
|
||||
struct wm8958_micd_rate {
|
||||
int sysclk;
|
||||
bool idle;
|
||||
int start;
|
||||
int rate;
|
||||
};
|
||||
|
||||
struct wm8994_pdata {
|
||||
int gpio_base;
|
||||
|
||||
|
@ -144,6 +161,9 @@ struct wm8994_pdata {
|
|||
int num_enh_eq_cfgs;
|
||||
struct wm8958_enh_eq_cfg *enh_eq_cfgs;
|
||||
|
||||
int num_micd_rates;
|
||||
struct wm8958_micd_rate *micd_rates;
|
||||
|
||||
/* LINEOUT can be differential or single ended */
|
||||
unsigned int lineout1_diff:1;
|
||||
unsigned int lineout2_diff:1;
|
||||
|
@ -168,12 +188,21 @@ struct wm8994_pdata {
|
|||
/* WM8958 microphone bias configuration */
|
||||
int micbias[2];
|
||||
|
||||
/* WM8958 microphone detection ranges */
|
||||
u16 micd_lvl_sel;
|
||||
|
||||
/* Disable the internal pull downs on the LDOs if they are
|
||||
* always driven (eg, connected to an always on supply or
|
||||
* GPIO that always drives an output. If they float power
|
||||
* consumption will rise.
|
||||
*/
|
||||
bool ldo_ena_always_driven;
|
||||
|
||||
/*
|
||||
* SPKMODE must be pulled internally by the device on this
|
||||
* system.
|
||||
*/
|
||||
bool spkmode_pu;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -95,11 +95,15 @@
|
|||
#define WM8994_FLL1_CONTROL_3 0x222
|
||||
#define WM8994_FLL1_CONTROL_4 0x223
|
||||
#define WM8994_FLL1_CONTROL_5 0x224
|
||||
#define WM8958_FLL1_EFS_1 0x226
|
||||
#define WM8958_FLL1_EFS_2 0x227
|
||||
#define WM8994_FLL2_CONTROL_1 0x240
|
||||
#define WM8994_FLL2_CONTROL_2 0x241
|
||||
#define WM8994_FLL2_CONTROL_3 0x242
|
||||
#define WM8994_FLL2_CONTROL_4 0x243
|
||||
#define WM8994_FLL2_CONTROL_5 0x244
|
||||
#define WM8958_FLL2_EFS_1 0x246
|
||||
#define WM8958_FLL2_EFS_2 0x247
|
||||
#define WM8994_AIF1_CONTROL_1 0x300
|
||||
#define WM8994_AIF1_CONTROL_2 0x301
|
||||
#define WM8994_AIF1_MASTER_SLAVE 0x302
|
||||
|
@ -116,6 +120,7 @@
|
|||
#define WM8994_AIF2DAC_LRCLK 0x315
|
||||
#define WM8994_AIF2DAC_DATA 0x316
|
||||
#define WM8994_AIF2ADC_DATA 0x317
|
||||
#define WM1811_AIF2TX_CONTROL 0x318
|
||||
#define WM8958_AIF3_CONTROL_1 0x320
|
||||
#define WM8958_AIF3_CONTROL_2 0x321
|
||||
#define WM8958_AIF3DAC_DATA 0x322
|
||||
|
@ -166,6 +171,7 @@
|
|||
#define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491
|
||||
#define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492
|
||||
#define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493
|
||||
#define WM8994_AIF1_DAC1_EQ_BAND_1_C 0x494
|
||||
#define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0
|
||||
#define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1
|
||||
#define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2
|
||||
|
@ -186,6 +192,7 @@
|
|||
#define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1
|
||||
#define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2
|
||||
#define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3
|
||||
#define WM8994_AIF1_DAC2_EQ_BAND_1_C 0x4B4
|
||||
#define WM8994_AIF2_ADC_LEFT_VOLUME 0x500
|
||||
#define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501
|
||||
#define WM8994_AIF2_DAC_LEFT_VOLUME 0x502
|
||||
|
@ -219,6 +226,7 @@
|
|||
#define WM8994_AIF2_EQ_BAND_5_A 0x591
|
||||
#define WM8994_AIF2_EQ_BAND_5_B 0x592
|
||||
#define WM8994_AIF2_EQ_BAND_5_PG 0x593
|
||||
#define WM8994_AIF2_EQ_BAND_1_C 0x594
|
||||
#define WM8994_DAC1_MIXER_VOLUMES 0x600
|
||||
#define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601
|
||||
#define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602
|
||||
|
@ -242,6 +250,7 @@
|
|||
#define WM8994_GPIO_4 0x703
|
||||
#define WM8994_GPIO_5 0x704
|
||||
#define WM8994_GPIO_6 0x705
|
||||
#define WM1811_JACKDET_CTRL 0x705
|
||||
#define WM8994_GPIO_7 0x706
|
||||
#define WM8994_GPIO_8 0x707
|
||||
#define WM8994_GPIO_9 0x708
|
||||
|
@ -264,7 +273,43 @@
|
|||
#define WM8958_DSP2_RELEASETIME 0xA03
|
||||
#define WM8958_DSP2_VERMAJMIN 0xA04
|
||||
#define WM8958_DSP2_VERBUILD 0xA05
|
||||
#define WM8958_DSP2_TESTREG 0xA06
|
||||
#define WM8958_DSP2_XORREG 0xA07
|
||||
#define WM8958_DSP2_SHIFTMAXX 0xA08
|
||||
#define WM8958_DSP2_SHIFTMAXY 0xA09
|
||||
#define WM8958_DSP2_SHIFTMAXZ 0xA0A
|
||||
#define WM8958_DSP2_SHIFTMAXEXTLO 0xA0B
|
||||
#define WM8958_DSP2_AESSELECT 0xA0C
|
||||
#define WM8958_DSP2_EXECCONTROL 0xA0D
|
||||
#define WM8958_DSP2_SAMPLEBREAK 0xA0E
|
||||
#define WM8958_DSP2_COUNTBREAK 0xA0F
|
||||
#define WM8958_DSP2_INTSTATUS 0xA10
|
||||
#define WM8958_DSP2_EVENTSTATUS 0xA11
|
||||
#define WM8958_DSP2_INTMASK 0xA12
|
||||
#define WM8958_DSP2_CONFIGDWIDTH 0xA13
|
||||
#define WM8958_DSP2_CONFIGINSTR 0xA14
|
||||
#define WM8958_DSP2_CONFIGDMEM 0xA15
|
||||
#define WM8958_DSP2_CONFIGDELAYS 0xA16
|
||||
#define WM8958_DSP2_CONFIGNUMIO 0xA17
|
||||
#define WM8958_DSP2_CONFIGEXTDEPTH 0xA18
|
||||
#define WM8958_DSP2_CONFIGMULTIPLIER 0xA19
|
||||
#define WM8958_DSP2_CONFIGCTRLDWIDTH 0xA1A
|
||||
#define WM8958_DSP2_CONFIGPIPELINE 0xA1B
|
||||
#define WM8958_DSP2_SHIFTMAXEXTHI 0xA1C
|
||||
#define WM8958_DSP2_SWVERSIONREG 0xA1D
|
||||
#define WM8958_DSP2_CONFIGXMEM 0xA1E
|
||||
#define WM8958_DSP2_CONFIGYMEM 0xA1F
|
||||
#define WM8958_DSP2_CONFIGZMEM 0xA20
|
||||
#define WM8958_FW_BUILD_1 0x2000
|
||||
#define WM8958_FW_BUILD_0 0x2001
|
||||
#define WM8958_FW_ID_1 0x2002
|
||||
#define WM8958_FW_ID_0 0x2003
|
||||
#define WM8958_FW_MAJOR_1 0x2004
|
||||
#define WM8958_FW_MAJOR_0 0x2005
|
||||
#define WM8958_FW_MINOR_1 0x2006
|
||||
#define WM8958_FW_MINOR_0 0x2007
|
||||
#define WM8958_FW_PATCH_1 0x2008
|
||||
#define WM8958_FW_PATCH_0 0x2009
|
||||
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200
|
||||
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201
|
||||
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202
|
||||
|
@ -333,6 +378,14 @@
|
|||
#define WM8958_MBC_B2_PG2_2 0x242D
|
||||
#define WM8958_MBC_B1_PG2_1 0x242E
|
||||
#define WM8958_MBC_B1_PG2_2 0x242F
|
||||
#define WM8958_MBC_CROSSOVER_1 0x2600
|
||||
#define WM8958_MBC_CROSSOVER_2 0x2601
|
||||
#define WM8958_MBC_HPF_1 0x2602
|
||||
#define WM8958_MBC_HPF_2 0x2603
|
||||
#define WM8958_MBC_LPF_1 0x2606
|
||||
#define WM8958_MBC_LPF_2 0x2607
|
||||
#define WM8958_MBC_RMS_LIMIT_1 0x260A
|
||||
#define WM8958_MBC_RMS_LIMIT_2 0x260B
|
||||
#define WM8994_WRITE_SEQUENCER_0 0x3000
|
||||
#define WM8994_WRITE_SEQUENCER_1 0x3001
|
||||
#define WM8994_WRITE_SEQUENCER_2 0x3002
|
||||
|
@ -1852,6 +1905,9 @@
|
|||
/*
|
||||
* R57 (0x39) - AntiPOP (2)
|
||||
*/
|
||||
#define WM1811_JACKDET_MODE_MASK 0x0180 /* JACKDET_MODE - [8:7] */
|
||||
#define WM1811_JACKDET_MODE_SHIFT 7 /* JACKDET_MODE - [8:7] */
|
||||
#define WM1811_JACKDET_MODE_WIDTH 2 /* JACKDET_MODE - [8:7] */
|
||||
#define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */
|
||||
#define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */
|
||||
#define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */
|
||||
|
@ -2389,6 +2445,10 @@
|
|||
/*
|
||||
* R548 (0x224) - FLL1 Control (5)
|
||||
*/
|
||||
#define WM8958_FLL1_BYP 0x8000 /* FLL1_BYP */
|
||||
#define WM8958_FLL1_BYP_MASK 0x8000 /* FLL1_BYP */
|
||||
#define WM8958_FLL1_BYP_SHIFT 15 /* FLL1_BYP */
|
||||
#define WM8958_FLL1_BYP_WIDTH 1 /* FLL1_BYP */
|
||||
#define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */
|
||||
#define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */
|
||||
#define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */
|
||||
|
@ -2403,6 +2463,24 @@
|
|||
#define WM8994_FLL1_REFCLK_SRC_SHIFT 0 /* FLL1_REFCLK_SRC - [1:0] */
|
||||
#define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */
|
||||
|
||||
/*
|
||||
* R550 (0x226) - FLL1 EFS 1
|
||||
*/
|
||||
#define WM8958_FLL1_LAMBDA_MASK 0xFFFF /* FLL1_LAMBDA - [15:0] */
|
||||
#define WM8958_FLL1_LAMBDA_SHIFT 0 /* FLL1_LAMBDA - [15:0] */
|
||||
#define WM8958_FLL1_LAMBDA_WIDTH 16 /* FLL1_LAMBDA - [15:0] */
|
||||
|
||||
/*
|
||||
* R551 (0x227) - FLL1 EFS 2
|
||||
*/
|
||||
#define WM8958_FLL1_LFSR_SEL_MASK 0x0006 /* FLL1_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL1_LFSR_SEL_SHIFT 1 /* FLL1_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL1_LFSR_SEL_WIDTH 2 /* FLL1_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL1_EFS_ENA 0x0001 /* FLL1_EFS_ENA */
|
||||
#define WM8958_FLL1_EFS_ENA_MASK 0x0001 /* FLL1_EFS_ENA */
|
||||
#define WM8958_FLL1_EFS_ENA_SHIFT 0 /* FLL1_EFS_ENA */
|
||||
#define WM8958_FLL1_EFS_ENA_WIDTH 1 /* FLL1_EFS_ENA */
|
||||
|
||||
/*
|
||||
* R576 (0x240) - FLL2 Control (1)
|
||||
*/
|
||||
|
@ -2452,6 +2530,10 @@
|
|||
/*
|
||||
* R580 (0x244) - FLL2 Control (5)
|
||||
*/
|
||||
#define WM8958_FLL2_BYP 0x8000 /* FLL2_BYP */
|
||||
#define WM8958_FLL2_BYP_MASK 0x8000 /* FLL2_BYP */
|
||||
#define WM8958_FLL2_BYP_SHIFT 15 /* FLL2_BYP */
|
||||
#define WM8958_FLL2_BYP_WIDTH 1 /* FLL2_BYP */
|
||||
#define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */
|
||||
#define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */
|
||||
#define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */
|
||||
|
@ -2466,6 +2548,24 @@
|
|||
#define WM8994_FLL2_REFCLK_SRC_SHIFT 0 /* FLL2_REFCLK_SRC - [1:0] */
|
||||
#define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */
|
||||
|
||||
/*
|
||||
* R582 (0x246) - FLL2 EFS 1
|
||||
*/
|
||||
#define WM8958_FLL2_LAMBDA_MASK 0xFFFF /* FLL2_LAMBDA - [15:0] */
|
||||
#define WM8958_FLL2_LAMBDA_SHIFT 0 /* FLL2_LAMBDA - [15:0] */
|
||||
#define WM8958_FLL2_LAMBDA_WIDTH 16 /* FLL2_LAMBDA - [15:0] */
|
||||
|
||||
/*
|
||||
* R583 (0x247) - FLL2 EFS 2
|
||||
*/
|
||||
#define WM8958_FLL2_LFSR_SEL_MASK 0x0006 /* FLL2_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL2_LFSR_SEL_SHIFT 1 /* FLL2_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL2_LFSR_SEL_WIDTH 2 /* FLL2_LFSR_SEL - [2:1] */
|
||||
#define WM8958_FLL2_EFS_ENA 0x0001 /* FLL2_EFS_ENA */
|
||||
#define WM8958_FLL2_EFS_ENA_MASK 0x0001 /* FLL2_EFS_ENA */
|
||||
#define WM8958_FLL2_EFS_ENA_SHIFT 0 /* FLL2_EFS_ENA */
|
||||
#define WM8958_FLL2_EFS_ENA_WIDTH 1 /* FLL2_EFS_ENA */
|
||||
|
||||
/*
|
||||
* R768 (0x300) - AIF1 Control (1)
|
||||
*/
|
||||
|
@ -4186,6 +4286,18 @@
|
|||
#define WM8994_STL_SEL_SHIFT 0 /* STL_SEL */
|
||||
#define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */
|
||||
|
||||
/*
|
||||
* R1797 (0x705) - JACKDET Ctrl
|
||||
*/
|
||||
#define WM1811_JACKDET_DB 0x0100 /* JACKDET_DB */
|
||||
#define WM1811_JACKDET_DB_MASK 0x0100 /* JACKDET_DB */
|
||||
#define WM1811_JACKDET_DB_SHIFT 8 /* JACKDET_DB */
|
||||
#define WM1811_JACKDET_DB_WIDTH 1 /* JACKDET_DB */
|
||||
#define WM1811_JACKDET_LVL 0x0040 /* JACKDET_LVL */
|
||||
#define WM1811_JACKDET_LVL_MASK 0x0040 /* JACKDET_LVL */
|
||||
#define WM1811_JACKDET_LVL_SHIFT 6 /* JACKDET_LVL */
|
||||
#define WM1811_JACKDET_LVL_WIDTH 1 /* JACKDET_LVL */
|
||||
|
||||
/*
|
||||
* R1824 (0x720) - Pull Control (1)
|
||||
*/
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Load firmware files from Analog Devices SigmaStudio
|
||||
*
|
||||
* Copyright 2009-2011 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __SIGMA_FIRMWARE_H__
|
||||
#define __SIGMA_FIRMWARE_H__
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct i2c_client;
|
||||
|
||||
#define SIGMA_MAGIC "ADISIGM"
|
||||
|
||||
struct sigma_firmware {
|
||||
const struct firmware *fw;
|
||||
size_t pos;
|
||||
};
|
||||
|
||||
struct sigma_firmware_header {
|
||||
unsigned char magic[7];
|
||||
u8 version;
|
||||
__le32 crc;
|
||||
};
|
||||
|
||||
enum {
|
||||
SIGMA_ACTION_WRITEXBYTES = 0,
|
||||
SIGMA_ACTION_WRITESINGLE,
|
||||
SIGMA_ACTION_WRITESAFELOAD,
|
||||
SIGMA_ACTION_DELAY,
|
||||
SIGMA_ACTION_PLLWAIT,
|
||||
SIGMA_ACTION_NOOP,
|
||||
SIGMA_ACTION_END,
|
||||
};
|
||||
|
||||
struct sigma_action {
|
||||
u8 instr;
|
||||
u8 len_hi;
|
||||
__le16 len;
|
||||
__be16 addr;
|
||||
unsigned char payload[];
|
||||
};
|
||||
|
||||
static inline u32 sigma_action_len(struct sigma_action *sa)
|
||||
{
|
||||
return (sa->len_hi << 16) | le16_to_cpu(sa->len);
|
||||
}
|
||||
|
||||
extern int process_sigma_firmware(struct i2c_client *client, const char *name);
|
||||
|
||||
#endif
|
|
@ -6,3 +6,5 @@ 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
|
||||
|
|
167
include/sound/compress_driver.h
Normal file
167
include/sound/compress_driver.h
Normal file
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* compress_driver.h - compress offload driver definations
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Vinod Koul <vinod.koul@linux.intel.com>
|
||||
* Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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 __COMPRESS_DRIVER_H
|
||||
#define __COMPRESS_DRIVER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
#include <sound/compress_offload.h>
|
||||
#include <sound/asound.h>
|
||||
#include <sound/pcm.h>
|
||||
|
||||
struct snd_compr_ops;
|
||||
|
||||
/**
|
||||
* struct snd_compr_runtime: runtime stream description
|
||||
* @state: stream state
|
||||
* @ops: pointer to DSP callbacks
|
||||
* @buffer: pointer to kernel buffer, valid only when not in mmap mode or
|
||||
* DSP doesn't implement copy
|
||||
* @buffer_size: size of the above buffer
|
||||
* @fragment_size: size of buffer fragment in bytes
|
||||
* @fragments: number of such fragments
|
||||
* @hw_pointer: offset of last location in buffer where DSP copied data
|
||||
* @app_pointer: offset of last location in buffer where app wrote data
|
||||
* @total_bytes_available: cumulative number of bytes made available in
|
||||
* the ring buffer
|
||||
* @total_bytes_transferred: cumulative bytes transferred by offload DSP
|
||||
* @sleep: poll sleep
|
||||
*/
|
||||
struct snd_compr_runtime {
|
||||
snd_pcm_state_t state;
|
||||
struct snd_compr_ops *ops;
|
||||
void *buffer;
|
||||
u64 buffer_size;
|
||||
u32 fragment_size;
|
||||
u32 fragments;
|
||||
u64 hw_pointer;
|
||||
u64 app_pointer;
|
||||
u64 total_bytes_available;
|
||||
u64 total_bytes_transferred;
|
||||
wait_queue_head_t sleep;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_stream: compressed stream
|
||||
* @name: device name
|
||||
* @ops: pointer to DSP callbacks
|
||||
* @runtime: pointer to runtime structure
|
||||
* @device: device pointer
|
||||
* @direction: stream direction, playback/recording
|
||||
* @private_data: pointer to DSP private data
|
||||
*/
|
||||
struct snd_compr_stream {
|
||||
const char *name;
|
||||
struct snd_compr_ops *ops;
|
||||
struct snd_compr_runtime *runtime;
|
||||
struct snd_compr *device;
|
||||
enum snd_compr_direction direction;
|
||||
void *private_data;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_ops: compressed path DSP operations
|
||||
* @open: Open the compressed stream
|
||||
* This callback is mandatory and shall keep dsp ready to receive the stream
|
||||
* parameter
|
||||
* @free: Close the compressed stream, mandatory
|
||||
* @set_params: Sets the compressed stream parameters, mandatory
|
||||
* This can be called in during stream creation only to set codec params
|
||||
* and the stream properties
|
||||
* @get_params: retrieve the codec parameters, mandatory
|
||||
* @trigger: Trigger operations like start, pause, resume, drain, stop.
|
||||
* This callback is mandatory
|
||||
* @pointer: Retrieve current h/w pointer information. Mandatory
|
||||
* @copy: Copy the compressed data to/from userspace, Optional
|
||||
* Can't be implemented if DSP supports mmap
|
||||
* @mmap: DSP mmap method to mmap DSP memory
|
||||
* @ack: Ack for DSP when data is written to audio buffer, Optional
|
||||
* Not valid if copy is implemented
|
||||
* @get_caps: Retrieve DSP capabilities, mandatory
|
||||
* @get_codec_caps: Retrieve capabilities for a specific codec, mandatory
|
||||
*/
|
||||
struct snd_compr_ops {
|
||||
int (*open)(struct snd_compr_stream *stream);
|
||||
int (*free)(struct snd_compr_stream *stream);
|
||||
int (*set_params)(struct snd_compr_stream *stream,
|
||||
struct snd_compr_params *params);
|
||||
int (*get_params)(struct snd_compr_stream *stream,
|
||||
struct snd_codec *params);
|
||||
int (*trigger)(struct snd_compr_stream *stream, int cmd);
|
||||
int (*pointer)(struct snd_compr_stream *stream,
|
||||
struct snd_compr_tstamp *tstamp);
|
||||
int (*copy)(struct snd_compr_stream *stream, const char __user *buf,
|
||||
size_t count);
|
||||
int (*mmap)(struct snd_compr_stream *stream,
|
||||
struct vm_area_struct *vma);
|
||||
int (*ack)(struct snd_compr_stream *stream, size_t bytes);
|
||||
int (*get_caps) (struct snd_compr_stream *stream,
|
||||
struct snd_compr_caps *caps);
|
||||
int (*get_codec_caps) (struct snd_compr_stream *stream,
|
||||
struct snd_compr_codec_caps *codec);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr: Compressed device
|
||||
* @name: DSP device name
|
||||
* @dev: Device pointer
|
||||
* @ops: pointer to DSP callbacks
|
||||
* @private_data: pointer to DSP pvt data
|
||||
* @card: sound card pointer
|
||||
* @direction: Playback or capture direction
|
||||
* @lock: device lock
|
||||
* @device: device id
|
||||
*/
|
||||
struct snd_compr {
|
||||
const char *name;
|
||||
struct device *dev;
|
||||
struct snd_compr_ops *ops;
|
||||
void *private_data;
|
||||
struct snd_card *card;
|
||||
unsigned int direction;
|
||||
struct mutex lock;
|
||||
int device;
|
||||
};
|
||||
|
||||
/* compress device register APIs */
|
||||
int snd_compress_register(struct snd_compr *device);
|
||||
int snd_compress_deregister(struct snd_compr *device);
|
||||
int snd_compress_new(struct snd_card *card, int device,
|
||||
int type, struct snd_compr *compr);
|
||||
|
||||
/* dsp driver callback apis
|
||||
* For playback: driver should call snd_compress_fragment_elapsed() to let the
|
||||
* framework know that a fragment has been consumed from the ring buffer
|
||||
*
|
||||
* For recording: we want to know when a frame is available or when
|
||||
* at least one frame is available so snd_compress_frame_elapsed()
|
||||
* callback should be called when a encodeded frame is available
|
||||
*/
|
||||
static inline void snd_compr_fragment_elapsed(struct snd_compr_stream *stream)
|
||||
{
|
||||
wake_up(&stream->runtime->sleep);
|
||||
}
|
||||
|
||||
#endif
|
161
include/sound/compress_offload.h
Normal file
161
include/sound/compress_offload.h
Normal file
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* compress_offload.h - compress offload header definations
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Vinod Koul <vinod.koul@linux.intel.com>
|
||||
* Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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 __COMPRESS_OFFLOAD_H
|
||||
#define __COMPRESS_OFFLOAD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <sound/asound.h>
|
||||
#include <sound/compress_params.h>
|
||||
|
||||
|
||||
#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)
|
||||
/**
|
||||
* struct snd_compressed_buffer: compressed buffer
|
||||
* @fragment_size: size of buffer fragment in bytes
|
||||
* @fragments: number of such fragments
|
||||
*/
|
||||
struct snd_compressed_buffer {
|
||||
__u32 fragment_size;
|
||||
__u32 fragments;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_params: compressed stream params
|
||||
* @buffer: buffer description
|
||||
* @codec: codec parameters
|
||||
* @no_wake_mode: dont wake on fragment elapsed
|
||||
*/
|
||||
struct snd_compr_params {
|
||||
struct snd_compressed_buffer buffer;
|
||||
struct snd_codec codec;
|
||||
__u8 no_wake_mode;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_tstamp: timestamp descriptor
|
||||
* @byte_offset: Byte offset in ring buffer to DSP
|
||||
* @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
|
||||
* @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
|
||||
* large steps and should only be used to monitor encoding/decoding
|
||||
* progress. It shall not be used for timing estimates.
|
||||
* @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
|
||||
* output/input. This field should be used for A/V sync or time estimates.
|
||||
* @sampling_rate: sampling rate of audio
|
||||
*/
|
||||
struct snd_compr_tstamp {
|
||||
__u32 byte_offset;
|
||||
__u32 copied_total;
|
||||
snd_pcm_uframes_t pcm_frames;
|
||||
snd_pcm_uframes_t pcm_io_frames;
|
||||
__u32 sampling_rate;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_avail: avail descriptor
|
||||
* @avail: Number of bytes available in ring buffer for writing/reading
|
||||
* @tstamp: timestamp infomation
|
||||
*/
|
||||
struct snd_compr_avail {
|
||||
__u64 avail;
|
||||
struct snd_compr_tstamp tstamp;
|
||||
};
|
||||
|
||||
enum snd_compr_direction {
|
||||
SND_COMPRESS_PLAYBACK = 0,
|
||||
SND_COMPRESS_CAPTURE
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_caps: caps descriptor
|
||||
* @codecs: pointer to array of codecs
|
||||
* @direction: direction supported. Of type snd_compr_direction
|
||||
* @min_fragment_size: minimum fragment supported by DSP
|
||||
* @max_fragment_size: maximum fragment supported by DSP
|
||||
* @min_fragments: min fragments supported by DSP
|
||||
* @max_fragments: max fragments supported by DSP
|
||||
* @num_codecs: number of codecs supported
|
||||
* @reserved: reserved field
|
||||
*/
|
||||
struct snd_compr_caps {
|
||||
__u32 num_codecs;
|
||||
__u32 direction;
|
||||
__u32 min_fragment_size;
|
||||
__u32 max_fragment_size;
|
||||
__u32 min_fragments;
|
||||
__u32 max_fragments;
|
||||
__u32 codecs[MAX_NUM_CODECS];
|
||||
__u32 reserved[11];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_codec_caps: query capability of codec
|
||||
* @codec: codec for which capability is queried
|
||||
* @num_descriptors: number of codec descriptors
|
||||
* @descriptor: array of codec capability descriptor
|
||||
*/
|
||||
struct snd_compr_codec_caps {
|
||||
__u32 codec;
|
||||
__u32 num_descriptors;
|
||||
struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
|
||||
};
|
||||
|
||||
/**
|
||||
* compress path ioctl definitions
|
||||
* SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
|
||||
* SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec
|
||||
* SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters
|
||||
* Note: only codec params can be changed runtime and stream params cant be
|
||||
* SNDRV_COMPRESS_GET_PARAMS: Query codec params
|
||||
* SNDRV_COMPRESS_TSTAMP: get the current timestamp value
|
||||
* SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
|
||||
* This also queries the tstamp properties
|
||||
* SNDRV_COMPRESS_PAUSE: Pause the running stream
|
||||
* SNDRV_COMPRESS_RESUME: resume a paused stream
|
||||
* SNDRV_COMPRESS_START: Start a stream
|
||||
* SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content
|
||||
* and the buffers currently with DSP
|
||||
* SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that
|
||||
* SNDRV_COMPRESS_IOCTL_VERSION: Query the API version
|
||||
*/
|
||||
#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
|
||||
#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
|
||||
#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\
|
||||
struct snd_compr_codec_caps)
|
||||
#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
|
||||
#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
|
||||
#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
|
||||
#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
|
||||
#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
|
||||
#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
|
||||
#define SNDRV_COMPRESS_START _IO('C', 0x32)
|
||||
#define SNDRV_COMPRESS_STOP _IO('C', 0x33)
|
||||
#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
|
||||
/*
|
||||
* TODO
|
||||
* 1. add mmap support
|
||||
*
|
||||
*/
|
||||
#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
|
||||
#endif
|
397
include/sound/compress_params.h
Normal file
397
include/sound/compress_params.h
Normal file
|
@ -0,0 +1,397 @@
|
|||
/*
|
||||
* compress_params.h - codec types and parameters for compressed data
|
||||
* streaming interface
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* Vinod Koul <vinod.koul@linux.intel.com>
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* The definitions in this file are derived from the OpenMAX AL version 1.1
|
||||
* and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
|
||||
*
|
||||
* Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and/or associated documentation files (the
|
||||
* "Materials "), to deal in the Materials without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
* permit persons to whom the Materials are furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*/
|
||||
#ifndef __SND_COMPRESS_PARAMS_H
|
||||
#define __SND_COMPRESS_PARAMS_H
|
||||
|
||||
/* AUDIO CODECS SUPPORTED */
|
||||
#define MAX_NUM_CODECS 32
|
||||
#define MAX_NUM_CODEC_DESCRIPTORS 32
|
||||
#define MAX_NUM_BITRATES 32
|
||||
|
||||
/* Codecs are listed linearly to allow for extensibility */
|
||||
#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
|
||||
#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
|
||||
#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
|
||||
#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
|
||||
#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
|
||||
#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
|
||||
#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
|
||||
#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
|
||||
#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
|
||||
#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
|
||||
#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
|
||||
#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
|
||||
|
||||
/*
|
||||
* Profile and modes are listed with bit masks. This allows for a
|
||||
* more compact representation of fields that will not evolve
|
||||
* (in contrast to the list of codecs)
|
||||
*/
|
||||
|
||||
#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
|
||||
|
||||
/* MP3 modes are only useful for encoders */
|
||||
#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
|
||||
#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
|
||||
#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
|
||||
#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
|
||||
|
||||
/* AMR modes are only useful for encoders */
|
||||
#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
|
||||
#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
|
||||
#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
|
||||
#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
|
||||
|
||||
/* AMRWB modes are only useful for encoders */
|
||||
#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
|
||||
|
||||
/* AAC modes are required for encoders and decoders */
|
||||
#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
|
||||
#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
|
||||
|
||||
/* AAC formats are required for encoders and decoders */
|
||||
#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
|
||||
#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
|
||||
#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
|
||||
|
||||
#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
|
||||
/*
|
||||
* Some implementations strip the ASF header and only send ASF packets
|
||||
* to the DSP
|
||||
*/
|
||||
#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
|
||||
|
||||
#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
|
||||
|
||||
/*
|
||||
* Define quality levels for FLAC encoders, from LEVEL0 (fast)
|
||||
* to LEVEL8 (best)
|
||||
*/
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
|
||||
|
||||
/* IEC61937 payloads without CUVP and preambles */
|
||||
#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
|
||||
/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
|
||||
#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
|
||||
|
||||
/*
|
||||
* IEC modes are mandatory for decoders. Format autodetection
|
||||
* will only happen on the DSP side with mode 0. The PCM mode should
|
||||
* not be used, the PCM codec should be used instead.
|
||||
*/
|
||||
#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
|
||||
#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
|
||||
#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
|
||||
#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
|
||||
#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
|
||||
#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
|
||||
#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
|
||||
#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
|
||||
#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
|
||||
#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
|
||||
#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
|
||||
|
||||
#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
|
||||
|
||||
/* <FIXME: multichannel encoders aren't supported for now. Would need
|
||||
an additional definition of channel arrangement> */
|
||||
|
||||
/* VBR/CBR definitions */
|
||||
#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
|
||||
#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
|
||||
|
||||
/* Encoder options */
|
||||
|
||||
struct snd_enc_wma {
|
||||
__u32 super_block_align; /* WMA Type-specific data */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct snd_enc_vorbis
|
||||
* @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
|
||||
* In the default mode of operation, the quality level is 3.
|
||||
* Normal quality range is 0 - 10.
|
||||
* @managed: Boolean. Set bitrate management mode. This turns off the
|
||||
* normal VBR encoding, but allows hard or soft bitrate constraints to be
|
||||
* enforced by the encoder. This mode can be slower, and may also be
|
||||
* lower quality. It is primarily useful for streaming.
|
||||
* @max_bit_rate: Enabled only if managed is TRUE
|
||||
* @min_bit_rate: Enabled only if managed is TRUE
|
||||
* @downmix: Boolean. Downmix input from stereo to mono (has no effect on
|
||||
* non-stereo streams). Useful for lower-bitrate encoding.
|
||||
*
|
||||
* These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
|
||||
* properties
|
||||
*
|
||||
* For best quality users should specify VBR mode and set quality levels.
|
||||
*/
|
||||
|
||||
struct snd_enc_vorbis {
|
||||
__s32 quality;
|
||||
__u32 managed;
|
||||
__u32 max_bit_rate;
|
||||
__u32 min_bit_rate;
|
||||
__u32 downmix;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct snd_enc_real
|
||||
* @quant_bits: number of coupling quantization bits in the stream
|
||||
* @start_region: coupling start region in the stream
|
||||
* @num_regions: number of regions value
|
||||
*
|
||||
* These options were extracted from the OpenMAX IL spec
|
||||
*/
|
||||
|
||||
struct snd_enc_real {
|
||||
__u32 quant_bits;
|
||||
__u32 start_region;
|
||||
__u32 num_regions;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_enc_flac
|
||||
* @num: serial number, valid only for OGG formats
|
||||
* needs to be set by application
|
||||
* @gain: Add replay gain tags
|
||||
*
|
||||
* These options were extracted from the FLAC online documentation
|
||||
* at http://flac.sourceforge.net/documentation_tools_flac.html
|
||||
*
|
||||
* To make the API simpler, it is assumed that the user will select quality
|
||||
* profiles. Additional options that affect encoding quality and speed can
|
||||
* be added at a later stage if needed.
|
||||
*
|
||||
* By default the Subset format is used by encoders.
|
||||
*
|
||||
* TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
|
||||
* not supported in this API.
|
||||
*/
|
||||
|
||||
struct snd_enc_flac {
|
||||
__u32 num;
|
||||
__u32 gain;
|
||||
};
|
||||
|
||||
struct snd_enc_generic {
|
||||
__u32 bw; /* encoder bandwidth */
|
||||
__s32 reserved[15];
|
||||
};
|
||||
|
||||
union snd_codec_options {
|
||||
struct snd_enc_wma wma;
|
||||
struct snd_enc_vorbis vorbis;
|
||||
struct snd_enc_real real;
|
||||
struct snd_enc_flac flac;
|
||||
struct snd_enc_generic generic;
|
||||
};
|
||||
|
||||
/** struct snd_codec_desc - description of codec capabilities
|
||||
* @max_ch: Maximum number of audio channels
|
||||
* @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this
|
||||
* @bit_rate: Indexed array containing supported bit rates
|
||||
* @num_bitrates: Number of valid values in bit_rate array
|
||||
* @rate_control: value is specified by SND_RATECONTROLMODE defines.
|
||||
* @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
|
||||
* @modes: Supported modes. See SND_AUDIOMODE defines
|
||||
* @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
|
||||
* @min_buffer: Minimum buffer size handled by codec implementation
|
||||
* @reserved: reserved for future use
|
||||
*
|
||||
* This structure provides a scalar value for profiles, modes and stream
|
||||
* format fields.
|
||||
* If an implementation supports multiple combinations, they will be listed as
|
||||
* codecs with different descriptors, for example there would be 2 descriptors
|
||||
* for AAC-RAW and AAC-ADTS.
|
||||
* This entails some redundancy but makes it easier to avoid invalid
|
||||
* configurations.
|
||||
*
|
||||
*/
|
||||
|
||||
struct snd_codec_desc {
|
||||
__u32 max_ch;
|
||||
__u32 sample_rates;
|
||||
__u32 bit_rate[MAX_NUM_BITRATES];
|
||||
__u32 num_bitrates;
|
||||
__u32 rate_control;
|
||||
__u32 profiles;
|
||||
__u32 modes;
|
||||
__u32 formats;
|
||||
__u32 min_buffer;
|
||||
__u32 reserved[15];
|
||||
};
|
||||
|
||||
/** struct snd_codec
|
||||
* @id: Identifies the supported audio encoder/decoder.
|
||||
* See SND_AUDIOCODEC macros.
|
||||
* @ch_in: Number of input audio channels
|
||||
* @ch_out: Number of output channels. In case of contradiction between
|
||||
* this field and the channelMode field, the channelMode field
|
||||
* overrides.
|
||||
* @sample_rate: Audio sample rate of input data
|
||||
* @bit_rate: Bitrate of encoded data. May be ignored by decoders
|
||||
* @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
|
||||
* Encoders may rely on profiles for quality levels.
|
||||
* May be ignored by decoders.
|
||||
* @profile: Mandatory for encoders, can be mandatory for specific
|
||||
* decoders as well. See SND_AUDIOPROFILE defines.
|
||||
* @level: Supported level (Only used by WMA at the moment)
|
||||
* @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
|
||||
* @format: Format of encoded bistream. Mandatory when defined.
|
||||
* See SND_AUDIOSTREAMFORMAT defines.
|
||||
* @align: Block alignment in bytes of an audio sample.
|
||||
* Only required for PCM or IEC formats.
|
||||
* @options: encoder-specific settings
|
||||
* @reserved: reserved for future use
|
||||
*/
|
||||
|
||||
struct snd_codec {
|
||||
__u32 id;
|
||||
__u32 ch_in;
|
||||
__u32 ch_out;
|
||||
__u32 sample_rate;
|
||||
__u32 bit_rate;
|
||||
__u32 rate_control;
|
||||
__u32 profile;
|
||||
__u32 level;
|
||||
__u32 ch_mode;
|
||||
__u32 format;
|
||||
__u32 align;
|
||||
union snd_codec_options options;
|
||||
__u32 reserved[3];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -227,4 +227,12 @@ snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
|
|||
return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper functions for jack-detection controls
|
||||
*/
|
||||
struct snd_kcontrol *
|
||||
snd_kctl_jack_new(const char *name, int idx, void *private_data);
|
||||
void snd_kctl_jack_report(struct snd_card *card,
|
||||
struct snd_kcontrol *kctl, bool status);
|
||||
|
||||
#endif /* __SOUND_CONTROL_H */
|
||||
|
|
|
@ -62,6 +62,7 @@ typedef int __bitwise snd_device_type_t;
|
|||
#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
|
||||
#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
|
||||
#define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009)
|
||||
#define SNDRV_DEV_COMPRESS ((__force snd_device_type_t) 0x100A)
|
||||
#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
|
||||
|
||||
typedef int __bitwise snd_device_state_t;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */
|
||||
|
||||
#ifndef CONFIG_SND_DYNAMIC_MINORS
|
||||
/* 2 - 3 (reserved) */
|
||||
#define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */
|
||||
#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */
|
||||
#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */
|
||||
#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */
|
||||
|
@ -49,6 +49,7 @@
|
|||
#define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE
|
||||
#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER
|
||||
#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER
|
||||
#define SNDRV_DEVICE_TYPE_COMPRESS SNDRV_MINOR_COMPRESS
|
||||
|
||||
#else /* CONFIG_SND_DYNAMIC_MINORS */
|
||||
|
||||
|
@ -60,6 +61,7 @@ enum {
|
|||
SNDRV_DEVICE_TYPE_RAWMIDI,
|
||||
SNDRV_DEVICE_TYPE_PCM_PLAYBACK,
|
||||
SNDRV_DEVICE_TYPE_PCM_CAPTURE,
|
||||
SNDRV_DEVICE_TYPE_COMPRESS,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_SND_DYNAMIC_MINORS */
|
||||
|
|
|
@ -78,4 +78,16 @@ struct sh_fsi_platform_info {
|
|||
int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
|
||||
};
|
||||
|
||||
/*
|
||||
* for fsi-ak4642
|
||||
*/
|
||||
struct fsi_ak4642_info {
|
||||
const char *name;
|
||||
const char *card;
|
||||
const char *cpu_dai;
|
||||
const char *codec;
|
||||
const char *platform;
|
||||
int id;
|
||||
};
|
||||
|
||||
#endif /* __SOUND_FSI_H */
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
.num_kcontrols = 0}
|
||||
|
||||
/* platform domain */
|
||||
#define SND_SOC_DAPM_SIGGEN(wname) \
|
||||
{ .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \
|
||||
.num_kcontrols = 0, .reg = SND_SOC_NOPM }
|
||||
#define SND_SOC_DAPM_INPUT(wname) \
|
||||
{ .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
|
||||
.num_kcontrols = 0, .reg = SND_SOC_NOPM }
|
||||
|
@ -380,6 +383,7 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
|
|||
const char *pin);
|
||||
int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
|
||||
const char *pin);
|
||||
void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
|
||||
|
||||
/* Mostly internal - should not normally be used */
|
||||
void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
|
||||
|
@ -409,6 +413,7 @@ enum snd_soc_dapm_type {
|
|||
snd_soc_dapm_supply, /* power/clock supply */
|
||||
snd_soc_dapm_aif_in, /* audio interface input */
|
||||
snd_soc_dapm_aif_out, /* audio interface output */
|
||||
snd_soc_dapm_siggen, /* signal generator */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -231,6 +231,7 @@ enum snd_soc_bias_level {
|
|||
SND_SOC_BIAS_ON = 3,
|
||||
};
|
||||
|
||||
struct device_node;
|
||||
struct snd_jack;
|
||||
struct snd_soc_card;
|
||||
struct snd_soc_pcm_stream;
|
||||
|
@ -266,8 +267,6 @@ enum snd_soc_control_type {
|
|||
|
||||
enum snd_soc_compress_type {
|
||||
SND_SOC_FLAT_COMPRESSION = 1,
|
||||
SND_SOC_LZO_COMPRESSION,
|
||||
SND_SOC_RBTREE_COMPRESSION
|
||||
};
|
||||
|
||||
enum snd_soc_pcm_subclass {
|
||||
|
@ -318,6 +317,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
|
|||
unsigned int reg);
|
||||
int snd_soc_platform_write(struct snd_soc_platform *platform,
|
||||
unsigned int reg, unsigned int val);
|
||||
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
|
||||
|
||||
/* Utility functions to get clock rates from various things */
|
||||
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
|
||||
|
@ -593,8 +593,7 @@ struct snd_soc_codec_driver {
|
|||
/* driver ops */
|
||||
int (*probe)(struct snd_soc_codec *);
|
||||
int (*remove)(struct snd_soc_codec *);
|
||||
int (*suspend)(struct snd_soc_codec *,
|
||||
pm_message_t state);
|
||||
int (*suspend)(struct snd_soc_codec *);
|
||||
int (*resume)(struct snd_soc_codec *);
|
||||
|
||||
/* Default control and setup, added after probe() is run */
|
||||
|
@ -706,8 +705,11 @@ struct snd_soc_dai_link {
|
|||
const char *name; /* Codec name */
|
||||
const char *stream_name; /* Stream name */
|
||||
const char *codec_name; /* for multi-codec */
|
||||
const struct device_node *codec_of_node;
|
||||
const char *platform_name; /* for multi-platform */
|
||||
const struct device_node *platform_of_node;
|
||||
const char *cpu_dai_name;
|
||||
const struct device_node *cpu_dai_of_node;
|
||||
const char *codec_dai_name;
|
||||
|
||||
unsigned int dai_fmt; /* format to set on init */
|
||||
|
@ -718,6 +720,9 @@ struct snd_soc_dai_link {
|
|||
/* Symmetry requirements */
|
||||
unsigned int symmetric_rates:1;
|
||||
|
||||
/* pmdown_time is ignored at stop */
|
||||
unsigned int ignore_pmdown_time:1;
|
||||
|
||||
/* codec/machine specific init - e.g. add machine controls */
|
||||
int (*init)(struct snd_soc_pcm_runtime *rtd);
|
||||
|
||||
|
@ -813,6 +818,7 @@ struct snd_soc_card {
|
|||
int num_dapm_widgets;
|
||||
const struct snd_soc_dapm_route *dapm_routes;
|
||||
int num_dapm_routes;
|
||||
bool fully_routed;
|
||||
|
||||
struct work_struct deferred_resume_work;
|
||||
|
||||
|
@ -840,8 +846,8 @@ struct snd_soc_card {
|
|||
};
|
||||
|
||||
/* SoC machine DAI configuration, glues a codec and cpu DAI together */
|
||||
struct snd_soc_pcm_runtime {
|
||||
struct device dev;
|
||||
struct snd_soc_pcm_runtime {
|
||||
struct device *dev;
|
||||
struct snd_soc_card *card;
|
||||
struct snd_soc_dai_link *dai_link;
|
||||
struct mutex pcm_mutex;
|
||||
|
@ -927,12 +933,12 @@ static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platfo
|
|||
static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd,
|
||||
void *data)
|
||||
{
|
||||
dev_set_drvdata(&rtd->dev, data);
|
||||
dev_set_drvdata(rtd->dev, data);
|
||||
}
|
||||
|
||||
static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return dev_get_drvdata(&rtd->dev);
|
||||
return dev_get_drvdata(rtd->dev);
|
||||
}
|
||||
|
||||
static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
|
||||
|
@ -960,6 +966,11 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
|
|||
int snd_soc_util_init(void);
|
||||
void snd_soc_util_exit(void);
|
||||
|
||||
int snd_soc_of_parse_card_name(struct snd_soc_card *card,
|
||||
const char *propname);
|
||||
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
||||
const char *propname);
|
||||
|
||||
#include <sound/soc-dai.h>
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
|
35
include/sound/sta32x.h
Normal file
35
include/sound/sta32x.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Platform data for ST STA32x ASoC codec driver.
|
||||
*
|
||||
* Copyright: 2011 Raumfeld GmbH
|
||||
* Author: Johannes Stezenbach <js@sig21.net>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#ifndef __LINUX_SND__STA32X_H
|
||||
#define __LINUX_SND__STA32X_H
|
||||
|
||||
#define STA32X_OCFG_2CH 0
|
||||
#define STA32X_OCFG_2_1CH 1
|
||||
#define STA32X_OCFG_1CH 3
|
||||
|
||||
#define STA32X_OM_CH1 0
|
||||
#define STA32X_OM_CH2 1
|
||||
#define STA32X_OM_CH3 2
|
||||
|
||||
#define STA32X_THERMAL_ADJUSTMENT_ENABLE 1
|
||||
#define STA32X_THERMAL_RECOVERY_ENABLE 2
|
||||
|
||||
struct sta32x_platform_data {
|
||||
int output_conf;
|
||||
int ch1_output_mapping;
|
||||
int ch2_output_mapping;
|
||||
int ch3_output_mapping;
|
||||
int thermal_conf;
|
||||
int needs_esd_watchdog;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_SND__STA32X_H */
|
|
@ -11,8 +11,11 @@
|
|||
#ifndef __LINUX_SND_WM8903_H
|
||||
#define __LINUX_SND_WM8903_H
|
||||
|
||||
/* Used to enable configuration of a GPIO to all zeros */
|
||||
#define WM8903_GPIO_NO_CONFIG 0x8000
|
||||
/*
|
||||
* Used to enable configuration of a GPIO to all zeros; a gpio_cfg value of
|
||||
* zero in platform data means "don't touch this pin".
|
||||
*/
|
||||
#define WM8903_GPIO_CONFIG_ZERO 0x8000
|
||||
|
||||
/*
|
||||
* R6 (0x06) - Mic Bias Control 0
|
||||
|
|
|
@ -251,18 +251,7 @@ static struct platform_driver pxa2xx_ac97_driver = {
|
|||
},
|
||||
};
|
||||
|
||||
static int __init pxa2xx_ac97_init(void)
|
||||
{
|
||||
return platform_driver_register(&pxa2xx_ac97_driver);
|
||||
}
|
||||
|
||||
static void __exit pxa2xx_ac97_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&pxa2xx_ac97_driver);
|
||||
}
|
||||
|
||||
module_init(pxa2xx_ac97_init);
|
||||
module_exit(pxa2xx_ac97_exit);
|
||||
module_platform_driver(pxa2xx_ac97_driver);
|
||||
|
||||
MODULE_AUTHOR("Nicolas Pitre");
|
||||
MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip");
|
||||
|
|
|
@ -154,6 +154,16 @@ config SND_DYNAMIC_MINORS
|
|||
|
||||
If you are unsure about this, say N here.
|
||||
|
||||
config SND_COMPRESS_OFFLOAD
|
||||
tristate "ALSA Compressed audio offload support"
|
||||
default n
|
||||
help
|
||||
If you want support for offloading compressed audio and have such
|
||||
a hardware, then you should say Y here and also to the DSP driver
|
||||
of your platform.
|
||||
|
||||
If you are unsure about this, say N here.
|
||||
|
||||
config SND_SUPPORT_OLD_API
|
||||
bool "Support old ALSA API"
|
||||
default y
|
||||
|
@ -206,6 +216,9 @@ config SND_PCM_XRUN_DEBUG
|
|||
config SND_VMASTER
|
||||
bool
|
||||
|
||||
config SND_KCTL_JACK
|
||||
bool
|
||||
|
||||
config SND_DMA_SGBUF
|
||||
def_bool y
|
||||
depends on X86
|
||||
|
|
|
@ -7,6 +7,7 @@ snd-y := sound.o init.o memory.o info.o control.o misc.o device.o
|
|||
snd-$(CONFIG_ISA_DMA_API) += isadma.o
|
||||
snd-$(CONFIG_SND_OSSEMUL) += sound_oss.o info_oss.o
|
||||
snd-$(CONFIG_SND_VMASTER) += vmaster.o
|
||||
snd-$(CONFIG_SND_KCTL_JACK) += ctljack.o
|
||||
snd-$(CONFIG_SND_JACK) += jack.o
|
||||
|
||||
snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
|
||||
|
@ -21,6 +22,8 @@ snd-hrtimer-objs := hrtimer.o
|
|||
snd-rtctimer-objs := rtctimer.o
|
||||
snd-hwdep-objs := hwdep.o
|
||||
|
||||
snd-compress-objs := compress_offload.o
|
||||
|
||||
obj-$(CONFIG_SND) += snd.o
|
||||
obj-$(CONFIG_SND_HWDEP) += snd-hwdep.o
|
||||
obj-$(CONFIG_SND_TIMER) += snd-timer.o
|
||||
|
@ -31,3 +34,5 @@ obj-$(CONFIG_SND_RAWMIDI) += snd-rawmidi.o
|
|||
|
||||
obj-$(CONFIG_SND_OSSEMUL) += oss/
|
||||
obj-$(CONFIG_SND_SEQUENCER) += seq/
|
||||
|
||||
obj-$(CONFIG_SND_COMPRESS_OFFLOAD) += snd-compress.o
|
||||
|
|
765
sound/core/compress_offload.c
Normal file
765
sound/core/compress_offload.c
Normal file
|
@ -0,0 +1,765 @@
|
|||
/*
|
||||
* compress_core.c - compress offload core
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Vinod Koul <vinod.koul@linux.intel.com>
|
||||
* Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
*/
|
||||
#define FORMAT(fmt) "%s: %d: " fmt, __func__, __LINE__
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " FORMAT(fmt)
|
||||
|
||||
#include <linux/file.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/uio.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/module.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/initval.h>
|
||||
#include <sound/compress_params.h>
|
||||
#include <sound/compress_offload.h>
|
||||
#include <sound/compress_driver.h>
|
||||
|
||||
/* TODO:
|
||||
* - add substream support for multiple devices in case of
|
||||
* SND_DYNAMIC_MINORS is not used
|
||||
* - Multiple node representation
|
||||
* driver should be able to register multiple nodes
|
||||
*/
|
||||
|
||||
static DEFINE_MUTEX(device_mutex);
|
||||
|
||||
struct snd_compr_file {
|
||||
unsigned long caps;
|
||||
struct snd_compr_stream stream;
|
||||
};
|
||||
|
||||
/*
|
||||
* a note on stream states used:
|
||||
* we use follwing states in the compressed core
|
||||
* SNDRV_PCM_STATE_OPEN: When stream has been opened.
|
||||
* SNDRV_PCM_STATE_SETUP: When stream has been initialized. This is done by
|
||||
* calling SNDRV_COMPRESS_SET_PARAMS. running streams will come to this
|
||||
* state at stop by calling SNDRV_COMPRESS_STOP, or at end of drain.
|
||||
* SNDRV_PCM_STATE_RUNNING: When stream has been started and is
|
||||
* decoding/encoding and rendering/capturing data.
|
||||
* SNDRV_PCM_STATE_DRAINING: When stream is draining current data. This is done
|
||||
* by calling SNDRV_COMPRESS_DRAIN.
|
||||
* SNDRV_PCM_STATE_PAUSED: When stream is paused. This is done by calling
|
||||
* SNDRV_COMPRESS_PAUSE. It can be stopped or resumed by calling
|
||||
* SNDRV_COMPRESS_STOP or SNDRV_COMPRESS_RESUME respectively.
|
||||
*/
|
||||
static int snd_compr_open(struct inode *inode, struct file *f)
|
||||
{
|
||||
struct snd_compr *compr;
|
||||
struct snd_compr_file *data;
|
||||
struct snd_compr_runtime *runtime;
|
||||
enum snd_compr_direction dirn;
|
||||
int maj = imajor(inode);
|
||||
int ret;
|
||||
|
||||
if (f->f_flags & O_WRONLY)
|
||||
dirn = SND_COMPRESS_PLAYBACK;
|
||||
else if (f->f_flags & O_RDONLY)
|
||||
dirn = SND_COMPRESS_CAPTURE;
|
||||
else {
|
||||
pr_err("invalid direction\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (maj == snd_major)
|
||||
compr = snd_lookup_minor_data(iminor(inode),
|
||||
SNDRV_DEVICE_TYPE_COMPRESS);
|
||||
else
|
||||
return -EBADFD;
|
||||
|
||||
if (compr == NULL) {
|
||||
pr_err("no device data!!!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (dirn != compr->direction) {
|
||||
pr_err("this device doesn't support this direction\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
data->stream.ops = compr->ops;
|
||||
data->stream.direction = dirn;
|
||||
data->stream.private_data = compr->private_data;
|
||||
data->stream.device = compr;
|
||||
runtime = kzalloc(sizeof(*runtime), GFP_KERNEL);
|
||||
if (!runtime) {
|
||||
kfree(data);
|
||||
return -ENOMEM;
|
||||
}
|
||||
runtime->state = SNDRV_PCM_STATE_OPEN;
|
||||
init_waitqueue_head(&runtime->sleep);
|
||||
data->stream.runtime = runtime;
|
||||
f->private_data = (void *)data;
|
||||
mutex_lock(&compr->lock);
|
||||
ret = compr->ops->open(&data->stream);
|
||||
mutex_unlock(&compr->lock);
|
||||
if (ret) {
|
||||
kfree(runtime);
|
||||
kfree(data);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int snd_compr_free(struct inode *inode, struct file *f)
|
||||
{
|
||||
struct snd_compr_file *data = f->private_data;
|
||||
data->stream.ops->free(&data->stream);
|
||||
kfree(data->stream.runtime->buffer);
|
||||
kfree(data->stream.runtime);
|
||||
kfree(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void snd_compr_update_tstamp(struct snd_compr_stream *stream,
|
||||
struct snd_compr_tstamp *tstamp)
|
||||
{
|
||||
if (!stream->ops->pointer)
|
||||
return;
|
||||
stream->ops->pointer(stream, tstamp);
|
||||
pr_debug("dsp consumed till %d total %d bytes\n",
|
||||
tstamp->byte_offset, tstamp->copied_total);
|
||||
stream->runtime->hw_pointer = tstamp->byte_offset;
|
||||
stream->runtime->total_bytes_transferred = tstamp->copied_total;
|
||||
}
|
||||
|
||||
static size_t snd_compr_calc_avail(struct snd_compr_stream *stream,
|
||||
struct snd_compr_avail *avail)
|
||||
{
|
||||
long avail_calc; /*this needs to be signed variable */
|
||||
|
||||
snd_compr_update_tstamp(stream, &avail->tstamp);
|
||||
|
||||
/* FIXME: This needs to be different for capture stream,
|
||||
available is # of compressed data, for playback it's
|
||||
remainder of buffer */
|
||||
|
||||
if (stream->runtime->total_bytes_available == 0 &&
|
||||
stream->runtime->state == SNDRV_PCM_STATE_SETUP) {
|
||||
pr_debug("detected init and someone forgot to do a write\n");
|
||||
return stream->runtime->buffer_size;
|
||||
}
|
||||
pr_debug("app wrote %lld, DSP consumed %lld\n",
|
||||
stream->runtime->total_bytes_available,
|
||||
stream->runtime->total_bytes_transferred);
|
||||
if (stream->runtime->total_bytes_available ==
|
||||
stream->runtime->total_bytes_transferred) {
|
||||
pr_debug("both pointers are same, returning full avail\n");
|
||||
return stream->runtime->buffer_size;
|
||||
}
|
||||
|
||||
/* FIXME: this routine isn't consistent, in one test we use
|
||||
* cumulative values and in the other byte offsets. Do we
|
||||
* really need the byte offsets if the cumulative values have
|
||||
* been updated? In the PCM interface app_ptr and hw_ptr are
|
||||
* already cumulative */
|
||||
|
||||
avail_calc = stream->runtime->buffer_size -
|
||||
(stream->runtime->app_pointer - stream->runtime->hw_pointer);
|
||||
pr_debug("calc avail as %ld, app_ptr %lld, hw+ptr %lld\n", avail_calc,
|
||||
stream->runtime->app_pointer,
|
||||
stream->runtime->hw_pointer);
|
||||
if (avail_calc >= stream->runtime->buffer_size)
|
||||
avail_calc -= stream->runtime->buffer_size;
|
||||
pr_debug("ret avail as %ld\n", avail_calc);
|
||||
avail->avail = avail_calc;
|
||||
return avail_calc;
|
||||
}
|
||||
|
||||
static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream)
|
||||
{
|
||||
struct snd_compr_avail avail;
|
||||
|
||||
return snd_compr_calc_avail(stream, &avail);
|
||||
}
|
||||
|
||||
static int
|
||||
snd_compr_ioctl_avail(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
struct snd_compr_avail ioctl_avail;
|
||||
size_t avail;
|
||||
|
||||
avail = snd_compr_calc_avail(stream, &ioctl_avail);
|
||||
ioctl_avail.avail = avail;
|
||||
|
||||
if (copy_to_user((__u64 __user *)arg,
|
||||
&ioctl_avail, sizeof(ioctl_avail)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_compr_write_data(struct snd_compr_stream *stream,
|
||||
const char __user *buf, size_t count)
|
||||
{
|
||||
void *dstn;
|
||||
size_t copy;
|
||||
struct snd_compr_runtime *runtime = stream->runtime;
|
||||
|
||||
dstn = runtime->buffer + runtime->app_pointer;
|
||||
pr_debug("copying %ld at %lld\n",
|
||||
(unsigned long)count, runtime->app_pointer);
|
||||
if (count < runtime->buffer_size - runtime->app_pointer) {
|
||||
if (copy_from_user(dstn, buf, count))
|
||||
return -EFAULT;
|
||||
runtime->app_pointer += count;
|
||||
} else {
|
||||
copy = runtime->buffer_size - runtime->app_pointer;
|
||||
if (copy_from_user(dstn, buf, copy))
|
||||
return -EFAULT;
|
||||
if (copy_from_user(runtime->buffer, buf + copy, count - copy))
|
||||
return -EFAULT;
|
||||
runtime->app_pointer = count - copy;
|
||||
}
|
||||
/* if DSP cares, let it know data has been written */
|
||||
if (stream->ops->ack)
|
||||
stream->ops->ack(stream, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t snd_compr_write(struct file *f, const char __user *buf,
|
||||
size_t count, loff_t *offset)
|
||||
{
|
||||
struct snd_compr_file *data = f->private_data;
|
||||
struct snd_compr_stream *stream;
|
||||
size_t avail;
|
||||
int retval;
|
||||
|
||||
if (snd_BUG_ON(!data))
|
||||
return -EFAULT;
|
||||
|
||||
stream = &data->stream;
|
||||
mutex_lock(&stream->device->lock);
|
||||
/* write is allowed when stream is running or has been steup */
|
||||
if (stream->runtime->state != SNDRV_PCM_STATE_SETUP &&
|
||||
stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return -EBADFD;
|
||||
}
|
||||
|
||||
avail = snd_compr_get_avail(stream);
|
||||
pr_debug("avail returned %ld\n", (unsigned long)avail);
|
||||
/* calculate how much we can write to buffer */
|
||||
if (avail > count)
|
||||
avail = count;
|
||||
|
||||
if (stream->ops->copy)
|
||||
retval = stream->ops->copy(stream, buf, avail);
|
||||
else
|
||||
retval = snd_compr_write_data(stream, buf, avail);
|
||||
if (retval > 0)
|
||||
stream->runtime->total_bytes_available += retval;
|
||||
|
||||
/* while initiating the stream, write should be called before START
|
||||
* call, so in setup move state */
|
||||
if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) {
|
||||
stream->runtime->state = SNDRV_PCM_STATE_PREPARED;
|
||||
pr_debug("stream prepared, Houston we are good to go\n");
|
||||
}
|
||||
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t snd_compr_read(struct file *f, char __user *buf,
|
||||
size_t count, loff_t *offset)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static inline int snd_compr_get_poll(struct snd_compr_stream *stream)
|
||||
{
|
||||
if (stream->direction == SND_COMPRESS_PLAYBACK)
|
||||
return POLLOUT | POLLWRNORM;
|
||||
else
|
||||
return POLLIN | POLLRDNORM;
|
||||
}
|
||||
|
||||
static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
|
||||
{
|
||||
struct snd_compr_file *data = f->private_data;
|
||||
struct snd_compr_stream *stream;
|
||||
size_t avail;
|
||||
int retval = 0;
|
||||
|
||||
if (snd_BUG_ON(!data))
|
||||
return -EFAULT;
|
||||
stream = &data->stream;
|
||||
if (snd_BUG_ON(!stream))
|
||||
return -EFAULT;
|
||||
|
||||
mutex_lock(&stream->device->lock);
|
||||
if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED ||
|
||||
stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
|
||||
retval = -EBADFD;
|
||||
goto out;
|
||||
}
|
||||
poll_wait(f, &stream->runtime->sleep, wait);
|
||||
|
||||
avail = snd_compr_get_avail(stream);
|
||||
pr_debug("avail is %ld\n", (unsigned long)avail);
|
||||
/* check if we have at least one fragment to fill */
|
||||
switch (stream->runtime->state) {
|
||||
case SNDRV_PCM_STATE_DRAINING:
|
||||
/* stream has been woken up after drain is complete
|
||||
* draining done so set stream state to stopped
|
||||
*/
|
||||
retval = snd_compr_get_poll(stream);
|
||||
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
|
||||
break;
|
||||
case SNDRV_PCM_STATE_RUNNING:
|
||||
case SNDRV_PCM_STATE_PREPARED:
|
||||
case SNDRV_PCM_STATE_PAUSED:
|
||||
if (avail >= stream->runtime->fragment_size)
|
||||
retval = snd_compr_get_poll(stream);
|
||||
break;
|
||||
default:
|
||||
if (stream->direction == SND_COMPRESS_PLAYBACK)
|
||||
retval = POLLOUT | POLLWRNORM | POLLERR;
|
||||
else
|
||||
retval = POLLIN | POLLRDNORM | POLLERR;
|
||||
break;
|
||||
}
|
||||
out:
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
int retval;
|
||||
struct snd_compr_caps caps;
|
||||
|
||||
if (!stream->ops->get_caps)
|
||||
return -ENXIO;
|
||||
|
||||
retval = stream->ops->get_caps(stream, &caps);
|
||||
if (retval)
|
||||
goto out;
|
||||
if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))
|
||||
retval = -EFAULT;
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
int retval;
|
||||
struct snd_compr_codec_caps *caps;
|
||||
|
||||
if (!stream->ops->get_codec_caps)
|
||||
return -ENXIO;
|
||||
|
||||
caps = kmalloc(sizeof(*caps), GFP_KERNEL);
|
||||
if (!caps)
|
||||
return -ENOMEM;
|
||||
|
||||
retval = stream->ops->get_codec_caps(stream, caps);
|
||||
if (retval)
|
||||
goto out;
|
||||
if (copy_to_user((void __user *)arg, caps, sizeof(*caps)))
|
||||
retval = -EFAULT;
|
||||
|
||||
out:
|
||||
kfree(caps);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* revisit this with snd_pcm_preallocate_xxx */
|
||||
static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
|
||||
struct snd_compr_params *params)
|
||||
{
|
||||
unsigned int buffer_size;
|
||||
void *buffer;
|
||||
|
||||
buffer_size = params->buffer.fragment_size * params->buffer.fragments;
|
||||
if (stream->ops->copy) {
|
||||
buffer = NULL;
|
||||
/* if copy is defined the driver will be required to copy
|
||||
* the data from core
|
||||
*/
|
||||
} else {
|
||||
buffer = kmalloc(buffer_size, GFP_KERNEL);
|
||||
if (!buffer)
|
||||
return -ENOMEM;
|
||||
}
|
||||
stream->runtime->fragment_size = params->buffer.fragment_size;
|
||||
stream->runtime->fragments = params->buffer.fragments;
|
||||
stream->runtime->buffer = buffer;
|
||||
stream->runtime->buffer_size = buffer_size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
struct snd_compr_params *params;
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
|
||||
/*
|
||||
* we should allow parameter change only when stream has been
|
||||
* opened not in other cases
|
||||
*/
|
||||
params = kmalloc(sizeof(*params), GFP_KERNEL);
|
||||
if (!params)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(params, (void __user *)arg, sizeof(*params)))
|
||||
return -EFAULT;
|
||||
retval = snd_compr_allocate_buffer(stream, params);
|
||||
if (retval) {
|
||||
kfree(params);
|
||||
return -ENOMEM;
|
||||
}
|
||||
retval = stream->ops->set_params(stream, params);
|
||||
if (retval)
|
||||
goto out;
|
||||
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
|
||||
} else
|
||||
return -EPERM;
|
||||
out:
|
||||
kfree(params);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
struct snd_codec *params;
|
||||
int retval;
|
||||
|
||||
if (!stream->ops->get_params)
|
||||
return -EBADFD;
|
||||
|
||||
params = kmalloc(sizeof(*params), GFP_KERNEL);
|
||||
if (!params)
|
||||
return -ENOMEM;
|
||||
retval = stream->ops->get_params(stream, params);
|
||||
if (retval)
|
||||
goto out;
|
||||
if (copy_to_user((char __user *)arg, params, sizeof(*params)))
|
||||
retval = -EFAULT;
|
||||
|
||||
out:
|
||||
kfree(params);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline int
|
||||
snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg)
|
||||
{
|
||||
struct snd_compr_tstamp tstamp;
|
||||
|
||||
snd_compr_update_tstamp(stream, &tstamp);
|
||||
return copy_to_user((struct snd_compr_tstamp __user *)arg,
|
||||
&tstamp, sizeof(tstamp)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int snd_compr_pause(struct snd_compr_stream *stream)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING)
|
||||
return -EPERM;
|
||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
|
||||
if (!retval) {
|
||||
stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
|
||||
wake_up(&stream->runtime->sleep);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int snd_compr_resume(struct snd_compr_stream *stream)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED)
|
||||
return -EPERM;
|
||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
|
||||
if (!retval)
|
||||
stream->runtime->state = SNDRV_PCM_STATE_RUNNING;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int snd_compr_start(struct snd_compr_stream *stream)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED)
|
||||
return -EPERM;
|
||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_START);
|
||||
if (!retval)
|
||||
stream->runtime->state = SNDRV_PCM_STATE_RUNNING;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int snd_compr_stop(struct snd_compr_stream *stream)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED ||
|
||||
stream->runtime->state == SNDRV_PCM_STATE_SETUP)
|
||||
return -EPERM;
|
||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP);
|
||||
if (!retval) {
|
||||
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
|
||||
wake_up(&stream->runtime->sleep);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int snd_compr_drain(struct snd_compr_stream *stream)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED ||
|
||||
stream->runtime->state == SNDRV_PCM_STATE_SETUP)
|
||||
return -EPERM;
|
||||
retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN);
|
||||
if (!retval) {
|
||||
stream->runtime->state = SNDRV_PCM_STATE_DRAINING;
|
||||
wake_up(&stream->runtime->sleep);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct snd_compr_file *data = f->private_data;
|
||||
struct snd_compr_stream *stream;
|
||||
int retval = -ENOTTY;
|
||||
|
||||
if (snd_BUG_ON(!data))
|
||||
return -EFAULT;
|
||||
stream = &data->stream;
|
||||
if (snd_BUG_ON(!stream))
|
||||
return -EFAULT;
|
||||
mutex_lock(&stream->device->lock);
|
||||
switch (_IOC_NR(cmd)) {
|
||||
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
|
||||
put_user(SNDRV_COMPRESS_VERSION,
|
||||
(int __user *)arg) ? -EFAULT : 0;
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
|
||||
retval = snd_compr_get_caps(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
|
||||
retval = snd_compr_get_codec_caps(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
|
||||
retval = snd_compr_set_params(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS):
|
||||
retval = snd_compr_get_params(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
|
||||
retval = snd_compr_tstamp(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
|
||||
retval = snd_compr_ioctl_avail(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_PAUSE):
|
||||
retval = snd_compr_pause(stream);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_RESUME):
|
||||
retval = snd_compr_resume(stream);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_START):
|
||||
retval = snd_compr_start(stream);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_STOP):
|
||||
retval = snd_compr_stop(stream);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
|
||||
retval = snd_compr_drain(stream);
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static const struct file_operations snd_compr_file_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = snd_compr_open,
|
||||
.release = snd_compr_free,
|
||||
.write = snd_compr_write,
|
||||
.read = snd_compr_read,
|
||||
.unlocked_ioctl = snd_compr_ioctl,
|
||||
.mmap = snd_compr_mmap,
|
||||
.poll = snd_compr_poll,
|
||||
};
|
||||
|
||||
static int snd_compress_dev_register(struct snd_device *device)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
char str[16];
|
||||
struct snd_compr *compr;
|
||||
|
||||
if (snd_BUG_ON(!device || !device->device_data))
|
||||
return -EBADFD;
|
||||
compr = device->device_data;
|
||||
|
||||
sprintf(str, "comprC%iD%i", compr->card->number, compr->device);
|
||||
pr_debug("reg %s for device %s, direction %d\n", str, compr->name,
|
||||
compr->direction);
|
||||
/* register compressed device */
|
||||
ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card,
|
||||
compr->device, &snd_compr_file_ops, compr, str);
|
||||
if (ret < 0) {
|
||||
pr_err("snd_register_device failed\n %d", ret);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int snd_compress_dev_disconnect(struct snd_device *device)
|
||||
{
|
||||
struct snd_compr *compr;
|
||||
|
||||
compr = device->device_data;
|
||||
snd_unregister_device(compr->direction, compr->card, compr->device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* snd_compress_new: create new compress device
|
||||
* @card: sound card pointer
|
||||
* @device: device number
|
||||
* @dirn: device direction, should be of type enum snd_compr_direction
|
||||
* @compr: compress device pointer
|
||||
*/
|
||||
int snd_compress_new(struct snd_card *card, int device,
|
||||
int dirn, struct snd_compr *compr)
|
||||
{
|
||||
static struct snd_device_ops ops = {
|
||||
.dev_free = NULL,
|
||||
.dev_register = snd_compress_dev_register,
|
||||
.dev_disconnect = snd_compress_dev_disconnect,
|
||||
};
|
||||
|
||||
compr->card = card;
|
||||
compr->device = device;
|
||||
compr->direction = dirn;
|
||||
return snd_device_new(card, SNDRV_DEV_COMPRESS, compr, &ops);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_compress_new);
|
||||
|
||||
static int snd_compress_add_device(struct snd_compr *device)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!device->card)
|
||||
return -EINVAL;
|
||||
|
||||
/* register the card */
|
||||
ret = snd_card_register(device->card);
|
||||
if (ret)
|
||||
goto out;
|
||||
return 0;
|
||||
|
||||
out:
|
||||
pr_err("failed with %d\n", ret);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int snd_compress_remove_device(struct snd_compr *device)
|
||||
{
|
||||
return snd_card_free(device->card);
|
||||
}
|
||||
|
||||
/**
|
||||
* snd_compress_register - register compressed device
|
||||
*
|
||||
* @device: compressed device to register
|
||||
*/
|
||||
int snd_compress_register(struct snd_compr *device)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (device->name == NULL || device->dev == NULL || device->ops == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
pr_debug("Registering compressed device %s\n", device->name);
|
||||
if (snd_BUG_ON(!device->ops->open))
|
||||
return -EINVAL;
|
||||
if (snd_BUG_ON(!device->ops->free))
|
||||
return -EINVAL;
|
||||
if (snd_BUG_ON(!device->ops->set_params))
|
||||
return -EINVAL;
|
||||
if (snd_BUG_ON(!device->ops->trigger))
|
||||
return -EINVAL;
|
||||
|
||||
mutex_init(&device->lock);
|
||||
|
||||
/* register a compressed card */
|
||||
mutex_lock(&device_mutex);
|
||||
retval = snd_compress_add_device(device);
|
||||
mutex_unlock(&device_mutex);
|
||||
return retval;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_compress_register);
|
||||
|
||||
int snd_compress_deregister(struct snd_compr *device)
|
||||
{
|
||||
pr_debug("Removing compressed device %s\n", device->name);
|
||||
mutex_lock(&device_mutex);
|
||||
snd_compress_remove_device(device);
|
||||
mutex_unlock(&device_mutex);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_compress_deregister);
|
||||
|
||||
static int __init snd_compress_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit snd_compress_exit(void)
|
||||
{
|
||||
}
|
||||
|
||||
module_init(snd_compress_init);
|
||||
module_exit(snd_compress_exit);
|
||||
|
||||
MODULE_DESCRIPTION("ALSA Compressed offload framework");
|
||||
MODULE_AUTHOR("Vinod Koul <vinod.koul@linux.intel.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
56
sound/core/ctljack.c
Normal file
56
sound/core/ctljack.c
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Helper functions for jack-detection kcontrols
|
||||
*
|
||||
* Copyright (c) 2011 Takashi Iwai <tiwai@suse.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/export.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/control.h>
|
||||
|
||||
#define jack_detect_kctl_info snd_ctl_boolean_mono_info
|
||||
|
||||
static int jack_detect_kctl_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = kcontrol->private_value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct snd_kcontrol_new jack_detect_kctl = {
|
||||
/* name is filled later */
|
||||
.iface = SNDRV_CTL_ELEM_IFACE_CARD,
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READ,
|
||||
.info = jack_detect_kctl_info,
|
||||
.get = jack_detect_kctl_get,
|
||||
};
|
||||
|
||||
struct snd_kcontrol *
|
||||
snd_kctl_jack_new(const char *name, int idx, void *private_data)
|
||||
{
|
||||
struct snd_kcontrol *kctl;
|
||||
kctl = snd_ctl_new1(&jack_detect_kctl, private_data);
|
||||
if (!kctl)
|
||||
return NULL;
|
||||
snprintf(kctl->id.name, sizeof(kctl->id.name), "%s Jack", name);
|
||||
kctl->id.index = idx;
|
||||
kctl->private_value = 0;
|
||||
return kctl;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_kctl_jack_new);
|
||||
|
||||
void snd_kctl_jack_report(struct snd_card *card,
|
||||
struct snd_kcontrol *kctl, bool status)
|
||||
{
|
||||
if (kctl->private_value == status)
|
||||
return;
|
||||
kctl->private_value = status;
|
||||
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_kctl_jack_report);
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
static int dsp_map[SNDRV_CARDS];
|
||||
static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
|
||||
static int nonblock_open = 1;
|
||||
static bool nonblock_open = 1;
|
||||
|
||||
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>");
|
||||
MODULE_DESCRIPTION("PCM OSS emulation for ALSA.");
|
||||
|
|
|
@ -65,7 +65,7 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_ALIAS("snd-seq-client-" __stringify(SNDRV_SEQ_CLIENT_DUMMY));
|
||||
|
||||
static int ports = 1;
|
||||
static int duplex;
|
||||
static bool duplex;
|
||||
|
||||
module_param(ports, int, 0444);
|
||||
MODULE_PARM_DESC(ports, "number of ports to be created");
|
||||
|
|
|
@ -229,6 +229,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
|
|||
case SNDRV_DEVICE_TYPE_RAWMIDI:
|
||||
case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
|
||||
case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
|
||||
case SNDRV_DEVICE_TYPE_COMPRESS:
|
||||
if (snd_BUG_ON(!card))
|
||||
return -EINVAL;
|
||||
minor = SNDRV_MINOR(card->number, type + dev);
|
||||
|
|
|
@ -51,7 +51,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
|
||||
static int pcm_notify[SNDRV_CARDS];
|
||||
|
||||
|
|
|
@ -60,15 +60,15 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static char *model[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = NULL};
|
||||
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
|
||||
//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
|
||||
#ifdef CONFIG_HIGH_RES_TIMERS
|
||||
static int hrtimer = 1;
|
||||
static bool hrtimer = 1;
|
||||
#endif
|
||||
static int fake_buffer = 1;
|
||||
static bool fake_buffer = 1;
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
|
||||
|
|
|
@ -73,7 +73,7 @@ MODULE_SUPPORTED_DEVICE("{{Xilinx,ML403 AC97 Controller Reference}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for ML403 AC97 Controller Reference.");
|
||||
|
@ -1341,15 +1341,4 @@ static struct platform_driver snd_ml403_ac97cr_driver = {
|
|||
},
|
||||
};
|
||||
|
||||
static int __init alsa_card_ml403_ac97cr_init(void)
|
||||
{
|
||||
return platform_driver_register(&snd_ml403_ac97cr_driver);
|
||||
}
|
||||
|
||||
static void __exit alsa_card_ml403_ac97cr_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&snd_ml403_ac97cr_driver);
|
||||
}
|
||||
|
||||
module_init(alsa_card_ml403_ac97cr_init)
|
||||
module_exit(alsa_card_ml403_ac97cr_exit)
|
||||
module_platform_driver(snd_ml403_ac97cr_driver);
|
||||
|
|
|
@ -35,13 +35,13 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* exclude the first card */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */
|
||||
static int uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
|
||||
static struct platform_device *platform_devices[SNDRV_CARDS];
|
||||
static int device_count;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
|
||||
|
||||
extern int use_internal_drums;
|
||||
extern bool use_internal_drums;
|
||||
|
||||
static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
|
||||
struct snd_midi_channel *chan);
|
||||
|
|
|
@ -32,7 +32,7 @@ MODULE_AUTHOR("Uros Bizjak <uros@kss-loka.si>");
|
|||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth");
|
||||
|
||||
int use_internal_drums = 0;
|
||||
bool use_internal_drums = 0;
|
||||
module_param(use_internal_drums, bool, 0444);
|
||||
MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ MODULE_ALIAS("platform:pcspkr");
|
|||
|
||||
static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
|
||||
static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
|
||||
static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
|
||||
static int nopcm; /* Disable PCM capability of the driver */
|
||||
static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
|
||||
static bool nopcm; /* Disable PCM capability of the driver */
|
||||
|
||||
module_param(index, int, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for pcsp soundcard.");
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <asm/io.h>
|
||||
#include "pcsp.h"
|
||||
|
||||
static int nforce_wa;
|
||||
static bool nforce_wa;
|
||||
module_param(nforce_wa, bool, 0444);
|
||||
MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "
|
||||
"(expect bad sound)");
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
|
||||
static struct platform_device *platform_devices[SNDRV_CARDS];
|
||||
static int device_count;
|
||||
|
|
|
@ -69,7 +69,7 @@ static char *adaptor_names[] = {
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */
|
||||
static int speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */
|
||||
|
@ -77,7 +77,7 @@ static int base[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 115200}; /* baud bas
|
|||
static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
|
||||
static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */
|
||||
static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
|
||||
static int droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };
|
||||
static bool droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for Serial MIDI.");
|
||||
|
|
|
@ -63,7 +63,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
|
||||
static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
|
|
|
@ -44,7 +44,7 @@ MODULE_SUPPORTED_DEVICE("{{Highscreen,Sound-Boostar 16 3D},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
|
|
|
@ -43,11 +43,11 @@ MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
|
||||
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
|
||||
static int thinkpad[SNDRV_CARDS]; /* Thinkpad special case */
|
||||
static bool thinkpad[SNDRV_CARDS]; /* Thinkpad special case */
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
|
||||
|
|
|
@ -18,7 +18,7 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
|
|
|
@ -54,7 +54,7 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
|
|
|
@ -55,7 +55,7 @@ MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
|
|
|
@ -69,9 +69,9 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||
static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
|
||||
|
|
|
@ -41,7 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
|
||||
|
|
|
@ -74,9 +74,9 @@ MODULE_ALIAS("snd_cs4232");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
|
|
|
@ -51,9 +51,9 @@ MODULE_ALIAS("snd_es968");
|
|||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
#endif
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
|
||||
static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */
|
||||
static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
|
||||
|
|
|
@ -1964,9 +1964,9 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1868 PnP AudioDrive},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */
|
||||
#ifndef CONFIG_PNP
|
||||
|
|
|
@ -35,7 +35,7 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
|
||||
|
|
|
@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */
|
||||
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
|
||||
|
|
|
@ -46,7 +46,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
|
||||
static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */
|
||||
static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */
|
||||
|
|
|
@ -40,7 +40,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */
|
||||
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
|
||||
|
|
|
@ -55,9 +55,9 @@ MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */
|
||||
#ifdef SNDRV_STB
|
||||
|
|
|
@ -785,7 +785,7 @@ static int write_ndelay[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
|
|||
static int calibrate_signal;
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
module_param_array(isapnp, bool, NULL, 0444);
|
||||
MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
|
||||
#define has_isapnp(x) isapnp[x]
|
||||
|
|
|
@ -46,9 +46,9 @@ MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */
|
||||
static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
|
||||
|
|
|
@ -61,7 +61,7 @@ static int dma2 = SNDRV_DEFAULT_DMA1; /* 0,1,3 */
|
|||
static int wss;
|
||||
static int ide;
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp = 1; /* Enable ISA PnP detection */
|
||||
static bool isapnp = 1; /* Enable ISA PnP detection */
|
||||
#endif
|
||||
|
||||
module_param(index, int, 0444);
|
||||
|
|
|
@ -63,7 +63,7 @@ MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)},"
|
|||
|
||||
static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
|
||||
static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
|
||||
//static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
|
||||
//static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp = 1; /* Enable ISA PnP detection */
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||
static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
|
||||
|
|
|
@ -68,9 +68,9 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */
|
||||
static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */
|
||||
|
|
|
@ -36,7 +36,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
|
||||
static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */
|
||||
|
|
|
@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000},"
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */
|
||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */
|
||||
static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
|
||||
|
|
|
@ -38,9 +38,9 @@ MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}");
|
|||
|
||||
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
|
||||
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
|
||||
#ifdef CONFIG_PNP
|
||||
static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
|
||||
#endif
|
||||
static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
|
||||
|
@ -51,7 +51,7 @@ static int ics2115_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,9,11,12,15 */
|
|||
static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
|
||||
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
|
||||
static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
|
||||
static int use_cs4232_midi[SNDRV_CARDS];
|
||||
static bool use_cs4232_midi[SNDRV_CARDS];
|
||||
|
||||
module_param_array(index, int, NULL, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for WaveFront soundcard.");
|
||||
|
|
|
@ -935,15 +935,4 @@ static struct platform_driver hal2_driver = {
|
|||
}
|
||||
};
|
||||
|
||||
static int __init alsa_card_hal2_init(void)
|
||||
{
|
||||
return platform_driver_register(&hal2_driver);
|
||||
}
|
||||
|
||||
static void __exit alsa_card_hal2_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&hal2_driver);
|
||||
}
|
||||
|
||||
module_init(alsa_card_hal2_init);
|
||||
module_exit(alsa_card_hal2_exit);
|
||||
module_platform_driver(hal2_driver);
|
||||
|
|
|
@ -976,15 +976,4 @@ static struct platform_driver sgio2audio_driver = {
|
|||
}
|
||||
};
|
||||
|
||||
static int __init alsa_card_sgio2audio_init(void)
|
||||
{
|
||||
return platform_driver_register(&sgio2audio_driver);
|
||||
}
|
||||
|
||||
static void __exit alsa_card_sgio2audio_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&sgio2audio_driver);
|
||||
}
|
||||
|
||||
module_init(alsa_card_sgio2audio_init)
|
||||
module_exit(alsa_card_sgio2audio_exit)
|
||||
module_platform_driver(sgio2audio_driver);
|
||||
|
|
|
@ -119,9 +119,9 @@ ad1848_port_info;
|
|||
static struct address_info cfg;
|
||||
static int nr_ad1848_devs;
|
||||
|
||||
static int deskpro_xl;
|
||||
static int deskpro_m;
|
||||
static int soundpro;
|
||||
static bool deskpro_xl;
|
||||
static bool deskpro_m;
|
||||
static bool soundpro;
|
||||
|
||||
static volatile signed char irq2dev[17] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
||||
|
@ -177,7 +177,7 @@ static struct {
|
|||
#ifdef CONFIG_PNP
|
||||
static int isapnp = 1;
|
||||
static int isapnpjump;
|
||||
static int reverse;
|
||||
static bool reverse;
|
||||
|
||||
static int audio_activated;
|
||||
#else
|
||||
|
|
|
@ -1701,7 +1701,7 @@ static int joystick_io __initdata = CONFIG_MSNDPIN_JOYSTICK_IO;
|
|||
#ifndef CONFIG_MSNDPIN_DIGITAL
|
||||
# define CONFIG_MSNDPIN_DIGITAL 0
|
||||
#endif
|
||||
static int digital __initdata = CONFIG_MSNDPIN_DIGITAL;
|
||||
static bool digital __initdata = CONFIG_MSNDPIN_DIGITAL;
|
||||
|
||||
#endif /* MSND_CLASSIC */
|
||||
|
||||
|
|
|
@ -41,19 +41,19 @@ static int pas_irq;
|
|||
static int pas_sb_base;
|
||||
DEFINE_SPINLOCK(pas_lock);
|
||||
#ifndef CONFIG_PAS_JOYSTICK
|
||||
static int joystick;
|
||||
static bool joystick;
|
||||
#else
|
||||
static int joystick = 1;
|
||||
static bool joystick = 1;
|
||||
#endif
|
||||
#ifdef SYMPHONY_PAS
|
||||
static int symphony = 1;
|
||||
static bool symphony = 1;
|
||||
#else
|
||||
static int symphony;
|
||||
static bool symphony;
|
||||
#endif
|
||||
#ifdef BROKEN_BUS_CLOCK
|
||||
static int broken_bus_clock = 1;
|
||||
static bool broken_bus_clock = 1;
|
||||
#else
|
||||
static int broken_bus_clock;
|
||||
static bool broken_bus_clock;
|
||||
#endif
|
||||
|
||||
static struct address_info cfg;
|
||||
|
|
|
@ -117,9 +117,9 @@
|
|||
|
||||
/* If compiled into kernel, it enable or disable pss mixer */
|
||||
#ifdef CONFIG_PSS_MIXER
|
||||
static int pss_mixer = 1;
|
||||
static bool pss_mixer = 1;
|
||||
#else
|
||||
static int pss_mixer;
|
||||
static bool pss_mixer;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -147,7 +147,7 @@ static DEFINE_SPINLOCK(lock);
|
|||
static int pss_initialized;
|
||||
static int nonstandard_microcode;
|
||||
static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */
|
||||
static int pss_enable_joystick; /* Parameter for enabling the joystick */
|
||||
static bool pss_enable_joystick; /* Parameter for enabling the joystick */
|
||||
static coproc_operations pss_coproc_operations;
|
||||
|
||||
static void pss_write(pss_confdata *devc, int data)
|
||||
|
@ -1133,8 +1133,8 @@ static int mss_irq __initdata = -1;
|
|||
static int mss_dma __initdata = -1;
|
||||
static int mpu_io __initdata = -1;
|
||||
static int mpu_irq __initdata = -1;
|
||||
static int pss_no_sound = 0; /* Just configure non-sound components */
|
||||
static int pss_keep_settings = 1; /* Keep hardware settings at module exit */
|
||||
static bool pss_no_sound = 0; /* Just configure non-sound components */
|
||||
static bool pss_keep_settings = 1; /* Keep hardware settings at module exit */
|
||||
static char *pss_firmware = "/etc/sound/pss_synth";
|
||||
|
||||
module_param(pss_io, int, 0);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
static int mpu;
|
||||
|
||||
static int joystick;
|
||||
static bool joystick;
|
||||
|
||||
static unsigned char trix_read(int addr)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
|
|||
MODULE_DESCRIPTION("Universal interface for Audio Codec '97");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static int enable_loopback;
|
||||
static bool enable_loopback;
|
||||
|
||||
module_param(enable_loopback, bool, 0444);
|
||||
MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
|
||||
|
|
|
@ -66,7 +66,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
|
|||
module_param_array(id, charp, NULL, 0444);
|
||||
MODULE_PARM_DESC(id, "ID string for the AD1889 soundcard.");
|
||||
|
||||
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
|
||||
module_param_array(enable, bool, NULL, 0444);
|
||||
MODULE_PARM_DESC(enable, "Enable AD1889 soundcard.");
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}");
|
|||
static int index = SNDRV_DEFAULT_IDX1; /* Index */
|
||||
static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
|
||||
static int pcm_channels = 32;
|
||||
static int spdif;
|
||||
static bool spdif;
|
||||
|
||||
module_param(index, int, 0444);
|
||||
MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio.");
|
||||
|
@ -60,7 +60,7 @@ module_param(spdif, bool, 0444);
|
|||
MODULE_PARM_DESC(spdif, "Support SPDIF I/O");
|
||||
|
||||
/* just for backward compatibility */
|
||||
static int enable;
|
||||
static bool enable;
|
||||
module_param(enable, bool, 0444);
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue