summaryrefslogtreecommitdiff
path: root/sound/pci/rme9652
AgeCommit message (Collapse)Author
2013-03-11ALSA: hdspm - Enable new TCO ALSA controlsAdrian Knoth
Expose the newly added TCO LTC and sync check functions to userspace. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Add ALSA controls to read the TCO LTC stateAdrian Knoth
This patch adds new ALSA controls to query the LTC state from userspace. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Also check for TCO sync statesAdrian Knoth
This patch prepares snd_hdspm_get_sync_check() to also check the TCO sync state. The added feature will be exposed to the user in a later commit. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Remove duplicate code from ALSA controlsAdrian Knoth
Considerably shorten the code by using a macro. Though this won't lower the binary size, it makes the source more readable. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Provide ALSA control to disable 96K framesAdrian Knoth
For 96kHz, MADI allows to multiplex the samples (SMUX) or to use a dedicated 96K mode. The RME cards default to 96K mode, but since not all external MADI equipment supports this, provide a switch to users that changes the on-wire protocol to SMUX. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Allow the TCO and SYNC-IN to be used in slave modeAdrian Knoth
When using the additional Time Code Option module in slave mode or the SYNC-In wordclock connector, the sample rate needs to be returned by hdspm_external_sample_rate(). Since this sample rate may contain any value with 1Hz granularity, we need to round it to a common rate as done by the OSX driver. [Fixed missing function declarations by tiwai] Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hdspm - Refactor sample rate acquisitionAdrian Knoth
This commit introduces hdspm_get_pll_freq() to avoid code duplication. Reading the sample rate from the DDS register will be required by upcoming code. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23Merge branch 'for-linus' into for-nextTakashi Iwai
This is a preliminary merge before the upcoming merge of generic parser branch.
2013-01-16ALSA: hdsp - Remove obsolete settings functionsAdrian Knoth
With HDSP_TOGGLE_SETTING in place, these functions are no longer required. Removing them makes the code DRY and considerably shorter. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Use HDSP_TOGGLE_SETTING to alter settingsAdrian Knoth
HDSP_TOGGLE_SETTING and its corresponding functions allow to change settings in the control register. Instead of using the specialised functions, use the generic code to make the code DRY. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Implement generic function to toggle settingsAdrian Knoth
The driver contains multiple similar functions that change only a single bit in the control register, only the bit position varies. This patch implements a generic function to toggle a certain bit position that will be used to replace the old code. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Fix detection for RME RPM/Multiface/Digiface ioboxesAdrian Knoth
The current iobox detection code reportedly fails for various users, so simply do what the Win32 driver does instead. Patch originally by Karl Grill <kgrill@chello.at> and then modified to comply with kernel coding guidelines + current HEAD. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-09ALSA: hdspm - Fix wordclock status on AES32Andre Schramm
Use correct bitmask for AES32 cards to determine wordclock lock state, add missing bitmask for sync check and make output of the corresponding control and /proc coherent. Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com> Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07ALSA: pci: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-03ALSA: hdspm - Remove obsolete settings functionsAdrian Knoth
With HDSPM_TOGGLE_SETTING in place, these functions are no longer required. Removing them makes the code DRY and considerably shorter. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-03ALSA: hdspm - Use HDSPM_TOGGLE_SETTING to alter settingsAdrian Knoth
HDSPM_TOGGLE_SETTING and its corresponding functions allow to change settings in the control register. Instead of using the specialised functions, use the generic code to make the code DRY. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-03ALSA: hdspm - Implement generic function to toggle settingsAdrian Knoth
The driver contains at least six similar functions that change only a single bit in the control register, only the bit position varies. This patch implements a generic function to toggle a certain bit position that will be used to replace the old code. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-22ALSA: hdsp: Add missing inclusion of linux/vmalloc.hTakashi Iwai
Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-22ALSA: hdsp: improve firmware cachingTakashi Iwai
As the recent firmware code tries to reread and cache the firmware by itself, it's even better to keep the struct firmware data instead of keeping a local copy. Also, it makes little sense to disable the fw loader for this driver, so added the explicit dependency, too. Last, but not least, allocate the firmware data loaded via ioctl in vmalloc'ed buffer instead, as the firmware size isn't that small. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ALSA: hdspm - Fix sync check reporting on RME RayDATAdrian Knoth
The RayDAT reports the sync status of its inputs in consecutive bit positions, so all we do in hdspm_s1_sync_check is to iterate over idx: status = hdspm_read(hdspm, HDSPM_RD_STATUS_1); lock = (status & (0x1<<idx)) ? 1 : 0; sync = (status & (0x100<<idx)) ? 1 : 0; The index is given in kcontrol->private_value: HDSPM_SYNC_CHECK("WC SyncCheck", 0), HDSPM_SYNC_CHECK("AES SyncCheck", 1), HDSPM_SYNC_CHECK("SPDIF SyncCheck", 2), HDSPM_SYNC_CHECK("ADAT1 SyncCheck", 3), HDSPM_SYNC_CHECK("ADAT2 SyncCheck", 4), HDSPM_SYNC_CHECK("ADAT3 SyncCheck", 5), HDSPM_SYNC_CHECK("ADAT4 SyncCheck", 6), HDSPM_SYNC_CHECK("TCO SyncCheck", 7), HDSPM_SYNC_CHECK("SYNC IN SyncCheck", 8), The patch corrects the indicated sync flags by passing the proper index value to hdspm_s1_sync_check(). Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-04ALSA: Fix typo in drivers soundMasanari Iida
Correct spelling typo in debug messages within drivers/sound Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix coding style in CTL_ELEM macrosAdrian Knoth
checkpatch.pl discourages the use of spaces at the beginning of lines. Some of the CTL_ELEM defines were not properly indented. This patch replaces the leading spaces by tabs. No functionality is changed, the commit is purely cosmetic. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix typo in kcontrol element on RME MADI cardsAdrian Knoth
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix sync_in detection on AES/AES32Adrian Knoth
According to the documentation, AES32 cards use a different bit position for reporting the sync_in status. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix sync_in reporting on RME MADI cardsAdrian Knoth
In contrast to AES32, MADI uses the first status register to report the sync_in status. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Also report autosync_sample_rate on MADI and MADIfaceAdrian Knoth
MADI and MADIface used to report the autosync_sample_rate. This functionality was lost in commit 0dca1793063c28dde8f6c49c9c72203fe5cb6efc, this commit now adds it back. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix reported autosync_sample_rateAdrian Knoth
Missing breaks lead to a fall-through, thus causing the wrong autosync_sample_rate to be reported. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix sync check reporting on all RME HDSPM cardsAdrian Knoth
Due to missing breaks and the resulting fall-through, card subtype selection was effectively missing, thus causing the wrong sync check functions to be called. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Report external rate in slave mode on PCI MADIAdrian Knoth
As a follow-up to a97bda7d29d02a2e9c6609d0947b15e55f5200e5, report the external sample rate as system_sample_rate when in slave mode. For PCIe MADI cards, the DDS value automatically contains the external sample rate, but the PCI version needs this manual workaround. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Allow DDS/Varispeed to be set from userspaceAdrian Knoth
The DDS value is the actual physical sample rate. We set it indirectly when selecting 44100, 48000 and so on via snd_hdspm_hw_params or hdspm_set_clock_source. This commit now allows the DDS value to be altered at runtime, thus speeding up or slowing down the physical sample rate. This is required for MADI's varispeed that allows for ±12.5% speed adjustment from the "selected" rate (32kHz, 44100kHz, 48kHz and so on). Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: sound/pci/rme9652/hdspm.c: fix error return codeJulia Lawall
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-31ALSA: hdspm - Work around broken DDS value on PCI RME MADIAdrian Knoth
On PCI RME MADI cards, the PLL register does not contain the proper value, so the calculated system_sample_rate is wrong. In this case, we simply return the cached rate from struct hdspm. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-21Merge branch 'topic/misc' into for-linusTakashi Iwai
2012-05-08ALSA: hdsp - Provide ioctl_compatAndre Schramm
snd_hdsp uses its own ioctls to acquire config- and status information. Expose the corresponding ioctl handler via ioctl_compat, so that 32bit applications can use it on 64bit kernels. Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com> Reviewed-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: pci: clean up using module_pci_driver()Takashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-08ALSA: hdspm - Provide ioctl_compatAdrian Knoth
snd_hdspm uses its own ioctls to acquire config- and status information. Expose the corresponding ioctl handler via ioctl_compat, so that 32bit applications can use it on 64bit kernels. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-11ALSA: hdspm - Provide unique driver id based on card serialAdrian Knoth
Before, /proc/asound looked like this: 2 [Default ]: HDSPM - RME RayDAT_f1cd85 RME RayDAT S/N 0xf1cd85 at 0xf7300000, irq 18 In case of a second HDSPM card, its name would be Default_1. This is cumbersome, because the order of the cards isn't stable across reboots. To help userspace tools referring to the correct card, this commit provides a unique id for each card: 2 [HDSPMxf1cd85 ]: HDSPM - RME RayDAT_f1cd85 RME RayDAT S/N 0xf1cd85 at 0xf7300000, irq 18 In this example, userspace (configuration files) would then use hw:HDSPMxf1cd85 to choose the right card. The serial is masked to 24bits, so this string is always shorter than sixteen chars. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-09ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()Takashi Iwai
Dan Carpenter reported that setting 0 to uinfo->value.enumerated.items in snd_hdsp_info_pref_sync_ref() may lead to Oops. This function should return an error immediately in such a case instead. Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-08ALSA: hdspm - Refactor serial number to avoid code duplicationAdrian Knoth
The serial number is used multiple times in hdspm.c. Since it belongs to the card, let's store it in struct hdspm and refer to it whenever necessary. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-19ALSA: module_param: make bool parameters really boolRusty Russell
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-22ALSA: hdspm - Fix PCI ID for PCIe RME MADI cardsAdrian Knoth
Commit c09403dcc5698abf214329fbbf3cf8dbb5558bea has introduced a regression: PCIe versions of RME MADI were no longer detected, because the MADIface ID (0xd5) was used instead of the correct 0xd2. This commit fixes the problem. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-07Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-10-31sound: fix drivers needing module.h not moduleparam.hPaul Gortmaker
The implicit presence of module.h lured several users into incorrectly thinking that they only needed/used modparam.h but once we clean up the module.h presence, these will show up as build failures, so fix 'em now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31ALSA: hdspm - Enable all firmware ranges for PCI MADI/AES cardsAdrian Knoth
From the Windows INF file, we know the firmware ranges for all RME cards. For PCIe, a single revision ID per device (RayDAT, MADI, AIO, AES) is used. Contrary, the older PCI versions use ranges, that is, one revision ID per firmware version. Instead of listing all possible revisions individually, match the range. This commit enables all MADI and AES PCI versions ever shipped. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-31ALSA: hdsp - Correct HDSP_VERSION_BIT constant, thus partly fixing RPM detectionAdrian Knoth
HDSP_VERSION_BIT has to be ORed with HDSP_S_LOAD. This fixes the detection of at least some RME RPM boxes. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-31ALSA: hdspm - Fix MADI channel format in the status ioctlAdrian Knoth
SNDRV_HDSPM_IOCTL_GET_STATUS is supposed to query the current card status, so we have to return what we receive on the MADI wire (RX), not what we transmit (TX) to others. The latter is a config item to be queried via SNDRV_HDSPM_IOCTL_GET_CONFIG. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-23ALSA: hdspm - cleanup __user tags in ioctl()Dan Carpenter
This makes the code cleaner and silences a Sparse complaint: sound/pci/rme9652/hdspm.c:6341:23: warning: incorrect type in assignment (incompatible argument 4 (different address spaces)) sound/pci/rme9652/hdspm.c:6341:23: expected int ( *ioctl )( ... ) sound/pci/rme9652/hdspm.c:6341:23: got int ( static [toplevel] *<noident> )( ... ) sound/pci/rme9652/hdspm.c:6102:44: warning: dereference of noderef expression sound/pci/rme9652/hdspm.c:6225:50: warning: dereference of noderef expression sound/pci/rme9652/hdspm.c:6264:50: warning: dereference of noderef expression sound/pci/rme9652/hdspm.c:6283:50: warning: dereference of noderef expression sound/pci/rme9652/hdspm.c:6289:59: warning: dereference of noderef expression Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-23ALSA: hdspm - potential info leak in snd_hdspm_hwdep_ioctl()Dan Carpenter
Smatch has a new check for Rosenberg type information leaks where structs are copied to the user with uninitialized stack data in them. The status struct has a hole in it, and on some paths not all the members were initialized. struct hdspm_status { unsigned char card_type; /* 0 1 */ /* XXX 3 bytes hole, try to pack */ enum hdspm_syncsource autosync_source; /* 4 4 */ long long unsigned int card_clock; /* 8 8 */ The hdspm_version struct had holes in it as well. struct hdspm_version { unsigned char card_type; /* 0 1 */ char cardname[20]; /* 1 20 */ /* XXX 3 bytes hole, try to pack */ unsigned int serial; /* 24 4 */ short unsigned int firmware_rev; /* 28 2 */ /* XXX 2 bytes hole, try to pack */ int addons; /* 32 4 */ Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15ALSA: hdspm - Simplify with snd_pcm_hw_constraint_pow2()Takashi Iwai
Refactoring the code using snd_pcm_hw_constraint_pow2() helper function. Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15ALSA: hdspm - Add missing KNOT flag for AES32 rate restrictionTakashi Iwai
AES32 supports the non-standard 128kHZ, and this is enabled only when SNDRV_PCM_RATE_KNOT is set in hw.rates field. Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>