summaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652/hdspm.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: hdspm - DRY cleanup of snd_pcm_opsAdrian Knoth2015-02-171-15/+3
| | | | | | | | | This commit removes code duplication between snd_hdspm_{capture,playback}_ops. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - DRY cleanup in .release callbackAdrian Knoth2015-02-171-18/+11
| | | | | | | | | This commit removes code duplication between snd_hdspm_{capture,playback}_release. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - DRY cleanup in .open callbacksAdrian Knoth2015-02-171-76/+24
| | | | | | | | | This commit removes code duplication between snd_hdspm_{capture,playback}_open. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Constrain periods to 2 on older cardsAdrian Knoth2015-02-131-0/+6
| | | | | | | | | | | | | | RME RayDAT and AIO use a fixed buffer size of 16384 samples. With period sizes of 32-4096, this translates to 4-512 periods. The older RME cards have a variable buffer size but require exactly two periods. This patch enforces nperiods=2 on those cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Cc: <stable@vger.kernel.org> # 2.6.39+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Include linux/io.h instead of asm/io.hTakashi Iwai2015-01-281-1/+1
| | | | | | Nowadays it's recommended. Replace all in a shot. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm: Use setup_timer() and mod_timer()Takashi Iwai2015-01-191-9/+5
| | | | | | No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Deletion of checks before the function call "iounmap"Markus Elfring2015-01-041-3/+1
| | | | | | | | | | The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Fix invalid kerneldoc markersTakashi Iwai2014-11-111-24/+24
| | | | | | They are no real kerneldoc comments, so drop such markers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm: remove unused variableSudip Mukherjee2014-10-291-20/+3
| | | | | | | | | | removed the unused variables. These variables were only being assigned some value, but the values were never being used. it has been build tested after removing the variables. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm: Use snd_ctl_enum_info()Takashi Iwai2014-10-211-12/+1
| | | | | | ... and reduce the open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine2014-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
* ALSA: hdspm: Use standard printk helpersTakashi Iwai2014-02-261-56/+69
| | | | | | Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pci: Convert to snd_card_new() with a device pointerTakashi Iwai2014-02-121-4/+2
| | | | | | Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Use strlcpy() instead of strncpy()Takashi Iwai2013-10-291-1/+1
| | | | | | | We tend to make stupid mistakes with strncpy(). Let's take a safer one, strlcpy(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: rme9652: Remove redundant breakSachin Kamat2013-09-131-5/+0
| | | | | | | 'break' after return statement is not necessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Use enums in hdspm_tco_ltc_frames()Adrian Knoth2013-08-191-5/+5
| | | | | | | | This patch doesn't change functionality, it only improves readability and fixes a copy&paste error in a comment. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Fix default value in SNDRV_HDSPM_IOCTL_GET_LTCAdrian Knoth2013-08-191-1/+1
| | | | | | | | | | | | Use enum hdspm_ltc_format's fps_30 (corresponds to 4) instead of 30, Other case branches return 1, 2 or 3 respectively, so 30 obviously is wrong. Since SNDRV_HDSPM_IOCTL_GET_LTC had never been working due to a copy&paste error in hdspm.h, this change doesn't break userspace. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - remove unneeded semicolonFengguang Wu2013-07-151-1/+1
| | | | | | | | | sound/pci/rme9652/hdspm.c:1110:2-3: Unneeded semicolon Generated by: coccinelle/misc/semicolon.cocci Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Added some comments and control register documentationMartin Dausel2013-07-051-7/+99
| | | | | | Signed-off-by: Martin Dausel <martin.dausel@iosono-sound.com> Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Use snd_ctl_enum_info() in snd_hdspm_info_autosync_refAdrian Knoth2013-07-051-20/+4
| | | | | | | | Also use snd_ctl_enum_info() to fill the autosync text fields on AES32 and MADI cards (only users of snd_hdspm_info_autosync_ref). Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Use snd_ctl_enum_info() for texts_autosyncAdrian Knoth2013-07-051-19/+10
| | | | | | | Also use snd_ctl_enum_info() to fill the autosync enumerated controls. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Use snd_ctl_enum_info for most text arraysAdrian Knoth2013-07-051-31/+19
| | | | | | | | Use snd_ctl_enum_info() to fill most of the enumerated controls. More non-trivial occurrences will follow in separate commits. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Enable TCO supportAdrian Knoth2013-07-051-0/+1
| | | | | | | This patch finally enables TCO support on RME AES(32) cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Report external sample rate to userspaceAdrian Knoth2013-07-051-3/+8
| | | | | | | | This patch adds a new ALSA control to read the external sample rate from userspace on RME AES(32) cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Introduce hdspm_external_rate_to_enum() helper functionAdrian Knoth2013-07-051-11/+17
| | | | | | | | | | | This patch refactors the code to query the external sample rate and its translation into the corresponding enum into a helper function to prevent future code duplication. A later commit will make use of this new helper function. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Include TCO and Sync-In in proc outputAdrian Knoth2013-07-051-0/+7
| | | | | | | Also report TCO status and Sync-In via /proc/ on AES(32) cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Enable TCO/Sync-In in snd_hdspm_put_sync_ref()Adrian Knoth2013-07-051-7/+8
| | | | | | | | This patch enables the user to select "TCO" and "Sync In" as a preferred sync reference on RME AES(32) cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Enable TCO input in hdspm_external_sample_rate()Adrian Knoth2013-07-051-9/+28
| | | | | | | | This patch adds support to read the TCO sample rate in hdspm_external_sample_rate() on RME AES(32) cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Ignore float/int format bitAdrian Knoth2013-07-051-0/+10
| | | | | | | | | | As mentioned in the comment, the AES32 cards must not set the format bit, since it is used to indicate the preferred sync setting instead. We hence simply skip the corresponding part in the hw_params function. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Enable AES32 in hdspm_get_tco_sample_rateAdrian Knoth2013-07-051-0/+3
| | | | | | | | This patch adds AES32 specific code to hdspm_get_tco_sample_rate to query the TCO sample rate. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Enable AES32 in hdspm_get_wc_sample_rateAdrian Knoth2013-07-051-0/+3
| | | | | | | | This patch adds AES32 specific code to hdspm_get_wc_sample_rate() to query the wordclock frequency. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Add prototype declarationsAdrian Knoth2013-07-051-4/+12
| | | | | | | | This patch only introduces prototype declarations, no real change. The functions themselves are already present. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Introduce hdspm_get_aes_sample_rate()Adrian Knoth2013-07-051-0/+17
| | | | | | | | | Helper function to return the AES sample rate class. This class needs to be translated via HDSPM_bit2freq() to get the more common representation. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Add TCO and Sync-In text entriesAdrian Knoth2013-07-051-4/+7
| | | | | | | | Provide the text for the two new clock options "TCO" and "Sync In" on AES32 cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AIO: Drop superfluous HDSPM_AUTOSYNC_REFAdrian Knoth2013-07-051-1/+0
| | | | | | | | The HDSPM_AUTOSYNC_REF macro is only implemented for MADI and AES32 cards, so it doesn't make sense to call it on AIO boards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Cosmetics, no real changeAdrian Knoth2013-07-051-5/+7
| | | | | | | This patch does nothing, it's sole intent is to clean up the code. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - AES32: Fix TCO sync check reportingAdrian Knoth2013-07-051-7/+18
| | | | | | | | | | | HDSPM_tco_lock and HDSPM_tcoLock were too close, so the previous code didn't honour the difference between the two. Let's be more verbose and use HDSPM_tcoLockMadi for MADI cards, HDSPM_tcoLockAes for AES(32) and fix the code that makes use of both. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Create TCO readout functionAdrian Knoth2013-07-051-60/+77
| | | | | | | | | | This patch separates the TCO bits from snd_hdspm_proc_read_madi(), so the new function can later be shared between MADI and AES32 cards. It's essentially only moving code around, no new functionality. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Fix S/PDIF Sync status and frequency on RME AIOAdrian Knoth2013-07-051-2/+3
| | | | | | | | | This is a left-over mistake from old code, the correct register offset is provided in kcontrol->private_value, not in the index. Cf. RayDAT case, where it has already been corrected. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Add support for AEBs on RME AIOAdrian Knoth2013-07-051-17/+37
| | | | | | | | | | | AIO cards allow to use AEB (Analogue Expansion Boards) to add four input and/or output channels. This patch adds the necessary code to detect and enable the additional I/O channels. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Enable AD/DA/PH gains and S/PDIF-Input select on AIOAdrian Knoth2013-07-051-1/+5
| | | | | | | | | | | This patch uses the newly introduced HDSPM_CONTROL_TRISTATE functions to create and expose the following ALSA controls: - Gain selection for Input, Output and Phones (HiGain, +4dBu, -10dbV) - S/PDIF Input select (Coaxial, Optical, Internal) Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Introduce generic AIO tristate controlAdrian Knoth2013-07-051-0/+78
| | | | | | | | | | | | | | | | | | AIO cards offer at least four individual settings options with three states each. Those settings are represented as two bits in the settings register with the following meaning: 0*some_base_bit --> Option value 0 1*some_base_bit --> Option value 1 2*some_base_bit --> Option value 2 3*some_base_bit --> mask to select the two involved bits This patch adds a generic ALSA control macro for such a value-to-bit pattern mapping. It will be used in a later commit to expose four new controls. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Refactor ENUMERATED_CTL_INFO into functionAdrian Knoth2013-07-051-8/+14
| | | | | | | | | ENUMERATED_CTL_INFO is a macro, so the binary code is generated multiple times. To avoid code duplication, refactor the involved functionality into a function and make ENUMERATED_CTL_INFO a call to this function. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Add S/PDIF, XLR, WCK48 and ADAT-in controls for RME AIO cardsAdrian Knoth2013-07-051-1/+6
| | | | | | | | | | | | | | This commit adds the following ALSA controls: - S/PDIF Out Optical to switch S/PDIF Out from coaxial to optical - S/PDIF Out Professional to send the Pro bit in the output stream - ADAT-Internal to enable ADAT/TDIF Expansion Board (AEB/TEB) - XLR Breakout Cable if analogue I/O uses the XLR breakout cable - WCK48 to force WordClock to the 32-48kHz range (single speed) if the card is operating at higher frequencies Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Add S/PDIF and WCK48 controls for RME RayDATAdrian Knoth2013-07-051-1/+3
| | | | | | | | This commit adds new ALSA controls to send single-speed WordClock and S/PDIF-Professional on RME RayDAT cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Drop duplicate code in hdspm_set_system_clock_mode()Adrian Knoth2013-07-051-20/+5
| | | | | | | | | hdspm_set_system_clock_mode() is almost a one-by-one copy of hdspm_set_toggle_setting(). To improve code quality, remove the duplication. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Augment HDSPM_TOGGLE_SETTING for AIO/RayDATAdrian Knoth2013-07-051-4/+23
| | | | | | | | | | | The HDSPM_TOGGLE_SETTING functions alter the control_register on older cards. On newer cards (AIO/RayDAT), they have to operate on the settings_register instead. This patch augments the existing functions to work with AIO/RayDAT, too. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Introduce hdspm_is_raydat_or_aio()Adrian Knoth2013-07-051-2/+7
| | | | | | | | | | | RME RayDAT and AIO cards are new designs with different register settings. Since we need to distinguish them from older cards multiple times in the driver, refactor the code into a separate helper function. No functional change intended. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Add missing defines for RME AIO and RayDATAdrian Knoth2013-07-051-0/+19
| | | | | | | | The driver did not support all possible configurations. These defines will be used by later commits to add the missing functionality. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hdspm - Allow SingleSpeed WordClock when in DS/QS modeAdrian Knoth2013-05-311-1/+1
| | | | | | | | | Similarly to MADI, WordClock can also be at SingleSpeed while the card is actually working at twice or four times this rate. If so, multiply the base rate accordingly. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
OpenPOWER on IntegriCloud