···404404 /* SNDRV_CARDS: maximum number of cards supported by this module */405405 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;406406 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;407407- static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;407407+ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;408408409409 /* definition of the chip-specific record */410410 struct mychip {
+188
Documentation/sound/alsa/compress_offload.txt
···11+ compress_offload.txt22+ =====================33+ Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com>44+ Vinod Koul <vinod.koul@linux.intel.com>55+66+Overview77+88+Since its early days, the ALSA API was defined with PCM support or99+constant bitrates payloads such as IEC61937 in mind. Arguments and1010+returned values in frames are the norm, making it a challenge to1111+extend the existing API to compressed data streams.1212+1313+In recent years, audio digital signal processors (DSP) were integrated1414+in system-on-chip designs, and DSPs are also integrated in audio1515+codecs. Processing compressed data on such DSPs results in a dramatic1616+reduction of power consumption compared to host-based1717+processing. Support for such hardware has not been very good in Linux,1818+mostly because of a lack of a generic API available in the mainline1919+kernel.2020+2121+Rather than requiring a compability break with an API change of the2222+ALSA PCM interface, a new 'Compressed Data' API is introduced to2323+provide a control and data-streaming interface for audio DSPs.2424+2525+The design of this API was inspired by the 2-year experience with the2626+Intel Moorestown SOC, with many corrections required to upstream the2727+API in the mainline kernel instead of the staging tree and make it2828+usable by others.2929+3030+Requirements3131+3232+The main requirements are:3333+3434+- separation between byte counts and time. Compressed formats may have3535+ a header per file, per frame, or no header at all. The payload size3636+ may vary from frame-to-frame. As a result, it is not possible to3737+ estimate reliably the duration of audio buffers when handling3838+ compressed data. Dedicated mechanisms are required to allow for3939+ reliable audio-video synchronization, which requires precise4040+ reporting of the number of samples rendered at any given time.4141+4242+- Handling of multiple formats. PCM data only requires a specification4343+ of the sampling rate, number of channels and bits per sample. In4444+ contrast, compressed data comes in a variety of formats. Audio DSPs4545+ may also provide support for a limited number of audio encoders and4646+ decoders embedded in firmware, or may support more choices through4747+ dynamic download of libraries.4848+4949+- Focus on main formats. This API provides support for the most5050+ popular formats used for audio and video capture and playback. It is5151+ likely that as audio compression technology advances, new formats5252+ will be added.5353+5454+- Handling of multiple configurations. Even for a given format like5555+ AAC, some implementations may support AAC multichannel but HE-AAC5656+ stereo. Likewise WMA10 level M3 may require too much memory and cpu5757+ cycles. The new API needs to provide a generic way of listing these5858+ formats.5959+6060+- Rendering/Grabbing only. This API does not provide any means of6161+ hardware acceleration, where PCM samples are provided back to6262+ user-space for additional processing. This API focuses instead on6363+ streaming compressed data to a DSP, with the assumption that the6464+ decoded samples are routed to a physical output or logical back-end.6565+6666+ - Complexity hiding. Existing user-space multimedia frameworks all6767+ have existing enums/structures for each compressed format. This new6868+ API assumes the existence of a platform-specific compatibility layer6969+ to expose, translate and make use of the capabilities of the audio7070+ DSP, eg. Android HAL or PulseAudio sinks. By construction, regular7171+ applications are not supposed to make use of this API.7272+7373+7474+Design7575+7676+The new API shares a number of concepts with with the PCM API for flow7777+control. Start, pause, resume, drain and stop commands have the same7878+semantics no matter what the content is.7979+8080+The concept of memory ring buffer divided in a set of fragments is8181+borrowed from the ALSA PCM API. However, only sizes in bytes can be8282+specified.8383+8484+Seeks/trick modes are assumed to be handled by the host.8585+8686+The notion of rewinds/forwards is not supported. Data committed to the8787+ring buffer cannot be invalidated, except when dropping all buffers.8888+8989+The Compressed Data API does not make any assumptions on how the data9090+is transmitted to the audio DSP. DMA transfers from main memory to an9191+embedded audio cluster or to a SPI interface for external DSPs are9292+possible. As in the ALSA PCM case, a core set of routines is exposed;9393+each driver implementer will have to write support for a set of9494+mandatory routines and possibly make use of optional ones.9595+9696+The main additions are9797+9898+- get_caps9999+This routine returns the list of audio formats supported. Querying the100100+codecs on a capture stream will return encoders, decoders will be101101+listed for playback streams.102102+103103+- get_codec_caps For each codec, this routine returns a list of104104+capabilities. The intent is to make sure all the capabilities105105+correspond to valid settings, and to minimize the risks of106106+configuration failures. For example, for a complex codec such as AAC,107107+the number of channels supported may depend on a specific profile. If108108+the capabilities were exposed with a single descriptor, it may happen109109+that a specific combination of profiles/channels/formats may not be110110+supported. Likewise, embedded DSPs have limited memory and cpu cycles,111111+it is likely that some implementations make the list of capabilities112112+dynamic and dependent on existing workloads. In addition to codec113113+settings, this routine returns the minimum buffer size handled by the114114+implementation. This information can be a function of the DMA buffer115115+sizes, the number of bytes required to synchronize, etc, and can be116116+used by userspace to define how much needs to be written in the ring117117+buffer before playback can start.118118+119119+- set_params120120+This routine sets the configuration chosen for a specific codec. The121121+most important field in the parameters is the codec type; in most122122+cases decoders will ignore other fields, while encoders will strictly123123+comply to the settings124124+125125+- get_params126126+This routines returns the actual settings used by the DSP. Changes to127127+the settings should remain the exception.128128+129129+- get_timestamp130130+The timestamp becomes a multiple field structure. It lists the number131131+of bytes transferred, the number of samples processed and the number132132+of samples rendered/grabbed. All these values can be used to determine133133+the avarage bitrate, figure out if the ring buffer needs to be134134+refilled or the delay due to decoding/encoding/io on the DSP.135135+136136+Note that the list of codecs/profiles/modes was derived from the137137+OpenMAX AL specification instead of reinventing the wheel.138138+Modifications include:139139+- Addition of FLAC and IEC formats140140+- Merge of encoder/decoder capabilities141141+- Profiles/modes listed as bitmasks to make descriptors more compact142142+- Addition of set_params for decoders (missing in OpenMAX AL)143143+- Addition of AMR/AMR-WB encoding modes (missing in OpenMAX AL)144144+- Addition of format information for WMA145145+- Addition of encoding options when required (derived from OpenMAX IL)146146+- Addition of rateControlSupported (missing in OpenMAX AL)147147+148148+Not supported:149149+150150+- Support for VoIP/circuit-switched calls is not the target of this151151+ API. Support for dynamic bit-rate changes would require a tight152152+ coupling between the DSP and the host stack, limiting power savings.153153+154154+- Packet-loss concealment is not supported. This would require an155155+ additional interface to let the decoder synthesize data when frames156156+ are lost during transmission. This may be added in the future.157157+158158+- Volume control/routing is not handled by this API. Devices exposing a159159+ compressed data interface will be considered as regular ALSA devices;160160+ volume changes and routing information will be provided with regular161161+ ALSA kcontrols.162162+163163+- Embedded audio effects. Such effects should be enabled in the same164164+ manner, no matter if the input was PCM or compressed.165165+166166+- multichannel IEC encoding. Unclear if this is required.167167+168168+- Encoding/decoding acceleration is not supported as mentioned169169+ above. It is possible to route the output of a decoder to a capture170170+ stream, or even implement transcoding capabilities. This routing171171+ would be enabled with ALSA kcontrols.172172+173173+- Audio policy/resource management. This API does not provide any174174+ hooks to query the utilization of the audio DSP, nor any premption175175+ mechanisms.176176+177177+- No notion of underun/overrun. Since the bytes written are compressed178178+ in nature and data written/read doesn't translate directly to179179+ rendered output in time, this does not deal with underrun/overun and180180+ maybe dealt in user-library181181+182182+Credits:183183+- Mark Brown and Liam Girdwood for discussions on the need for this API184184+- Harsha Priya for her work on intel_sst compressed API185185+- Rakesh Ughreja for valuable feedback186186+- Sing Nallasellan, Sikkandar Madar and Prasanna Samaga for187187+ demonstrating and quantifying the benefits of audio offload on a188188+ real platform.
···11+/*22+ * compress_driver.h - compress offload driver definations33+ *44+ * Copyright (C) 2011 Intel Corporation55+ * Authors: Vinod Koul <vinod.koul@linux.intel.com>66+ * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>77+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~88+ *99+ * This program is free software; you can redistribute it and/or modify1010+ * it under the terms of the GNU General Public License as published by1111+ * the Free Software Foundation; version 2 of the License.1212+ *1313+ * This program is distributed in the hope that it will be useful, but1414+ * WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU1616+ * General Public License for more details.1717+ *1818+ * You should have received a copy of the GNU General Public License along1919+ * with this program; if not, write to the Free Software Foundation, Inc.,2020+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.2121+ *2222+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2323+ *2424+ */2525+#ifndef __COMPRESS_DRIVER_H2626+#define __COMPRESS_DRIVER_H2727+2828+#include <linux/types.h>2929+#include <linux/sched.h>3030+#include <sound/compress_offload.h>3131+#include <sound/asound.h>3232+#include <sound/pcm.h>3333+3434+struct snd_compr_ops;3535+3636+/**3737+ * struct snd_compr_runtime: runtime stream description3838+ * @state: stream state3939+ * @ops: pointer to DSP callbacks4040+ * @buffer: pointer to kernel buffer, valid only when not in mmap mode or4141+ * DSP doesn't implement copy4242+ * @buffer_size: size of the above buffer4343+ * @fragment_size: size of buffer fragment in bytes4444+ * @fragments: number of such fragments4545+ * @hw_pointer: offset of last location in buffer where DSP copied data4646+ * @app_pointer: offset of last location in buffer where app wrote data4747+ * @total_bytes_available: cumulative number of bytes made available in4848+ * the ring buffer4949+ * @total_bytes_transferred: cumulative bytes transferred by offload DSP5050+ * @sleep: poll sleep5151+ */5252+struct snd_compr_runtime {5353+ snd_pcm_state_t state;5454+ struct snd_compr_ops *ops;5555+ void *buffer;5656+ u64 buffer_size;5757+ u32 fragment_size;5858+ u32 fragments;5959+ u64 hw_pointer;6060+ u64 app_pointer;6161+ u64 total_bytes_available;6262+ u64 total_bytes_transferred;6363+ wait_queue_head_t sleep;6464+};6565+6666+/**6767+ * struct snd_compr_stream: compressed stream6868+ * @name: device name6969+ * @ops: pointer to DSP callbacks7070+ * @runtime: pointer to runtime structure7171+ * @device: device pointer7272+ * @direction: stream direction, playback/recording7373+ * @private_data: pointer to DSP private data7474+ */7575+struct snd_compr_stream {7676+ const char *name;7777+ struct snd_compr_ops *ops;7878+ struct snd_compr_runtime *runtime;7979+ struct snd_compr *device;8080+ enum snd_compr_direction direction;8181+ void *private_data;8282+};8383+8484+/**8585+ * struct snd_compr_ops: compressed path DSP operations8686+ * @open: Open the compressed stream8787+ * This callback is mandatory and shall keep dsp ready to receive the stream8888+ * parameter8989+ * @free: Close the compressed stream, mandatory9090+ * @set_params: Sets the compressed stream parameters, mandatory9191+ * This can be called in during stream creation only to set codec params9292+ * and the stream properties9393+ * @get_params: retrieve the codec parameters, mandatory9494+ * @trigger: Trigger operations like start, pause, resume, drain, stop.9595+ * This callback is mandatory9696+ * @pointer: Retrieve current h/w pointer information. Mandatory9797+ * @copy: Copy the compressed data to/from userspace, Optional9898+ * Can't be implemented if DSP supports mmap9999+ * @mmap: DSP mmap method to mmap DSP memory100100+ * @ack: Ack for DSP when data is written to audio buffer, Optional101101+ * Not valid if copy is implemented102102+ * @get_caps: Retrieve DSP capabilities, mandatory103103+ * @get_codec_caps: Retrieve capabilities for a specific codec, mandatory104104+ */105105+struct snd_compr_ops {106106+ int (*open)(struct snd_compr_stream *stream);107107+ int (*free)(struct snd_compr_stream *stream);108108+ int (*set_params)(struct snd_compr_stream *stream,109109+ struct snd_compr_params *params);110110+ int (*get_params)(struct snd_compr_stream *stream,111111+ struct snd_codec *params);112112+ int (*trigger)(struct snd_compr_stream *stream, int cmd);113113+ int (*pointer)(struct snd_compr_stream *stream,114114+ struct snd_compr_tstamp *tstamp);115115+ int (*copy)(struct snd_compr_stream *stream, const char __user *buf,116116+ size_t count);117117+ int (*mmap)(struct snd_compr_stream *stream,118118+ struct vm_area_struct *vma);119119+ int (*ack)(struct snd_compr_stream *stream, size_t bytes);120120+ int (*get_caps) (struct snd_compr_stream *stream,121121+ struct snd_compr_caps *caps);122122+ int (*get_codec_caps) (struct snd_compr_stream *stream,123123+ struct snd_compr_codec_caps *codec);124124+};125125+126126+/**127127+ * struct snd_compr: Compressed device128128+ * @name: DSP device name129129+ * @dev: Device pointer130130+ * @ops: pointer to DSP callbacks131131+ * @private_data: pointer to DSP pvt data132132+ * @card: sound card pointer133133+ * @direction: Playback or capture direction134134+ * @lock: device lock135135+ * @device: device id136136+ */137137+struct snd_compr {138138+ const char *name;139139+ struct device *dev;140140+ struct snd_compr_ops *ops;141141+ void *private_data;142142+ struct snd_card *card;143143+ unsigned int direction;144144+ struct mutex lock;145145+ int device;146146+};147147+148148+/* compress device register APIs */149149+int snd_compress_register(struct snd_compr *device);150150+int snd_compress_deregister(struct snd_compr *device);151151+int snd_compress_new(struct snd_card *card, int device,152152+ int type, struct snd_compr *compr);153153+154154+/* dsp driver callback apis155155+ * For playback: driver should call snd_compress_fragment_elapsed() to let the156156+ * framework know that a fragment has been consumed from the ring buffer157157+ *158158+ * For recording: we want to know when a frame is available or when159159+ * at least one frame is available so snd_compress_frame_elapsed()160160+ * callback should be called when a encodeded frame is available161161+ */162162+static inline void snd_compr_fragment_elapsed(struct snd_compr_stream *stream)163163+{164164+ wake_up(&stream->runtime->sleep);165165+}166166+167167+#endif
+161
include/sound/compress_offload.h
···11+/*22+ * compress_offload.h - compress offload header definations33+ *44+ * Copyright (C) 2011 Intel Corporation55+ * Authors: Vinod Koul <vinod.koul@linux.intel.com>66+ * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>77+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~88+ *99+ * This program is free software; you can redistribute it and/or modify1010+ * it under the terms of the GNU General Public License as published by1111+ * the Free Software Foundation; version 2 of the License.1212+ *1313+ * This program is distributed in the hope that it will be useful, but1414+ * WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU1616+ * General Public License for more details.1717+ *1818+ * You should have received a copy of the GNU General Public License along1919+ * with this program; if not, write to the Free Software Foundation, Inc.,2020+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.2121+ *2222+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2323+ *2424+ */2525+#ifndef __COMPRESS_OFFLOAD_H2626+#define __COMPRESS_OFFLOAD_H2727+2828+#include <linux/types.h>2929+#include <sound/asound.h>3030+#include <sound/compress_params.h>3131+3232+3333+#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)3434+/**3535+ * struct snd_compressed_buffer: compressed buffer3636+ * @fragment_size: size of buffer fragment in bytes3737+ * @fragments: number of such fragments3838+ */3939+struct snd_compressed_buffer {4040+ __u32 fragment_size;4141+ __u32 fragments;4242+};4343+4444+/**4545+ * struct snd_compr_params: compressed stream params4646+ * @buffer: buffer description4747+ * @codec: codec parameters4848+ * @no_wake_mode: dont wake on fragment elapsed4949+ */5050+struct snd_compr_params {5151+ struct snd_compressed_buffer buffer;5252+ struct snd_codec codec;5353+ __u8 no_wake_mode;5454+};5555+5656+/**5757+ * struct snd_compr_tstamp: timestamp descriptor5858+ * @byte_offset: Byte offset in ring buffer to DSP5959+ * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP6060+ * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by6161+ * large steps and should only be used to monitor encoding/decoding6262+ * progress. It shall not be used for timing estimates.6363+ * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio6464+ * output/input. This field should be used for A/V sync or time estimates.6565+ * @sampling_rate: sampling rate of audio6666+ */6767+struct snd_compr_tstamp {6868+ __u32 byte_offset;6969+ __u32 copied_total;7070+ snd_pcm_uframes_t pcm_frames;7171+ snd_pcm_uframes_t pcm_io_frames;7272+ __u32 sampling_rate;7373+};7474+7575+/**7676+ * struct snd_compr_avail: avail descriptor7777+ * @avail: Number of bytes available in ring buffer for writing/reading7878+ * @tstamp: timestamp infomation7979+ */8080+struct snd_compr_avail {8181+ __u64 avail;8282+ struct snd_compr_tstamp tstamp;8383+};8484+8585+enum snd_compr_direction {8686+ SND_COMPRESS_PLAYBACK = 0,8787+ SND_COMPRESS_CAPTURE8888+};8989+9090+/**9191+ * struct snd_compr_caps: caps descriptor9292+ * @codecs: pointer to array of codecs9393+ * @direction: direction supported. Of type snd_compr_direction9494+ * @min_fragment_size: minimum fragment supported by DSP9595+ * @max_fragment_size: maximum fragment supported by DSP9696+ * @min_fragments: min fragments supported by DSP9797+ * @max_fragments: max fragments supported by DSP9898+ * @num_codecs: number of codecs supported9999+ * @reserved: reserved field100100+ */101101+struct snd_compr_caps {102102+ __u32 num_codecs;103103+ __u32 direction;104104+ __u32 min_fragment_size;105105+ __u32 max_fragment_size;106106+ __u32 min_fragments;107107+ __u32 max_fragments;108108+ __u32 codecs[MAX_NUM_CODECS];109109+ __u32 reserved[11];110110+};111111+112112+/**113113+ * struct snd_compr_codec_caps: query capability of codec114114+ * @codec: codec for which capability is queried115115+ * @num_descriptors: number of codec descriptors116116+ * @descriptor: array of codec capability descriptor117117+ */118118+struct snd_compr_codec_caps {119119+ __u32 codec;120120+ __u32 num_descriptors;121121+ struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];122122+};123123+124124+/**125125+ * compress path ioctl definitions126126+ * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP127127+ * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec128128+ * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters129129+ * Note: only codec params can be changed runtime and stream params cant be130130+ * SNDRV_COMPRESS_GET_PARAMS: Query codec params131131+ * SNDRV_COMPRESS_TSTAMP: get the current timestamp value132132+ * SNDRV_COMPRESS_AVAIL: get the current buffer avail value.133133+ * This also queries the tstamp properties134134+ * SNDRV_COMPRESS_PAUSE: Pause the running stream135135+ * SNDRV_COMPRESS_RESUME: resume a paused stream136136+ * SNDRV_COMPRESS_START: Start a stream137137+ * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content138138+ * and the buffers currently with DSP139139+ * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that140140+ * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version141141+ */142142+#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)143143+#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)144144+#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\145145+ struct snd_compr_codec_caps)146146+#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)147147+#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)148148+#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)149149+#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)150150+#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)151151+#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)152152+#define SNDRV_COMPRESS_START _IO('C', 0x32)153153+#define SNDRV_COMPRESS_STOP _IO('C', 0x33)154154+#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)155155+/*156156+ * TODO157157+ * 1. add mmap support158158+ *159159+ */160160+#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */161161+#endif
+397
include/sound/compress_params.h
···11+/*22+ * compress_params.h - codec types and parameters for compressed data33+ * streaming interface44+ *55+ * Copyright (C) 2011 Intel Corporation66+ * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>77+ * Vinod Koul <vinod.koul@linux.intel.com>88+ *99+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1010+ *1111+ * This program is free software; you can redistribute it and/or modify1212+ * it under the terms of the GNU General Public License as published by1313+ * the Free Software Foundation; version 2 of the License.1414+ *1515+ * This program is distributed in the hope that it will be useful, but1616+ * WITHOUT ANY WARRANTY; without even the implied warranty of1717+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU1818+ * General Public License for more details.1919+ *2020+ * You should have received a copy of the GNU General Public License along2121+ * with this program; if not, write to the Free Software Foundation, Inc.,2222+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.2323+ *2424+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2525+ *2626+ * The definitions in this file are derived from the OpenMAX AL version 1.12727+ * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.2828+ *2929+ * Copyright (c) 2007-2010 The Khronos Group Inc.3030+ *3131+ * Permission is hereby granted, free of charge, to any person obtaining3232+ * a copy of this software and/or associated documentation files (the3333+ * "Materials "), to deal in the Materials without restriction, including3434+ * without limitation the rights to use, copy, modify, merge, publish,3535+ * distribute, sublicense, and/or sell copies of the Materials, and to3636+ * permit persons to whom the Materials are furnished to do so, subject to3737+ * the following conditions:3838+ *3939+ * The above copyright notice and this permission notice shall be included4040+ * in all copies or substantial portions of the Materials.4141+ *4242+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS4343+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF4444+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.4545+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY4646+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,4747+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE4848+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.4949+ *5050+ */5151+#ifndef __SND_COMPRESS_PARAMS_H5252+#define __SND_COMPRESS_PARAMS_H5353+5454+/* AUDIO CODECS SUPPORTED */5555+#define MAX_NUM_CODECS 325656+#define MAX_NUM_CODEC_DESCRIPTORS 325757+#define MAX_NUM_BITRATES 325858+5959+/* Codecs are listed linearly to allow for extensibility */6060+#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)6161+#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)6262+#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)6363+#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)6464+#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)6565+#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)6666+#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)6767+#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)6868+#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)6969+#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)7070+#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)7171+#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)7272+#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)7373+7474+/*7575+ * Profile and modes are listed with bit masks. This allows for a7676+ * more compact representation of fields that will not evolve7777+ * (in contrast to the list of codecs)7878+ */7979+8080+#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)8181+8282+/* MP3 modes are only useful for encoders */8383+#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)8484+#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)8585+#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)8686+#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)8787+8888+#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)8989+9090+/* AMR modes are only useful for encoders */9191+#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)9292+#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)9393+#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)9494+9595+#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)9696+#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)9797+#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)9898+#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)9999+#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)100100+#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)101101+#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)102102+103103+#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)104104+105105+/* AMRWB modes are only useful for encoders */106106+#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)107107+#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)108108+#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)109109+110110+#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)111111+112112+#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)113113+114114+/* AAC modes are required for encoders and decoders */115115+#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)116116+#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)117117+#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)118118+#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)119119+#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)120120+#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)121121+#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)122122+#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)123123+#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)124124+#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)125125+126126+/* AAC formats are required for encoders and decoders */127127+#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)128128+#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)129129+#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)130130+#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)131131+#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)132132+#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)133133+#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)134134+135135+#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)136136+#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)137137+#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)138138+#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)139139+140140+#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)141141+#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)142142+#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)143143+#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)144144+#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)145145+#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)146146+#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)147147+#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)148148+149149+#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)150150+/*151151+ * Some implementations strip the ASF header and only send ASF packets152152+ * to the DSP153153+ */154154+#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)155155+156156+#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)157157+158158+#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)159159+#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)160160+#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)161161+#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)162162+163163+#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)164164+165165+#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)166166+167167+#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)168168+169169+/*170170+ * Define quality levels for FLAC encoders, from LEVEL0 (fast)171171+ * to LEVEL8 (best)172172+ */173173+#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)174174+#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)175175+#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)176176+#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)177177+#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)178178+#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)179179+#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)180180+#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)181181+#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)182182+183183+#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)184184+#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)185185+186186+/* IEC61937 payloads without CUVP and preambles */187187+#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)188188+/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */189189+#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)190190+191191+/*192192+ * IEC modes are mandatory for decoders. Format autodetection193193+ * will only happen on the DSP side with mode 0. The PCM mode should194194+ * not be used, the PCM codec should be used instead.195195+ */196196+#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)197197+#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)198198+#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)199199+#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)200200+#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)201201+#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)202202+#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)203203+#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)204204+#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)205205+#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)206206+#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)207207+#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)208208+#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)209209+#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)210210+#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)211211+#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)212212+#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)213213+#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)214214+#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)215215+216216+#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)217217+218218+#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)219219+#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)220220+#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)221221+222222+#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)223223+224224+#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)225225+#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)226226+227227+/* <FIXME: multichannel encoders aren't supported for now. Would need228228+ an additional definition of channel arrangement> */229229+230230+/* VBR/CBR definitions */231231+#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)232232+#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)233233+234234+/* Encoder options */235235+236236+struct snd_enc_wma {237237+ __u32 super_block_align; /* WMA Type-specific data */238238+};239239+240240+241241+/**242242+ * struct snd_enc_vorbis243243+ * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).244244+ * In the default mode of operation, the quality level is 3.245245+ * Normal quality range is 0 - 10.246246+ * @managed: Boolean. Set bitrate management mode. This turns off the247247+ * normal VBR encoding, but allows hard or soft bitrate constraints to be248248+ * enforced by the encoder. This mode can be slower, and may also be249249+ * lower quality. It is primarily useful for streaming.250250+ * @max_bit_rate: Enabled only if managed is TRUE251251+ * @min_bit_rate: Enabled only if managed is TRUE252252+ * @downmix: Boolean. Downmix input from stereo to mono (has no effect on253253+ * non-stereo streams). Useful for lower-bitrate encoding.254254+ *255255+ * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc256256+ * properties257257+ *258258+ * For best quality users should specify VBR mode and set quality levels.259259+ */260260+261261+struct snd_enc_vorbis {262262+ __s32 quality;263263+ __u32 managed;264264+ __u32 max_bit_rate;265265+ __u32 min_bit_rate;266266+ __u32 downmix;267267+};268268+269269+270270+/**271271+ * struct snd_enc_real272272+ * @quant_bits: number of coupling quantization bits in the stream273273+ * @start_region: coupling start region in the stream274274+ * @num_regions: number of regions value275275+ *276276+ * These options were extracted from the OpenMAX IL spec277277+ */278278+279279+struct snd_enc_real {280280+ __u32 quant_bits;281281+ __u32 start_region;282282+ __u32 num_regions;283283+};284284+285285+/**286286+ * struct snd_enc_flac287287+ * @num: serial number, valid only for OGG formats288288+ * needs to be set by application289289+ * @gain: Add replay gain tags290290+ *291291+ * These options were extracted from the FLAC online documentation292292+ * at http://flac.sourceforge.net/documentation_tools_flac.html293293+ *294294+ * To make the API simpler, it is assumed that the user will select quality295295+ * profiles. Additional options that affect encoding quality and speed can296296+ * be added at a later stage if needed.297297+ *298298+ * By default the Subset format is used by encoders.299299+ *300300+ * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are301301+ * not supported in this API.302302+ */303303+304304+struct snd_enc_flac {305305+ __u32 num;306306+ __u32 gain;307307+};308308+309309+struct snd_enc_generic {310310+ __u32 bw; /* encoder bandwidth */311311+ __s32 reserved[15];312312+};313313+314314+union snd_codec_options {315315+ struct snd_enc_wma wma;316316+ struct snd_enc_vorbis vorbis;317317+ struct snd_enc_real real;318318+ struct snd_enc_flac flac;319319+ struct snd_enc_generic generic;320320+};321321+322322+/** struct snd_codec_desc - description of codec capabilities323323+ * @max_ch: Maximum number of audio channels324324+ * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this325325+ * @bit_rate: Indexed array containing supported bit rates326326+ * @num_bitrates: Number of valid values in bit_rate array327327+ * @rate_control: value is specified by SND_RATECONTROLMODE defines.328328+ * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.329329+ * @modes: Supported modes. See SND_AUDIOMODE defines330330+ * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines331331+ * @min_buffer: Minimum buffer size handled by codec implementation332332+ * @reserved: reserved for future use333333+ *334334+ * This structure provides a scalar value for profiles, modes and stream335335+ * format fields.336336+ * If an implementation supports multiple combinations, they will be listed as337337+ * codecs with different descriptors, for example there would be 2 descriptors338338+ * for AAC-RAW and AAC-ADTS.339339+ * This entails some redundancy but makes it easier to avoid invalid340340+ * configurations.341341+ *342342+ */343343+344344+struct snd_codec_desc {345345+ __u32 max_ch;346346+ __u32 sample_rates;347347+ __u32 bit_rate[MAX_NUM_BITRATES];348348+ __u32 num_bitrates;349349+ __u32 rate_control;350350+ __u32 profiles;351351+ __u32 modes;352352+ __u32 formats;353353+ __u32 min_buffer;354354+ __u32 reserved[15];355355+};356356+357357+/** struct snd_codec358358+ * @id: Identifies the supported audio encoder/decoder.359359+ * See SND_AUDIOCODEC macros.360360+ * @ch_in: Number of input audio channels361361+ * @ch_out: Number of output channels. In case of contradiction between362362+ * this field and the channelMode field, the channelMode field363363+ * overrides.364364+ * @sample_rate: Audio sample rate of input data365365+ * @bit_rate: Bitrate of encoded data. May be ignored by decoders366366+ * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.367367+ * Encoders may rely on profiles for quality levels.368368+ * May be ignored by decoders.369369+ * @profile: Mandatory for encoders, can be mandatory for specific370370+ * decoders as well. See SND_AUDIOPROFILE defines.371371+ * @level: Supported level (Only used by WMA at the moment)372372+ * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines373373+ * @format: Format of encoded bistream. Mandatory when defined.374374+ * See SND_AUDIOSTREAMFORMAT defines.375375+ * @align: Block alignment in bytes of an audio sample.376376+ * Only required for PCM or IEC formats.377377+ * @options: encoder-specific settings378378+ * @reserved: reserved for future use379379+ */380380+381381+struct snd_codec {382382+ __u32 id;383383+ __u32 ch_in;384384+ __u32 ch_out;385385+ __u32 sample_rate;386386+ __u32 bit_rate;387387+ __u32 rate_control;388388+ __u32 profile;389389+ __u32 level;390390+ __u32 ch_mode;391391+ __u32 format;392392+ __u32 align;393393+ union snd_codec_options options;394394+ __u32 reserved[3];395395+};396396+397397+#endif
···251251 },252252};253253254254-static int __init pxa2xx_ac97_init(void)255255-{256256- return platform_driver_register(&pxa2xx_ac97_driver);257257-}258258-259259-static void __exit pxa2xx_ac97_exit(void)260260-{261261- platform_driver_unregister(&pxa2xx_ac97_driver);262262-}263263-264264-module_init(pxa2xx_ac97_init);265265-module_exit(pxa2xx_ac97_exit);254254+module_platform_driver(pxa2xx_ac97_driver);266255267256MODULE_AUTHOR("Nicolas Pitre");268257MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip");
+10
sound/core/Kconfig
···155155156156 If you are unsure about this, say N here.157157158158+config SND_COMPRESS_OFFLOAD159159+ tristate "ALSA Compressed audio offload support"160160+ default n161161+ help162162+ If you want support for offloading compressed audio and have such163163+ a hardware, then you should say Y here and also to the DSP driver164164+ of your platform.165165+166166+ If you are unsure about this, say N here.167167+158168config SND_SUPPORT_OLD_API159169 bool "Support old ALSA API"160170 default y
···11+/*22+ * compress_core.c - compress offload core33+ *44+ * Copyright (C) 2011 Intel Corporation55+ * Authors: Vinod Koul <vinod.koul@linux.intel.com>66+ * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>77+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~88+ *99+ * This program is free software; you can redistribute it and/or modify1010+ * it under the terms of the GNU General Public License as published by1111+ * the Free Software Foundation; version 2 of the License.1212+ *1313+ * This program is distributed in the hope that it will be useful, but1414+ * WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU1616+ * General Public License for more details.1717+ *1818+ * You should have received a copy of the GNU General Public License along1919+ * with this program; if not, write to the Free Software Foundation, Inc.,2020+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.2121+ *2222+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2323+ *2424+ */2525+#define FORMAT(fmt) "%s: %d: " fmt, __func__, __LINE__2626+#define pr_fmt(fmt) KBUILD_MODNAME ": " FORMAT(fmt)2727+2828+#include <linux/file.h>2929+#include <linux/fs.h>3030+#include <linux/list.h>3131+#include <linux/mm.h>3232+#include <linux/mutex.h>3333+#include <linux/poll.h>3434+#include <linux/slab.h>3535+#include <linux/sched.h>3636+#include <linux/uio.h>3737+#include <linux/uaccess.h>3838+#include <linux/module.h>3939+#include <sound/core.h>4040+#include <sound/initval.h>4141+#include <sound/compress_params.h>4242+#include <sound/compress_offload.h>4343+#include <sound/compress_driver.h>4444+4545+/* TODO:4646+ * - add substream support for multiple devices in case of4747+ * SND_DYNAMIC_MINORS is not used4848+ * - Multiple node representation4949+ * driver should be able to register multiple nodes5050+ */5151+5252+static DEFINE_MUTEX(device_mutex);5353+5454+struct snd_compr_file {5555+ unsigned long caps;5656+ struct snd_compr_stream stream;5757+};5858+5959+/*6060+ * a note on stream states used:6161+ * we use follwing states in the compressed core6262+ * SNDRV_PCM_STATE_OPEN: When stream has been opened.6363+ * SNDRV_PCM_STATE_SETUP: When stream has been initialized. This is done by6464+ * calling SNDRV_COMPRESS_SET_PARAMS. running streams will come to this6565+ * state at stop by calling SNDRV_COMPRESS_STOP, or at end of drain.6666+ * SNDRV_PCM_STATE_RUNNING: When stream has been started and is6767+ * decoding/encoding and rendering/capturing data.6868+ * SNDRV_PCM_STATE_DRAINING: When stream is draining current data. This is done6969+ * by calling SNDRV_COMPRESS_DRAIN.7070+ * SNDRV_PCM_STATE_PAUSED: When stream is paused. This is done by calling7171+ * SNDRV_COMPRESS_PAUSE. It can be stopped or resumed by calling7272+ * SNDRV_COMPRESS_STOP or SNDRV_COMPRESS_RESUME respectively.7373+ */7474+static int snd_compr_open(struct inode *inode, struct file *f)7575+{7676+ struct snd_compr *compr;7777+ struct snd_compr_file *data;7878+ struct snd_compr_runtime *runtime;7979+ enum snd_compr_direction dirn;8080+ int maj = imajor(inode);8181+ int ret;8282+8383+ if (f->f_flags & O_WRONLY)8484+ dirn = SND_COMPRESS_PLAYBACK;8585+ else if (f->f_flags & O_RDONLY)8686+ dirn = SND_COMPRESS_CAPTURE;8787+ else {8888+ pr_err("invalid direction\n");8989+ return -EINVAL;9090+ }9191+9292+ if (maj == snd_major)9393+ compr = snd_lookup_minor_data(iminor(inode),9494+ SNDRV_DEVICE_TYPE_COMPRESS);9595+ else9696+ return -EBADFD;9797+9898+ if (compr == NULL) {9999+ pr_err("no device data!!!\n");100100+ return -ENODEV;101101+ }102102+103103+ if (dirn != compr->direction) {104104+ pr_err("this device doesn't support this direction\n");105105+ return -EINVAL;106106+ }107107+108108+ data = kzalloc(sizeof(*data), GFP_KERNEL);109109+ if (!data)110110+ return -ENOMEM;111111+ data->stream.ops = compr->ops;112112+ data->stream.direction = dirn;113113+ data->stream.private_data = compr->private_data;114114+ data->stream.device = compr;115115+ runtime = kzalloc(sizeof(*runtime), GFP_KERNEL);116116+ if (!runtime) {117117+ kfree(data);118118+ return -ENOMEM;119119+ }120120+ runtime->state = SNDRV_PCM_STATE_OPEN;121121+ init_waitqueue_head(&runtime->sleep);122122+ data->stream.runtime = runtime;123123+ f->private_data = (void *)data;124124+ mutex_lock(&compr->lock);125125+ ret = compr->ops->open(&data->stream);126126+ mutex_unlock(&compr->lock);127127+ if (ret) {128128+ kfree(runtime);129129+ kfree(data);130130+ }131131+ return ret;132132+}133133+134134+static int snd_compr_free(struct inode *inode, struct file *f)135135+{136136+ struct snd_compr_file *data = f->private_data;137137+ data->stream.ops->free(&data->stream);138138+ kfree(data->stream.runtime->buffer);139139+ kfree(data->stream.runtime);140140+ kfree(data);141141+ return 0;142142+}143143+144144+static void snd_compr_update_tstamp(struct snd_compr_stream *stream,145145+ struct snd_compr_tstamp *tstamp)146146+{147147+ if (!stream->ops->pointer)148148+ return;149149+ stream->ops->pointer(stream, tstamp);150150+ pr_debug("dsp consumed till %d total %d bytes\n",151151+ tstamp->byte_offset, tstamp->copied_total);152152+ stream->runtime->hw_pointer = tstamp->byte_offset;153153+ stream->runtime->total_bytes_transferred = tstamp->copied_total;154154+}155155+156156+static size_t snd_compr_calc_avail(struct snd_compr_stream *stream,157157+ struct snd_compr_avail *avail)158158+{159159+ long avail_calc; /*this needs to be signed variable */160160+161161+ snd_compr_update_tstamp(stream, &avail->tstamp);162162+163163+ /* FIXME: This needs to be different for capture stream,164164+ available is # of compressed data, for playback it's165165+ remainder of buffer */166166+167167+ if (stream->runtime->total_bytes_available == 0 &&168168+ stream->runtime->state == SNDRV_PCM_STATE_SETUP) {169169+ pr_debug("detected init and someone forgot to do a write\n");170170+ return stream->runtime->buffer_size;171171+ }172172+ pr_debug("app wrote %lld, DSP consumed %lld\n",173173+ stream->runtime->total_bytes_available,174174+ stream->runtime->total_bytes_transferred);175175+ if (stream->runtime->total_bytes_available ==176176+ stream->runtime->total_bytes_transferred) {177177+ pr_debug("both pointers are same, returning full avail\n");178178+ return stream->runtime->buffer_size;179179+ }180180+181181+ /* FIXME: this routine isn't consistent, in one test we use182182+ * cumulative values and in the other byte offsets. Do we183183+ * really need the byte offsets if the cumulative values have184184+ * been updated? In the PCM interface app_ptr and hw_ptr are185185+ * already cumulative */186186+187187+ avail_calc = stream->runtime->buffer_size -188188+ (stream->runtime->app_pointer - stream->runtime->hw_pointer);189189+ pr_debug("calc avail as %ld, app_ptr %lld, hw+ptr %lld\n", avail_calc,190190+ stream->runtime->app_pointer,191191+ stream->runtime->hw_pointer);192192+ if (avail_calc >= stream->runtime->buffer_size)193193+ avail_calc -= stream->runtime->buffer_size;194194+ pr_debug("ret avail as %ld\n", avail_calc);195195+ avail->avail = avail_calc;196196+ return avail_calc;197197+}198198+199199+static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream)200200+{201201+ struct snd_compr_avail avail;202202+203203+ return snd_compr_calc_avail(stream, &avail);204204+}205205+206206+static int207207+snd_compr_ioctl_avail(struct snd_compr_stream *stream, unsigned long arg)208208+{209209+ struct snd_compr_avail ioctl_avail;210210+ size_t avail;211211+212212+ avail = snd_compr_calc_avail(stream, &ioctl_avail);213213+ ioctl_avail.avail = avail;214214+215215+ if (copy_to_user((__u64 __user *)arg,216216+ &ioctl_avail, sizeof(ioctl_avail)))217217+ return -EFAULT;218218+ return 0;219219+}220220+221221+static int snd_compr_write_data(struct snd_compr_stream *stream,222222+ const char __user *buf, size_t count)223223+{224224+ void *dstn;225225+ size_t copy;226226+ struct snd_compr_runtime *runtime = stream->runtime;227227+228228+ dstn = runtime->buffer + runtime->app_pointer;229229+ pr_debug("copying %ld at %lld\n",230230+ (unsigned long)count, runtime->app_pointer);231231+ if (count < runtime->buffer_size - runtime->app_pointer) {232232+ if (copy_from_user(dstn, buf, count))233233+ return -EFAULT;234234+ runtime->app_pointer += count;235235+ } else {236236+ copy = runtime->buffer_size - runtime->app_pointer;237237+ if (copy_from_user(dstn, buf, copy))238238+ return -EFAULT;239239+ if (copy_from_user(runtime->buffer, buf + copy, count - copy))240240+ return -EFAULT;241241+ runtime->app_pointer = count - copy;242242+ }243243+ /* if DSP cares, let it know data has been written */244244+ if (stream->ops->ack)245245+ stream->ops->ack(stream, count);246246+ return count;247247+}248248+249249+static ssize_t snd_compr_write(struct file *f, const char __user *buf,250250+ size_t count, loff_t *offset)251251+{252252+ struct snd_compr_file *data = f->private_data;253253+ struct snd_compr_stream *stream;254254+ size_t avail;255255+ int retval;256256+257257+ if (snd_BUG_ON(!data))258258+ return -EFAULT;259259+260260+ stream = &data->stream;261261+ mutex_lock(&stream->device->lock);262262+ /* write is allowed when stream is running or has been steup */263263+ if (stream->runtime->state != SNDRV_PCM_STATE_SETUP &&264264+ stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {265265+ mutex_unlock(&stream->device->lock);266266+ return -EBADFD;267267+ }268268+269269+ avail = snd_compr_get_avail(stream);270270+ pr_debug("avail returned %ld\n", (unsigned long)avail);271271+ /* calculate how much we can write to buffer */272272+ if (avail > count)273273+ avail = count;274274+275275+ if (stream->ops->copy)276276+ retval = stream->ops->copy(stream, buf, avail);277277+ else278278+ retval = snd_compr_write_data(stream, buf, avail);279279+ if (retval > 0)280280+ stream->runtime->total_bytes_available += retval;281281+282282+ /* while initiating the stream, write should be called before START283283+ * call, so in setup move state */284284+ if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) {285285+ stream->runtime->state = SNDRV_PCM_STATE_PREPARED;286286+ pr_debug("stream prepared, Houston we are good to go\n");287287+ }288288+289289+ mutex_unlock(&stream->device->lock);290290+ return retval;291291+}292292+293293+294294+static ssize_t snd_compr_read(struct file *f, char __user *buf,295295+ size_t count, loff_t *offset)296296+{297297+ return -ENXIO;298298+}299299+300300+static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma)301301+{302302+ return -ENXIO;303303+}304304+305305+static inline int snd_compr_get_poll(struct snd_compr_stream *stream)306306+{307307+ if (stream->direction == SND_COMPRESS_PLAYBACK)308308+ return POLLOUT | POLLWRNORM;309309+ else310310+ return POLLIN | POLLRDNORM;311311+}312312+313313+static unsigned int snd_compr_poll(struct file *f, poll_table *wait)314314+{315315+ struct snd_compr_file *data = f->private_data;316316+ struct snd_compr_stream *stream;317317+ size_t avail;318318+ int retval = 0;319319+320320+ if (snd_BUG_ON(!data))321321+ return -EFAULT;322322+ stream = &data->stream;323323+ if (snd_BUG_ON(!stream))324324+ return -EFAULT;325325+326326+ mutex_lock(&stream->device->lock);327327+ if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED ||328328+ stream->runtime->state == SNDRV_PCM_STATE_OPEN) {329329+ retval = -EBADFD;330330+ goto out;331331+ }332332+ poll_wait(f, &stream->runtime->sleep, wait);333333+334334+ avail = snd_compr_get_avail(stream);335335+ pr_debug("avail is %ld\n", (unsigned long)avail);336336+ /* check if we have at least one fragment to fill */337337+ switch (stream->runtime->state) {338338+ case SNDRV_PCM_STATE_DRAINING:339339+ /* stream has been woken up after drain is complete340340+ * draining done so set stream state to stopped341341+ */342342+ retval = snd_compr_get_poll(stream);343343+ stream->runtime->state = SNDRV_PCM_STATE_SETUP;344344+ break;345345+ case SNDRV_PCM_STATE_RUNNING:346346+ case SNDRV_PCM_STATE_PREPARED:347347+ case SNDRV_PCM_STATE_PAUSED:348348+ if (avail >= stream->runtime->fragment_size)349349+ retval = snd_compr_get_poll(stream);350350+ break;351351+ default:352352+ if (stream->direction == SND_COMPRESS_PLAYBACK)353353+ retval = POLLOUT | POLLWRNORM | POLLERR;354354+ else355355+ retval = POLLIN | POLLRDNORM | POLLERR;356356+ break;357357+ }358358+out:359359+ mutex_unlock(&stream->device->lock);360360+ return retval;361361+}362362+363363+static int364364+snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg)365365+{366366+ int retval;367367+ struct snd_compr_caps caps;368368+369369+ if (!stream->ops->get_caps)370370+ return -ENXIO;371371+372372+ retval = stream->ops->get_caps(stream, &caps);373373+ if (retval)374374+ goto out;375375+ if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))376376+ retval = -EFAULT;377377+out:378378+ return retval;379379+}380380+381381+static int382382+snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)383383+{384384+ int retval;385385+ struct snd_compr_codec_caps *caps;386386+387387+ if (!stream->ops->get_codec_caps)388388+ return -ENXIO;389389+390390+ caps = kmalloc(sizeof(*caps), GFP_KERNEL);391391+ if (!caps)392392+ return -ENOMEM;393393+394394+ retval = stream->ops->get_codec_caps(stream, caps);395395+ if (retval)396396+ goto out;397397+ if (copy_to_user((void __user *)arg, caps, sizeof(*caps)))398398+ retval = -EFAULT;399399+400400+out:401401+ kfree(caps);402402+ return retval;403403+}404404+405405+/* revisit this with snd_pcm_preallocate_xxx */406406+static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,407407+ struct snd_compr_params *params)408408+{409409+ unsigned int buffer_size;410410+ void *buffer;411411+412412+ buffer_size = params->buffer.fragment_size * params->buffer.fragments;413413+ if (stream->ops->copy) {414414+ buffer = NULL;415415+ /* if copy is defined the driver will be required to copy416416+ * the data from core417417+ */418418+ } else {419419+ buffer = kmalloc(buffer_size, GFP_KERNEL);420420+ if (!buffer)421421+ return -ENOMEM;422422+ }423423+ stream->runtime->fragment_size = params->buffer.fragment_size;424424+ stream->runtime->fragments = params->buffer.fragments;425425+ stream->runtime->buffer = buffer;426426+ stream->runtime->buffer_size = buffer_size;427427+ return 0;428428+}429429+430430+static int431431+snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)432432+{433433+ struct snd_compr_params *params;434434+ int retval;435435+436436+ if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {437437+ /*438438+ * we should allow parameter change only when stream has been439439+ * opened not in other cases440440+ */441441+ params = kmalloc(sizeof(*params), GFP_KERNEL);442442+ if (!params)443443+ return -ENOMEM;444444+ if (copy_from_user(params, (void __user *)arg, sizeof(*params)))445445+ return -EFAULT;446446+ retval = snd_compr_allocate_buffer(stream, params);447447+ if (retval) {448448+ kfree(params);449449+ return -ENOMEM;450450+ }451451+ retval = stream->ops->set_params(stream, params);452452+ if (retval)453453+ goto out;454454+ stream->runtime->state = SNDRV_PCM_STATE_SETUP;455455+ } else456456+ return -EPERM;457457+out:458458+ kfree(params);459459+ return retval;460460+}461461+462462+static int463463+snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg)464464+{465465+ struct snd_codec *params;466466+ int retval;467467+468468+ if (!stream->ops->get_params)469469+ return -EBADFD;470470+471471+ params = kmalloc(sizeof(*params), GFP_KERNEL);472472+ if (!params)473473+ return -ENOMEM;474474+ retval = stream->ops->get_params(stream, params);475475+ if (retval)476476+ goto out;477477+ if (copy_to_user((char __user *)arg, params, sizeof(*params)))478478+ retval = -EFAULT;479479+480480+out:481481+ kfree(params);482482+ return retval;483483+}484484+485485+static inline int486486+snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg)487487+{488488+ struct snd_compr_tstamp tstamp;489489+490490+ snd_compr_update_tstamp(stream, &tstamp);491491+ return copy_to_user((struct snd_compr_tstamp __user *)arg,492492+ &tstamp, sizeof(tstamp)) ? -EFAULT : 0;493493+}494494+495495+static int snd_compr_pause(struct snd_compr_stream *stream)496496+{497497+ int retval;498498+499499+ if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING)500500+ return -EPERM;501501+ retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);502502+ if (!retval) {503503+ stream->runtime->state = SNDRV_PCM_STATE_PAUSED;504504+ wake_up(&stream->runtime->sleep);505505+ }506506+ return retval;507507+}508508+509509+static int snd_compr_resume(struct snd_compr_stream *stream)510510+{511511+ int retval;512512+513513+ if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED)514514+ return -EPERM;515515+ retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE);516516+ if (!retval)517517+ stream->runtime->state = SNDRV_PCM_STATE_RUNNING;518518+ return retval;519519+}520520+521521+static int snd_compr_start(struct snd_compr_stream *stream)522522+{523523+ int retval;524524+525525+ if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED)526526+ return -EPERM;527527+ retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_START);528528+ if (!retval)529529+ stream->runtime->state = SNDRV_PCM_STATE_RUNNING;530530+ return retval;531531+}532532+533533+static int snd_compr_stop(struct snd_compr_stream *stream)534534+{535535+ int retval;536536+537537+ if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED ||538538+ stream->runtime->state == SNDRV_PCM_STATE_SETUP)539539+ return -EPERM;540540+ retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP);541541+ if (!retval) {542542+ stream->runtime->state = SNDRV_PCM_STATE_SETUP;543543+ wake_up(&stream->runtime->sleep);544544+ }545545+ return retval;546546+}547547+548548+static int snd_compr_drain(struct snd_compr_stream *stream)549549+{550550+ int retval;551551+552552+ if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED ||553553+ stream->runtime->state == SNDRV_PCM_STATE_SETUP)554554+ return -EPERM;555555+ retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN);556556+ if (!retval) {557557+ stream->runtime->state = SNDRV_PCM_STATE_DRAINING;558558+ wake_up(&stream->runtime->sleep);559559+ }560560+ return retval;561561+}562562+563563+static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)564564+{565565+ struct snd_compr_file *data = f->private_data;566566+ struct snd_compr_stream *stream;567567+ int retval = -ENOTTY;568568+569569+ if (snd_BUG_ON(!data))570570+ return -EFAULT;571571+ stream = &data->stream;572572+ if (snd_BUG_ON(!stream))573573+ return -EFAULT;574574+ mutex_lock(&stream->device->lock);575575+ switch (_IOC_NR(cmd)) {576576+ case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):577577+ put_user(SNDRV_COMPRESS_VERSION,578578+ (int __user *)arg) ? -EFAULT : 0;579579+ break;580580+ case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):581581+ retval = snd_compr_get_caps(stream, arg);582582+ break;583583+ case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):584584+ retval = snd_compr_get_codec_caps(stream, arg);585585+ break;586586+ case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):587587+ retval = snd_compr_set_params(stream, arg);588588+ break;589589+ case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS):590590+ retval = snd_compr_get_params(stream, arg);591591+ break;592592+ case _IOC_NR(SNDRV_COMPRESS_TSTAMP):593593+ retval = snd_compr_tstamp(stream, arg);594594+ break;595595+ case _IOC_NR(SNDRV_COMPRESS_AVAIL):596596+ retval = snd_compr_ioctl_avail(stream, arg);597597+ break;598598+ case _IOC_NR(SNDRV_COMPRESS_PAUSE):599599+ retval = snd_compr_pause(stream);600600+ break;601601+ case _IOC_NR(SNDRV_COMPRESS_RESUME):602602+ retval = snd_compr_resume(stream);603603+ break;604604+ case _IOC_NR(SNDRV_COMPRESS_START):605605+ retval = snd_compr_start(stream);606606+ break;607607+ case _IOC_NR(SNDRV_COMPRESS_STOP):608608+ retval = snd_compr_stop(stream);609609+ break;610610+ case _IOC_NR(SNDRV_COMPRESS_DRAIN):611611+ retval = snd_compr_drain(stream);612612+ break;613613+ }614614+ mutex_unlock(&stream->device->lock);615615+ return retval;616616+}617617+618618+static const struct file_operations snd_compr_file_ops = {619619+ .owner = THIS_MODULE,620620+ .open = snd_compr_open,621621+ .release = snd_compr_free,622622+ .write = snd_compr_write,623623+ .read = snd_compr_read,624624+ .unlocked_ioctl = snd_compr_ioctl,625625+ .mmap = snd_compr_mmap,626626+ .poll = snd_compr_poll,627627+};628628+629629+static int snd_compress_dev_register(struct snd_device *device)630630+{631631+ int ret = -EINVAL;632632+ char str[16];633633+ struct snd_compr *compr;634634+635635+ if (snd_BUG_ON(!device || !device->device_data))636636+ return -EBADFD;637637+ compr = device->device_data;638638+639639+ sprintf(str, "comprC%iD%i", compr->card->number, compr->device);640640+ pr_debug("reg %s for device %s, direction %d\n", str, compr->name,641641+ compr->direction);642642+ /* register compressed device */643643+ ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card,644644+ compr->device, &snd_compr_file_ops, compr, str);645645+ if (ret < 0) {646646+ pr_err("snd_register_device failed\n %d", ret);647647+ return ret;648648+ }649649+ return ret;650650+651651+}652652+653653+static int snd_compress_dev_disconnect(struct snd_device *device)654654+{655655+ struct snd_compr *compr;656656+657657+ compr = device->device_data;658658+ snd_unregister_device(compr->direction, compr->card, compr->device);659659+ return 0;660660+}661661+662662+/*663663+ * snd_compress_new: create new compress device664664+ * @card: sound card pointer665665+ * @device: device number666666+ * @dirn: device direction, should be of type enum snd_compr_direction667667+ * @compr: compress device pointer668668+ */669669+int snd_compress_new(struct snd_card *card, int device,670670+ int dirn, struct snd_compr *compr)671671+{672672+ static struct snd_device_ops ops = {673673+ .dev_free = NULL,674674+ .dev_register = snd_compress_dev_register,675675+ .dev_disconnect = snd_compress_dev_disconnect,676676+ };677677+678678+ compr->card = card;679679+ compr->device = device;680680+ compr->direction = dirn;681681+ return snd_device_new(card, SNDRV_DEV_COMPRESS, compr, &ops);682682+}683683+EXPORT_SYMBOL_GPL(snd_compress_new);684684+685685+static int snd_compress_add_device(struct snd_compr *device)686686+{687687+ int ret;688688+689689+ if (!device->card)690690+ return -EINVAL;691691+692692+ /* register the card */693693+ ret = snd_card_register(device->card);694694+ if (ret)695695+ goto out;696696+ return 0;697697+698698+out:699699+ pr_err("failed with %d\n", ret);700700+ return ret;701701+702702+}703703+704704+static int snd_compress_remove_device(struct snd_compr *device)705705+{706706+ return snd_card_free(device->card);707707+}708708+709709+/**710710+ * snd_compress_register - register compressed device711711+ *712712+ * @device: compressed device to register713713+ */714714+int snd_compress_register(struct snd_compr *device)715715+{716716+ int retval;717717+718718+ if (device->name == NULL || device->dev == NULL || device->ops == NULL)719719+ return -EINVAL;720720+721721+ pr_debug("Registering compressed device %s\n", device->name);722722+ if (snd_BUG_ON(!device->ops->open))723723+ return -EINVAL;724724+ if (snd_BUG_ON(!device->ops->free))725725+ return -EINVAL;726726+ if (snd_BUG_ON(!device->ops->set_params))727727+ return -EINVAL;728728+ if (snd_BUG_ON(!device->ops->trigger))729729+ return -EINVAL;730730+731731+ mutex_init(&device->lock);732732+733733+ /* register a compressed card */734734+ mutex_lock(&device_mutex);735735+ retval = snd_compress_add_device(device);736736+ mutex_unlock(&device_mutex);737737+ return retval;738738+}739739+EXPORT_SYMBOL_GPL(snd_compress_register);740740+741741+int snd_compress_deregister(struct snd_compr *device)742742+{743743+ pr_debug("Removing compressed device %s\n", device->name);744744+ mutex_lock(&device_mutex);745745+ snd_compress_remove_device(device);746746+ mutex_unlock(&device_mutex);747747+ return 0;748748+}749749+EXPORT_SYMBOL_GPL(snd_compress_deregister);750750+751751+static int __init snd_compress_init(void)752752+{753753+ return 0;754754+}755755+756756+static void __exit snd_compress_exit(void)757757+{758758+}759759+760760+module_init(snd_compress_init);761761+module_exit(snd_compress_exit);762762+763763+MODULE_DESCRIPTION("ALSA Compressed offload framework");764764+MODULE_AUTHOR("Vinod Koul <vinod.koul@linux.intel.com>");765765+MODULE_LICENSE("GPL v2");
+1-1
sound/core/oss/pcm_oss.c
···47474848static int dsp_map[SNDRV_CARDS];4949static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};5050-static int nonblock_open = 1;5050+static bool nonblock_open = 1;51515252MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>");5353MODULE_DESCRIPTION("PCM OSS emulation for ALSA.");
+1-1
sound/core/seq/seq_dummy.c
···6565MODULE_ALIAS("snd-seq-client-" __stringify(SNDRV_SEQ_CLIENT_DUMMY));66666767static int ports = 1;6868-static int duplex;6868+static bool duplex;69697070module_param(ports, int, 0444);7171MODULE_PARM_DESC(ports, "number of ports to be created");
+1
sound/core/sound.c
···229229 case SNDRV_DEVICE_TYPE_RAWMIDI:230230 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:231231 case SNDRV_DEVICE_TYPE_PCM_CAPTURE:232232+ case SNDRV_DEVICE_TYPE_COMPRESS:232233 if (snd_BUG_ON(!card))233234 return -EINVAL;234235 minor = SNDRV_MINOR(card->number, type + dev);
+1-1
sound/drivers/aloop.c
···51515252static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5353static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5454-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};5454+static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};5555static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};5656static int pcm_notify[SNDRV_CARDS];5757
+3-3
sound/drivers/dummy.c
···60606161static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */6262static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */6363-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};6363+static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};6464static char *model[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = NULL};6565static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};6666static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};6767//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};6868#ifdef CONFIG_HIGH_RES_TIMERS6969-static int hrtimer = 1;6969+static bool hrtimer = 1;7070#endif7171-static int fake_buffer = 1;7171+static bool fake_buffer = 1;72727373module_param_array(index, int, NULL, 0444);7474MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
+2-13
sound/drivers/ml403-ac97cr.c
···73737474static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;7575static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;7676-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;7676+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;77777878module_param_array(index, int, NULL, 0444);7979MODULE_PARM_DESC(index, "Index value for ML403 AC97 Controller Reference.");···13411341 },13421342};1343134313441344-static int __init alsa_card_ml403_ac97cr_init(void)13451345-{13461346- return platform_driver_register(&snd_ml403_ac97cr_driver);13471347-}13481348-13491349-static void __exit alsa_card_ml403_ac97cr_exit(void)13501350-{13511351- platform_driver_unregister(&snd_ml403_ac97cr_driver);13521352-}13531353-13541354-module_init(alsa_card_ml403_ac97cr_init)13551355-module_exit(alsa_card_ml403_ac97cr_exit)13441344+module_platform_driver(snd_ml403_ac97cr_driver);
+3-3
sound/drivers/mpu401/mpu401.c
···35353636static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* exclude the first card */3737static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */3838-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */3838+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */3939#ifdef CONFIG_PNP4040-static int pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4040+static bool pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4141#endif4242static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */4343static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */4444-static int uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4444+static bool uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};45454646module_param_array(index, int, NULL, 0444);4747MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
+1-1
sound/drivers/mts64.c
···36363737static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;3838static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;3939-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;3939+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;40404141static struct platform_device *platform_devices[SNDRV_CARDS]; 4242static int device_count;
+1-1
sound/drivers/opl3/opl3_midi.c
···27272828extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];29293030-extern int use_internal_drums;3030+extern bool use_internal_drums;31313232static void snd_opl3_note_off_unsafe(void *p, int note, int vel,3333 struct snd_midi_channel *chan);
+1-1
sound/drivers/opl3/opl3_seq.c
···3232MODULE_LICENSE("GPL");3333MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth");34343535-int use_internal_drums = 0;3535+bool use_internal_drums = 0;3636module_param(use_internal_drums, bool, 0444);3737MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");3838
+2-2
sound/drivers/pcsp/pcsp.c
···25252626static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */2727static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */2828-static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */2929-static int nopcm; /* Disable PCM capability of the driver */2828+static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */2929+static bool nopcm; /* Disable PCM capability of the driver */30303131module_param(index, int, 0444);3232MODULE_PARM_DESC(index, "Index value for pcsp soundcard.");
+1-1
sound/drivers/pcsp/pcsp_lib.c
···1414#include <asm/io.h>1515#include "pcsp.h"16161717-static int nforce_wa;1717+static bool nforce_wa;1818module_param(nforce_wa, bool, 0444);1919MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "2020 "(expect bad sound)");
+1-1
sound/drivers/portman2x4.c
···55555656static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;5757static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;5858-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5858+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;59596060static struct platform_device *platform_devices[SNDRV_CARDS]; 6161static int device_count;
+2-2
sound/drivers/serial-u16550.c
···69697070static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */7171static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */7272-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */7272+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */7373static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */7474static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */7575static int speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */···7777static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */7878static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */7979static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};8080-static int droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };8080+static bool droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };81818282module_param_array(index, int, NULL, 0444);8383MODULE_PARM_DESC(index, "Index value for Serial MIDI.");
+1-1
sound/drivers/virmidi.c
···63636464static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */6565static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */6666-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};6666+static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};6767static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};68686969module_param_array(index, int, NULL, 0444);
+1-1
sound/isa/ad1816a/ad1816a.c
···44444545static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */4646static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4747-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */4747+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */4848static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */4949static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */5050static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
+2-2
sound/isa/ad1848/ad1848.c
···43434444static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4545static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4646-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4646+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4747static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */4848static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */4949static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */5050-static int thinkpad[SNDRV_CARDS]; /* Thinkpad special case */5050+static bool thinkpad[SNDRV_CARDS]; /* Thinkpad special case */51515252module_param_array(index, int, NULL, 0444);5353MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
+1-1
sound/isa/adlib.c
···18181919static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;2020static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;2121-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;2121+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;2222static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;23232424module_param_array(index, int, NULL, 0444);
+1-1
sound/isa/als100.c
···54545555static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5656static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5757-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5757+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5858static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */5959static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */6060static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
+1-1
sound/isa/azt2320.c
···55555656static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5757static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5858-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */5858+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */5959static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */6060static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */6161static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
+2-2
sound/isa/cmi8330.c
···69697070static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;7171static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;7272-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;7272+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;7373#ifdef CONFIG_PNP7474-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};7474+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};7575#endif7676static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;7777static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
+1-1
sound/isa/cs423x/cs4231.c
···41414242static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4343static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4444-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4444+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4545static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */4646static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */4747static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
+2-2
sound/isa/cs423x/cs4236.c
···74747575static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */7676static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */7777-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */7777+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */7878#ifdef CONFIG_PNP7979-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};7979+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};8080#endif8181static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */8282static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
+2-2
sound/isa/es1688/es1688.c
···5151static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5252static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5353#ifdef CONFIG_PNP5454-static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;5454+static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;5555#endif5656-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5656+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5757static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */5858static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */5959static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
+2-2
sound/isa/es18xx.c
···1964196419651965static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */19661966static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */19671967-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */19671967+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */19681968#ifdef CONFIG_PNP19691969-static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;19691969+static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;19701970#endif19711971static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */19721972#ifndef CONFIG_PNP
+1-1
sound/isa/galaxy/galaxy.c
···35353636static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;3737static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;3838-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;3838+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;39394040module_param_array(index, int, NULL, 0444);4141MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
+1-1
sound/isa/gus/gusclassic.c
···42424343static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4444static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4545-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4545+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4646static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */4747static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */4848static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
+1-1
sound/isa/gus/gusextreme.c
···46464747static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4848static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4949-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4949+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5050static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */5151static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */5252static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */
+1-1
sound/isa/gus/gusmax.c
···40404141static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4242static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4343-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4343+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4444static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */4545static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */4646static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
+2-2
sound/isa/gus/interwave.c
···55555656static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5757static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5858-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */5858+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */5959#ifdef CONFIG_PNP6060-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};6060+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};6161#endif6262static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */6363#ifdef SNDRV_STB
+1-1
sound/isa/msnd/msnd_pinnacle.c
···785785static int calibrate_signal;786786787787#ifdef CONFIG_PNP788788-static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;788788+static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;789789module_param_array(isapnp, bool, NULL, 0444);790790MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");791791#define has_isapnp(x) isapnp[x]
+2-2
sound/isa/opl3sa2.c
···46464747static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4848static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4949-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */4949+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */5050#ifdef CONFIG_PNP5151-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};5151+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};5252#endif5353static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */5454static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
+1-1
sound/isa/opti9xx/miro.c
···6161static int wss;6262static int ide;6363#ifdef CONFIG_PNP6464-static int isapnp = 1; /* Enable ISA PnP detection */6464+static bool isapnp = 1; /* Enable ISA PnP detection */6565#endif66666767module_param(index, int, 0444);
+1-1
sound/isa/opti9xx/opti92x-ad1848.c
···63636464static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */6565static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */6666-//static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */6666+//static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */6767#ifdef CONFIG_PNP6868static int isapnp = 1; /* Enable ISA PnP detection */6969#endif
+1-1
sound/isa/sb/jazz16.c
···36363737static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */3838static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */3939-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */3939+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4040static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;4141static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;4242static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
+2-2
sound/isa/sb/sb16.c
···68686969static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */7070static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */7171-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */7171+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */7272#ifdef CONFIG_PNP7373-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};7373+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};7474#endif7575static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */7676static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */
+1-1
sound/isa/sb/sb8.c
···36363737static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */3838static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */3939-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */3939+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4040static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */4141static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */4242static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */
+1-1
sound/isa/sc6000.c
···48484949static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5050static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5151-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5151+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */5252static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */5353static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */5454static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
+3-3
sound/isa/wavefront/wavefront.c
···38383939static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4040static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4141-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4141+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */4242#ifdef CONFIG_PNP4343-static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4343+static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4444#endif4545static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */4646static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */···5151static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */5252static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */5353static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */5454-static int use_cs4232_midi[SNDRV_CARDS];5454+static bool use_cs4232_midi[SNDRV_CARDS];55555656module_param_array(index, int, NULL, 0444);5757MODULE_PARM_DESC(index, "Index value for WaveFront soundcard.");
···119119static struct address_info cfg;120120static int nr_ad1848_devs;121121122122-static int deskpro_xl;123123-static int deskpro_m;124124-static int soundpro;122122+static bool deskpro_xl;123123+static bool deskpro_m;124124+static bool soundpro;125125126126static volatile signed char irq2dev[17] = {127127 -1, -1, -1, -1, -1, -1, -1, -1,···177177#ifdef CONFIG_PNP178178static int isapnp = 1;179179static int isapnpjump;180180-static int reverse;180180+static bool reverse;181181182182static int audio_activated;183183#else
+1-1
sound/oss/msnd_pinnacle.c
···17011701#ifndef CONFIG_MSNDPIN_DIGITAL17021702# define CONFIG_MSNDPIN_DIGITAL 017031703#endif17041704-static int digital __initdata = CONFIG_MSNDPIN_DIGITAL;17041704+static bool digital __initdata = CONFIG_MSNDPIN_DIGITAL;1705170517061706#endif /* MSND_CLASSIC */17071707
+6-6
sound/oss/pas2_card.c
···4141static int pas_sb_base;4242DEFINE_SPINLOCK(pas_lock);4343#ifndef CONFIG_PAS_JOYSTICK4444-static int joystick;4444+static bool joystick;4545#else4646-static int joystick = 1;4646+static bool joystick = 1;4747#endif4848#ifdef SYMPHONY_PAS4949-static int symphony = 1;4949+static bool symphony = 1;5050#else5151-static int symphony;5151+static bool symphony;5252#endif5353#ifdef BROKEN_BUS_CLOCK5454-static int broken_bus_clock = 1;5454+static bool broken_bus_clock = 1;5555#else5656-static int broken_bus_clock;5656+static bool broken_bus_clock;5757#endif58585959static struct address_info cfg;
+5-5
sound/oss/pss.c
···117117118118/* If compiled into kernel, it enable or disable pss mixer */119119#ifdef CONFIG_PSS_MIXER120120-static int pss_mixer = 1;120120+static bool pss_mixer = 1;121121#else122122-static int pss_mixer;122122+static bool pss_mixer;123123#endif124124125125···147147static int pss_initialized;148148static int nonstandard_microcode;149149static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */150150-static int pss_enable_joystick; /* Parameter for enabling the joystick */150150+static bool pss_enable_joystick; /* Parameter for enabling the joystick */151151static coproc_operations pss_coproc_operations;152152153153static void pss_write(pss_confdata *devc, int data)···11331133static int mss_dma __initdata = -1;11341134static int mpu_io __initdata = -1;11351135static int mpu_irq __initdata = -1;11361136-static int pss_no_sound = 0; /* Just configure non-sound components */11371137-static int pss_keep_settings = 1; /* Keep hardware settings at module exit */11361136+static bool pss_no_sound = 0; /* Just configure non-sound components */11371137+static bool pss_keep_settings = 1; /* Keep hardware settings at module exit */11381138static char *pss_firmware = "/etc/sound/pss_synth";1139113911401140module_param(pss_io, int, 0);
+1-1
sound/oss/trix.c
···31313232static int mpu;33333434-static int joystick;3434+static bool joystick;35353636static unsigned char trix_read(int addr)3737{
+1-1
sound/pci/ac97/ac97_codec.c
···4242MODULE_DESCRIPTION("Universal interface for Audio Codec '97");4343MODULE_LICENSE("GPL");44444545-static int enable_loopback;4545+static bool enable_loopback;46464747module_param(enable_loopback, bool, 0444);4848MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
+1-1
sound/pci/ad1889.c
···6666module_param_array(id, charp, NULL, 0444);6767MODULE_PARM_DESC(id, "ID string for the AD1889 soundcard.");68686969-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;6969+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;7070module_param_array(enable, bool, NULL, 0444);7171MODULE_PARM_DESC(enable, "Enable AD1889 soundcard.");7272
+2-2
sound/pci/ali5451/ali5451.c
···4848static int index = SNDRV_DEFAULT_IDX1; /* Index */4949static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */5050static int pcm_channels = 32;5151-static int spdif;5151+static bool spdif;52525353module_param(index, int, 0444);5454MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio.");···6060MODULE_PARM_DESC(spdif, "Support SPDIF I/O");61616262/* just for backward compatibility */6363-static int enable;6363+static bool enable;6464module_param(enable, bool, 0444);65656666
+8-1
sound/pci/als300.c
···115115116116static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;117117static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;118118-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;118118+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;119119+120120+module_param_array(index, int, NULL, 0444);121121+MODULE_PARM_DESC(index, "Index value for ALS300 sound card.");122122+module_param_array(id, charp, NULL, 0444);123123+MODULE_PARM_DESC(id, "ID string for ALS300 sound card.");124124+module_param_array(enable, bool, NULL, 0444);125125+MODULE_PARM_DESC(enable, "Enable ALS300 sound card.");119126120127struct snd_als300 {121128 unsigned long port;
+1-1
sound/pci/als4000.c
···90909191static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */9292static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */9393-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */9393+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */9494#ifdef SUPPORT_JOYSTICK9595static int joystick_port[SNDRV_CARDS];9696#endif
···30303131#ifndef _HPI_H_3232#define _HPI_H_3333-/* HPI Version3434-If HPI_VER_MINOR is odd then its a development release not intended for the3535-public. If HPI_VER_MINOR is even then is a release version3636-i.e 3.05.02 is a development version3737-*/3838-#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \3939- ((maj << 16) + (min << 8) + rel)4040-4141-#define HPI_VER_MAJOR(v) ((int)(v >> 16))4242-#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))4343-#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))4444-4545-#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)4646-#define HPI_VER_STRING "4.08.00"4747-4848-/* Library version as documented in hpi-api-versions.txt */4949-#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 0, 0)50335134#include <linux/types.h>5252-#define HPI_BUILD_EXCLUDE_DEPRECATED5335#define HPI_BUILD_KERNEL_MODE54365537/******************************************************************************/···195213 /** RTP stream input node - This node is a destination for196214 packets of RTP audio samples from other devices. */197215 HPI_SOURCENODE_RTP_DESTINATION = 112,198198- HPI_SOURCENODE_GP_IN = 113, /**< general purpose input. */216216+ HPI_SOURCENODE_INTERNAL = 113, /**< node internal to the device. */199217 /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */200218 HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */201219 /* AX6 max sourcenode types = 15 */···224242 /** RTP stream output node - This node is a source for225243 packets of RTP audio samples that are sent to other devices. */226244 HPI_DESTNODE_RTP_SOURCE = 208,227227- HPI_DESTNODE_GP_OUT = 209, /**< general purpose output node. */228245 /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */229229- HPI_DESTNODE_LAST_INDEX = 209 /**< largest ID */246246+ HPI_DESTNODE_LAST_INDEX = 208 /**< largest ID */230247 /* AX6 max destnode types = 15 */231248};232249···431450across the host bus. Note, this does not imply that interrupts are432451enabled. Instead it indicates that they can be enabled.433452*/434434- HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272453453+ HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272,454454+/** Readonly supports firmware updating.455455+Indicates that the adapter implements an interface to update firmware456456+on the adapter.457457+*/458458+ HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273,459459+/** Readonly Firmware IDs460460+Identifiy firmware independent of individual adapter type.461461+May be used as a filter for firmware update images.462462+Property 1 = Bootloader ID463463+Property 2 = Main program ID464464+*/465465+ HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274435466};436467437468/** Adapter mode commands···631638 HPI_MIXER_STORE_ENABLE = 4,632639/** Disable auto storage of some control settings. */633640 HPI_MIXER_STORE_DISABLE = 5,634634-/** Save the attributes of a single control. */641641+/** Unimplemented - save the attributes of a single control. */635642 HPI_MIXER_STORE_SAVE_SINGLE = 6636643};637644···934941 HPI_ERROR_BAD_ADAPTER_NUMBER = 202,935942 /** 2 adapters with the same adapter number. */936943 HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203,937937- /** DSP code failed to bootload. (unused?) */944944+ /** DSP code failed to bootload. Usually a DSP memory test failure. */938945 HPI_ERROR_DSP_BOOTLOAD = 204,939946 /** Couldn't find or open the DSP code file. */940947 HPI_ERROR_DSP_FILE_NOT_FOUND = 206,···971978 HPI_ERROR_FLASH_VERIFY = 225,972979 HPI_ERROR_FLASH_TYPE = 226,973980 HPI_ERROR_FLASH_START = 227,981981+ HPI_ERROR_FLASH_READ = 228,982982+ HPI_ERROR_FLASH_READ_NO_FILE = 229,983983+ HPI_ERROR_FLASH_SIZE = 230,974984975985 /** Reserved for OEMs. */976986 HPI_ERROR_RESERVED_1 = 290,···10161020 HPI_ERROR_NO_INTERDSP_GROUPS = 315,10171021 /** Stream wait cancelled before threshold reached. */10181022 HPI_ERROR_WAIT_CANCELLED = 316,10231023+ /** A character string is invalid. */10241024+ HPI_ERROR_INVALID_STRING = 317,1019102510201026 /** Invalid mixer node for this adapter. */10211027 HPI_ERROR_INVALID_NODE = 400,···10441046 /** I2C */10451047 HPI_ERROR_I2C_BAD_ADR = 460,1046104810471047- /** Entity errors */10491049+ /** Entity type did not match requested type */10481050 HPI_ERROR_ENTITY_TYPE_MISMATCH = 470,10511051+ /** Entity item count did not match requested count */10491052 HPI_ERROR_ENTITY_ITEM_COUNT = 471,10531053+ /** Entity type is not one of the valid types */10501054 HPI_ERROR_ENTITY_TYPE_INVALID = 472,10551055+ /** Entity role is not one of the valid roles */10511056 HPI_ERROR_ENTITY_ROLE_INVALID = 473,10571057+ /** Entity size doesn't match target size */10521058 HPI_ERROR_ENTITY_SIZE_MISMATCH = 474,1053105910541060 /* AES18 specific errors were 500..507 */···10801078/** \defgroup maximums HPI maximum values10811079\{10821080*/10831083-/** Maximum number of adapters per HPI sub-system10841084- WARNING: modifying this value changes the response structure size.*/10811081+/** Maximum number of PCI HPI adapters */10851082#define HPI_MAX_ADAPTERS 2010861083/** Maximum number of in or out streams per adapter */10871084#define HPI_MAX_STREAMS 16···10901089/** maximum number of ancillary bytes per MPEG frame */10911090#define HPI_MAX_ANC_BYTES_PER_FRAME (64)10921091#define HPI_STRING_LEN 1610921092+10931093+/** Networked adapters have index >= 100 */10941094+#define HPI_MIN_NETWORK_ADAPTER_IDX 1001093109510941096/** Velocity units */10951097#define HPI_OSTREAM_VELOCITY_UNITS 4096···11151111struct hpi_format {11161112 u32 sample_rate;11171113 /**< 11025, 32000, 44100 ... */11181118- u32 bit_rate; /**< for MPEG */11141114+ u32 bit_rate; /**< for MPEG */11191115 u32 attributes;11201116 /**< Stereo/JointStereo/Mono */11211117 u16 mode_legacy;11221118 /**< Legacy ancillary mode or idle bit */11231123- u16 unused; /**< Unused */11241124- u16 channels; /**< 1,2..., (or ancillary mode or idle bit */11251125- u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */11191119+ u16 unused; /**< Unused */11201120+ u16 channels; /**< 1,2..., (or ancillary mode or idle bit */11211121+ u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */11261122};1127112311281124struct hpi_anc_frame {···11471143 } control;11481144 } u;11491145};11501150-11511151-/* skip host side function declarations for11521152- DSP compile and documentation extraction */1153114611541147#ifndef DISABLE_PRAGMA_PACK111551148#pragma pack(pop)···13581357u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,13591358 short *max_gain_01dB, short *step_gain_01dB);1360135913611361-u16 hpi_volume_query_channels(const u32 h_volume, u32 *p_channels);13601360+u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);1362136113631362u16 hpi_volume_auto_fade(u32 h_control,13641363 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);···13661365u16 hpi_volume_auto_fade_profile(u32 h_control,13671366 short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,13681367 u16 profile);13681368+13691369+u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,13701370+ u16 *profile);1369137113701372/*****************/13711373/* Level control */
···11/*****************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+29-28
sound/pci/asihpi/hpi6205.c
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as···4545#define HPI6205_ERROR_MSG_RESP_TIMEOUT 101646464747/* initialization/bootload errors */4848-#define HPI6205_ERROR_6205_NO_IRQ 10024949-#define HPI6205_ERROR_6205_INIT_FAILED 10035050-#define HPI6205_ERROR_6205_REG 10065151-#define HPI6205_ERROR_6205_DSPPAGE 10075252-#define HPI6205_ERROR_C6713_HPIC 10095353-#define HPI6205_ERROR_C6713_HPIA 10105454-#define HPI6205_ERROR_C6713_PLL 10115555-#define HPI6205_ERROR_DSP_INTMEM 10125656-#define HPI6205_ERROR_DSP_EXTMEM 10135757-#define HPI6205_ERROR_DSP_PLD 10145858-#define HPI6205_ERROR_6205_EEPROM 10175959-#define HPI6205_ERROR_DSP_EMIF 10184848+#define HPI6205_ERROR_6205_NO_IRQ 10024949+#define HPI6205_ERROR_6205_INIT_FAILED 10035050+#define HPI6205_ERROR_6205_REG 10065151+#define HPI6205_ERROR_6205_DSPPAGE 10075252+#define HPI6205_ERROR_C6713_HPIC 10095353+#define HPI6205_ERROR_C6713_HPIA 10105454+#define HPI6205_ERROR_C6713_PLL 10115555+#define HPI6205_ERROR_DSP_INTMEM 10125656+#define HPI6205_ERROR_DSP_EXTMEM 10135757+#define HPI6205_ERROR_DSP_PLD 10145858+#define HPI6205_ERROR_6205_EEPROM 10175959+#define HPI6205_ERROR_DSP_EMIF1 10186060+#define HPI6205_ERROR_DSP_EMIF2 10196161+#define HPI6205_ERROR_DSP_EMIF3 10206262+#define HPI6205_ERROR_DSP_EMIF4 102160636164/*****************************************************************************/6265/* for C6205 PCI i/f */···491488 return;492489 }493490494494- phr->u.s.adapter_type = ao.adapter_type;491491+ phr->u.s.adapter_type = ao.type;495492 phr->u.s.adapter_index = ao.index;496493 phr->error = 0;497494}···506503 phr->error = HPI_ERROR_INVALID_OBJ_INDEX;507504 return;508505 }509509- phw = (struct hpi_hw_obj *)pao->priv;506506+ phw = pao->priv;510507 /* reset adapter h/w */511508 /* Reset C6713 #1 */512509 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0);···655652 if (hr.error)656653 return hr.error;657654658658- pao->adapter_type = hr.u.ax.info.adapter_type;655655+ pao->type = hr.u.ax.info.adapter_type;659656 pao->index = hr.u.ax.info.adapter_index;660657661658 max_streams =···667664 hr.u.ax.info.adapter_type, hr.u.ax.info.adapter_index,668665 hr.u.ax.info.serial_number);669666 }670670-671671- pao->open = 0; /* upon creation the adapter is closed */672667673668 if (phw->p_cache)674669 phw->p_cache->adap_idx = pao->index;···804803 obj_index];805804 status->samples_processed = 0;806805 status->stream_state = HPI_STATE_STOPPED;807807- status->dSP_index = 0;808808- status->host_index = status->dSP_index;806806+ status->dsp_index = 0;807807+ status->host_index = status->dsp_index;809808 status->size_in_bytes = phm->u.d.u.buffer.buffer_size;810809 status->auxiliary_data_available = 0;811810···879878static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status)880879{881880 return status->size_in_bytes - (status->host_index -882882- status->dSP_index);881881+ status->dsp_index);883882}884883885884static void outstream_write(struct hpi_adapter_obj *pao,···10811080 obj_index];10821081 status->samples_processed = 0;10831082 status->stream_state = HPI_STATE_STOPPED;10841084- status->dSP_index = 0;10851085- status->host_index = status->dSP_index;10831083+ status->dsp_index = 0;10841084+ status->host_index = status->dsp_index;10861085 status->size_in_bytes = phm->u.d.u.buffer.buffer_size;10871086 status->auxiliary_data_available = 0;10881087···1163116211641163static u32 instream_get_bytes_available(struct hpi_hostbuffer_status *status)11651164{11661166- return status->dSP_index - status->host_index;11651165+ return status->dsp_index - status->host_index;11671166}1168116711691168static void instream_read(struct hpi_adapter_obj *pao,···16151614 boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting);16161615 if (setting != boot_loader_read_mem32(pao, dsp_index,16171616 0x01800008))16181618- return HPI6205_ERROR_DSP_EMIF;16171617+ return HPI6205_ERROR_DSP_EMIF1;1619161816201619 /* EMIF CE1 setup - 32 bit async. This is 6713 #1 HPI, */16211620 /* which occupies D15..0. 6713 starts at 27MHz, so need */···16281627 boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting);16291628 if (setting != boot_loader_read_mem32(pao, dsp_index,16301629 0x01800004))16311631- return HPI6205_ERROR_DSP_EMIF;16301630+ return HPI6205_ERROR_DSP_EMIF2;1632163116331632 /* EMIF CE2 setup - 32 bit async. This is 6713 #2 HPI, */16341633 /* which occupies D15..0. 6713 starts at 27MHz, so need */···16401639 boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting);16411640 if (setting != boot_loader_read_mem32(pao, dsp_index,16421641 0x01800010))16431643- return HPI6205_ERROR_DSP_EMIF;16421642+ return HPI6205_ERROR_DSP_EMIF3;1644164316451644 /* EMIF CE3 setup - 32 bit async. */16461645 /* This is the PLD on the ASI5000 cards only */···16511650 boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting);16521651 if (setting != boot_loader_read_mem32(pao, dsp_index,16531652 0x01800014))16541654- return HPI6205_ERROR_DSP_EMIF;16531653+ return HPI6205_ERROR_DSP_EMIF4;1655165416561655 /* set EMIF SDRAM control for 2Mx32 SDRAM (512x32x4 bank) */16571656 /* need to use this else DSP code crashes? */
···11+/** HPI Version Definitions22+Development releases have odd minor version.33+Production releases have even minor version.44+55+\file hpi_version.h66+*/77+88+#ifndef _HPI_VERSION_H99+#define _HPI_VERSION_H1010+1111+/* Use single digits for versions less that 10 to avoid octal. */1212+/* *** HPI_VER is the only edit required to update version *** */1313+/** HPI version */1414+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4, 10, 1)1515+1616+/** HPI version string in dotted decimal format */1717+#define HPI_VER_STRING "4.10.01"1818+1919+/** Library version as documented in hpi-api-versions.txt */2020+#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 2, 0)2121+2222+/** Construct hpi version number from major, minor, release numbers */2323+#define HPI_VERSION_CONSTRUCTOR(maj, min, r) ((maj << 16) + (min << 8) + r)2424+2525+/** Extract major version from hpi version number */2626+#define HPI_VER_MAJOR(v) ((int)(v >> 16))2727+/** Extract minor version from hpi version number */2828+#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))2929+/** Extract release from hpi version number */3030+#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))3131+3232+#endif
+19-13
sound/pci/asihpi/hpicmn.c
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as···6868u16 hpi_add_adapter(struct hpi_adapter_obj *pao)6969{7070 u16 retval = 0;7171- /*HPI_ASSERT(pao->wAdapterType); */7171+ /*HPI_ASSERT(pao->type); */72727373 hpios_alistlock_lock(&adapters);7474···7777 goto unlock;7878 }79798080- if (adapters.adapter[pao->index].adapter_type) {8080+ if (adapters.adapter[pao->index].type) {8181 int a;8282 for (a = HPI_MAX_ADAPTERS - 1; a >= 0; a--) {8383- if (!adapters.adapter[a].adapter_type) {8383+ if (!adapters.adapter[a].type) {8484 HPI_DEBUG_LOG(WARNING,8585 "ASI%X duplicate index %d moved to %d\n",8686- pao->adapter_type, pao->index, a);8686+ pao->type, pao->index, a);8787 pao->index = a;8888 break;8989 }···104104105105void hpi_delete_adapter(struct hpi_adapter_obj *pao)106106{107107- if (!pao->adapter_type) {107107+ if (!pao->type) {108108 HPI_DEBUG_LOG(ERROR, "removing null adapter?\n");109109 return;110110 }111111112112 hpios_alistlock_lock(&adapters);113113- if (adapters.adapter[pao->index].adapter_type)113113+ if (adapters.adapter[pao->index].type)114114 adapters.gw_num_adapters--;115115 memset(&adapters.adapter[pao->index], 0, sizeof(adapters.adapter[0]));116116 hpios_alistlock_unlock(&adapters);···132132 }133133134134 pao = &adapters.adapter[adapter_index];135135- if (pao->adapter_type != 0) {135135+ if (pao->type != 0) {136136 /*137137 HPI_DEBUG_LOG(VERBOSE, "Found adapter index %d\n",138138 wAdapterIndex);···165165166166 /* find the nCount'th nonzero adapter in array */167167 for (index = 0; index < HPI_MAX_ADAPTERS; index++) {168168- if (adapters.adapter[index].adapter_type) {168168+ if (adapters.adapter[index].type) {169169 if (!count)170170 break;171171 count--;···174174175175 if (index < HPI_MAX_ADAPTERS) {176176 phr->u.s.adapter_index = adapters.adapter[index].index;177177- phr->u.s.adapter_type = adapters.adapter[index].adapter_type;177177+ phr->u.s.adapter_type = adapters.adapter[index].type;178178 } else {179179 phr->u.s.adapter_index = 0;180180 phr->u.s.adapter_type = 0;181181- phr->error = HPI_ERROR_BAD_ADAPTER_NUMBER;181181+ phr->error = HPI_ERROR_INVALID_OBJ_INDEX;182182 }183183}184184···324324 }325325326326 phr->error = 0;327327+ phr->specific_error = 0;328328+ phr->version = 0;327329328330 /* set the default response size */329331 response_size =···533531 found ? "Cached" : "Uncached", phm->adapter_index,534532 pI->control_index, pI->control_type, phm->u.c.attribute);535533536536- if (found)534534+ if (found) {537535 phr->size = (u16)response_size;536536+ phr->type = HPI_TYPE_RESPONSE;537537+ phr->object = phm->object;538538+ phr->function = phm->function;539539+ }538540539541 return found;540542}···637631 if (!p_cache)638632 return NULL;639633640640- p_cache->p_info = kzalloc(sizeof(*p_cache->p_info) * control_count,634634+ p_cache->p_info = kcalloc(control_count, sizeof(*p_cache->p_info),641635 GFP_KERNEL);642636 if (!p_cache->p_info) {643637 kfree(p_cache);
+8-5
sound/pci/asihpi/hpicmn.h
···11/**2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as···18181919*/20202121+struct hpi_adapter_obj;2222+2323+/* a function that takes an adapter obj and returns an int */2424+typedef int adapter_int_func(struct hpi_adapter_obj *pao);2525+2126struct hpi_adapter_obj {2227 struct hpi_pci pci; /* PCI info - bus#,dev#,address etc */2323- u16 adapter_type; /* ASI6701 etc */2424- u16 index; /* */2525- u16 open; /* =1 when adapter open */2626- u16 mixer_open;2828+ u16 type; /* 0x6644 == ASI6644 etc */2929+ u16 index;27302831 struct hpios_spinlock dsp_lock;2932
+1-1
sound/pci/asihpi/hpidebug.c
···11/************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+1-1
sound/pci/asihpi/hpidebug.h
···11/*****************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
···27272828#include "hpi_internal.h"29293030-/** Code header version is decimal encoded e.g. 4.06.10 is 40601 */3131-#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \3232-HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))3333-3430/** Header structure for dsp firmware file3531 This structure must match that used in s2bin.c for generation of asidsp.bin3632 */
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+1-1
sound/pci/asihpi/hpimsginit.h
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+2-1
sound/pci/asihpi/hpimsgx.c
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as···2222*****************************************************************************/2323#define SOURCEFILE_NAME "hpimsgx.c"2424#include "hpi_internal.h"2525+#include "hpi_version.h"2526#include "hpimsginit.h"2627#include "hpicmn.h"2728#include "hpimsgx.h"
+1-1
sound/pci/asihpi/hpimsgx.h
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+27-36
sound/pci/asihpi/hpioctl.c
···2121#define SOURCEFILE_NAME "hpioctl.c"22222323#include "hpi_internal.h"2424+#include "hpi_version.h"2425#include "hpimsginit.h"2526#include "hpidebug.h"2627#include "hpimsgx.h"···6665static void hpi_send_recv_f(struct hpi_message *phm, struct hpi_response *phr,6766 struct file *file)6867{6969- int adapter = phm->adapter_index;7070-7171- if ((adapter >= HPI_MAX_ADAPTERS || adapter < 0)6868+ if ((phm->adapter_index >= HPI_MAX_ADAPTERS)7269 && (phm->object != HPI_OBJ_SUBSYSTEM))7370 phr->error = HPI_ERROR_INVALID_OBJ_INDEX;7471 else···177178 } else {178179 u16 __user *ptr = NULL;179180 u32 size = 0;180180- u32 adapter_present;181181 /* -1=no data 0=read from user mem, 1=write to user mem */182182 int wrflag = -1;183183- struct hpi_adapter *pa;183183+ struct hpi_adapter *pa = NULL;184184185185- if (hm->h.adapter_index < HPI_MAX_ADAPTERS) {185185+ if (hm->h.adapter_index < ARRAY_SIZE(adapters))186186 pa = &adapters[hm->h.adapter_index];187187- adapter_present = pa->type;188188- } else {189189- adapter_present = 0;190190- }191187192192- if (!adapter_present) {188188+ if (!pa || !pa->adapter || !pa->adapter->type) {193189 hpi_init_response(&hr->r0, hm->h.object,194190 hm->h.function, HPI_ERROR_BAD_ADAPTER_NUMBER);195191···311317 const struct pci_device_id *pci_id)312318{313319 int idx, nm;320320+ int adapter_index;314321 unsigned int memlen;315322 struct hpi_message hm;316323 struct hpi_response hr;···340345341346 hm.adapter_index = HPI_ADAPTER_INDEX_INVALID;342347343343- adapter.pci = pci_dev;344344-345348 nm = HPI_MAX_ADAPTER_MEM_SPACES;346349347350 for (idx = 0; idx < nm; idx++) {···348355349356 if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) {350357 memlen = pci_resource_len(pci_dev, idx);351351- adapter.ap_remapped_mem_base[idx] =358358+ pci.ap_mem_base[idx] =352359 ioremap(pci_resource_start(pci_dev, idx),353360 memlen);354354- if (!adapter.ap_remapped_mem_base[idx]) {361361+ if (!pci.ap_mem_base[idx]) {355362 HPI_DEBUG_LOG(ERROR,356363 "ioremap failed, aborting\n");357364 /* unmap previously mapped pci mem space */358365 goto err;359366 }360367 }361361-362362- pci.ap_mem_base[idx] = adapter.ap_remapped_mem_base[idx];363368 }364369365370 pci.pci_dev = pci_dev;···368377 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);369378 if (hr.error)370379 goto err;380380+381381+ adapter_index = hr.u.s.adapter_index;382382+ adapter.adapter = hpi_find_adapter(adapter_index);371383372384 if (prealloc_stream_buf) {373385 adapter.p_buffer = vmalloc(prealloc_stream_buf);···383389 }384390 }385391386386- adapter.index = hr.u.s.adapter_index;387387- adapter.type = hr.u.s.adapter_type;388388-389392 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,390393 HPI_ADAPTER_OPEN);391391- hm.adapter_index = adapter.index;394394+ hm.adapter_index = adapter.adapter->index;392395 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);393396394397 if (hr.error)395398 goto err;396399397397- adapter.snd_card_asihpi = NULL;398400 /* WARNING can't init mutex in 'adapter'399401 * and then copy it to adapters[] ?!?!400402 */401401- adapters[adapter.index] = adapter;402402- mutex_init(&adapters[adapter.index].mutex);403403- pci_set_drvdata(pci_dev, &adapters[adapter.index]);403403+ adapters[adapter_index] = adapter;404404+ mutex_init(&adapters[adapter_index].mutex);405405+ pci_set_drvdata(pci_dev, &adapters[adapter_index]);404406405407 dev_printk(KERN_INFO, &pci_dev->dev,406406- "probe succeeded for ASI%04X HPI index %d\n", adapter.type,407407- adapter.index);408408+ "probe succeeded for ASI%04X HPI index %d\n",409409+ adapter.adapter->type, adapter_index);408410409411 return 0;410412411413err:412414 for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) {413413- if (adapter.ap_remapped_mem_base[idx]) {414414- iounmap(adapter.ap_remapped_mem_base[idx]);415415- adapter.ap_remapped_mem_base[idx] = NULL;415415+ if (pci.ap_mem_base[idx]) {416416+ iounmap(pci.ap_mem_base[idx]);417417+ pci.ap_mem_base[idx] = NULL;416418 }417419 }418420···427437 struct hpi_message hm;428438 struct hpi_response hr;429439 struct hpi_adapter *pa;440440+ struct hpi_pci pci;441441+430442 pa = pci_get_drvdata(pci_dev);443443+ pci = pa->adapter->pci;431444432445 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,433446 HPI_ADAPTER_DELETE);434434- hm.adapter_index = pa->index;447447+ hm.adapter_index = pa->adapter->index;435448 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);436449437450 /* unmap PCI memory space, mapped during device init. */438451 for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) {439439- if (pa->ap_remapped_mem_base[idx]) {440440- iounmap(pa->ap_remapped_mem_base[idx]);441441- pa->ap_remapped_mem_base[idx] = NULL;442442- }452452+ if (pci.ap_mem_base[idx])453453+ iounmap(pci.ap_mem_base[idx]);443454 }444455445456 if (pa->p_buffer)···452461 "remove %04x:%04x,%04x:%04x,%04x," " HPI index %d.\n",453462 pci_dev->vendor, pci_dev->device,454463 pci_dev->subsystem_vendor, pci_dev->subsystem_device,455455- pci_dev->devfn, pa->index);464464+ pci_dev->devfn, pa->adapter->index);456465457466 memset(pa, 0, sizeof(*pa));458467}
+1-1
sound/pci/asihpi/hpioctl.h
···11/*******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+1-1
sound/pci/asihpi/hpios.c
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+7-9
sound/pci/asihpi/hpios.h
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as···149149#define hpios_alistlock_lock(obj) spin_lock(&((obj)->list_lock.lock))150150#define hpios_alistlock_unlock(obj) spin_unlock(&((obj)->list_lock.lock))151151152152+struct snd_card;153153+154154+/** pci drvdata points to an instance of this struct */152155struct hpi_adapter {156156+ struct hpi_adapter_obj *adapter;157157+ struct snd_card *snd_card;158158+153159 /* mutex prevents contention for one card154160 between multiple user programs (via ioctl) */155161 struct mutex mutex;156156- u16 index;157157- u16 type;158158-159159- /* ALSA card structure */160160- void *snd_card_asihpi;161161-162162 char *p_buffer;163163 size_t buffer_size;164164- struct pci_dev *pci;165165- void __iomem *ap_remapped_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];166164};167165168166#endif
+1-1
sound/pci/asihpi/hpipcida.h
···11/******************************************************************************2233 AudioScience HPI driver44- Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>44+ Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>5566 This program is free software; you can redistribute it and/or modify77 it under the terms of version 2 of the GNU General Public License as
+2-2
sound/pci/atiixp.c
···4343static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */4444static int ac97_clock = 48000;4545static char *ac97_quirk;4646-static int spdif_aclink = 1;4646+static bool spdif_aclink = 1;4747static int ac97_codec = -1;48484949module_param(index, int, 0444);···6060MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");61616262/* just for backward compatibility */6363-static int enable;6363+static bool enable;6464module_param(enable, bool, 0444);65656666
+1-1
sound/pci/atiixp_modem.c
···5151MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");52525353/* just for backward compatibility */5454-static int enable;5454+static bool enable;5555module_param(enable, bool, 0444);56565757
+1-1
sound/pci/au88x0/au88x0.c
···2626// module parameters (see "Module Parameters")2727static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;2828static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;2929-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;2929+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;3030static int pcifix[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 255 };31313232module_param_array(index, int, NULL, 0444);
+4-6
sound/pci/au88x0/au88x0_core.c
···805805}806806807807static void808808-vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority,808808+vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int stereo, int priority,809809 int empty, int valid, int f)810810{811811 int temp, lifeboat = 0;···837837#else838838 temp = (this_4 & 0x3f) << 0xc;839839#endif840840- temp = (temp & 0xfffffffd) | ((b & 1) << 1);840840+ temp = (temp & 0xfffffffd) | ((stereo & 1) << 1);841841 temp = (temp & 0xfffffff3) | ((priority & 3) << 2);842842 temp = (temp & 0xffffffef) | ((valid & 1) << 4);843843 temp |= FIFO_U1;···1148114811491149static void11501150vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, int dir,11511151- int fmt, int d, u32 offset)11511151+ int fmt, int stereo, u32 offset)11521152{11531153 stream_t *dma = &vortex->dma_adb[adbdma];1154115411551155- dma->dma_unknown = d;11551155+ dma->dma_unknown = stereo;11561156 dma->dma_ctrl =11571157 ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK));11581158 /* Enable PCMOUT interrupts. */···13361336 dma->fifo_status = FIFO_PAUSE;13371337}1338133813391339-#if 0 // Using pause instead13401339static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma)13411340{13421341 stream_t *dma = &vortex->dma_adb[adbdma];···13501351 dma->fifo_enabled = 0;13511352}1352135313531353-#endif13541354/* WTDMA */1355135513561356#ifndef CHIP_AU8810
···153153 ********************************/154154static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;155155static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;156156-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;156156+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;157157158158module_param_array(index, int, NULL, 0444);159159MODULE_PARM_DESC(index, "Index value for Audiowerk2 soundcard.");
+1-1
sound/pci/azt3328.c
···301301module_param_array(id, charp, NULL, 0444);302302MODULE_PARM_DESC(id, "ID string for AZF3328 soundcard.");303303304304-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */304304+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */305305module_param_array(enable, bool, NULL, 0444);306306MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard.");307307
+2-2
sound/pci/bt87x.c
···42424343static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */4444static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4545-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4545+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4646static int digital_rate[SNDRV_CARDS]; /* digital input rate */4747-static int load_all; /* allow to load the non-whitelisted cards */4747+static bool load_all; /* allow to load the non-whitelisted cards */48484949module_param_array(index, int, NULL, 0444);5050MODULE_PARM_DESC(index, "Index value for Bt87x soundcard");
+1-1
sound/pci/ca0106/ca0106_main.c
···156156// module parameters (see "Module Parameters")157157static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;158158static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;159159-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;159159+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;160160static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */161161162162module_param_array(index, int, NULL, 0444);
+2-2
sound/pci/cmipci.c
···54545555static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5656static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5757-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */5757+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */5858static long mpu_port[SNDRV_CARDS];5959static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};6060-static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};6060+static bool soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};6161#ifdef SUPPORT_JOYSTICK6262static int joystick_port[SNDRV_CARDS];6363#endif
+2-2
sound/pci/cs4281.c
···44444545static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4646static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4747-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */4848-static int dual_codec[SNDRV_CARDS]; /* dual codec */4747+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */4848+static bool dual_codec[SNDRV_CARDS]; /* dual codec */49495050module_param_array(index, int, NULL, 0444);5151MODULE_PARM_DESC(index, "Index value for CS4281 soundcard.");
+4-4
sound/pci/cs46xx/cs46xx.c
···46464747static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4848static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4949-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5050-static int external_amp[SNDRV_CARDS];5151-static int thinkpad[SNDRV_CARDS];5252-static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};4949+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5050+static bool external_amp[SNDRV_CARDS];5151+static bool thinkpad[SNDRV_CARDS];5252+static bool mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};53535454module_param_array(index, int, NULL, 0444);5555MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard.");
+8-1
sound/pci/cs5530.c
···50505151static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;5252static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;5353-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5353+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5454+5555+module_param_array(index, int, NULL, 0444);5656+MODULE_PARM_DESC(index, "Index value for CS5530 Audio driver.");5757+module_param_array(id, charp, NULL, 0444);5858+MODULE_PARM_DESC(id, "ID string for CS5530 Audio driver.");5959+module_param_array(enable, bool, NULL, 0444);6060+MODULE_PARM_DESC(enable, "Enable CS5530 Audio driver.");54615562struct snd_cs5530 {5663 struct snd_card *card;
+1-1
sound/pci/cs5535audio/cs5535audio.c
···57575858static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;5959static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;6060-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;6060+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;61616262module_param_array(index, int, NULL, 0444);6363MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME);
···437437438438 /* Allocate mem for master src resource */439439 if (MEMRD == desc->mode)440440- src = kzalloc(sizeof(*src)*desc->multi, GFP_KERNEL);440440+ src = kcalloc(desc->multi, sizeof(*src), GFP_KERNEL);441441 else442442 src = kzalloc(sizeof(*src), GFP_KERNEL);443443
+2-2
sound/pci/ctxfi/cttimer.c
···1515#include "cthardware.h"1616#include "cttimer.h"17171818-static int use_system_timer;1919-MODULE_PARM_DESC(use_system_timer, "Foce to use system-timer");1818+static bool use_system_timer;1919+MODULE_PARM_DESC(use_system_timer, "Force to use system-timer");2020module_param(use_system_timer, bool, S_IRUGO);21212222struct ct_timer_ops {
+1-1
sound/pci/ctxfi/xfi.c
···32323333static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;3434static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;3535-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;3535+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;3636static unsigned int subsystem[SNDRV_CARDS];37373838module_param_array(index, int, NULL, 0444);
+1-1
sound/pci/echoaudio/echoaudio.c
···26262727static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;2828static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;2929-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;2929+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;30303131module_param_array(index, int, NULL, 0444);3232MODULE_PARM_DESC(index, "Index value for " ECHOCARD_NAME " soundcard.");
+2-2
sound/pci/emu10k1/emu10k1.c
···44444545static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4646static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4747-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4747+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4848static int extin[SNDRV_CARDS];4949static int extout[SNDRV_CARDS];5050static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};5151static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};5252static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};5353-static int enable_ir[SNDRV_CARDS];5353+static bool enable_ir[SNDRV_CARDS];5454static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */5555static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};5656
···5050// module parameters (see "Module Parameters")5151static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;5252static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;5353-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5353+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;54545555module_param_array(index, int, NULL, 0444);5656MODULE_PARM_DESC(index, "Index value for the EMU10K1X soundcard.");
+2-2
sound/pci/ens1370.c
···83838484static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8585static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8686-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */8686+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */8787#ifdef SUPPORT_JOYSTICK8888#ifdef CHIP13718989static int joystick_port[SNDRV_CARDS];9090#else9191-static int joystick[SNDRV_CARDS];9191+static bool joystick[SNDRV_CARDS];9292#endif9393#endif9494#ifdef CHIP1371
+1-1
sound/pci/es1938.c
···79798080static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8181static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8282-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */8282+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */83838484module_param_array(index, int, NULL, 0444);8585MODULE_PARM_DESC(index, "Index value for ESS Solo-1 soundcard.");
+2-2
sound/pci/es1968.c
···132132133133static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */134134static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */135135-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */135135+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */136136static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };137137static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };138138static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };···140140static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};141141static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};142142#ifdef SUPPORT_JOYSTICK143143-static int joystick[SNDRV_CARDS];143143+static bool joystick[SNDRV_CARDS];144144#endif145145146146module_param_array(index, int, NULL, 0444);
+1-1
sound/pci/fm801.c
···48484949static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5050static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5151-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5151+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5252/*5353 * Enable TEA575x tuner5454 * 1 = MediaForte 256-PCS
+3-3
sound/pci/hda/hda_codec.c
···4046404640474047 /* Search for codec ID */40484048 for (q = tbl; q->subvendor; q++) {40494049- unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);40504050-40514051- if (vendorid == codec->subsystem_id)40494049+ unsigned int mask = 0xffff0000 | q->subdevice_mask;40504050+ unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;40514051+ if ((codec->subsystem_id & mask) == id)40524052 break;40534053 }40544054
+19-9
sound/pci/hda/hda_eld.c
···347347348348 for (i = 0; i < size; i++) {349349 unsigned int val = hdmi_get_eld_data(codec, nid, i);350350+ /*351351+ * Graphics driver might be writing to ELD buffer right now.352352+ * Just abort. The caller will repoll after a while.353353+ */350354 if (!(val & AC_ELDD_ELD_VALID)) {351351- if (!i) {352352- snd_printd(KERN_INFO353353- "HDMI: invalid ELD data\n");354354- ret = -EINVAL;355355- goto error;356356- }357355 snd_printd(KERN_INFO358356 "HDMI: invalid ELD data byte %d\n", i);359359- val = 0;360360- } else361361- val &= AC_ELDD_ELD_DATA;357357+ ret = -EINVAL;358358+ goto error;359359+ }360360+ val &= AC_ELDD_ELD_DATA;361361+ /*362362+ * The first byte cannot be zero. This can happen on some DVI363363+ * connections. Some Intel chips may also need some 250ms delay364364+ * to return non-zero ELD data, even when the graphics driver365365+ * correctly writes ELD content before setting ELD_valid bit.366366+ */367367+ if (!val && !i) {368368+ snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");369369+ ret = -EINVAL;370370+ goto error;371371+ }362372 buf[i] = val;363373 }364374
+4-5
sound/pci/hda/hda_intel.c
···58585959static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;6060static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;6161-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;6161+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;6262static char *model[SNDRV_CARDS];6363static int position_fix[SNDRV_CARDS];6464static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};6565static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};6666static int probe_only[SNDRV_CARDS];6767-static int single_cmd;6767+static bool single_cmd;6868static int enable_msi = -1;6969#ifdef CONFIG_SND_HDA_PATCH_LOADER7070static char *patch[SNDRV_CARDS];···116116 * this may give more power-saving, but will take longer time to117117 * wake up.118118 */119119-static int power_save_controller = 1;119119+static bool power_save_controller = 1;120120module_param(power_save_controller, bool, 0644);121121MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");122122#endif123123124124-static int align_buffer_size = 1;124124+static bool align_buffer_size = 1;125125module_param(align_buffer_size, bool, 0644);126126MODULE_PARM_DESC(align_buffer_size,127127 "Force buffer and period sizes to be multiple of 128 bytes.");···25082508 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),25092509 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),25102510 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),25112511- SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),25122511 SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),25132512 SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),25142513 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
+23-9
sound/pci/hda/patch_cirrus.c
···5858 unsigned int gpio_mask;5959 unsigned int gpio_dir;6060 unsigned int gpio_data;6161+ unsigned int gpio_eapd_hp; /* EAPD GPIO bit for headphones */6262+ unsigned int gpio_eapd_speaker; /* EAPD GPIO bit for speakers */61636264 struct hda_pcm pcm_rec[2]; /* PCM information */6365···7876 CS420X_MBP53,7977 CS420X_MBP55,8078 CS420X_IMAC27,7979+ CS420X_APPLE,8180 CS420X_AUTO,8281 CS420X_MODELS8382};···931928 spdif_present ? 0 : PIN_OUT);932929 }933930 }934934- if (spec->board_config == CS420X_MBP53 ||935935- spec->board_config == CS420X_MBP55 ||936936- spec->board_config == CS420X_IMAC27) {937937- unsigned int gpio = hp_present ? 0x02 : 0x08;931931+ if (spec->gpio_eapd_hp) {932932+ unsigned int gpio = hp_present ?933933+ spec->gpio_eapd_hp : spec->gpio_eapd_speaker;938934 snd_hda_codec_write(codec, 0x01, 0,939935 AC_VERB_SET_GPIO_DATA, gpio);940936 }···12781276 [CS420X_MBP53] = "mbp53",12791277 [CS420X_MBP55] = "mbp55",12801278 [CS420X_IMAC27] = "imac27",12791279+ [CS420X_APPLE] = "apple",12811280 [CS420X_AUTO] = "auto",12821281};12831282···12881285 SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),12891286 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),12901287 SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),12911291- SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),12881288+ /* this conflicts with too many other models */12891289+ /*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/12901290+ {} /* terminator */12911291+};12921292+12931293+static const struct snd_pci_quirk cs420x_codec_cfg_tbl[] = {12941294+ SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),12921295 {} /* terminator */12931296};12941297···13761367 spec->board_config =13771368 snd_hda_check_board_config(codec, CS420X_MODELS,13781369 cs420x_models, cs420x_cfg_tbl);13701370+ if (spec->board_config < 0)13711371+ spec->board_config =13721372+ snd_hda_check_board_codec_sid_config(codec,13731373+ CS420X_MODELS, NULL, cs420x_codec_cfg_tbl);13791374 if (spec->board_config >= 0)13801375 fix_pincfg(codec, spec->board_config, cs_pincfgs);13811376···13871374 case CS420X_IMAC27:13881375 case CS420X_MBP53:13891376 case CS420X_MBP55:13901390- /* GPIO1 = headphones */13911391- /* GPIO3 = speakers */13921392- spec->gpio_mask = 0x0a;13931393- spec->gpio_dir = 0x0a;13771377+ case CS420X_APPLE:13781378+ spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */13791379+ spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */13801380+ spec->gpio_mask = spec->gpio_dir =13811381+ spec->gpio_eapd_hp | spec->gpio_eapd_speaker;13941382 break;13951383 }13961384
···277277 return false;278278}279279280280+static inline hda_nid_t get_capsrc(struct alc_spec *spec, int idx)281281+{282282+ return spec->capsrc_nids ?283283+ spec->capsrc_nids[idx] : spec->adc_nids[idx];284284+}285285+280286/* select the given imux item; either unmute exclusively or select the route */281287static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,282288 unsigned int idx, bool force)···309303 adc_idx = spec->dyn_adc_idx[idx];310304 }311305312312- nid = spec->capsrc_nids ?313313- spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];306306+ nid = get_capsrc(spec, adc_idx);314307315308 /* no selection? */316309 num_conns = snd_hda_get_conn_list(codec, nid, NULL);···10591054 spec->imux_pins[2] = spec->dock_mic_pin;10601055 for (i = 0; i < 3; i++) {10611056 strcpy(imux->items[i].label, texts[i]);10621062- if (spec->imux_pins[i])10571057+ if (spec->imux_pins[i]) {10581058+ hda_nid_t pin = spec->imux_pins[i];10591059+ int c;10601060+ for (c = 0; c < spec->num_adc_nids; c++) {10611061+ hda_nid_t cap = get_capsrc(spec, c);10621062+ int idx = get_connection_index(codec, cap, pin);10631063+ if (idx >= 0) {10641064+ imux->items[i].index = idx;10651065+ break;10661066+ }10671067+ }10631068 imux->num_items = i + 1;10691069+ }10641070 }10651071 spec->num_mux_defs = 1;10661072 spec->input_mux = imux;···19731957 if (!kctl)19741958 kctl = snd_hda_find_mixer_ctl(codec, "Input Source");19751959 for (i = 0; kctl && i < kctl->count; i++) {19761976- const hda_nid_t *nids = spec->capsrc_nids;19771977- if (!nids)19781978- nids = spec->adc_nids;19791979- err = snd_hda_add_nid(codec, kctl, i, nids[i]);19601960+ err = snd_hda_add_nid(codec, kctl, i,19611961+ get_capsrc(spec, i));19801962 if (err < 0)19811963 return err;19821964 }···27612747 }2762274827632749 for (c = 0; c < num_adcs; c++) {27642764- hda_nid_t cap = spec->capsrc_nids ?27652765- spec->capsrc_nids[c] : spec->adc_nids[c];27502750+ hda_nid_t cap = get_capsrc(spec, c);27662751 idx = get_connection_index(codec, cap, pin);27672752 if (idx >= 0) {27682753 spec->imux_pins[imux->num_items] = pin;···37073694 if (!pin)37083695 return 0;37093696 for (i = 0; i < spec->num_adc_nids; i++) {37103710- hda_nid_t cap = spec->capsrc_nids ?37113711- spec->capsrc_nids[i] : spec->adc_nids[i];36973697+ hda_nid_t cap = get_capsrc(spec, i);37123698 int idx;3713369937143700 idx = get_connection_index(codec, cap, pin);
+5-19
sound/pci/hda/patch_sigmatel.c
···16411641 "Alienware M17x", STAC_ALIENWARE_M17X),16421642 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,16431643 "Alienware M17x", STAC_ALIENWARE_M17X),16441644+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,16451645+ "Alienware M17x", STAC_ALIENWARE_M17X),16441646 {} /* terminator */16451647};16461648···44414439 int pinctl, def_conf;4442444044434441 /* power on when no jack detection is available */44444444- if (!spec->hp_detect) {44424442+ /* or when the VREF is used for controlling LED */44434443+ if (!spec->hp_detect ||44444444+ (spec->gpio_led > 8 && spec->gpio_led == nid)) {44454445 stac_toggle_power_map(codec, nid, 1);44464446 continue;44474447 }···50575053 return 0;50585054}5059505550605060-static int stac92xx_post_suspend(struct hda_codec *codec)50615061-{50625062- struct sigmatel_spec *spec = codec->spec;50635063- if (spec->gpio_led > 8) {50645064- /* with vref-out pin used for mute led control50655065- * codec AFG is prevented from D3 state, but on50665066- * system suspend it can (and should) be used50675067- */50685068- snd_hda_codec_read(codec, codec->afg, 0,50695069- AC_VERB_SET_POWER_STATE, AC_PWRST_D3);50705070- }50715071- return 0;50725072-}50735073-50745056static void stac92xx_set_power_state(struct hda_codec *codec, hda_nid_t fg,50755057 unsigned int power_state)50765058{···56565666 } else {56575667 codec->patch_ops.set_power_state =56585668 stac92xx_set_power_state;56595659- codec->patch_ops.post_suspend =56605660- stac92xx_post_suspend;56615669 }56625670 codec->patch_ops.pre_resume = stac92xx_pre_resume;56635671 codec->patch_ops.check_power_status =···59695981 } else {59705982 codec->patch_ops.set_power_state =59715983 stac92xx_set_power_state;59725972- codec->patch_ops.post_suspend =59735973- stac92xx_post_suspend;59745984 }59755985 codec->patch_ops.pre_resume = stac92xx_pre_resume;59765986 codec->patch_ops.check_power_status =
···68686969static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice)7070{7171- /* we use pins 39 and 41 of the VT1616 for left and right read outputs */7272- snd_ac97_write_cache(ice->ac97, 0x5a, snd_ac97_read(ice->ac97, 0x5a) & ~0x8000);7171+ if (ice->ac97)7272+ /* we use pins 39 and 41 of the VT1616 for left and right7373+ read outputs */7474+ snd_ac97_write_cache(ice->ac97, 0x5a,7575+ snd_ac97_read(ice->ac97, 0x5a) & ~0x8000);7376 return 0;7477}7578
+1
sound/pci/ice1712/envy24ht.h
···6666#define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */6767#define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */6868#define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */6969+#define VT1724_CFG_ADC_NONE 0x0c /* no ADCs */6970#define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */70717172#define VT1724_REG_AC97_CFG 0x05 /* byte */
+2-2
sound/pci/ice1712/ice1712.c
···84848585static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8686static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8787-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */8787+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */8888static char *model[SNDRV_CARDS];8989-static int omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */8989+static bool omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */9090static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transceiver reset timeout value in msec */9191static int dxr_enable[SNDRV_CARDS]; /* DXR enable for DMX6FIRE */9292
+57-8
sound/pci/ice1712/ice1724.c
···80808181static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8282static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8383-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */8383+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */8484static char *model[SNDRV_CARDS];85858686module_param_array(index, int, NULL, 0444);···11171117static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device)11181118{11191119 struct snd_pcm *pcm;11201120- int err;11201120+ int capt, err;1121112111221122- err = snd_pcm_new(ice->card, "ICE1724", device, 1, 1, &pcm);11221122+ if ((ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) ==11231123+ VT1724_CFG_ADC_NONE)11241124+ capt = 0;11251125+ else11261126+ capt = 1;11271127+ err = snd_pcm_new(ice->card, "ICE1724", device, 1, capt, &pcm);11231128 if (err < 0)11241129 return err;1125113011261131 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops);11271127- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_vt1724_capture_pro_ops);11321132+ if (capt)11331133+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,11341134+ &snd_vt1724_capture_pro_ops);1128113511291136 pcm->private_data = ice;11301137 pcm->info_flags = 0;···18321825 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;18331826 uinfo->count = 1;1834182718351835- uinfo->value.enumerated.items = hw_rates_count + ice->ext_clock_count;18281828+ /* internal clocks */18291829+ uinfo->value.enumerated.items = hw_rates_count;18301830+ /* external clocks */18311831+ if (ice->force_rdma1 ||18321832+ (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_IN))18331833+ uinfo->value.enumerated.items += ice->ext_clock_count;18361834 /* upper limit - keep at top */18371835 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)18381836 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;···2185217321862174static struct snd_ice1712_card_info no_matched __devinitdata;2187217521762176+21772177+/*21782178+ ooAoo cards with no controls21792179+*/21802180+static unsigned char ooaoo_sq210_eeprom[] __devinitdata = {21812181+ [ICE_EEP2_SYSCONF] = 0x4c, /* 49MHz crystal, no mpu401, no ADC,21822182+ 1xDACs */21832183+ [ICE_EEP2_ACLINK] = 0x80, /* I2S */21842184+ [ICE_EEP2_I2S] = 0x78, /* no volume, 96k, 24bit, 192k */21852185+ [ICE_EEP2_SPDIF] = 0xc1, /* out-en, out-int, out-ext */21862186+ [ICE_EEP2_GPIO_DIR] = 0x00, /* no GPIOs are used */21872187+ [ICE_EEP2_GPIO_DIR1] = 0x00,21882188+ [ICE_EEP2_GPIO_DIR2] = 0x00,21892189+ [ICE_EEP2_GPIO_MASK] = 0xff,21902190+ [ICE_EEP2_GPIO_MASK1] = 0xff,21912191+ [ICE_EEP2_GPIO_MASK2] = 0xff,21922192+21932193+ [ICE_EEP2_GPIO_STATE] = 0x00, /* inputs */21942194+ [ICE_EEP2_GPIO_STATE1] = 0x00, /* all 1, but GPIO_CPLD_RW21952195+ and GPIO15 always zero */21962196+ [ICE_EEP2_GPIO_STATE2] = 0x00, /* inputs */21972197+};21982198+21992199+22002200+struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] __devinitdata = {22012201+ {22022202+ .name = "ooAoo SQ210a",22032203+ .model = "sq210a",22042204+ .eeprom_size = sizeof(ooaoo_sq210_eeprom),22052205+ .eeprom_data = ooaoo_sq210_eeprom,22062206+ },22072207+ { } /* terminator */22082208+};22092209+21882210static struct snd_ice1712_card_info *card_tables[] __devinitdata = {21892211 snd_vt1724_revo_cards,21902212 snd_vt1724_amp_cards,···22332187 snd_vt1724_wtm_cards,22342188 snd_vt1724_se_cards,22352189 snd_vt1724_qtet_cards,21902190+ snd_vt1724_ooaoo_cards,22362191 NULL,22372192};22382193···23172270 }23182271 }23192272 for (tbl = card_tables; *tbl; tbl++) {23202320- for (c = *tbl; c->subvendor; c++) {22732273+ for (c = *tbl; c->name; c++) {23212274 if (modelname && c->model &&23222275 !strcmp(modelname, c->model)) {23232276 printk(KERN_INFO "ice1724: Using board model %s\n",···26262579 ice->ext_clock_count = 0;2627258026282581 for (tbl = card_tables; *tbl; tbl++) {26292629- for (c = *tbl; c->subvendor; c++) {26302630- if (c->subvendor == ice->eeprom.subvendor) {25822582+ for (c = *tbl; c->name; c++) {25832583+ if ((model[dev] && c->model &&25842584+ !strcmp(model[dev], c->model)) ||25852585+ (c->subvendor == ice->eeprom.subvendor)) {26312586 strcpy(card->shortname, c->name);26322587 if (c->driver) /* specific driver? */26332588 strcpy(card->driver, c->driver);
+3-3
sound/pci/intel8x0.c
···7979static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */8080static int ac97_clock;8181static char *ac97_quirk;8282-static int buggy_semaphore;8282+static bool buggy_semaphore;8383static int buggy_irq = -1; /* auto-check */8484-static int xbox;8484+static bool xbox;8585static int spdif_aclink = -1;8686static int inside_vm = -1;8787···105105MODULE_PARM_DESC(inside_vm, "KVM/Parallels optimization.");106106107107/* just for backward compatibility */108108-static int enable;108108+static bool enable;109109module_param(enable, bool, 0444);110110static int joystick;111111module_param(joystick, int, 0444);
+1-1
sound/pci/intel8x0m.c
···6868MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");69697070/* just for backward compatibility */7171-static int enable;7171+static bool enable;7272module_param(enable, bool, 0444);73737474/*
+1-1
sound/pci/korg1212/korg1212.c
···408408409409static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */410410static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */411411-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */411411+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */412412413413module_param_array(index, int, NULL, 0444);414414MODULE_PARM_DESC(index, "Index value for Korg 1212 soundcard.");
+1-1
sound/pci/lola/lola.c
···3535/* Standard options */3636static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;3737static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;3838-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;3838+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;39394040module_param_array(index, int, NULL, 0444);4141MODULE_PARM_DESC(index, "Index value for Digigram Lola driver.");
+1-1
sound/pci/lx6464es/lx6464es.c
···42424343static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;4444static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;4545-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;4545+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;46464747module_param_array(index, int, NULL, 0444);4848MODULE_PARM_DESC(index, "Index value for Digigram LX6464ES interface.");
+16-7
sound/pci/lx6464es/lx_core.c
···7878 return ioread32(address);7979}80808181-void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len)8181+static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data,8282+ u32 len)8283{8383- void __iomem *address = lx_dsp_register(chip, port);8484- memcpy_fromio(data, address, len*sizeof(u32));8484+ u32 __iomem *address = lx_dsp_register(chip, port);8585+ int i;8686+8787+ /* we cannot use memcpy_fromio */8888+ for (i = 0; i != len; ++i)8989+ data[i] = ioread32(address + i);8590}86918792···9691 iowrite32(data, address);9792}98939999-void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,100100- u32 len)9494+static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port,9595+ const u32 *data, u32 len)10196{102102- void __iomem *address = lx_dsp_register(chip, port);103103- memcpy_toio(address, data, len*sizeof(u32));9797+ u32 __iomem *address = lx_dsp_register(chip, port);9898+ int i;9999+100100+ /* we cannot use memcpy_to */101101+ for (i = 0; i != len; ++i)102102+ iowrite32(data[i], address + i);104103}105104106105
-3
sound/pci/lx6464es/lx_core.h
···7272};73737474unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port);7575-void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len);7675void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data);7777-void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,7878- u32 len);79768077/* plx register access */8178enum {
+2-2
sound/pci/maestro3.c
···64646565static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */6666static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */6767-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* all enabled */6868-static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};6767+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* all enabled */6868+static bool external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};6969static int amp_gpio[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};70707171module_param_array(index, int, NULL, 0444);
+1-1
sound/pci/mixart/mixart.c
···49495050static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5151static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5252-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5252+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */53535454module_param_array(index, int, NULL, 0444);5555MODULE_PARM_DESC(index, "Index value for Digigram " CARD_NAME " soundcard.");
+6-6
sound/pci/nm256/nm256.c
···5757static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */5858static int playback_bufsize = 16;5959static int capture_bufsize = 16;6060-static int force_ac97; /* disabled as default */6060+static bool force_ac97; /* disabled as default */6161static int buffer_top; /* not specified */6262-static int use_cache; /* disabled */6363-static int vaio_hack; /* disabled */6464-static int reset_workaround;6565-static int reset_workaround_2;6262+static bool use_cache; /* disabled */6363+static bool vaio_hack; /* disabled */6464+static bool reset_workaround;6565+static bool reset_workaround_2;66666767module_param(index, int, 0444);6868MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");···8686MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops.");87878888/* just for backward compatibility */8989-static int enable;8989+static bool enable;9090module_param(enable, bool, 0444);91919292
···52525353static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5454static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5555-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */5656-static int mono[SNDRV_CARDS]; /* capture mono only */5555+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */5656+static bool mono[SNDRV_CARDS]; /* capture mono only */57575858module_param_array(index, int, NULL, 0444);5959MODULE_PARM_DESC(index, "Index value for Digigram " DRIVER_NAME " soundcard");
+1-1
sound/pci/riptide/riptide.c
···122122123123static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;124124static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;125125-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;125125+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;126126127127#ifdef SUPPORT_JOYSTICK128128static int joystick_port[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS - 1)] = 0x200 };
+2-2
sound/pci/rme32.c
···89899090static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */9191static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */9292-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */9393-static int fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1};9292+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */9393+static bool fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1};94949595module_param_array(index, int, NULL, 0444);9696MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard.");
+1-1
sound/pci/rme96.c
···53535454static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5555static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5656-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5656+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */57575858module_param_array(index, int, NULL, 0444);5959MODULE_PARM_DESC(index, "Index value for RME Digi96 soundcard.");
+2-3
sound/pci/rme9652/hdsp.c
···45454646static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4747static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4848-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4848+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */49495050module_param_array(index, int, NULL, 0444);5151MODULE_PARM_DESC(index, "Index value for RME Hammerfall DSP interface.");···26402640 uinfo->value.enumerated.items = 3;26412641 break;26422642 default:26432643- uinfo->value.enumerated.items = 0;26442644- break;26432643+ return -EINVAL;26452644 }2646264526472646 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+27-7
sound/pci/rme9652/hdspm.c
···61616262static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */6363static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */6464-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */6464+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */65656666module_param_array(index, int, NULL, 0444);6767MODULE_PARM_DESC(index, "Index value for RME HDSPM interface.");···940940 int texts_autosync_items;941941942942 cycles_t last_interrupt;943943+944944+ unsigned int serial;943945944946 struct hdspm_peak_rms peak_rms;945947};···4696469446974695 snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n",46984696 (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF,46994699- (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF);46974697+ hdspm->serial);4700469847014699 snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n",47024700 hdspm->irq, hdspm->port, (unsigned long)hdspm->iobase);···62686266 hdspm_version.card_type = hdspm->io_type;62696267 strncpy(hdspm_version.cardname, hdspm->card_name,62706268 sizeof(hdspm_version.cardname));62716271- hdspm_version.serial = (hdspm_read(hdspm,62726272- HDSPM_midiStatusIn0)>>8) & 0xFFFFFF;62696269+ hdspm_version.serial = hdspm->serial;62736270 hdspm_version.firmware_rev = hdspm->firmware_rev;62746271 hdspm_version.addons = 0;62756272 if (hdspm->tco)···65196518 hdspm->io_type = AES32;65206519 hdspm->card_name = "RME AES32";65216520 hdspm->midiPorts = 2;65226522- } else if ((hdspm->firmware_rev == 0xd5) ||65216521+ } else if ((hdspm->firmware_rev == 0xd2) ||65236522 ((hdspm->firmware_rev >= 0xc8) &&65246523 (hdspm->firmware_rev <= 0xcf))) {65256524 hdspm->io_type = MADI;···67836782 tasklet_init(&hdspm->midi_tasklet,67846783 hdspm_midi_tasklet, (unsigned long) hdspm);6785678467856785+67866786+ if (hdspm->io_type != MADIface) {67876787+ hdspm->serial = (hdspm_read(hdspm,67886788+ HDSPM_midiStatusIn0)>>8) & 0xFFFFFF;67896789+ /* id contains either a user-provided value or the default67906790+ * NULL. If it's the default, we're safe to67916791+ * fill card->id with the serial number.67926792+ *67936793+ * If the serial number is 0xFFFFFF, then we're dealing with67946794+ * an old PCI revision that comes without a sane number. In67956795+ * this case, we don't set card->id to avoid collisions67966796+ * when running with multiple cards.67976797+ */67986798+ if (NULL == id[hdspm->dev] && hdspm->serial != 0xFFFFFF) {67996799+ sprintf(card->id, "HDSPMx%06x", hdspm->serial);68006800+ snd_card_set_id(card, card->id);68016801+ }68026802+ }68036803+67866804 snd_printdd("create alsa devices.\n");67876805 err = snd_hdspm_create_alsa_devices(card, hdspm);67886806 if (err < 0)···68886868 if (hdspm->io_type != MADIface) {68896869 sprintf(card->shortname, "%s_%x",68906870 hdspm->card_name,68916891- (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF);68716871+ hdspm->serial);68926872 sprintf(card->longname, "%s S/N 0x%x at 0x%lx, irq %d",68936873 hdspm->card_name,68946894- (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF,68746874+ hdspm->serial,68956875 hdspm->port, hdspm->irq);68966876 } else {68976877 sprintf(card->shortname, "%s", hdspm->card_name);
+2-2
sound/pci/rme9652/rme9652.c
···38383939static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4040static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4141-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4242-static int precise_ptr[SNDRV_CARDS]; /* Enable precise pointer */4141+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4242+static bool precise_ptr[SNDRV_CARDS]; /* Enable precise pointer */43434444module_param_array(index, int, NULL, 0444);4545MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard.");
+66-25
sound/pci/sis7019.c
···40404141static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */4242static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */4343-static int enable = 1;4343+static bool enable = 1;4444+static int codecs = 1;44454546module_param(index, int, 0444);4647MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator.");···4948MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator.");5049module_param(enable, bool, 0444);5150MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator.");5151+module_param(codecs, int, 0444);5252+MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)");52535354static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = {5455 { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) },···143140 dma_addr_t silence_dma_addr;144141};145142143143+/* These values are also used by the module param 'codecs' to indicate144144+ * which codecs should be present.145145+ */146146#define SIS_PRIMARY_CODEC_PRESENT 0x0001147147#define SIS_SECONDARY_CODEC_PRESENT 0x0002148148#define SIS_TERTIARY_CODEC_PRESENT 0x0004···983977 mutex_unlock(&sis->ac97_mutex);984978985979 if (!count) {986986- printk(KERN_ERR "sis7019: ac97 codec %d timeout cmd 0x%08x\n",980980+ dev_err(&sis->pci->dev, "ac97 codec %d timeout cmd 0x%08x\n",987981 codec, cmd);988982 }989983···10841078{10851079 unsigned long io = sis->ioport;10861080 void __iomem *ioaddr = sis->ioaddr;10811081+ unsigned long timeout;10871082 u16 status;10881083 int count;10891084 int i;···11111104 while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)11121105 udelay(1);1113110611141114- /* Now that we've finished the reset, find out what's attached.11151115- */11161116- status = inl(io + SIS_AC97_STATUS);11171117- if (status & SIS_AC97_STATUS_CODEC_READY)11181118- sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;11191119- if (status & SIS_AC97_STATUS_CODEC2_READY)11201120- sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;11211121- if (status & SIS_AC97_STATUS_CODEC3_READY)11221122- sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;11231123-11241124- /* All done, let go of the semaphore, and check for errors11071107+ /* Command complete, we can let go of the semaphore now.11251108 */11261109 outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA);11271127- if (!sis->codecs_present || !count)11101110+ if (!count)11281111 return -EIO;11121112+11131113+ /* Now that we've finished the reset, find out what's attached.11141114+ * There are some codec/board combinations that take an extremely11151115+ * long time to come up. 350+ ms has been observed in the field,11161116+ * so we'll give them up to 500ms.11171117+ */11181118+ sis->codecs_present = 0;11191119+ timeout = msecs_to_jiffies(500) + jiffies;11201120+ while (time_before_eq(jiffies, timeout)) {11211121+ status = inl(io + SIS_AC97_STATUS);11221122+ if (status & SIS_AC97_STATUS_CODEC_READY)11231123+ sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT;11241124+ if (status & SIS_AC97_STATUS_CODEC2_READY)11251125+ sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT;11261126+ if (status & SIS_AC97_STATUS_CODEC3_READY)11271127+ sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT;11281128+11291129+ if (sis->codecs_present == codecs)11301130+ break;11311131+11321132+ msleep(1);11331133+ }11341134+11351135+ /* All done, check for errors.11361136+ */11371137+ if (!sis->codecs_present) {11381138+ dev_err(&sis->pci->dev, "could not find any codecs\n");11391139+ return -EIO;11401140+ }11411141+11421142+ if (sis->codecs_present != codecs) {11431143+ dev_warn(&sis->pci->dev, "missing codecs, found %0x, expected %0x\n",11441144+ sis->codecs_present, codecs);11451145+ }1129114611301147 /* Let the hardware know that the audio driver is alive,11311148 * and enable PCM slots on the AC-link for L/R playback (3 & 4) and···12561225 pci_restore_state(pci);1257122612581227 if (pci_enable_device(pci) < 0) {12591259- printk(KERN_ERR "sis7019: unable to re-enable device\n");12281228+ dev_err(&pci->dev, "unable to re-enable device\n");12601229 goto error;12611230 }1262123112631232 if (sis_chip_init(sis)) {12641264- printk(KERN_ERR "sis7019: unable to re-init controller\n");12331233+ dev_err(&pci->dev, "unable to re-init controller\n");12651234 goto error;12661235 }1267123612681237 if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED,12691238 KBUILD_MODNAME, sis)) {12701270- printk(KERN_ERR "sis7019: unable to regain IRQ %d\n", pci->irq);12391239+ dev_err(&pci->dev, "unable to regain IRQ %d\n", pci->irq);12711240 goto error;12721241 }12731242···13351304 goto error_out;1336130513371306 if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) {13381338- printk(KERN_ERR "sis7019: architecture does not support "13391339- "30-bit PCI busmaster DMA");13071307+ dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA");13401308 goto error_out_enabled;13411309 }13421310···1349131913501320 rc = pci_request_regions(pci, "SiS7019");13511321 if (rc) {13521352- printk(KERN_ERR "sis7019: unable request regions\n");13221322+ dev_err(&pci->dev, "unable request regions\n");13531323 goto error_out_enabled;13541324 }1355132513561326 rc = -EIO;13571327 sis->ioaddr = ioremap_nocache(pci_resource_start(pci, 1), 0x4000);13581328 if (!sis->ioaddr) {13591359- printk(KERN_ERR "sis7019: unable to remap MMIO, aborting\n");13291329+ dev_err(&pci->dev, "unable to remap MMIO, aborting\n");13601330 goto error_out_cleanup;13611331 }1362133213631333 rc = sis_alloc_suspend(sis);13641334 if (rc < 0) {13651365- printk(KERN_ERR "sis7019: unable to allocate state storage\n");13351335+ dev_err(&pci->dev, "unable to allocate state storage\n");13661336 goto error_out_cleanup;13671337 }13681338···13701340 if (rc)13711341 goto error_out_cleanup;1372134213731373- if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED,13741374- KBUILD_MODNAME, sis)) {13751375- printk(KERN_ERR "unable to allocate irq %d\n", sis->irq);13431343+ if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, KBUILD_MODNAME,13441344+ sis)) {13451345+ dev_err(&pci->dev, "unable to allocate irq %d\n", sis->irq);13761346 goto error_out_cleanup;13771347 }13781348···14191389 rc = -ENOENT;14201390 if (!enable)14211391 goto error_out;13921392+13931393+ /* The user can specify which codecs should be present so that we13941394+ * can wait for them to show up if they are slow to recover from13951395+ * the AC97 cold reset. We default to a single codec, the primary.13961396+ *13971397+ * We assume that SIS_PRIMARY_*_PRESENT matches bits 0-2.13981398+ */13991399+ codecs &= SIS_PRIMARY_CODEC_PRESENT | SIS_SECONDARY_CODEC_PRESENT |14001400+ SIS_TERTIARY_CODEC_PRESENT;14011401+ if (!codecs)14021402+ codecs = SIS_PRIMARY_CODEC_PRESENT;1422140314231404 rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);14241405 if (rc < 0)
+3-3
sound/pci/sonicvibes.c
···52525353static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5454static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5555-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5656-static int reverb[SNDRV_CARDS];5757-static int mge[SNDRV_CARDS];5555+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5656+static bool reverb[SNDRV_CARDS];5757+static bool mge[SNDRV_CARDS];5858static unsigned int dmaio = 0x7a00; /* DDMA i/o address */59596060module_param_array(index, int, NULL, 0444);
+1-1
sound/pci/trident/trident.c
···47474848static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4949static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5050-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5050+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5151static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32};5252static int wavetable_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8192};5353
+2-2
sound/pci/via82xx.c
···8080static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */8181static long mpu_port;8282#ifdef SUPPORT_JOYSTICK8383-static int joystick;8383+static bool joystick;8484#endif8585static int ac97_clock = 48000;8686static char *ac97_quirk;···110110MODULE_PARM_DESC(nodelay, "Disable 500ms init delay");111111112112/* just for backward compatibility */113113-static int enable;113113+static bool enable;114114module_param(enable, bool, 0444);115115116116
+1-1
sound/pci/via82xx_modem.c
···6666MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");67676868/* just for backward compatibility */6969-static int enable;6969+static bool enable;7070module_param(enable, bool, 0444);71717272
+2-2
sound/pci/vx222/vx222.c
···37373838static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */3939static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4040-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4141-static int mic[SNDRV_CARDS]; /* microphone */4040+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4141+static bool mic[SNDRV_CARDS]; /* microphone */4242static int ibl[SNDRV_CARDS]; /* microphone */43434444module_param_array(index, int, NULL, 0444);
+2-2
sound/pci/ymfpci/ymfpci.c
···41414242static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4343static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4444-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4444+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */4545static long fm_port[SNDRV_CARDS];4646static long mpu_port[SNDRV_CARDS];4747#ifdef SUPPORT_JOYSTICK4848static long joystick_port[SNDRV_CARDS];4949#endif5050-static int rear_switch[SNDRV_CARDS];5050+static bool rear_switch[SNDRV_CARDS];51515252module_param_array(index, int, NULL, 0444);5353MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard.");
+1-1
sound/pcmcia/pdaudiocf/pdaudiocf.c
···39394040static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4141static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4242-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */4242+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */43434444module_param_array(index, int, NULL, 0444);4545MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
+1-1
sound/pcmcia/vx/vxpocket.c
···39394040static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4141static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4242-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */4242+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */4343static int ibl[SNDRV_CARDS];44444545module_param_array(index, int, NULL, 0444);
+1-1
sound/ppc/powermac.c
···36363737static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */3838static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */3939-static int enable_beep = 1;3939+static bool enable_beep = 1;40404141module_param(index, int, 0444);4242MODULE_PARM_DESC(index, "Index value for " CHIP_NAME " soundchip.");
+1-1
sound/sh/aica.c
···5555#define CARD_NAME "AICA"5656static int index = -1;5757static char *id;5858-static int enable = 1;5858+static bool enable = 1;5959module_param(index, int, 0444);6060MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");6161module_param(id, charp, 0444);
···50505151static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */5252static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */5353-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5353+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */54545555module_param_array(index, int, NULL, 0444);5656MODULE_PARM_DESC(index, "Index value for Sun AMD7930 soundcard.");
+2-13
sound/sparc/cs4231.c
···4040static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */4141static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */4242/* Enable this card */4343-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;4343+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;44444545module_param_array(index, int, NULL, 0444);4646MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard.");···21182118 .remove = __devexit_p(cs4231_remove),21192119};2120212021212121-static int __init cs4231_init(void)21222122-{21232123- return platform_driver_register(&cs4231_driver);21242124-}21252125-21262126-static void __exit cs4231_exit(void)21272127-{21282128- platform_driver_unregister(&cs4231_driver);21292129-}21302130-21312131-module_init(cs4231_init);21322132-module_exit(cs4231_exit);21212121+module_platform_driver(cs4231_driver);
+2-14
sound/sparc/dbri.c
···8080static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8181static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8282/* Enable this card */8383-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;8383+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;84848585module_param_array(index, int, NULL, 0444);8686MODULE_PARM_DESC(index, "Index value for Sun DBRI soundcard.");···26972697 .remove = __devexit_p(dbri_remove),26982698};2699269927002700-/* Probe for the dbri chip and then attach the driver. */27012701-static int __init dbri_init(void)27022702-{27032703- return platform_driver_register(&dbri_sbus_driver);27042704-}27052705-27062706-static void __exit dbri_exit(void)27072707-{27082708- platform_driver_unregister(&dbri_sbus_driver);27092709-}27102710-27112711-module_init(dbri_init);27122712-module_exit(dbri_exit);27002700+module_platform_driver(dbri_sbus_driver);
+1-1
sound/usb/6fire/chip.c
···35353636static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */3737static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */3838-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */3838+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */3939static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;4040static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;4141
+1-1
sound/usb/caiaq/device.c
···55555656static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */5757static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */5858-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5858+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */5959static int snd_card_used[SNDRV_CARDS];60606161module_param_array(index, int, NULL, 0444);
+3-3
sound/usb/card.c
···78787979static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */8080static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */8181-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */8181+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */8282/* Vendor/product IDs for this card */8383static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };8484static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };8585static int nrpacks = 8; /* max. number of packets per urb */8686-static int async_unlink = 1;8686+static bool async_unlink = 1;8787static int device_setup[SNDRV_CARDS]; /* device parameter for this card */8888-static int ignore_ctl_error;8888+static bool ignore_ctl_error;89899090module_param_array(index, int, NULL, 0444);9191MODULE_PARM_DESC(index, "Index value for the USB audio adapter.");
+3-2
sound/usb/endpoint.c
···17171818#include <linux/gfp.h>1919#include <linux/init.h>2020+#include <linux/ratelimit.h>2021#include <linux/usb.h>2122#include <linux/usb/audio.h>2223···459458460459 for (i = 0; i < urb->number_of_packets; i++) {461460 cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset;462462- if (urb->iso_frame_desc[i].status) {463463- snd_printd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status);461461+ if (urb->iso_frame_desc[i].status && printk_ratelimit()) {462462+ snd_printdd("frame %d active: %d\n", i, urb->iso_frame_desc[i].status);464463 // continue;465464 }466465 bytes = urb->iso_frame_desc[i].actual_length;
+7-1
sound/usb/format.c
···209209 return 0;210210}211211212212+#define MAX_UAC2_NR_RATES 1024213213+212214/*213215 * Helper function to walk the array of sample rate triplets reported by214216 * the device. The problem is that we need to parse whole array first to···228226 int min = combine_quad(&data[2 + 12 * i]);229227 int max = combine_quad(&data[6 + 12 * i]);230228 int res = combine_quad(&data[10 + 12 * i]);231231- int rate;229229+ unsigned int rate;232230233231 if ((max < 0) || (min < 0) || (res < 0) || (max < min))234232 continue;···255253 fp->rates |= snd_pcm_rate_to_rate_bit(rate);256254257255 nr_rates++;256256+ if (nr_rates >= MAX_UAC2_NR_RATES) {257257+ snd_printk(KERN_ERR "invalid uac2 rates\n");258258+ break;259259+ }258260259261 /* avoid endless loop */260262 if (res == 0)
+1-1
sound/usb/misc/ua101.c
···52525353static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;5454static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;5555-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5555+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;5656static unsigned int queue_length = 21;57575858module_param_array(index, int, NULL, 0444);
···3737static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */3838static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */3939 /* Enable this card */4040-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;4040+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;41414242module_param_array(index, int, NULL, 0444);4343MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS".");
+2-4
sound/usb/usx2y/usb_stream.c
···674674 inurb->transfer_buffer_length =675675 inurb->number_of_packets *676676 inurb->iso_frame_desc[0].length;677677- preempt_disable();677677+678678 if (u == 0) {679679 int now;680680 struct usb_device *dev = inurb->dev;···686686 }687687 err = usb_submit_urb(inurb, GFP_ATOMIC);688688 if (err < 0) {689689- preempt_enable();690689 snd_printk(KERN_ERR"usb_submit_urb(sk->inurb[%i])"691690 " returned %i\n", u, err);692691 return err;693692 }694693 err = usb_submit_urb(outurb, GFP_ATOMIC);695694 if (err < 0) {696696- preempt_enable();697695 snd_printk(KERN_ERR"usb_submit_urb(sk->outurb[%i])"698696 " returned %i\n", u, err);699697 return err;700698 }701701- preempt_enable();699699+702700 if (inurb->start_frame != outurb->start_frame) {703701 snd_printd(KERN_DEBUG704702 "u[%i] start_frames differ in:%u out:%u\n",
+1-1
sound/usb/usx2y/usbusx2y.c
···154154155155static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */156156static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */157157-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */157157+static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */158158159159module_param_array(index, int, NULL, 0444);160160MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS".");