Commit Graph

474 Commits

Author SHA1 Message Date
Peter Senna Tschudin 395d9dd5dd sound: Remove unnecessary semicolon
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
        cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:47:53 +02:00
David Flater 1338fc97d0 ALSA: emu8000: fix emu8000 DRAM sized 512 KiB too small
v2:  Fixed result still wrong in the case of 512 KiB DRAM.  Oops.

Applicable to 3.5.3 mainline.

In emu8000.c, size_dram determines the amount of memory on the sound card by
doing write/readback tests starting at 512 KiB and incrementing by 512 KiB.
On success, detected_size is updated to the successful address and testing
continues.  On failure, the loop is immediately exited.  The resulting
detected_size is 512 KiB too small except in two special cases:

1. If there is no memory, the initial 0 value of detected_size is used, which
   is correct.
2. If the address space wraps around, detected_size is updated before the
   bailout, so the result is correct.

The patch corrects all cases and was tested with an AWE64 Gold.  Before:
  EMU8000 [0x620]: 3584 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 (4174814 B) fails.
After:
  EMU8000 [0x620]: 4096 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 succeeds.

I do not have a card with 512 KiB to test with, but by forcibly enabling the
added conditional I verified on the AWE64 Gold that it detects 512 KiB
(successfully reading from the first memory location) and does not hang the
card.

C.f. Bug 46451 https://bugzilla.kernel.org/show_bug.cgi?id=46451

Signed-off-by: David Flater <dave@flaterco.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28 19:58:12 +02:00
Takashi Iwai a184d4e459 Merge branch 'for-linus' into for-next
Need to merge the fixes regarding EPSS.

Conflicts:
	sound/pci/hda/hda_codec.c
2012-08-28 09:26:59 -07:00
Takashi Iwai 56244d0868 ALSA: cmi8328: Fix build error with CONFIG_GAMEPORT=n
sound/isa/cmi8328.c: In function 'snd_cmi8328_remove':
  sound/isa/cmi8328.c:416:24: error: 'cmi' undeclared (first use in this function)
  sound/isa/cmi8328.c:416:24: note: each undeclared identifier is reported only once for each function it appears in
  make[3]: *** [sound/isa/cmi8328.o] Error 1

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-24 07:54:16 +02:00
Ondrej Zary f993348746 ALSA: introduce snd-cmi8328: C-Media CMI8328 driver
Introduce snd-cmi8328 driver for C-Media CMI8328-based sound cards, such as
AudioExcel AV500.

It supports PCM playback and capture (full-duplex) through wss_lib, gameport,
OPL3 and MPU401. The AV500 card has onboard Dream wavetable synth connected
to the MPU401 port and Aux 1 input internally which works too.
The CDROM interface is not supported (as the drivers for these CDROMs were
removed from the kernel some time ago).

A separate driver is needed because CMI8328 is completely different chip to
CMI8329/CMI8330. It's configured by magic registers (there's no PnP). Sound is
provided by a real WSS codec (CS4231A) and the SB part is just a SB Pro
emulation (for DOS games, useless for Linux).

When SB is enabled, the CMI8328 chip disables access to the WSS codec,
emulates SoundBlaster on one side and outputs sound data to the codec - so SB
and WSS can't work together with this card. The WSS codec can do full duplex
by itself so there's no need for crazy things like snd-cmi8330 does
(combining SB and WSS parts into one driver).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-21 07:30:46 +02:00
Ondrej Zary 53e1719f3d ALSA: snd-als100: fix suspend/resume
snd_card_als100_probe() does not set pcm field in struct snd_sb.
As a result, PCM is not suspended and applications don't know that they need
to resume the playback.

Tested with Labway A381-F20 card (ALS120).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-21 07:29:40 +02:00
Ondrej Zary 6f0fa66051 ALSA: snd-ad1816a: Implement suspend/resume
Implement suspend/resume support for AD1816 chips.
Tested with Terratec SoundSystem Base-1.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:12:56 +02:00
Ondrej Zary c86b6b452a ALSA: snd-ad1816a: remove useless struct snd_card_ad1816a
struct snd_card_ad1816a is only set but the values are never used then.
Removing it allows struct snd_card's private_data to be used for
struct snd_ad1816a, simplifying the code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:10:39 +02:00
Andy Shevchenko 793ea49c47 ALSA: print small buffers via %*ph[C]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-06 11:09:50 +02:00
Ondrej Zary 988aec3de5 ALSA: isa: Move snd_legacy_find_free_ioport to initval.h
Move snd_legacy_find_free_ioport() function back to initval.h as it is used
by two drivers.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-03 12:57:44 +02:00
Fengguang Wu e5b35420ef ALSA: es1688 - freeup resources on init failure
This will fix the following oops:

[    6.169981] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
[    6.170851] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
[    6.170851] Call Trace:
[    6.170851]  [<c1062237>] ? __setup_irq+0x3c7/0x420
[    6.170851]  [<c1062486>] ? request_threaded_irq+0x76/0x140
[    6.170851]  [<c1290220>] ? snd_es1688_ioctl+0x10/0x10
[    6.170851]  [<c10624c2>] ? request_threaded_irq+0xb2/0x140
[    6.170851]  [<c1291196>] ? snd_es1688_create+0x96/0x330
[    6.170851]  [<c138365d>] ? snd_gusextreme_probe+0x18d/0x5a2
[    6.170851]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.170851]  [<c10db22f>] ? sysfs_create_link+0xf/0x20
[    6.170851]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.170851]  [<c11d1502>] ? isa_bus_probe+0x12/0x20
[    6.170851]  [<c11c9b95>] ? driver_probe_device+0x55/0x1c0
[    6.170851]  [<c13ae04f>] ? _raw_spin_unlock+0xf/0x30
[    6.170851]  [<c13705ea>] ? klist_next+0x6a/0xe0
[    6.170851]  [<c11d15c1>] ? isa_bus_match+0x21/0x40
[    6.170851]  [<c11c8a24>] ? bus_for_each_drv+0x34/0x70
[    6.170851]  [<c11c9e4b>] ? device_attach+0x7b/0x90
[    6.170851]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.170851]  [<c11c8bff>] ? bus_probe_device+0x5f/0x80
[    6.170851]  [<c11c7493>] ? device_add+0x573/0x620
[    6.170851]  [<c1042820>] ? complete_all+0x40/0x60
[    6.170851]  [<c13ae08a>] ? _raw_spin_unlock_irqrestore+0x1a/0x30
[    6.170851]  [<c11d16c6>] ? isa_register_driver+0xb6/0x150
[    6.170851]  [<c15c9002>] ? alsa_card_gusmax_init+0xf/0xf
[    6.170851]  [<c15a99bc>] ? do_one_initcall+0x7f/0x12b
[    6.170851]  [<c15a9b7a>] ? kernel_init+0x112/0x1a9
[    6.170851]  [<c15a9423>] ? do_early_param+0x77/0x77
[    6.170851]  [<c15a9a68>] ? do_one_initcall+0x12b/0x12b
[    6.170851]  [<c13aefbe>] ? kernel_thread_helper+0x6/0xd
[    6.190170] es1688: can't grab IRQ 5
[    6.190613] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
[    6.191566] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
[    6.192394] Call Trace:
[    6.192685]  [<c1062237>] ? __setup_irq+0x3c7/0x420
[    6.193342]  [<c1062486>] ? request_threaded_irq+0x76/0x140
[    6.194081]  [<c1290220>] ? snd_es1688_ioctl+0x10/0x10
[    6.194607]  [<c10624c2>] ? request_threaded_irq+0xb2/0x140
[    6.194607]  [<c1291196>] ? snd_es1688_create+0x96/0x330
[    6.194607]  [<c138365d>] ? snd_gusextreme_probe+0x18d/0x5a2
[    6.194607]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.194607]  [<c10db22f>] ? sysfs_create_link+0xf/0x20
[    6.194607]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.194607]  [<c11d1502>] ? isa_bus_probe+0x12/0x20
[    6.194607]  [<c11c9b95>] ? driver_probe_device+0x55/0x1c0
[    6.194607]  [<c13ae04f>] ? _raw_spin_unlock+0xf/0x30
[    6.194607]  [<c13705ea>] ? klist_next+0x6a/0xe0
[    6.194607]  [<c11d15c1>] ? isa_bus_match+0x21/0x40
[    6.194607]  [<c11c8a24>] ? bus_for_each_drv+0x34/0x70
[    6.194607]  [<c11c9e4b>] ? device_attach+0x7b/0x90
[    6.194607]  [<c11c9d80>] ? __driver_attach+0x80/0x80
[    6.194607]  [<c11c8bff>] ? bus_probe_device+0x5f/0x80
[    6.194607]  [<c11c7493>] ? device_add+0x573/0x620
[    6.194607]  [<c1042820>] ? complete_all+0x40/0x60
[    6.194607]  [<c13ae08a>] ? _raw_spin_unlock_irqrestore+0x1a/0x30
[    6.194607]  [<c11d16c6>] ? isa_register_driver+0xb6/0x150
[    6.194607]  [<c15c9002>] ? alsa_card_gusmax_init+0xf/0xf
[    6.194607]  [<c15a99bc>] ? do_one_initcall+0x7f/0x12b
[    6.194607]  [<c15a9b7a>] ? kernel_init+0x112/0x1a9
[    6.194607]  [<c15a9423>] ? do_early_param+0x77/0x77
[    6.194607]  [<c15a9a68>] ? do_one_initcall+0x12b/0x12b
[    6.194607]  [<c13aefbe>] ? kernel_thread_helper+0x6/0xd
[    6.210779] es1688: can't grab IRQ 5
[    6.211305] gusextreme: probe of gusextreme.0 failed with error -16

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-30 10:11:14 +02:00
Takashi Iwai 59b1f084ab ALSA: opti9xx: Fix section mismatch by PM support
In the previous commit, snd_opti9xx_configure() is called from the
resume handler but it's still marked as __devinit.  Fix it.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 12:15:49 +02:00
Ondrej Zary 5dd250728a ALSA: snd-opti9xx: Implement suspend/resume
Implement suspend/resume support for Opti 92x and 93x chips.
Tested with Opti 929A+AD1848 and Opti 931.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 10:55:47 +02:00
Ondrej Zary b4e2a16f99 ALSA: wss_lib: Fix resume on Yamaha OPL3-SAx
Yamaha OPL3-SAx chips don't resume properly when playback is running -
garbage is played after resume. Restoring the CS4231_PLAYBK_FORMAT register
last fixes the problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 11:24:05 +02:00
Ondrej Zary ca3273fb59 ALSA: wss_lib: fix suspend/resume
By setting SNDRV_PCM_INFO_RESUME, wss_lib claims that it can restore the card
state fully on resume. But in fact, it can't as DMA is not restored so any
playback/capture running during suspend will fail to continue after resume.

Remove SNDRV_PCM_INFO_RESUME flag from pcm info field to fix the problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 11:23:45 +02:00
Ondrej Zary 10a3061acc ALSA: snd-opti9xx: fixes for MED3931 card (opti931)
MED3931 card did not work (failed with "OPTI chip not found") because
snd-opti9xx gets mc_indir_index from pnp by adding 2 to the pnp-reported port.
It probably works for some cards but not for this one. Datasheet says that
the port is always at 0xe?e so just force the lowest nibble to be 0xe.

Also this card powers up with (ugly) 3D sound enabled. As there's no mixer
control for this, just disable it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18 09:39:38 +02:00
Linus Torvalds e8650a0823 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial updates from Jiri Kosina:
 "As usual, it's mostly typo fixes, redundant code elimination and some
  documentation updates."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
  edac, mips: don't change code that has been removed in edac/mips tree
  xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
  lib: Change mail address of Oskar Schirmer
  net: Change mail address of Oskar Schirmer
  arm/m68k: Change mail address of Sebastian Hess
  i2c: Change mail address of Oskar Schirmer
  net: Fix tcp_build_and_update_options comment in struct tcp_sock
  atomic64_32.h: fix parameter naming mismatch
  Kconfig: replace "--- help ---" with "---help---"
  c2port: fix bogus Kconfig "default no"
  edac: Fix spelling errors.
  qla1280: Remove redundant NULL check before release_firmware() call
  remoteproc: remove redundant NULL check before release_firmware()
  qla2xxx: Remove redundant NULL check before release_firmware() call.
  aic94xx: Get rid of redundant NULL check before release_firmware() call
  tehuti: delete redundant NULL check before release_firmware()
  qlogic: get rid of a redundant test for NULL before call to release_firmware()
  bna: remove redundant NULL test before release_firmware()
  tg3: remove redundant NULL test before release_firmware() call
  typhoon: get rid of redundant conditional before all to release_firmware()
  ...
2012-05-22 19:22:50 -07:00
Julia Lawall 38be95dd3d ALSA: sound/isa/sscape.c: add missing resource-release code
At the point of this error-handling code, both regions and the dma have
been allocated, so free it as done in previous and subsequent
error-handling code.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-10 08:42:07 +02:00
Jiri Kosina e75d660672 Merge branch 'master' into for-next
Merge with latest Linus' tree, as I have incoming patches
that fix code that is newer than current HEAD of for-next.

Conflicts:
	drivers/net/ethernet/realtek/r8169.c
2012-04-08 21:48:52 +02:00
Randy Dunlap c578ae0026 ALSA: fix isa/opti9xx module param type
Fix module parameter data type to eliminate build warnings.

sound/isa/opti9xx/opti92x-ad1848.c:87:1: warning: return from incompatible pointer type
sound/isa/opti9xx/opti92x-ad1848.c:87:1: warning: return from incompatible pointer type

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-29 17:57:08 +02:00
Jonathan Woithe 409a3e9813 Email/web address change
This patch updates Jonathan Woithe's contact details across the kernel tree.

Signed-off-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-03-28 10:35:15 +02:00
Jesper Juhl 226e01ef0d ALSA: emu8000: Remove duplicate linux/moduleparam.h include from emu8000_patch.c
The header 'linux/moduleparam.h' is included twice in
'sound/isa/sb/emu8000_patch.c'. Once is enough.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-06 10:22:54 +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
Paul Gortmaker d81a6d7176 sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed
These aren't modules, but they do make use of these macros, so
they will need export.h to get that definition.  Previously,
they got it via the implicit module.h inclusion.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:22 -04:00
Paul Gortmaker da155d5b40 sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:21 -04:00
Paul Gortmaker 31623caaf0 sound: add moduleparam.h to users of module_param/MODULE_PARM_DESC
These files were getting access to these two via the implicit
presence of moduleparam.h everywhere.  But that is being fixed, so
get these guys what they need in advance.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:20 -04: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
Yong Zhang 88e24c3a4b sound: irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-22 11:19:20 +02:00
Clemens Ladisch dba8b46992 ALSA: mpu401: clean up interrupt specification
The semantics of snd_mpu401_uart_new()'s interrupt parameters are
somewhat counterintuitive:  To prevent the function from allocating its
own interrupt, either the irq number must be invalid, or the irq_flags
parameter must be zero.  At the same time, the irq parameter being
invalid specifies that the mpu401 code has to work without an interrupt
allocated by the caller.  This implies that, if there is an interrupt
and it is allocated by the caller, the irq parameter must be set to
a valid-looking number which then isn't actually used.

With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
which forces us to handle the parameters differently.

This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
device interrupt is handled by the caller, and makes the allocation of
the interrupt to depend only on the irq parameter.  As suggested by
Takashi, the irq_flags parameter was dropped because, when used, it had
the constant value IRQF_DISABLED.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-14 11:00:51 +02:00
Al Viro da404dc0b1 snd_msnd ->mode is fmode_t, not mode_t
we put FMODE_... in there

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-07-26 12:59:29 -04: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
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
Takashi Iwai c8bdfacb63 Merge branch 'fix/misc' into topic/misc 2010-09-09 10:51:45 +02:00
Takashi Iwai e4ee8dd8af ALSA: msnd-classic: Fix invalid cfg parameter
The driver doesn't probe the device properly because of left-over cfg[]
that isn't used at all for msnd-classic device.  This is only for msnd-
pinnacle.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-08 09:58:12 +02:00
Joe Perches 9fe856e47e sound: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-07 08:05:59 +02:00
René Herman cbaa9f60d5 ALSA: ISA: Remove snd-sgalaxy
Its hardware is handled more fully by the new azt1605/azt2316 drivers.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-13 13:02:20 +02:00
René Herman 495311927f ALSA: ISA: New Aztech Sound Galaxy driver
This is a new driver for Aztech Sound Galaxy ISA soundcards based on the
AZT1605 and AZT2316 chipsets. It's constructed as two seperate drivers
for either chipset generated from the same source file, with (very)
minimal ifdeffery.

The drivers check the SB DSP version to decide if they are being loaded
for the right chip. AZT1605 returns 2.1 by default and AZT2316 3.1.
This isn't full-proof as the DSP version can actually be set through
software but it's close enough -- as far as I've been able to see, the
DSP version can not be stored in the EEPROM and the cards will therefore
startup with the defaults.

This distinction could (with the same success rate) also be used to
decide which chip we're looking at at runtime meaning a single, merged
driver is also an option but I feel it's actually nicer this way. A
merged driver would have to postpone translating the passed in resource
values to the card configuration until it knew which one it was looking
at and would need to postpone erring out on mpu_irq=10 for azt1605 and
mpu_irq=3 for azt2316.

The drivers have been tested on various cards. For snd-azt1605:

FCC-ID I38-MMSN811: Aztech Sound Galaxy Nova 16 Extra
FCC-ID I38-MMSN822: Aztech Sound Galaxy Pro 16 II

and for snd-azt2316:

FCC-ID I38-MMSN824: Aztech Sound Galaxy Pro 16 AB
FCC-ID I38-MMSN826: Trust Sound Expert DeLuxe Wave 32 (05201)
FCC-ID I38-MMSN830: Trust Sound Expert DeLuxe 16+ (05202)
FCC-ID I38-MMSN837: Packard Bell ISA Soundcard 030069
FCC-ID I38-MMSN846: Trust Sound Expert DeLuxe 16-3D (06300)
FCC-ID I38-MMSN847: Trust Sound Expert DeLuxe Wave 32-3D (06301)
FCC-ID I38-MMSN852: Aztech Sound Galaxy Waverider Pro 32-3D

826 and 846 were also marketed directly by Aztech and then known as:

FCC-ID I38-MMSN826: Aztech Sound Galaxy Waverider 32+
FCC-ID I38-MMSN846: Aztech Sound Galaxy Nova 16 Extra II-3D

Together, these cover the AZT1605 and AT2316A, AZT2316R and AZT2316-S
chipsets. All cards work fully -- full-duplex PCM, MIDI and FM. Full
duplex is a little flaky on some.

I38-MSN811 tends to not work in full-duplex but sometimes does with the
highest success rate being achieved when you first start the capture and
then a playback instead of the other way around (it's a CS4231-KL
codec).

The cards with an AD1845XP codec (my I38-MMSN826 and one of my
I38-MMSN830s) are also somewhat duplex-challenged. Sometimes full-duplex
works, sometimes not and this varies from try to try. This seems likely
to be a timing problem somewhere inside wss-lib.

I38-MMSN826 has an additional "ICS2115 WaveFront" wavetable synth
onboard that isn't supported yet. The wavetable synths on I38-MMSN847
and I38-MMSN852 are wired directly to the standard MPU-401 UART and the
AUX1 input on the codec and work without problem.

CD-ROM audio on the cards is routed to the codec "Line" input, Line-In
to its Aux input, and FM/Wavetable to its AUX1 input. I did not rename
the controls due to the capture source enumeration: I see that
capture-source overrides are hardcoded in wss-lib and this is just too
ugly to live.

Versus the old snd-sgalaxy driver these drivers add support for the
models without a configuration EEPROM (which are common), full-duplex,
MPU-401 UART and OPL3. In the future they might grow support for that
ICS2115 WaveFront synth on 826 and an hwdep interface to write to the
EEPROM on the models that have one.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-13 12:57:58 +02:00
Kulikov Vasiliy fa95a6471f ALSA: msnd: check request_region() return value
request_region() may fail, if so return -EBUSY.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-29 13:48:39 +02:00
Kulikov Vasiliy 5157cc8113 ALSA: sb: check get_user() return value
get_user() may fail, if so return -EFAULT.

[Fixed one missing place by tiwai]

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-29 12:24:22 +02:00
Takashi Iwai 5e8aa85253 Merge branch 'topic/misc' into for-linus 2010-05-20 11:59:29 +02:00
Takashi Iwai 3374cd1abd Merge branch 'topic/core-cleanup' into for-linus 2010-05-20 11:58:57 +02:00
Dan Carpenter b0fb75ad5c ALSA: es1688: add pedantic range checks
Smatch complains that if (dev == SNDRV_CARDS) we're one past the end of
the array.  That's unlikely to happen in real life, I suppose.

Also smatch complains about "strcpy(card->shortname, pcm->name);"
The "pcm->name" buffer is 80 characters and "card->shortname" is 32
characters.  If you follow the call paths it turns out we never actually
use more than 16 characters so it's not a problem.  But anyway, let's
make it easy for people auditing this in the future.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-17 08:09:51 +02:00
Krzysztof Helt a20971b201 ALSA: Merge es1688 and es968 drivers
The ESS ES968 chip is nothing more then a PnP companion
for a non-PnP audio chip. It was paired with non-PnP ESS' chips:
ES688 and ES1688. The ESS' audio chips are handled by the es1688
driver in native mode. The PnP cards are handled by the ES968
driver in SB compatible mode.

Move the ES968 chip handling to the es1688 driver so the driver
can handle both PnP and non-PnP cards. The es968 is removed.

Also, a new PnP id is added for the card I acquired (the change
was tested on this card).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-10 09:49:30 +02:00
Krzysztof Helt 396fa82726 ALSA: es1688: allocate snd_es1688 structure as a part of snd_card structure
Allocate the snd_es1688 during the snd_card allocation.
This allows to remove the card pointer from the snd_es1688 structure.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-10 09:48:59 +02:00
Krzysztof Helt 867f1845c5 ALSA: es968: fix wrong PnP dma index
There is only one dma for the ESS ES968 based board.
Its index is 0 and not 1.

This make the es968 card working.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-26 09:05:44 +02:00
Takashi Iwai 73029e0ff1 ALSA: info - Implement common llseek for binary mode
The llseek implementation is identical for existing driver implementations,
so let's merge to the common layer.  The same code for the text proc file
can be used even for the binary proc file.

The driver can provide its own llseek method if needed.  Then the common
code will be skipped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-13 12:01:20 +02:00
Takashi Iwai d97e1b7823 ALSA: info - Check file position validity in common layer
Check the validity of the file position in the common info layer before
calling read or write callbacks in assumption that entry->size is set up
properly to indicate the max file size.

Removed the redundant checks from the callbacks as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-13 12:01:14 +02:00
Takashi Iwai 24e4a1211f ALSA: info - Use standard types for info callbacks
Use loff_t, size_t and ssize_t for arguments of info callbacks
to follow the standard procfs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-13 11:57:14 +02:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Randy Dunlap 89c0ac7cab sound: fix opti92x-ad1848 build
Fix 'else' placement in ifdef block so that build succeeds:

sound/isa/opti9xx/opti92x-ad1848.c:221: error: 'else' without a previous 'if'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-08 18:36:17 +01:00
Meelis Roos 50152dfaa7 ALSA: fix jazz16 compile (udelay)
While trying to compile jazz16 isa sound driver on alpha (2.6.33+git), I
found a compile failure in jazz16.c (udelay is unknown). Fix it by
including delay.h.

Signed-foo-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:13:20 +01:00
Krzysztof Helt fd8d47351d ALSA: opti92x: use PnP data to select Master Control port
The Master Control port (MC) is available as the last
PnP resource (OPT005). Use this value instead fo guessing.

Also, add some comments to the code.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-03 22:36:18 +01:00
Jaroslav Kysela b8f1f5983f Merge branch 'topic/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel 2010-02-16 11:25:03 +01:00
Krzysztof Helt edf12b4af6 sbawe: fix memory detection part 2
The patch "sbawe: fix memory detection" fixed detection
for memoryless SB32 cards but broke detection of memory
above 512KB. This patch fixes the regression.

The patch has been tested on the SB32 card (CT3670) with
0MB, 2MB and 8MB memory installed.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-08 09:27:23 +01:00
Krzysztof Helt 44eba3e82b ALSA: jazz16: refine dma and irq selection
Narrow the dma and irq selection after the DOS driver.

Add ALSA configuration description as well.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25 14:15:41 +01:00
Takashi Iwai cb3b04debb Merge branch 'fix/misc' into topic/misc 2009-12-22 07:57:54 +01:00
Krzysztof Helt ad8decb7f5 ALSA: jazz16: Add support for Media Vision Jazz16 chipset
This is one of Sound Blaster Pro compatible chipsets which is supported
by Linux OSS driver and was missing native supoort for ALSA.

The Jazz16 audio codec is Crystal CS4216 which is capable
of playback and recording up to 48 kHz stereo.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-21 12:09:22 +01:00
Krzysztof Helt db8cf334f6 ALSA: sbawe: fix memory detection
Memory amount is increased before a successful write-read
sequence is done. Thus, 512 kB of onboard memory is detected
on memoryless cards like SB32.

Move the increasing of memory counter after successful read
is done.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-21 12:03:11 +01:00
Julia Lawall ef86f581f7 ALSA: Use kzalloc for allocating only one thing
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-19 09:40:26 +01:00
Takashi Iwai 709334c87d Merge branch 'fixes' of git://git.alsa-project.org/alsa-kernel into for-linus 2009-12-15 10:29:06 +01:00
Takashi Iwai b89371621e Merge branch 'next/isa' into topic/misc 2009-12-14 18:01:56 +01:00
Krzysztof Helt 74c2b45b71 ALSA: sb_mixer: convert pointer tables to mixer control tables
Convert table of pointers to mixer controls into tables
of the mixer controls. It saves about 20% of the snd-sb-common
module size reported by lsmod.

The als4000 uses part of sb16's control table.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-14 11:22:25 +01:00
Julia Lawall 0d64b568fc ALSA: sound/isa/gus: Correct code taking the size of a pointer
sizeof(share_id) is just the size of the pointer.  On the other hand,
block->share_id is an array, so its size seems more appropriate.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-14 11:16:09 +01:00
Linus Torvalds 6eb7365db6 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Overwrite pin config on intel DG45ID board.
  intelhdmi - dont power off HDA link
  ALSA: hrtimer - Fix lock-up
  ALSA: intelhdmi - add channel mapping for typical configurations
  ALSA: intelhdmi - channel mapping applies to Pin
  ALSA: intelhdmi - accept DisplayPort pin
  ALSA: hda - show HBR(High Bit Rate) pin cap in procfs
  ALSA: hda - Fix LED GPIO setup for HP laptops with IDT codecs
  ASoC: Fix build of OMAP sound drivers
  ALSA: opti93x: fix irq releasing if the irq cannot be allocated
2009-12-12 11:40:50 -08:00
Krzysztof Helt e9d0a803c1 ALSA: opti93x: use dB scale for mixer controls
Add dB scale for mixer controls. Fix dB scale for
Master Volume control.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-12 10:42:25 +01:00
Krzysztof Helt b2e8d7dab9 ALSA: opti93x: move controls definitions to opti93x driver
Move OPTi93x controls definitions to the opti93x driver
from the common wss-lib library module. These controls
are used only by the opti93x driver.

Also, fix capture source names. They are the same as
opl3sa2 names.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-11 14:43:16 +01:00
Krzysztof Helt 14ff3e7830 ALSA: dt019x: merge into the als100 driver
The als100 driver is so similar to the dt019x/als007 driver
that one driver's source can be used for both drivers with
only few changes. Merge the dt019x driver into the als100.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-11 14:43:04 +01:00
Krzysztof Helt 5f60e49608 ALSA: opti93x: fix irq releasing if the irq cannot be allocated
Use the chip->irq to check if the irq should be released so the irq is not released
if it has not been allocated.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-10 11:39:48 +01:00
Linus Torvalds 78f1ae193d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume
  ALSA: hda/realtek: quirk for D945GCLF2 mainboard
  ALSA: hda - Terradici HDA controllers does not support 64-bit mode
  ALSA: document: Add direct git link to grub hda-analyzer
  ALSA: radio/sound/miro: fix build, cleanup depends/selects
  ALSA: hda - Generalize EAPD inversion check in patch_analog.c
  ASoC: Wrong variable returned on error
  ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII
  ALSA: hda - Exclude unusable ADCs for ALC88x
  ALSA: hda - Add missing Line-Out and PCM switches as slave
  ALSA: hda - iMac 9,1 sound patch.
  ALSA: opti93x: set MC indirect registers base from PnP data
2009-12-09 19:52:13 -08:00
Linus Torvalds 4ef58d4e2a Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
  tree-wide: fix misspelling of "definition" in comments
  reiserfs: fix misspelling of "journaled"
  doc: Fix a typo in slub.txt.
  inotify: remove superfluous return code check
  hdlc: spelling fix in find_pvc() comment
  doc: fix regulator docs cut-and-pasteism
  mtd: Fix comment in Kconfig
  doc: Fix IRQ chip docs
  tree-wide: fix assorted typos all over the place
  drivers/ata/libata-sff.c: comment spelling fixes
  fix typos/grammos in Documentation/edac.txt
  sysctl: add missing comments
  fs/debugfs/inode.c: fix comment typos
  sgivwfb: Make use of ARRAY_SIZE.
  sky2: fix sky2_link_down copy/paste comment error
  tree-wide: fix typos "couter" -> "counter"
  tree-wide: fix typos "offest" -> "offset"
  fix kerneldoc for set_irq_msi()
  spidev: fix double "of of" in comment
  comment typo fix: sybsystem -> subsystem
  ...
2009-12-09 19:43:33 -08:00
Krzysztof Helt e6960e194a ALSA: opti93x: set MC indirect registers base from PnP data
The PnP data on the OPTI931 and OPTI933 contains io port
range for the MC indirect registers. Use the PnP range
instead of hardwired value 0xE0E.

Also, request region of MC indirect registers so it is
marked as used to other drivers (this was missing previously).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-08 12:22:52 +01:00
Takashi Iwai 57648cd52b Merge branch 'topic/misc' into for-linus 2009-12-04 16:22:37 +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
Krzysztof Helt d8ea23931c ALSA: opti9xx: remove snd_opti9xx fields
Remove snd_opti9xx fields which are indirect arguments to
the snd_opti9xx_configure(). Pass these values as function
arguments.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-02 23:56:10 +01:00
Krzysztof Helt 306ecee926 ALSA: opti-miro: add PnP detection
The PCM12 and PCM20 can be set into the ISA PnP mode. The PCM12 PnP
was sold as the PnP device.
Add code to handle detection of these cards using ISA PnP framework.

Tested on the PCM20 in PnP mode. The PCM12 PnP has the same MS Windows
INF file except for a card name displayed for user.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-30 11:26:30 +01:00
Krzysztof Helt 70a5f1187b ALSA: opti-miro: separate comon probing code
Separate common probing code in order to use it
for PnP probing.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-30 11:26:22 +01:00
Krzysztof Helt 8700055e0a ALSA: opti-miro: fix OOPS if hardware is not detected
If a hardware is not detected there is a kernel crash
due to not initialized snd_miro->aci pointer. This pointer
is initialized after detection of the opti (miro) chip.

This bug was introduced by patches to expose
ACI mikser outside the snd-miro driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-27 11:21:40 +01:00
Krzysztof Helt 9dc9120c77 ALSA: opti-miro: expose ACI mixer to outside drivers
The ACI mixer is used to control the radio FM module
installed on the Miro PCM20 sound card. Expose ACI mixer
outside the sound card driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-23 09:41:55 +01:00
Krzysztof Helt 9aeba62971 ALSA: opti-miro: make miro.h header available outside the alsa directory
Move the miro.h header to the include/sound directory. It can
be used in the Miro PCM20 radio driver (v4l).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-23 09:41:46 +01:00
Krzysztof Helt 616ad593fe ALSA: opti-miro: remove snd_card pointer from snd_miro structure
Remove the snd_card pointer from the snd_miro structure and
do some small code improvements.

Also, move Opti chipset detection before detection of the
ACI mixer, so the mci_base value is set in one place only.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-21 19:59:49 +01:00
Krzysztof Helt 4b28dca860 ALSA: cs4236: add dB scale for all volume controls
Use db scale for all volume controls according to Crystal's datasheets.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-19 11:52:47 +01:00
Takashi Iwai 67f2db24fb ALSA: opti-miro: Fix missing semicolon
To fix a build error
  sound/isa/opti9xx/miro.c:1281: error: expected ';' before '}' token

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-18 08:37:59 +01:00
Krzysztof Helt b67cad932c ALSA: opti-miro: use variables directly in the probe function
Use the fm_port and mpu_port variables directly in a probe function.
This completely eliminates a need to copy the fm_port value to
the snd_miro structure.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-18 07:23:32 +01:00
Krzysztof Helt b753e03e5e ALSA: cs4236: update control names
Update control names to be more closer to their meaning.
Change the "Mono" name to the "Beep" as this line is usually
used to forward the PC beeper signal to sound card's output.
Update names for both cs423x and wss.

Clean up cs4235 controls according to the cs4235 doc. Rename
some of the cs4235 controls to be consistent with the cs4236's
ones.

Also, delete one misnamed cs4231 register define.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-18 07:23:16 +01:00
Krzysztof Helt faa1242c59 ALSA: es18xx: code improvements
1. Set the third argument of the snd_device_new to not NULL, so there is
   no warning about bug during chip detection. The third argument is not
   used in this driver. It was changed in my previous patch.

2. Remove the fm_port and mpu_port fields from the snd_es18xx structure.
   They can be converted to function arguments.

3. Remove the dmaN_size fields from the snd_es18xx structure. These
   values are used only in pointer functions and can be easily calculated.

4. Remove the ctrl_lock spinlock which is used only in one read function
   which is called once during chip initialization. There are many
   writes to the same register and they are not protected on purpose
   (see the comment ina the snd_es18xx_config_write()).

5. Use the first part of the text5Sources string table as the text4Soruces
   table (they are the same).

6. Merge the same cases for the ES1887 and ES1888 when setting chip's caps.

7. Move the snd_es18xx_reset() to __devinit section.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-08 11:26:04 +01:00
Krzysztof Helt d114cd84a1 ALSA: cs4236: detect chip in one pass
The cs4236 was two step detection with call to the snd_wss_free()
between two steps. The snd_wss_free() did not free a sound device
created in the snd_wss_create(). This caused an OOPS during module
removal as the same sound device was released twice. The same OOPS
happened if the cs4236 module loading failed.

Fix this by adapting the snd_cs4236_create() to correctly work with
chips less capable then cs4236. The snd_cs4236_create() behaves the
same as the snd_wss_create() if the chip is less capable than the cs4236.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-05 18:10:25 +01:00
Jaroslav Kysela d355c82a01 ALSA: rename "PC Speaker" and "PC Beep" controls to "Beep"
To avoid confusion in control names for the standard analog PC Beep generator
using a small Internal PC Speaker, rename all related "PC Speaker" and "PC
Beep" controls to "Beep" only. This name is more universal and can be also
used on more platforms without confusion.

Introduce also "Internal Speaker" in ControlNames.txt for systems with
full-featured build-in internal speaker.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-05 09:00:18 +01:00
Krzysztof Helt b14f5de731 ALSA: es18xx: remove snd_audiodrive structure
Remove intermediate snd_audiodrive structure between
snd_card structure and snd_es18xx. This reduces size of
source code and binary driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 12:46:39 +01:00
Krzysztof Helt 3c76b4d69b ALSA: es18xx: remove snd_card pointer from snd_es18xx structure
The snd_card pointer is redundant and code can be easily
changed to work without it.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 12:46:18 +01:00
Krzysztof Helt 633c7e92bd ALSA: wss: reuse CS4231 controls for AD1848
The C4231 control set is a superset of the AD1848 control
set so reuse the CS4231 controls definitions for the AD1848.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-11 18:02:58 +02:00
Krzysztof Helt abd134db94 ALSA: wss: convert CS4231 mixer to dB scale
Convert CS4231 mixer to dB scale after AD1848 mixer.

Also, add missing microphone boost control for the AD1848
and correct wrong bits for loopback volume on the AD1848.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-10 10:55:10 +02:00
Krzysztof Helt 6fcfa3959a ALSA: sscape: coding style fixes
Fix coding style errors in the driver.

Also, add missing argument for CMD_XXX_MIDI_VOL command.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-10 10:54:52 +02:00
Takashi Iwai ed76f652d5 ALSA: sscape - Remove invalid __devinitdata to module parameters
Module parameters shouldn't be marked as __devinitdata since they can be
referred via sysfs even after probing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-05 18:27:28 +02:00
Krzysztof Helt 1cb0fdebae ALSA: sscape: force AD1848 codec mode on old Soundscape
Old Soundscape cards (pre PnP) work only with AD1848 codecs.
If the CS4231 codec is installed it must be used in AD1848
compatible mode.

Also, add gameport support and remove an unused mpu field.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-05 18:21:33 +02:00
Krzysztof Helt bcde1f8a80 ALSA: sscape: remove MIDI instances counting with limit ULONG_MAX
There is no sense to limit open MIDI connections with limit
as high as ULONG_MAX.

Also, convert more messages to use the snd_printk.

Correct few old and misleading comments as well.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-04 10:22:51 +02:00
Krzysztof Helt acd4710091 ALSA: sscape: convert to firmware loader framework
The conversion solves the problem that firmware size was set to 64KB
while non PnP cards have 128KB firmware files.

An additional firmware initialization code has been moved from the OSS
driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-01 07:51:56 +02:00
Krzysztof Helt f0968e3f7a ALSA: sscape: add supoort for SPEA Media FX/Reveal SC-600
Move code from the OSS sscape driver in order to support old Soundscape OEM models.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28 11:31:36 +02:00
Takashi Iwai 9d2743f84d Merge branch 'topic/cmi8330' into for-linus
* topic/cmi8330:
  ALSA: cmi8330: Allow MPU-401-less operation
  ALSA: cmi8330: find OPL3 port automatically
  cmi8330: Add basic CMI8329 support
  ALSA: cmi8330: revert comments about AD1848 back
2009-09-10 15:32:45 +02:00
Julia Lawall fcb2954b96 ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call.  Indeed, the second call does not need
to save the interrupt state, so it is changed to a simple spin_lock.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression lock1,lock2;
expression flags;
@@

*spin_lock_irqsave(lock1,flags)
... when != flags
*spin_lock_irqsave(lock2,flags)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-19 14:02:29 +02:00
Ondrej Zary 72b43cf140 ALSA: cmi8330: Allow MPU-401-less operation
Adding MPU-401 support to cmi8330 driver could cause a regression (non-working
sound) on a system where there is no free IRQ for the MPU-401 device (which
is not very uncommon as this card requires two separate IRQs plus a third one
for MPU-401).

When MPU-401 PnP configuration fails (mostly because of unavailable IRQ), just
ignore MPU-401 and continue without it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-07 18:24:53 +02:00