kcalloc is supposed to be called with the count as its first argument and the
element size as the second.
Both arguments are size_t so does not affect correctness. This callsite is
during module_init and therefore not performance critical. Another patch will
optimize the case when the count is variable but the size is fixed.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fixed the missing initialization for unsolicited events on
Cx5045 micsense model.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added volume controls for the analog PC Beep on 92hd71bxx codecs.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fix a const pointer usage warning in the Digigram miXart soundcard driver. A
const pointer is being passed to copy_from_user() to load the firmware into.
This is okay in this case because the function has allocated the firmware
struct itself, but the const qualifier is part of the firmware struct - so the
patch casts the const away.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Fix a const pointer usage warning in the Digigram pcxhr compatible soundcard
driver. A const pointer is being passed to copy_from_user() to load the
firmware into. This is okay in this case because the function has allocated
the firmware struct itself, but the const qualifier is part of the firmware
struct - so the patch casts the const away.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Standardise both in-kernel and loaded firmware to be stored as
little-endian instead of host-endian.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
The maestro3 driver is byte-swapping its firmware to be host-endian in
advance, when it doesn't seem to be necessary -- we could just use
le16_to_cpu() as we load it.
Doing that means that we need to switch the in-tree firmware to be
little-endian too.
Take the least intrusive way of doing this, which is to switch the
existing snd_m3_convert_from_le() function to convert _to_ little-endian
instead, and use it on the in-tree firmware instead of the loaded
firmware. It's a bit suboptimal but doesn't matter much right now
because we're about to remove the special cases for the in-tree version
anyway.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
As reported and tested by an RedHat customer, HP dc7600 with pci sub IDs
0x103c/0x3011 works with the hp-3013 model and not with the hp only model.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
An gpio_mask value was defined twice needlessly.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added the model entry (model=lenovo) for Lenovo N3000 N200 laptop
with ALC861-VD. Reference below:
https://bugzilla.novell.com/show_bug.cgi?id=406425
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Replace 'snd_ac97_write' with snd_ac97_write_cache' in pacth_ucb1400 to allow
proper codec wakeup.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Toshiba Satellite P105 with cx5045 has no HP pin but only a
speaker pin and does the speaker-muting on hardware.
Thus the matching model is laptop-micsense.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added the missing SSID of Thinkpad Z60m for model=thinkpad with
AD1981HD.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ALC883 medion model doesn't unmute the proper amps so no output can be heard.
Replaced the mute switches to behave just like other models.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Some laptops don't like PR3 powerdown. Do PR3 powerdown only
for the real power-saving.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Some machines with Cx5045 seem to have no problem with the volume
over 0dB on NID 0x17. Disable amp overrides for other devices but HP.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
YDSXGR_BUF441OUTVOL register isn't initialized properly. This may lead to
a silent output at full volume of unchanged "Wave Playback Volume".
http://bugzilla.kernel.org/show_bug.cgi?id=10963
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
MacBook 3.1 is compatible with model=mbp3.
Added the codec SSID 10b6:3600.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- fix problem with codec register 0x6a being write-only
by adding a software shadow register
(caused annoying noise after module loading due to _toggling_
between gameport and audio bits instead of configuring them properly)
- rename several "Wave" mixer controls to "PCM", since this is
what Wine and several other apps are looking for (IOW, _requiring_)
and this is what AC97 specs use as naming, too,
thus I'd guess it's what these controls are
- cleanup, small optimizations
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Stop the S/PDIF DMA engine and output when the device is told to pause.
It will keep on looping the current buffer contents if this isn't done.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Tested-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add the SSID for the "Fujitsu Siemens Amilo M1451G" laptop to
patch_realtek.c , so that it uses ALC880_FUJITSU by default.
Signed-off-by: Travis Place <wishie@wishie.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added the SSID of a known iMac 24" to automatically use
ALC885_IMAC24 quirk.
Signed-off-by: Travis Place <wishie@wishie.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The irq handler may be called before the proper initialization of hardware.
Call snd_aw2_saa7146_setup() before the irq handler registration.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
AC_VERB_GET_DIGI_CONVERT_2 isn't actually implemented but reserved.
The whole SIC bits are returned from DIGI_CONVERT_1.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added an entry for another MSI K8N Diamond mobo with SSID 1102:1009.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Don't create mixer volume elements for Headphone and Speaker if they
use the same DAC as normal line-outs on AD1988. Otherwise the amp
value gets screwed up, e.g.
https://bugzilla.novell.com/show_bug.cgi?id=398255
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Check that model->control_filter is set before trying to call it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use bdl_pos_adj=32 as default except for Intel hardwares confirmed
to work with bdl_pos_adj=1. Looks like ATI and NVidia require this
higher value.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added support for new family of IDT codecs.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Sort stac9205_cfg_table in the order of id numbers, and removed the
duplicated (obsoleted) entries for 0x01fc and 0x01fd. This doesn't
change the driver behavior since the old entries are all secondary.
The duplication occured due to commit dfe495d0, and the old entries
were introduced by commit ae0a8ed8.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The pending IRQ handling is a very hackish workaround and should be
avoided as much as possible via a larger bdl_pos_adj option value.
Put a warning message if this situation occurs so that the user may have
a chance to notice that something is wrong.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ATI SB controllers seem to report the DMA ahead in the amount of FIFO.
Thus bdl_pos_adj should be 32 for them as default.
Also, the default value is set to -1, which means to make the driver
to choose the appropriate value.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The option bdl_pos_adj should be provided for each card instance instead of
a global one because the value depends rather on each controller-chip.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
position_fix=3 is the option to correct the DMA position with the
FIFO size. But, it never worked correctly, and we have now more other
workarounds for the DMA position fixes. Thus better to remove it.
Also, change POS_FIX_NONE to POS_FIX_LPIB to represent its real role
better.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added a new option, bdl_pos_adj, to adjust the delay of IRQ-wakeup
timing.
Most HD-audio hardwares have a problem that a BDL IRQ is issued before
actually the data and the DMA pointer are updated.
We have already a mechanism to force to delay snd_pcm_period_elapsed()
calls via workq, but this costs much CPU, and typically the delay is
within one sample. Thus, it's more clever to adjust the BDL entries
instead.
The new option adds the size of the delay in frames. As default,
it's set to 1 -- that is, one sample delay. Even the hardware is
really correct, one sample delay is relatively harmless in comparison
with reporting wrong positions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>