Commit graph

173 commits

Author SHA1 Message Date
Adrian Knoth 7b5593976c ALSA: hdspm - Allow SingleSpeed WordClock when in DS/QS mode
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>
2013-05-31 15:06:01 +02:00
Adrian Knoth a8a729fa06 ALSA: hdspm - Refactor SS/DS/QS clock multiplier into function
When the DoubleSpeed or QuadSpeed bit is set, the SingleSpeed frequency
has to be multiplied accordingly. Since this functionality will be
required at least twice, refactor it into a separate function.

The second reference to the newly introduced hdspm_rate_multiplier()
will be in a separate commit.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-31 15:05:41 +02:00
Adrian Knoth a8cd714804 ALSA: hdspm - Add support for 128-192kHz WordClock input
Allow WordClock input rates of 128, 176.4 and 192kHz.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-31 15:05:19 +02:00
Takashi Iwai 20a24225d8 ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove
As drvdata is cleared to NULL at probe failure or at removal by the
driver core, we don't have to call pci_set_drvdata(pci, NULL) any
longer in each driver.

The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
hda_intel.c.  Since this function itself releases the card instance,
we need to clear drvdata here as well, so that it won't be released
doubly in the remove callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-29 12:37:32 +02:00
Adrian Knoth a817650ebb ALSA: hdspm - Enable new TCO ALSA controls
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-11 10:11:21 +01:00
Adrian Knoth f99c78812f ALSA: hdspm - Add ALSA controls to read the TCO LTC state
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-11 10:11:20 +01:00
Adrian Knoth 345422133a ALSA: hdspm - Also check for TCO sync states
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-11 10:11:19 +01:00
Adrian Knoth e5b7b1fe3b ALSA: hdspm - Remove duplicate code from ALSA controls
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-11 10:11:18 +01:00
Adrian Knoth 696be0fbe2 ALSA: hdspm - Provide ALSA control to disable 96K frames
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-11 10:11:17 +01:00
Adrian Knoth fcdc4ba1d8 ALSA: hdspm - Allow the TCO and SYNC-IN to be used in slave mode
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-11 10:10:53 +01:00
Adrian Knoth 3f7bf918bf ALSA: hdspm - Refactor sample rate acquisition
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-03-11 09:57:22 +01:00
Andre Schramm 56bde0f328 ALSA: hdspm - Fix wordclock status on AES32
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>
2013-01-09 16:59:24 +01:00
Bill Pemberton e23e7a1436 ALSA: pci: remove __dev* attributes
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-07 07:20:55 +01:00
Adrian Knoth 467b103505 ALSA: hdspm - Remove obsolete settings functions
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-03 15:30:01 +01:00
Adrian Knoth c9e1668c68 ALSA: hdspm - Use HDSPM_TOGGLE_SETTING to alter settings
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-03 15:29:54 +01:00
Adrian Knoth bf0ff87bef ALSA: hdspm - Implement generic function to toggle settings
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-12-03 15:29:45 +01:00
Adrian Knoth d1a3c98d50 ALSA: hdspm - Fix sync check reporting on RME RayDAT
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-07 19:55:22 +01:00
Masanari Iida ec8f53fb69 ALSA: Fix typo in drivers sound
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-11-04 09:20:58 +01:00
Adrian Knoth f27a64f997 ALSA: hdspm - Fix coding style in CTL_ELEM macros
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-20 10:44:40 +02:00
Adrian Knoth 930f4ff078 ALSA: hdspm - Fix typo in kcontrol element on RME MADI cards
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20 10:44:10 +02:00
Adrian Knoth 9a215f47da ALSA: hdspm - Fix sync_in detection on AES/AES32
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-20 10:43:59 +02:00
Adrian Knoth 2e0452f544 ALSA: hdspm - Fix sync_in reporting on RME MADI cards
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-20 10:43:33 +02:00
Adrian Knoth b8812c55c5 ALSA: hdspm - Also report autosync_sample_rate on MADI and MADIface
MADI and MADIface used to report the autosync_sample_rate. This
functionality was lost in commit
0dca179306, 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-20 10:43:05 +02:00
Adrian Knoth d681deaa74 ALSA: hdspm - Fix reported autosync_sample_rate
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-20 10:40:40 +02:00
Adrian Knoth fba30fd342 ALSA: hdspm - Fix sync check reporting on all RME HDSPM cards
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-20 10:40:25 +02:00
Adrian Knoth 21a164df0c ALSA: hdspm - Report external rate in slave mode on PCI MADI
As a follow-up to a97bda7d29, 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-20 10:40:07 +02:00
Adrian Knoth 41285a98f8 ALSA: hdspm - Allow DDS/Varispeed to be set from userspace
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-10-20 10:39:45 +02:00
Julia Lawall b17cbdd85f ALSA: sound/pci/rme9652/hdspm.c: fix error return code
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-08-20 11:00:51 +02:00
Adrian Knoth a97bda7d29 ALSA: hdspm - Work around broken DDS value on PCI RME MADI
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-31 10:26:12 +02:00
Takashi Iwai e9f66d9b9c ALSA: pci: clean up using module_pci_driver()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24 12:25:00 +02:00
Adrian Knoth 8de5d6f19b ALSA: hdspm - Provide ioctl_compat
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-03-08 15:58:58 +01:00
Adrian Knoth f7de8ba3fc ALSA: hdspm - Provide unique driver id based on card serial
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-11 08:55:58 +01:00
Adrian Knoth 7d53a631ed ALSA: hdspm - Refactor serial number to avoid code duplication
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>
2012-01-08 16:05:40 +01:00
Rusty Russell a67ff6a540 ALSA: module_param: make bool parameters really bool
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-12-19 10:34:41 +01:00
Adrian Knoth 05c7cc9cca ALSA: hdspm - Fix PCI ID for PCIe RME MADI cards
Commit c09403dcc5 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-22 08:34:36 +01:00
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of 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-11-06 19:44:47 -08:00
Paul Gortmaker 65a772172b sound: fix drivers needing module.h not moduleparam.h
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-31 19:31:19 -04:00
Adrian Knoth c09403dcc5 ALSA: hdspm - Enable all firmware ranges for PCI MADI/AES cards
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-31 09:53:54 +01:00
Adrian Knoth 9e6ff52088 ALSA: hdspm - Fix MADI channel format in the status ioctl
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-10-31 09:53:25 +01:00
Dan Carpenter 2ca595ab7a ALSA: hdspm - cleanup __user tags in ioctl()
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-23 08:29:08 +02:00
Dan Carpenter 643d6bbb96 ALSA: hdspm - potential info leak in snd_hdspm_hwdep_ioctl()
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-09-23 08:28:56 +02:00
Takashi Iwai d877681d2e ALSA: hdspm - Simplify with snd_pcm_hw_constraint_pow2()
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-15 13:37:03 +02:00
Takashi Iwai 3fa9e3d230 ALSA: hdspm - Add missing KNOT flag for AES32 rate restriction
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>
2011-08-15 13:36:49 +02:00
Takashi Iwai 52e6fb4812 ALSA: hdspm - Correct max buffer size limit
Some modesl can support up to 8192 frames per period.

Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 13:36:18 +02:00
Adrian Knoth 2e61027079 ALSA: hdspm - Enable 32 samples/period on RME RayDAT/AIO
Newer RME cards like RayDAT and AIO support 32 samples per period. This
value is encoded as {1,1,1} in the HDSP_LatencyMask bits in the control
register.

Since {1,1,1} is also the representation for 8192 samples/period on
older RME cards, we have to special case 32 samples and 32768 bytes
according to the actual card.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 10:25:39 +02:00
Adrian Knoth 7cb155ff3e ALSA: hdspm - Introduce hdspm_get_latency() to harmonize latency calculation
Currently, hdspm_decode_latency is called several times, violating the
DRY principle. Given that we need to distinguish between old and new
cards when decoding the latency bits in the control register, introduce
hdspm_get_latency() to provide the required functionality.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 10:25:32 +02:00
Adrian Knoth 1ad5972f71 ALSA: hdspm - Reorder period sizes according to their bit representation
On newer RME cards like RayDAT and AIO, the 8192 samples per period size
are no longer supported. Instead, setting all three bits of
HDSP_LatencyMask to one ({1,1,1}) now corresponds to 32 samples per
period.

To make this more obvious to future developers, let's reorder the array
according to their bit representation, starting at 64 ({0,0,0}) up to
4096 ({1,1,0}) and finally 32 ({1,1,1}).

Note that this patch doesn't change semantics.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 10:25:23 +02:00
Adrian Knoth 1b6fa108b3 ALSA: hdspm - Set period_bytes_min to 32 * 4 for new RME cards
On newer RME cards like RayDAT and AIO, the lower bound is 32 samples
per period in contrast to 64 samples as seen on older cards.

We hence lower period_bytes_min to 32 * 4. Four bytes per sample.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 10:24:42 +02:00
Adrian Knoth 135d1535f4 ALSA: hdspm - Allow for 8192 period size on RME MADI and AES cards
Older RME cards like MADI and AES support period sizes of 8192 samples.
The original hdspm driver already featured this value, apparently, it
was lost during the rewrite.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-15 10:24:35 +02:00
Takashi Iwai 3d56c8e6b0 ALSA: hdspm - Fix uninitialized compile warnings
Put the exception checks for io_type switch() for possible mistakes in
future.  Also this shuts up annoying compile warnings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-05 12:30:12 +02:00
Adrian Knoth 5f8b4d53d7 ALSA: hdspm - Add firmware revision 0xcc for RME MADI
Apparently, there are multiple old firmware revisions in the wild for
the PCI RME MADI cards. Just add them to the list of supported devices
and treat them like their modern counterparts.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-29 07:41:30 +02:00
Adrian Knoth d12c51d829 ALSA: hdspm - Fix reported external sample rate on RME MADI and MADIface
In slave mode, the card can only detect the base frequency (32..48kHz)
on the MADI link (exception: 96k frames), so the real external sample
rate is this base frequency multiplied by 1, 2 or 4 depending on the
speed mode.

This patch enables 64..192kHz sample rates in clock slave mode, which
failed before due to an alleged sample rate mismatch between the MADI
link (e.g., 48kHz) and the application in DS/QS mode (e.g., 96kHz,
192kHz).

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-29 07:41:04 +02:00
Adrian Knoth 700d1ef33f ALSA: hdspm - Provide MADI speed mode selector on RME MADI and MADIface
When running in slave mode (no clock master), there is no way to
determine the real wirespeed on the MADI link (single/double/quad
speed). Like physical gear, simply provide the user with a tristate
switch to select the appropriate format.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-29 07:40:51 +02:00
Takashi Iwai 7d339ae997 Merge branch 'topic/misc' into for-linus 2011-07-22 08:43:24 +02:00
Takashi Iwai 286bed0f0c ALSA: hdspm - Fix compile warnings with PPC
The char can be unsigned on some architectures.  Since the code checks
the negative values, they should be declared as signed char explicitly.

  sound/pci/rme9652/hdspm.c:5449: warning: comparison is always false due to limited range of data type
  sound/pci/rme9652/hdspm.c:5462: warning: comparison is always false due to limited range of data type

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-30 12:45:36 +02:00
Takashi Iwai 85e4d95da0 Merge branch 'test/pci-rename' into topic/misc 2011-06-14 08:56:42 +02:00
Adrian Knoth efef054e8c ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
The PCI version of the RME HDSP MADI card uses 0xcf as revision ID. Just
add this to the list of supported cards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:50:08 +02:00
Adrian Knoth fedf1535ab ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
When using Word Clock on RME MADI cards, AutoSync mode was alternating
betweeen MADI and WC due to a typo: AutoSync is indicated in the second
status register (status2), not the first one (status).

While the proc output was always correct, the reported WC frequency to
ALSA was unstable as mentioned in

http://mailman.alsa-project.org/pipermail/alsa-devel/2008-March/006723.html

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:56 +02:00
Adrian Knoth c0da00145f ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
For the MIDI part, we need to acquire (and release) the hmidi->lock,
access to the global hdspm structure is serialized through
hmidi->hdspm->lock instead.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:42 +02:00
Takashi Iwai 934c2b6d0c ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*
The name argument of request_irq() appears in /proc/interrupts, and
it's quite ugly when the name entry contains a space or special letters.
In general, it's simpler and more readable when the module name appears
there, so let's replace all entries with KBUILD_MODNAME.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:36:37 +02:00
Takashi Iwai 3733e424c4 ALSA: Use KBUILD_MODNAME for pci_driver.name entries
The convention for pci_driver.name entry in kernel drivers seem to be
the module name or equivalent ones.  But, so far, almost all PCI sound
drivers use more verbose name like "ABC Xyz (12)", and these are fairly
confusing when appearing as a file name.

This patch converts the all pci_driver.name entries in sound/pci/* to
use KBUILD_MODNAME for more unified appearance.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:20:20 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Adrian Knoth bdd3255d3a ALSA: hdspm - Add firmware ID for older AES32 cards.
The current AES32 firmware revision ID is 234, however, a user confirmed
that everything works fine with the previous revision, too.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 12:59:16 +01:00
Adrian Knoth 7c7102b7af ALSA: hdspm - Fix midi port initialization
Depending on the model and the presence of a TCO module, the number of
midi ports varies. Some have 1 port (MADIface), some have 2 (default),
with TCO, there are 3.

Don't hardcode the number of midi ports to initialize.

This patch also fixes a boot lockup on MADIface.

[Coding-style fixes by tiwai]

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:58:19 +01:00
Adrian Knoth 5027f347ff ALSA: hdspm - Abort on unknown firmware revision
Don't continue if we cannot detect the real card type, otherwise, all
subsequent functions, especially strcpy(), would fail, leaving the whole
driver in an unusable state.

Without such a protection, dmesg would look like this:

Pid: 1525, comm: modprobe Not tainted 2.6.38-rc6 #1 MSI MS-7250/MS-7250
EIP: 0060:[<c114e700>] EFLAGS: 00010296 CPU: 1
EIP is at strcpy+0x10/0x30
EAX: f4d33e58 EBX: f5990800 ECX: f4d33e58 EDX: 00000000
ESI: 00000000 EDI: f4d33e58 EBP: f5990930 ESP: f3dd3e0c
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
f53d4204 00000000 f90bfc03 00000001 00000001 f3dd3e64 c10fedff f3dd3e7c
f3d854e4 f53d4000 c10307b8 00000001 c10307b8 f5990860 c10307b8 00000001
c10332e5 f59908bc c12f4339 f59908bc f5990860 c11ef207 f4d33e00 f53d4000
[<f90bfc03>] ? snd_hdspm_probe+0x7e7/0x1166 [snd_hdspm]
[<c10fedff>] ? __sysfs_add_one+0x1f/0xf0
[<c10307b8>] ? get_parent_ip+0x8/0x20
[<c10307b8>] ? get_parent_ip+0x8/0x20
[<c10307b8>] ? get_parent_ip+0x8/0x20
[<c10332e5>] ? add_preempt_count+0xa5/0xd0
[<c12f4339>] ? _raw_spin_lock_irqsave+0x19/0x40
[<c11ef207>] ? pm_runtime_enable+0x17/0x80
[<c1160172>] ? local_pci_probe+0x42/0xb0
[<c1161091>] ? pci_device_probe+0x61/0x80
[<c11e9587>] ? driver_probe_device+0x77/0x180
[<c11600f0>] ? pci_match_device+0xa0/0xc0
[<c11e9709>] ? __driver_attach+0x79/0x80
[<c11e9690>] ? __driver_attach+0x0/0x80
[<c11e8e32>] ? bus_for_each_dev+0x52/0x80
[<c11e9416>] ? driver_attach+0x16/0x20
[<c11e9690>] ? __driver_attach+0x0/0x80
[<c11e8771>] ? bus_add_driver+0xa1/0x220
[<c1160f20>] ? pci_device_remove+0x0/0xf0
[<c11e99a3>] ? driver_register+0x63/0x120
[<c11612bd>] ? __pci_register_driver+0x3d/0xb0
[<c1001132>] ? do_one_initcall+0x32/0x160
[<f90d6000>] ? alsa_card_hdspm_init+0x0/0x14 [snd_hdspm]
[<c10676a9>] ? sys_init_module+0x99/0x1e0
[<c10ade3d>] ? sys_close+0x6d/0xc0
[<c1002c90>] ? sysenter_do_call+0x12/0x26
---[ end trace 239f0661c558378b ]---

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:57:21 +01:00
Adrian Knoth 526ea86778 ALSA: hdspm - Add updated firmware revision for AES32
In contrast to the PCIe version (RME AES), the PCI version (RME AES32)
has a different firmware revision.

This patch adds the missing PCI revision.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:56:50 +01:00
Adrian Knoth d2d10a2132 ALSA: hdspm - AES32: Use define instead of hardcoded channel count
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:56:29 +01:00
Adrian Knoth a7edbd5bf9 ALSA: hdspm - Fix lock/sync reporting on MADI and AES32
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:46:44 +01:00
Adrian Knoth 4ab69a2b3b ALSA: hdspm - prevent reading unitialized stack memory
Original patch by Dan Rosenberg <drosenberg@vsecurity.com> under commit
e68d3b316a. I'm copying his text here:

The SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO ioctl in hdspm.c allow unprivileged
users to read uninitialized kernel stack memory, because several fields
of the hdspm_config struct declared on the stack are not altered
or zeroed before being copied back to the user.  This patch takes care
of it.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:46:29 +01:00
Adrian Knoth 7c4a95b5ec ALSA: hdspm - fix sync check on AES32
Fredrik Lingvall <fredrik.lingvall@gmail.com> has discovered wrong
frequency and sync detection on AES32. According to him, the provided
patch fixes these issues.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:44:42 +01:00
Adrian Knoth f6ea805f52 ALSA: hdspm - Remove input selector on MADIface
In contrast to the RME MADI card, coax/optical selection on the MADIface
is done via a physical switch located at the breakout box. Obviously,
the driver cannot switch ports in software.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:44:06 +01:00
Adrian Knoth 01e9607815 ALSA: hdspm - Fix DS/QS output channel mappings on RME MADI/MADIface
Caused by two typos, no output channel mappings were assigned for
MADI/MADIface at double/quad speed.

The channel mapping is indeed identical to the single speed mapping, the
cards will simply use the first N channels.

Signed-off-by: Florian Faber <faber@faberman.de>
Signed-off-by: Fredrik Lingvall <fredrik.lingvall@gmail.com>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:43:30 +01:00
Adrian Knoth 88fabbfcc6 ALSA: hdspm - Restrict channel count on RME AES/AES32
Without calling an appropriate rule, AES/AES32 cards would announce a
theoretical channel count of 64 (HDSPM_MAX_CHANNELS), leading to the
already known bug:

[37422.640481] ------------[ cut here ]------------
[37422.640487] WARNING: at sound/pci/rme9652/hdspm.c:5449
snd_hdspm_ioctl+0x18f/0x202 [snd_hdspm]()
[37422.640489] Hardware name: PRIMERGY RX100 S6
[37422.640490] BUG? (info->channel >= hdspm->max_channels_in)
[37422.640492] Modules linked in: snd_hdspm snd_seq_midi ipmi_watchdog
ipmi_poweroff ipmi_si ipmi_devintf ipmi_msghandler i2c_i801 e1000e
snd_rawmidi power_meter [last unloaded: snd_hdspm]
[37422.640501] Pid: 22231, comm: jackd Tainted: G      D W
2.6.36-gentoo-r5 #5
[37422.640502] Call Trace:
[37422.640508]  [<ffffffff8103db3a>] warn_slowpath_common+0x80/0x98
[37422.640511]  [<ffffffff8103dbe6>] warn_slowpath_fmt+0x41/0x43
[37422.640514]  [<ffffffff81034306>] ? get_parent_ip+0x11/0x42
[37422.640518]  [<ffffffffa0055763>] snd_hdspm_ioctl+0x18f/0x202
[snd_hdspm]
[37422.640522]  [<ffffffff813fd626>] snd_pcm_channel_info+0x73/0x7c
[37422.640525]  [<ffffffff814001e9>] snd_pcm_common_ioctl1+0x326/0xb01
[37422.640527]  [<ffffffff81034306>] ? get_parent_ip+0x11/0x42
[37422.640531]  [<ffffffff8105be6c>] ? __srcu_read_unlock+0x3b/0x59
[37422.640533]  [<ffffffff81400bce>] snd_pcm_capture_ioctl1+0x20a/0x227
[37422.640537]  [<ffffffff811e599c>] ? file_has_perm+0x90/0x9e
[37422.640540]  [<ffffffff81400c15>] snd_pcm_capture_ioctl+0x2a/0x2e
[37422.640543]  [<ffffffff810f2c69>] do_vfs_ioctl+0x404/0x453
[37422.640546]  [<ffffffff810f2d09>] sys_ioctl+0x51/0x74
[37422.640549]  [<ffffffff81002aab>] system_call_fastpath+0x16/0x1b
[37422.640552] ---[ end trace 0cd919cd68118082 ]---

We already have all the right values in place, we simply have to inform
the upper layers about this restriction.

Note that snd_hdspm_hw_rule_rate_out_channels and
snd_hdspm_hw_rule_rate_in_channels must not be called on AES32, because
the channel count is always 16, no matter of the samplerate in use.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:43:05 +01:00
Adrian Knoth 483cee77d2 ALSA: hdspm - Fix buffer handling on RME MADI/MADIface/AES(32)
Only RayDAT and AIO provide sane buffer pointers that can be used with
HDSPM_BufferPositionMask, on all other cards, this would result in a
wrong HW pointer leading to xruns and these messages:

[260808.916788] BUG: pcmC0D0p:0, pos = 2976, buffer size = 1024, period size = 512
[260808.961124] BUG: pcmC0D0c:0, pos = 4944, buffer size = 1024, period size = 512

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:42:28 +01:00
Adrian Knoth 432d2500ac ALSA: hpdsm - RME AES(32): Fix missing channel mappings
On RME AES and AES(32), none of the required information
(max_channels_in, max_channels_out, channel mappings, port names) was
set, leading to the BUG below.

This patch adds the missing bits, thus fixing the bug.

125.058768] ------------[ cut here ]------------
[  125.058773] WARNING: at sound/pci/rme9652/hdspm.c:5389
snd_hdspm_ioctl+0x10c/0x1d8 [snd_hdspm]()
[  125.058775] Hardware name: PRIMERGY RX100 S6
[  125.058777] BUG? (info->channel >= hdspm->max_channels_out)
[  125.058778] Modules linked in: ipmi_watchdog ipmi_poweroff ipmi_si
ipmi_devintf ipmi_msghandler snd_hdspm power_meter e1000e snd_rawmidi
i2c_i801
[  125.058787] Pid: 3652, comm: audacity Tainted: G        W
2.6.36-gentoo-r5 #5
[  125.058788] Call Trace:
[  125.058792]  [<ffffffff8103db3a>] warn_slowpath_common+0x80/0x98
[  125.058796]  [<ffffffff8103dbe6>] warn_slowpath_fmt+0x41/0x43
[  125.058800]  [<ffffffffa006761a>] snd_hdspm_ioctl+0x10c/0x1d8
[snd_hdspm]
[  125.058803]  [<ffffffff813fd626>] snd_pcm_channel_info+0x73/0x7c
[  125.058806]  [<ffffffff814001e9>] snd_pcm_common_ioctl1+0x326/0xb01
[  125.058809]  [<ffffffff810c604c>] ? __do_fault+0x361/0x3a6
[  125.058812]  [<ffffffff81400e23>] snd_pcm_playback_ioctl1+0x20a/0x227
[  125.058815]  [<ffffffff811e599c>] ? file_has_perm+0x90/0x9e
[  125.058818]  [<ffffffff81400e6a>] snd_pcm_playback_ioctl+0x2a/0x2e
[  125.058821]  [<ffffffff810f2c69>] do_vfs_ioctl+0x404/0x453
[  125.058824]  [<ffffffff810f2d09>] sys_ioctl+0x51/0x74
[  125.058827]  [<ffffffff81002aab>] system_call_fastpath+0x16/0x1b
[  125.058830] ---[ end trace 5bddb08e5d4cbeb1 ]---

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Florian Faber <faber@faberman.de>
Signed-off-by: Fredrik Lingvall <fredrik.lingvall@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-23 15:42:15 +01:00
Jaroslav Kysela 730a586515 ALSA: hdspm - remove unused arrays, reduce stack usage in hwdep_ioctl
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 13:10:33 +01:00
Adrian Knoth 55a57606b2 ALSA: [hdspm] Move static mapping arrays to .c
As requested by Takashi and Jaroslav, these arrays should not be in the
header file.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 12:09:23 +01:00
Adrian Knoth 0dca179306 ALSA: hdspm - Add support for RME RayDAT and AIO
Incorporate changes by Florian Faber into hdspm.c. Code taken from

   http://wiki.linuxproaudio.org/index.php/Driver:hdspe

Heavily reworked to mostly comply with the coding standard (whitespace
fixes, line width, C++ style comments)

The code was tested and confirmed to be working on RME RayDAT.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 12:09:18 +01:00
Uwe Kleine-König b595076a18 tree-wide: fix comment/printk typos
"gadget", "through", "command", "maintain", "maintain", "controller", "address",
"between", "initiali[zs]e", "instead", "function", "select", "already",
"equal", "access", "management", "hierarchy", "registration", "interest",
"relative", "memory", "offset", "already",

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-11-01 15:38:34 -04:00
Dan Rosenberg e68d3b316a ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
The SNDRV_HDSP_IOCTL_GET_CONFIG_INFO and
SNDRV_HDSP_IOCTL_GET_CONFIG_INFO ioctls in hdspm.c and hdsp.c allow
unprivileged users to read uninitialized kernel stack memory, because
several fields of the hdsp{m}_config_info structs declared on the stack
are not altered or zeroed before being copied back to the user.  This
patch takes care of it.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-25 17:46:22 +02:00
Jiri Kosina 318ae2edc3 Merge branch 'for-next' into for-linus
Conflicts:
	Documentation/filesystems/proc.txt
	arch/arm/mach-u300/include/mach/debug-macro.S
	drivers/net/qlge/qlge_ethtool.c
	drivers/net/qlge/qlge_main.c
	drivers/net/typhoon.c
2010-03-08 16:55:37 +01:00
Daniel Mack 3ad2f3fbb9 tree-wide: Assorted spelling fixes
In particular, several occurances of funny versions of 'success',
'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
'beginning', 'desirable', 'separate' and 'necessary' are fixed.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Joe Perches <joe@perches.com>
Cc: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-09 11:13:56 +01:00
Alexey Dobriyan cebe41d4b8 sound: use DEFINE_PCI_DEVICE_TABLE
Use DEFINE_PCI_DEVICE_TABLE() to make PCI device ids go to
.devinit.rodata section, so they can be discarded in some cases,
and make them const.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-09 11:08:33 +01:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Takashi Iwai 3f7440a6b7 ALSA: Clean up 64bit division functions
Replace the house-made div64_32() with the standard div_u64*() functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-05 17:45:17 +02:00
Takashi Iwai c2f43981e5 Merge branch 'topic/hwdep-cleanup' into for-linus 2009-03-24 00:35:41 +01:00
Takashi Iwai 28b7e343ee ALSA: Remove superfluous hwdep ops
Remove NOP hwdep ops in sound drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-05 09:28:08 +01:00
Takashi Iwai e58de7baf7 ALSA: Convert to snd_card_create() in sound/pci/*
Convert from snd_card_new() to the new snd_card_create() function
in sound/pci/*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12 15:20:55 +01:00
Takashi Iwai 5ce442fe2c Merge branch 'topic/udev-id-rename' into to-push 2008-12-25 11:40:34 +01:00
Takashi Iwai 1f04128a3d ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule()
Replace all tasklet_hi_schedule() callers with the normal
tasklet_schedule().  The former often causes troubles with
RT-kernels, and has actually no merit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-18 12:17:55 +01:00
Jaroslav Kysela 972d4c50fb ALSA: hdsp/hdspm: remove card->id from rawmidi device name
The card->id (card text identification) can be changed at runtime.
It might be confusing to have old text identification in device name.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-12 17:07:46 +01:00
Takashi Iwai 77a23f2695 ALSA: Clean up SG-buffer helper functions and macros
Clean up SG-buffer helper functions and macros.  Helpers take substream
as arguments now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25 09:57:18 +02:00
Takashi Iwai da3cec35dd ALSA: Kill snd_assert() in sound/pci/*
Kill snd_assert() in sound/pci/*, either removed or replaced with
if () with snd_BUG_ON().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13 11:46:38 +02:00
Denys Vlasenko 62cef8212f [ALSA] sound/pci/rme9652/hdspm.c: stop inlining largish static functions
sound/pci/rme9652/hdspm.c has unusually large number of static inline
functions - 22.

I looked through them and some of them seem to be too big to warrant inlining.

This patch removes "inline" from these static functions (regardless of number
of callsites - gcc nowadays auto-inlines statics with one callsite).

Size difference on 32bit x86:
   text    data     bss     dec     hex filename
  20437    2160     516   23113    5a49 linux-2.6-ALLYES/sound/pci/rme9652/hdspm.o
  18036    2160     516   20712    50e8 linux-2.6.inline-ALLYES/sound/pci/rme9652/hdspm.o

[coding fix by Takashi Iwai <tiwai@suse.de>]

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:33 +02:00
Harvey Harrison 0b76b51e58 [ALSA] sound: hdspm.c fix returning void expression warnings
Just drop the returns.
sound/pci/rme9652/hdspm.c:1031:3: warning: returning void-valued expression
sound/pci/rme9652/hdspm.c:1033:3: warning: returning void-valued expression

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:18 +02:00
Takashi Iwai 9004acc70e [ALSA] Remove sound/driver.h
This header file exists only for some hacks to adapt alsa-driver
tree.  It's useless for building in the kernel.  Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it.  This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:48 +01:00
Joe Perches 561de31a23 [ALSA] sound/: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:41 +01:00
Remy Bruno 6534599d14 [ALSA] hdspm - Fix autosync bug
* better report of speed mode change failures
* autosync_ref control bugfix (was reporting pref_sync_ref instead)
  (changed HDSPM_AES32_AUTOSYNC_FROM_NONE value to comply with array
  indexing in snd_hdspm_info_autosync_ref())
* added support for master modes up to 192kHz (clock source control
  value was restricted up to 96kHz)

Signed-off-by: Remy Bruno <remy.bruno@trinnov.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:59:37 +02:00
Takashi Iwai ef5fa1a49f [ALSA] hdspm - Coding style fixes
Fix codes to follow more to the standard kernel coding style.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:10 +02:00
Takashi Iwai a5ce88909d [ALSA] Clean up with common snd_ctl_boolean_*_info callbacks
Clean up codes using the new common snd_ctl_boolean_*_info() callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:57:45 +02:00