dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

5274 Commits

Author SHA1 Message Date
Takashi Iwai f49921b894 ALSA: cmipci: Implement channel mapping
Simply enable the channel map according to the h/w capability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:32 +02:00
Takashi Iwai e36e3b86c7 ALSA: Implement channel maps for standard onboard AC97 drivers
Just set the channel maps depending on the hardware availability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:31 +02:00
Takashi Iwai 833a493b7e ALSA: ac97: Implement channel map workaround for ALC650
ALC650 has a channel swap option between surround and CLFE channels,
so we need to tweak the channel maps dynamically depending on the
register bit.

Now struct snd_ac97 can contain chmap pointers for playback and
capture.  The driver may store these and let ac97 driver changing the
channel mapping dynamically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:30 +02:00
Takashi Iwai 53775b0d0c ALSA: hda - Fix channel maps for Nvidia 7x 8ch HDMI codecs
Some old Nvidia HDMI codecs with 8ch support only 2/8 or
2/6/8 channels and with the fixed CLFE-first map.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:30 +02:00
Takashi Iwai d45e6889ee ALSA: hda - Provide the proper channel mapping for generic HDMI driver
... instead of the standard fixed channel maps.
The generic HDMI is based on the audio infoframe, and its configuration
can be selected via CA bits.  Thus we need a translation between the
CA index and the verbose channel map list.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:26 +02:00
Takashi Iwai 9c9a5175e6 ALSA: hda - Add standard channel maps
Although HD-audio allows pair-wise channel configurations, only the
fixed channel positions are used in this version.  In future, this can
be changed and allow user to modify the channel positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:01:18 +02:00
Takashi Iwai 1a6003b525 ALSA: hda - Move non-PCM check to per_pin in patch_hdmi.c
Recently the check for non-PCM stream state was added to the generic
HDMI driver code.  But this check should be done rather to each pin
instead of each converter.  Otherwise when a different converter is
assigned at the next open, the audio infoframe can be inconsistent
with the setup using the previous converter.

For fixing this issue, this patch moves the state of the current
non-PCM status from per_cvt to per_pin.  (In addition an unused
argument cvt_nid is stripped from hdmi_setup_channel_mapping())

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 17:59:19 +02:00
David Henningsson 298efee7f5 ALSA: hda - fix control names for multiple speaker out on IDT/STAC
For multiple speaker outs, the names were previously
"Speaker,0", "Speaker,1", "Center"/"LFE", "Speaker,3". This is
inconsistent, confusing, and is not picked up correctly by PulseAudio.
Instead use "Front", "Surround", "Center"/"LFE", "Side" which
is more standard.

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1046734
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 12:01:55 +02:00
Takashi Iwai ab548d2dba ALSA: hda - Fix missing Master volume for STAC9200/925x
With the commit [2faa3bf: ALSA: hda - Rewrite the mute-LED hook with
vmaster hook in patch_sigmatel.c], the former Master volume control
was converted to PCM.  This was supposed to be covered by the vmaster
control.  But due to the lack of "PCM" slave definition, this didn't
happen properly.  The patch fixes the missing entry.

Reported-by: Andrew Shadura <bugzilla@tut.by>
Cc: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 10:10:11 +02:00
Wang Xingchao 2d7e887cbb ALSA: HDMI - Setup channel mapping for non_pcm audio
For HBR stream test, use straight channel mapping way.
when switched back to "speaker-test -c8", even the audio
infoframe is up-to-date, there should be correct channel mapping setup.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 08:50:35 +02:00
Wang Xingchao 433968da4d ALSA: HDMI - Enable HBR feature on Intel chips
HDMI channel remapping apparently effects HBR packets on Intel's chips.
For compressed non-PCM audio, use "straight-through" channel mapping.
For uncompressed multi-channel pcm audio, use normal channel mapping.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 08:50:33 +02:00
Wang Xingchao 72357c78b7 ALSA: HDMI - Fix channel_allocation array wrong order
The array channel_allocations[] is an ordered list, add function to get
correct order by ca_index.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 08:50:31 +02:00
Wei Yongjun 292f2b6254 ALSA: emu10k1: use list_move_tail instead of list_del/list_add_tail
Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-05 09:15:12 +02:00
Takashi Iwai d819387ef7 ALSA: hda - Clean up redundant FG checks
Just refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31 07:58:28 -07:00
Takashi Iwai 08fa20ae20 ALSA: hda - Yet another fix for D3 stop-clock refcounting
The call of pm_notify callback in snd_hda_codec_free() should be with
the check of the current state whether pm_notify(false) is called or
not, instead of codec->power_on check.

For improving the code readability and fixing this inconsistency,
codec->d3_stop_clk_ok is renamed to codec->pm_down_notified, and this
flag is set only when runtime PM down is called.  The new name reflects
to a more direct purpose of the flag.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31 07:50:28 -07:00
Takashi Iwai 5a798394c8 ALSA: cs5530: Fix resource leak in error path
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44741

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 13:21:00 -07:00
Takashi Iwai fbaf6a5a35 ALSA: korg1212: Fix reverted min/max ADC sense range
k1212MinADCSens and k1212MaxADCSens are defined wrongly.
The max must be greater than the min by obvious reason.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46561

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:57:38 -07:00
Takashi Iwai 4b927345a3 ALSA: hda - Optimize bitfield usage in struct hda_codec
Move up a few bitfields to be packed into a single int.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:50:40 -07:00
Takashi Iwai 83012a7ccb ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its
behavior can be well controlled via the default value and module
parameter.  Let's just replace it with the standard CONFIG_PM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:50:13 -07:00
Takashi Iwai 432c641e01 ALSA: hda - Fix D3 clock stop check for codecs with own set_power_state op
When a codec provides its own set_power_state op, the D3-clock-stop
isn't checked correctly.  And the recent changes for repeating the
state-setting operation isn't applied to such a codec, too.

This patch fixes these issues by moving the call of codec's own op to
the place where the generic power-set operation is done, and move the
power-state synchronization code out of
snd_hda_set_power_state_to_all() so that it can be called always at
the end of power-up/down sequence, and updates the D3 clock-stop flag
properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:48:55 -07:00
Takashi Iwai 68467f51c1 ALSA: hda - Fix runtime PM leftover refcounts
When the HD-audio is removed, it leaves the refcounts when codecs are
powered up (usually yes) in the destructor.  For fixing the unbalance,
and cleaning up the code mess, this patch changes the following:
- change pm_notify callback to take the explicit power on/off state,
- check of D3 stop-clock and keep_link_on flags is moved to the caller
  side,
- call pm_notify callback in snd_hda_codec_new() and snd_hda_codec_free()
  so that the refcounts are proprely updated.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:48:49 -07: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 c36b5b054a ALSA: hda - Don't trust codec EPSS bit for IDT 92HD83xx & co
These codecs seem reporting EPSS but require longer delay for the
proper D3 transition.  For example, D3_STOP_CLOCK_OK bit won't be set
correctly even after D3.

In this patch, codec->epss flag is overridden for avoid the
misbehavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28 09:26:16 -07:00
Takashi Iwai 983f6b9381 ALSA: hda - Avoid unnecessary parameter read for EPSS
EPSS parameter should be static, so we can read it once and remember.
This also allows more easily to override the wrong EPSS capability
reported from a codec by changing the flag in the codec
initialization step.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28 09:25:57 -07:00
Takashi Iwai 5d908ab941 ALSA: hda - Make clear built-in driver optimization
Use unsigned int to make clear that the codes required only for
modules will be reduced by the compiler optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28 09:12:09 -07:00
Markus Bollinger 8c3f1b1cbc ALSA: pcxhr: Add 8 new sound cards
add new sound cards VX442HR VX442e PCX442HR PCX442e VX822HR VX822e PCX822HR and PCX822e

Signed-off-by: Markus Bollinger <bollinger@digigram.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-27 16:10:29 +02:00
Mengdong Lin 5d6147f101 ALSA: hda - bug fix on references without checking CONFIG_SND_HDA_POWER_SAVE
The patch to support runtime PM introduced a bug:
Module parameter 'power_save_controller', and the codec flag 'd3_stop_clk'
'd3_stop_clk_ok' are defined only when HDA power save is enabled in config. But
there are references to them without checking macro CONFIG_SND_HDA_POWER_SAVE.

This patch is to fix the bug.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-24 07:22:42 +02:00
Mengdong Lin b8dfc46241 ALSA: hda - add runtime PM support
Runtime PM can bring more power saving:
- When the controller is suspended, its parent device will also have a chance
  to suspend.
- PCI subsystem can choose the lowest power state the controller can signal
  wake up from. This state can be D3cold on platforms with ACPI PM support.
And runtime PM can provide a gerneral sysfs interface for a system policy
manager.

Runtime PM support is based on current HDA power saving implementation. The user
can enable runtime PM on platfroms that provide acceptable latency on transition
from D3 to D0.

Details:
- When both power saving and runtime PM are enabled:
  -- If a codec supports 'stop-clock' in D3, it will request suspending the
     controller after it enters D3 and request resuming the controller before
     back to D0. Thus the controller will be suspended only when all codecs are
     suspended and support stop-clock in D3.
  -- User IO operations and HW wakeup signal can resume the controller back to
     D0.
- If runtime PM is disabled, power saving just works as before.
- If power saving is disabled, the controller won't be suspended because the
  power usage counter can never be 0.

More about 'stop-clock' feature:
If a codec can support targeted pass-through operations in D3 state when there
is no BCLK present on the link, it will set CLKSTOP flag in the supported power
states and report PS-ClkStopOk when entering D3 state. Please refer to HDA spec
section 7.3.3.10 Power state and 7.3.4.12 Supported Power State.

[Fixed CONFIG_PM_RUNTIME dependency in hda_intel.c by tiwai]

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-23 14:21:32 +02:00
Takashi Iwai 8a5354140a ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.c
Instead of calling the jack sync in the init callback of each codec,
call it generically at initialization and resume.  By calling it at
the last of resume sequence, a possible race between the jack sync and
the unsol event enablement in the current code will be closed, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22 16:48:17 +02:00
David Henningsson 042b92c185 ALSA: hda - Do not set GPIOs for speakers on IDT if there are no speakers
This fixes an issue with a machine where there were no speakers,
but GPIO0 had to be data=1 for the headphone to be functioning.

I'm not sure if we need a more advanced patch to solve all possible cases,
but if so, this patch would still provide a minor optimisation.

BugLink: https://bugs.launchpad.net/bugs/1040077
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22 16:26:05 +02:00
Tejun Heo 43829731dd workqueue: deprecate flush[_delayed]_work_sync()
flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
and convert all users to flush[_delayed]_work().

If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Avi Kivity <avi@redhat.com>
2012-08-20 14:51:24 -07:00
Takashi Iwai ddf83485d7 Merge branch 'for-linus' into for-next
Conflicts:
	sound/pci/hda/hda_codec.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 22:14:26 +02:00
Takashi Iwai 535b6c51fe ALSA: hda - Fix leftover codec->power_transition
When the codec turn-on operation is canceled by the immediate
power-on, the driver left the power_transition flag as is.
This caused the persistent avoidance of power-save behavior.

Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 21:25:22 +02:00
Takashi Iwai 099d53c308 ALSA: hda - Add missing ifdef CONFIG_SND_HDA_POWER_SAVE to tracepoints
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 18:04:40 +02:00
Takashi Iwai 65fcd41d37 ALSA: hda - Check the power state when power_save option is changed
... by calling the newly introduced snd_hda_power_sync().

I had to reimplement a wheel for adding the trigger at changing the
parameter -- the parameter set ops is overwritten to pass the integer
parameter, then trigger the power-state sync.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:46:06 +02:00
Takashi Iwai c376e2c72b ALSA: hda - Implement snd_hda_power_sync() helper function
Added a new helper function snd_hda_power_sync() to trigger the
power-saving manually.  It's an inline function call to
snd_hda_power_save() helper function.

Together with this addition, snd_hda_power_up*() and
snd_hda_power_down() functions are inlined to a call of the same
snd_hda_power_save() helper function.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:46:05 +02:00
Takashi Iwai fa2f5bf096 Merge branch 'topic/ca0132-fix' into for-linus
This is a series of fixes for CA0132, especially the missing SPDIF I/O
and the mixer build errors.
2012-08-20 11:38:31 +02:00
David Henningsson c41999a239 ALSA: hda - don't create dysfunctional mixer controls for ca0132
It's possible that these amps are settable somehow, e g through
secret codec verbs, but for now, don't create the controls (as
they won't be working anyway, and cause errors in amixer).

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1038651
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:33:23 +02:00
Takashi Iwai b244d33560 ALSA: hda - Add tracepoints at snd_hda_power_up/down entrances.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 11:24:29 +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
Julia Lawall ae970eb45d ALSA: sound/pci/sis7019.c: fix error return code
Initialize rc before returning on failure, as done 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 10:57:51 +02:00
Julia Lawall 4d8ce1c996 ALSA: sound/pci/ctxfi/ctatc.c: fix error return code
Initialize err before returning on failure, as done 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 10:57:30 +02:00
David Henningsson 5e68fb3cab ALSA: hda - Don't send invalid volume knob command on IDT 92hd75bxx
Instead of blindly initializing a volume knob widget, first check
that there actually is a volume knob widget.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-16 14:14:56 +02:00
Takashi Iwai 1c86845268 ALSA: hda - Add 3stack-automute model to AD1882 codec
Added a simple support of automute for the front HP jack to AD1882
stack model.  Such an addition is basically an exception -- we really
want to avoid the static quirk codes, but AD1882 parser isn't still
ready for moving to the BIOS auto-parser yet.  So, as a quick fix, I
merged it for now.

In near future, we really need the big clean up of patch_analog.c to
move on to the auto-parser...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-15 11:50:05 +02:00
Takashi Iwai c7561cd804 ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEP
Otherwise we may get compile warnings due to unused functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14 18:12:04 +02:00
Takashi Iwai 7ccbde57ce ALSA: hda - Fix possible compile warnings regarding CONFIG_PM
Replace with a proper ifdef check of CONFIG_PM_SLEEP in hda_intel.c.
But other places in HD-audio driver are still marked with CONFIG_PM,
since these can be called for power-saving even without
CONFIG_PM_SLEEP.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14 18:11:51 +02:00
Takashi Iwai 3bdcff70b6 ALSA: lx6464es: Add a missing error check
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44541

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14 17:42:11 +02:00
David Henningsson 265d931a9e ALSA: hda - Fix 'Beep Playback Switch' with no underlying mute switch
Some Conexant devices (e g CX20590) have no mute capability on
their Beep widgets.
This patch makes sure we don't try setting mutes on those widgets.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14 10:22:31 +02:00
Wang Xingchao 088c820b73 ALSA: hda - fix Copyright debug message
As spec said, 1 indicates no copyright is asserted.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-13 10:02:01 +02:00
Wang Xingchao 6152597971 ALSA: hda - show ICT/KAE control bits
Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-13 10:01:29 +02:00
Mengdong Lin e037cb4a54 ALSA : hda - bug fix on checking the supported power states of a codec
The return value of snd_hda_param_read() is -1 for an error, otherwise
it's the supported power states of a codec.

The supported power states is a 32-bit value. Bit 31 will be set to 1
if the codec supports EPSS, thus making "sup" negative. And the bit
28:5 is reserved as "0".
So a negative value other than -1 shall be further checked.

Please refer to High-Definition spec 7.3.4.12 "Supported Power
States", thanks!

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 14:11:58 +02:00
David Henningsson 14bc9c6dc6 ALSA: hda - Fix panned "Beep Playback Switch"
When "Beep Playback Switch" had a different value on left and right
channels (such as muting left but not right, or vice versa), this
could result in the right channel being ignored.

This patch enables beep to be sounding from right channel only, and
also give correct result back to userspace (e g amixer).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 14:10:20 +02:00
Dan Carpenter de64c0ee7d ALSA: cs46xx - signedness bug in snd_cs46xx_codec_read()
This function returns its own error codes instead of normal negative
error codes.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-10 12:11:21 +02:00
James Ralston 144dad99ef ALSA: hda_intel: Add Device IDs for Intel Lynx Point-LP PCH
This patch adds the Intel HD Audio Device IDs for the Intel Lynx Point-LP PCH

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 18:42:42 +02:00
Takashi Iwai 97c6a3d17b ALSA: hda - Fix forgotten ifdef CONFIG_SND_HDA_PATCH_LOADER
The firmware callback must be protected by that ifdef.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 17:41:01 +02:00
Takashi Iwai 5cb543dba9 ALSA: hda - Deferred probing with request_firmware_nowait()
For processing the firmware handling properly for built-in kernels,
implement an asynchronous firmware loading with
request_firmware_nowait().  This means that the codec probing is
deferred when the patch option is specified.

Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 16:28:51 +02:00
Takashi Iwai 4918cdab49 ALSA: hda - Load firmware in hda_intel.c
This is a preliminary work for the deferred probing for
request_firmware() errors at init.

This patch moves the call of request_firmware() to hda_intel.c, and
call it in the earlier stage of probing rather than
azx_probe_continue().

Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 16:28:19 +02:00
David Henningsson 94c142a160 ALSA: hda - Fix pop noise in headphones on S3 for Asus X55A, X55V
To turn off pin control for the pin was tested, and helped against
this issue.

BugLink: https://bugs.launchpad.net/bugs/1034779
Tested-by: Chih-Hsyuan Ho <chih.ho@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 11:00:40 +02:00
Takashi Iwai 8e13fc1c5f ALSA: hda - Add missing SPDIF I/O setup for CA0132
CA0132 driver had some codes to handle the S/PDIF I/O, but the actual
setups of pins and converters were missing.  Now the pins are added.

Also, fixed a few points triggering invalid codec verbs and mixer
elements since the digital I/O audio widgets on CA0132 have no amp.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 17:27:50 +02:00
Takashi Iwai 27ebeb0b1b ALSA: hda - Use the standard PCM ops for CA0132
Now with the workaround using codec->pcm_format_first flag, we can
clean up the home-baked codes in patch_ca0132.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 17:25:02 +02:00
Takashi Iwai 55cf87fe0e ALSA: hda - Fix superfluous "-in" suffix from CA0132 capture items
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 17:15:55 +02:00
Takashi Iwai ed36081350 ALSA: hda - Add codec->pcm_format_first flag
Introduced a new flag to set up the PCM stream format at first before
the stream_id and channel tag.  Some codecs (e.g. CA0132) seem
preferring this over stream_id -> format order.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 17:12:52 +02:00
David Henningsson 012e7eb1e5 ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad
The same ID is twice in the quirk table, so the second one is not used.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org> [v3.2+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-08 09:03:13 +02:00
Takashi Iwai 709aea6b05 ALSA: hda - Fix ugly debug prints with CONFIG_SND_VERBOSE_PRINTK=y
When CONFIG_SND_VERBOSE_PRINTK=y is set, the debug print in
hda_auto_parser.c looks really ugly like:

  ALSA sound/pci/hda/hda_auto_parser.c:331    mono: mono_out=0x0
  ALSA sound/pci/hda/hda_auto_parser.c:334    dig-out=0x12/0x0
  ALSA sound/pci/hda/hda_auto_parser.c:335    inputs:
  ALSA sound/pci/hda/hda_auto_parser.c:339  Mic=0x11ALSA sound/pci/hda/hda_auto_parser.c:339  Line=0x10
  ALSA sound/pci/hda/hda_auto_parser.c:341
  ALSA sound/pci/hda/hda_auto_parser.c:343    dig-in=0x13

Better to put one item at each line.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-07 18:10:31 +02:00
David Henningsson bb10b09a8e ALSA: hda - remove redundant auto quirks for conexant 506x
Now that the auto model is the default, these quirks are redundant
and can be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-07 14:14:16 +02:00
David Henningsson e9fc83cb2e ALSA: hda - remove quirk for Dell Vostro 1015
This computer is confirmed working with model=auto on kernel 3.2.
Also, parsing fails with hda-emu with the current model.

Cc: stable@kernel.org (3.2+)
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-07 14:14:09 +02:00
Felix Kaechele c8415a48fc ALSA: hda - add dock support for Thinkpad X230
As with the ThinkPad Models X230 Tablet and T530 the X230 needs a qurik to
correctly set up the pins for the dock port.

Signed-off-by: Felix Kaechele <felix@fetzig.org>
Cc: <stable@vger.kernel.org> [v3.2+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-07 08:02:49 +02:00
Takashi Iwai 8dfaa57391 ALSA: hda - Fix regression of HDMI codec probing
The commit c4bfe94a causes a regression on some codecs at probing.
Since this was just a workaround to shut up a kernel warning, it'd be
better to revert and fix properly.  So we ended up with re-adding the
cleanup callback.

Tested-and-reported-by: Matt Horan <matt@matthoran.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-06 14:52:44 +02:00
Philipp A. Mohrenweiser 4407be6ba2 ALSA: hda - add dock support for Thinkpad T430s
Add a model/fixup string "lenovo-dock", for Thinkpad T430s, to allow
sound in docking station.

Tested on Lenovo T430s with ThinkPad Mini Dock Plus Series 3

Cc: stable@kernel.org
Signed-off-by: Philipp A. Mohrenweiser <phiamo@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-06 13:16:08 +02:00
Takashi Iwai fcfb7866af ALSA: emu10k1: Avoid access to invalid pages when period=1
When period=1, the driver tries to allocate a bit bigger buffer than
requested by the user due to the irq latency tolerance.  This may lead
to accesses over the actually allocated pages.

This patch adds a check of the page index and assigns the silent page
when it's over the given buffer size.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-03 12:51:21 +02:00
Takashi Iwai 707fba3fa7 ALSA: hda - Support dock on Lenovo Thinkpad T530 with ALC269VC
Lenovo Thinkpad T530 with ALC269VC codec has a dock port but BIOS
doesn't set up the pins properly.  Enable the pins as well as on
Thinkpad X230 Tablet.

Reported-and-tested-by: Mario <anyc@hadiko.de>
Cc: <stable@vger.kernel.org> [v3.2+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-02 09:05:06 +02:00
Takashi Iwai 1f43f6c1bc ALSA: hda - Fix mute-LED GPIO initialization for IDT codecs
The IDT codecs initializes the GPIO setup for mute LEDs via
snd_hda_sync_vmaster_hook().  This works in most cases except for the
very first call, which is called before PCM and control creations.
Thus before Master switch is set manually via alsactl, the mute LED
may show the wrong state, depending on the polarity.

Now it's fixed by calling the LED-status update function manually when
no vmaster is set yet.

Cc: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-31 10:50:20 +02:00
Takashi Iwai ff8a1e274c ALSA: hda - Fix polarity of mute LED on HP Mini 210
The commit a3e199732b made the LED working again on HP Mini 210 but
with a wrong polarity.  This patch fixes the polarity for this
machine, and also introduce a new model string "hp-inv-led".

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=772923

Cc: <stable@vger.kernel.org> [v3.3+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-31 10:19:17 +02:00
Takashi Iwai e427c23756 ALSA: hda - Workaround for silent output on VAIO Z with ALC889
On recent kernels, Realtek codec parser tries to optimize the routing
aggressively and take the headphone output as primary at first.  This
caused a regression on VAIO Z with ALC889, the silent output from the
speaker.

The problem seems that the speaker pin must be connected to the first
DAC (0x02) on this machine by some reason although the codec itself
advertises the flexible routing with any DACs.

This patch adds a fix-up for choosing the speaker pin as the primary
so that the right DAC is assigned on this device.

Reported-and-tested-by: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-29 10:06:19 +02:00
Takashi Iwai c4bfe94a8b ALSA: hda - Fix WARNING from HDMI/DP parser
The recent fix to converter detaching timing in patch_hdmi.c
leads to a kernel WARNING due to a sanity check when the debug
option is set.  Add a workaround by setting a dummy hinfo->nid.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-27 18:29:58 +02:00
Takashi Iwai f2ad24fa57 ALSA: hda - Detach from converter at closing in patch_hdmi.c
The generic HDMI code detaches the converter from the stream when
unused, but it must be done rather in the close callback instead of
the cleanup callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-26 18:08:14 +02:00
Takashi Iwai a3e199732b ALSA: hda - Fix mute-LED GPIO setup for HP Mini 210
BIOS on HP Mini 210 doesn't provide the proper "HP_Mute_LED" DMI
string, thus the driver doesn't initialize the GPIO, too.  In the
earlier kernel, the driver falls back to GPIO1, but since 3.3 we've
stopped this due to other wrongly advertised machines.

For fixing this particular case, add a new model type to specify the
default polarity explicitly so that the fallback to GPIO1 is handled.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=772923

Cc: <stable@vger.kernel.org> [v3.3+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-26 08:21:53 +02:00
Takashi Iwai 6162552b0d ALSA: hda - Fix invalid D3 of headphone DAC on VT202x codecs
We've got a bug report about the silent output from the headphone on a
mobo with VT2021, and spotted out that this was because of the wrong
D3 state on the DAC for the headphone output.  The bug is triggered by
the incomplete check for this DAC in set_widgets_power_state_vt1718S().
It checks only the connectivity of the primary output (0x27) but
doesn't consider the path from the headphone pin (0x28).

Now this patch fixes the problem by checking both pins for DAC 0x0b.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-25 13:55:49 +02:00
David Henningsson 108cc108a3 ALSA: hda - add dock support for Thinkpad X230 Tablet
Also add a model/fixup string "lenovo-dock", so that other Thinkpad
users will be able to test this fixup easily, to see if it enables
dock I/O for them as well.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1026953
Tested-by: John McCarron <john.mccarron@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-20 10:45:07 +02:00
Dylan Reid 9e76e6d031 ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.
Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is
enabled in open, but is disabled in hdmi_init_pin which is called during
system resume.  This causes a system suspend/resume during playback to
mute HDMI/DP. Enabling the pin in prepare instead of open allows calling
snd_pcm_prepare after a system resume to restore audio.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-20 07:47:01 +02:00
Takashi Iwai 1558eb838f Merge branch 'topic/pm-convert' into for-next
This merges the changes for converting to new PM ops for platform
and some other drivers.
Also move some header files to local places from the public
include/sound.
2012-07-19 08:21:57 +02:00
David Henningsson 639aa4bd58 ALSA: hda - make sure alc268 does not OOPS on codec parse
A recent commit made patch_alc268 call snd_hda_pick_fixup with
NULL quirk pointer. Make sure we do not reference that NULL pointer.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-18 18:07:03 +02:00
Takashi Iwai f0913cd16e Merge branch 'topic/misc' into for-next
Generic updates for sound 3.6
2012-07-18 13:53:29 +02:00
Takashi Iwai 61eab000f3 Merge branch 'topic/hda' into for-next
This is a large chunk merge for 3.6 HD-audio things
2012-07-18 13:53:06 +02:00
David Henningsson 4e01ec636e ALSA: hda - Add support for Realtek ALC282
This codec has a separate dmic path (separate dmic only ADC),
and thus it looks mostly like ALC275.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1025377
Tested-by: Ray Chen <ray.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-18 07:51:26 +02:00
Takashi Iwai f46c329644 ALSA: hda - Fix index number conflicts of phantom jacks
Since some jack controls may be renamed as phantom jacks, the existing
check for index conflicts doesn't work because it simply compares the
name with the last used name, assuming that the controls with the same
name continue.  Thus, it would result in the duplicated controls when
two or more phantom jacks with the very same type exist, and the
driver gives up with an error.

This patch fixes the problem by checking the index number conflicts
more intensively (but dumbly).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 16:55:56 +02:00
Aaron Plattner 7ae48b56f8 ALSA: hda - Add new GPU codec ID to snd-hda
Vendor ID 0x10de0051 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Acked-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 07:30:44 +02:00
Takashi Iwai bdbe34dece ALSA: hda - Fix driver type of Haswell controller to AZX_DRIVER_SCH
According to Xingchao,
  This works for HDMI audio, otherwise there's blocking issue.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 16:17:10 +02:00
Wang Xingchao 1c76684d27 ALSA: hda - add Haswell HDMI codec id
0x80862807 is HDMI id for Haswell HDA.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 16:03:11 +02:00
Wang Xingchao e926f2c850 ALSA: hda - Add DeviceID for Haswell HDA
this patch add proper id for Haswell HDA Controller.

[Added AZX_DCAPS_POSFIX_COMBO flag by tiwai]

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 16:01:57 +02:00
Clemens Ladisch 093eef4166 ALSA: es1938: replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE
Instead of the hard-to-mantain TLV_DB_RANGE_HEAD macro, use
DECLARE_TLV_DB_RANGE, which computes its size automatically.

(Also make this data const on the way.)

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 10:02:19 +02:00
David Henningsson a7a0a64dab ALSA: hda - Always call standard unsolicited event for Realtek codecs
With the model parsers out of the way, we have no custom unsol
events to worry about, we can therefore simplify the code.

In addition, this fixes a bug on the ASUS TC710, which has only
a headphone jack and a mic jack, but no internal mic or speakers.
Therefore the unsol_event pointer was not set, and as a result,
the jack kcontrols were not correctly updated.

BugLink: https://bugs.launchpad.net/bugs/1021192
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-05 12:22:47 +02:00
Takashi Iwai f68d891d85 Merge branch 'topic/hda-beep' into topic/hda 2012-07-04 09:12:50 +02:00
Takashi Iwai 3fd877d32c ALSA: hda - Avoid possible race of beep on/off
Call cancel_work_sync() when turning off the beep switch so that the
mute call is executed in a proper order.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 18:31:37 +02:00
Takashi Iwai 257dfb4100 ALSA: hda - Get rid of superfluous beep->mode field
It's no longer necessary since beep_mode=2 option was dropped.
It can be checked simply via codec->beep != NULL.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 18:31:36 +02:00
Takashi Iwai 0401e8548e ALSA: hda - Move beep helper functions to hda_beep.c
Move snd_hda_mixer_amp_switch_put_beep() to hda_beep.c as a clean up
to remove one more ifdef.

Also add the corresponding get callback to return consistently the
digital beep state independently from the mixer amp value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 18:31:36 +02:00
Takashi Iwai 0920c9b4c4 ALSA: hda - Remove beep_mode=2
The beep_mode=2 option was introduced to make the beep mixer
controlling the beep input allocation/deallocation dynamically, so
that a user can switch between HD-audio codec digital beep and the
system beep only via mixer API.  This was necessary because the
keyboard driver took only the first input beep instance at that time.

However, the recent keyboard driver already processes the multiple
input instances, thus there is no point to keep this mode.

Let's remove it.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 18:31:20 +02:00
Takashi Iwai 81fcb17085 ALSA: Move some headers to local directories from include/sound
This is a bit clean up of public sound header directory.
Some header files in include/sound aren't really necessary to be
located there but can be moved to their local directories gracefully.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:09 +02:00
Takashi Iwai 68cb2b5592 ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:03 +02:00
Kailang Yang 8663ff75cd ALSA: hda - Fix no sound from ALC662 after Windows reboot
Windows use hidden register to control EAPD.
Linux use verb to control EAPD.
If windows reboot to Linux, it must change the EAPD control to verb
control.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-29 09:44:44 +02:00
Linus Torvalds 2b25679453 Sound fixes for 3.5-rc5
Here you find quite a few changes for HD-audio and a copule of quirk
 additions for USB-audio.  All reasonably small and/or trivial.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJP6tBMAAoJEGwxgFQ9KSmkhUsQAJcwhnQb27EB9eBnhjcZvmPS
 2K02VNVhoh7kVVjQQ92znpeu+5WFdpFyiBzRPkAzkRR29k7KAtYQRrKg0En7qOL7
 RN6CuZAhIr0D7r8QhpeiJ1ZqpOTzPpycBscYUWZGJR07+iBOZIGIuly4hcWWy2WQ
 ntwcaeDk/n6PWYCwaMxsGdarOZEBh+dcB/8m7QpRtLEOs72IbzpFGyvXpK/Cv+Fd
 8rxVL4JYeDq3bRpHlDQhiPejOW1OnX9H5FkUz28Z38AMAECYGoQ6gIpCybBXNgl3
 Ck+xlL7LeVw8S1ZwpZeNnCLG4qzbUDD6e879X0MtvskaDbE04RD68qWSZVgUD37k
 A/zIJdP2hJNnNdXr5nXn9EqF+hIfndUNnBUjtAp8yJm6PJSOGac5fDk34DD8crM8
 /1/bwyGrGjSfALxL78dZjSDK3LFa/q6llKqoCFf+oxpcNnevuf13ZWyYeM7ol6lC
 q8j6lvNCpDdvCULmnNaTUF2wOpyGKwwFfsiFawhDZf86IqJ44FvDo0ybgbS7IkeO
 UdAjInzFovVJ0jGmKAY5B2Saic8Aem21Z4PAerOfkMAvxGE6P0QvSHPnCMcfWbtI
 dFVBSG6vSpM02Htwn1yU+a99qMRN2n13xedPq0SfZTGM0sCFecCaNU8jpQ9hqBwv
 PEREXZGsaG8JIAESxuM3
 =V/+z
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Here you find quite a few changes for HD-audio and a copule of quirk
  additions for USB-audio.  All reasonably small and/or trivial."

* tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix power-map regression for HP dv6 & co
  ALSA: hda - Initialize caches at codec reconfiguration
  ALSA: hda - Fix memory leaks at module unload
  ALSA: hda - Fix memory leaks in Realtek & Conexant codec parsers
  ALSA: hda - Add Realtek ALC280 codec support
  ALSA: hda - Remove obsoleted CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
  ASoC: wm8994: remove duplicate code
  ALSA: usb-audio: add BOSS GT-100 support
  ALSA: HDA: Add inverted internal mic quirk for Lenovo S205
  ALSA: hda - Fix ALC272X codec detection
  ALSA: snd_usb_audio: ignore ctrl errors on QuickCam Pro for Notebooks
  ALSA: snd_usb_audio: ignore ctrl errors on QuickCam E3500
2012-06-27 12:50:28 -07:00
David Henningsson 5780b627e2 ALSA: hda - give 3-pin jack the name "Headphone Mic Jack"
This 3-pin jack was labeled "Headphone Jack", but it could also be
used as a mic jack just by switching "Input Source". Therefore we need
to call the jack something else, to make sure PulseAudio can use the
speaker together with the external mic. (PulseAudio might mute the
speaker if it detects a headphone being plugged in.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-27 20:21:02 +02:00
David Henningsson 00227f15a0 ALSA: HDA: Support single 3-pin jack without VREF on the actual pin
Some ASUS device has a single 3-pin jack that can either be a mic or
a headphone, but the pin does not have VREF capabilities. We've been
told by Realtek to instead enable VREF on pin 0x18 in that case.

BugLink: https://bugs.launchpad.net/bugs/1018262
Tested-by: Chih-Hsyuan Ho <chih.ho@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-27 20:20:40 +02:00
Takashi Iwai b54f8abad6 Merge branch 'fix/hda' into topic/hda 2012-06-26 18:06:01 +02:00
Takashi Iwai 6e1c39c6b0 ALSA: hda - Fix power-map regression for HP dv6 & co
The recent fix for power-map controls (commit b0791dda81) caused
regressions on some other HP laptops.  They have fixed pins but these
pins are exposed as jack-detectable.  Thus the driver tries to control
the power-map dynamically per jack detection where it never gets on.

This patch adds the check of connection and it assumes the no jack
detection is available for fixed pins no matter what pin capability
says.

BugLink: http://bugs.launchpad.net/bugs/1013183
Reported-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-26 17:43:06 +02:00
Takashi Iwai 09a6071bfe ALSA: hda - Initialize caches at codec reconfiguration
Better to clean up the caches for avoiding inconsistent codec state
after the reconfiguration.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-26 15:01:33 +02:00
Takashi Iwai 59cad16bc6 ALSA: hda - Fix memory leaks at module unload
Some caches aren't released properly at module unloading time.

Cc: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-26 15:00:20 +02:00
Takashi Iwai ee48df57c9 ALSA: hda - Fix memory leaks in Realtek & Conexant codec parsers
When moved to the helper code, forgot to release the verb arrays.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-26 14:56:20 +02:00
Linus Torvalds aace99e57c Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab.

Trivial conflict due to new USB HID ID's being added next to each other
(Baanto vs Axentia).

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (44 commits)
  [media] smia: Fix compile failures
  [media]  Fix VIDIOC_DQEVENT docbook entry
  [media] s5p-fimc: Fix control creation function
  [media] s5p-mfc: Fix checkpatch error in s5p_mfc_shm.h file
  [media] s5p-mfc: Fix setting controls
  [media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT
  [media] v4l/s5p-mfc: corrected encoder v4l control definitions
  [media] v4l: mem2mem_testdev: Fix race conditions in driver
  [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism
  [media] cxd2820r: Fix an incorrect modulation type bitmask
  [media] em28xx: Show a warning if the board does not support remote controls
  [media] em28xx: Add remote control support for Terratec's Cinergy HTC Stick HD
  [media] USB: Staging: media: lirc: initialize spinlocks before usage
  [media] Revert "[media] media: mx2_camera: Fix mbus format handling"
  [media] bw-qcam: driver and pixfmt documentation fixes
  [media] cx88: fix firmware load on big-endian systems
  [media] cx18: support big-endian systems
  [media] ivtv: fix support for big-endian systems
  [media] tuner-core: return the frequency range of the correct tuner
  [media] v4l2-dev.c: fix g_parm regression in determine_valid_ioctls()
  ...
2012-06-25 14:53:09 -07:00
David Henningsson befae82e29 ALSA: hda - Add Realtek ALC280 codec support
This chip looks very similar to ALC269 and ALC27* variants. The bug reporter
has verified that sound was working after this patch had been applied.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1017017
Tested-by: Richard Crossley <richardcrossley@o2.co.uk>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 21:24:41 +02:00
Takashi Iwai 55d52ea868 ALSA: hda - Remove obsoleted CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
I simply forgot to remove this entry although all Realtek quirks have
been dropped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 14:40:16 +02:00
Takashi Iwai e6656369da ALSA: hda - Remove suprefluous EAPD init verbs for ALC660vd
The EAPD on nodes 0x14 and 0x15 are initialized in alc_auto_setup_eapd().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 11:03:12 +02:00
Takashi Iwai 6e72aa5f51 ALSA: hda - Add inv-dmic model to possible Realtek codecs
For convenience, add "inv-dmic" model string for enabling the inverted
internal mic workaround to possible Realtek codecs, so far,
ALC882-variants, ALC262, ALC268, ALC269-variants, and ALC662-variants.

Also, the model strings for hardware inv-dmic workarounds,
"alc269-dmic" and "alc271-dmic", are added for ALC269(VA) and ALC271
codecs as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 10:52:25 +02:00
David Henningsson 693b613dc4 ALSA: hda - Add inverted mic quirks for Asus U41SV, Acer 1810TZ and AOD260
These machines have inverted phase on right channel for their
internal mics.

BugLink: https://bugs.launchpad.net/bugs/997227
BugLink: https://bugs.launchpad.net/bugs/996611
BugLink: https://bugs.launchpad.net/bugs/1006089
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 10:20:08 +02:00
Takashi Iwai 125821ae53 ALSA: hda - Add the inverted digital mic workaround to Realtek codecs
Some laptops are equipped with ForteMedia digital mics that give the
differential input.  With such devices, summing stereo streams into a
mono (like PulseAudio does) results in almost silence.

This patch provides a workaround for this bug by adding a new mixer
switch to turn on/off the right channel of digital mic, just like a
similar fix for Conexant codecs.

When the new switch "Inverted Internal Mic Capture Switch" is off and
the current input source is the digital mic, the right channel of the
recording stream is muted.  When another input source is selected, the
right channel is restored.

Tested-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25 09:45:54 +02:00
Dylan Reid b43d224767 ALSA: hda - Don't power up when not powered down.
After cancel_delayed_work_sync returns, the power down work either never
started (power_on == 1) or finished (power_on == 0).  In the former case
there is no need to power up again.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-22 09:08:58 +02:00
David Henningsson b3c5dce815 ALSA: HDA: Add inverted internal mic quirk for Lenovo S205
The Lenovo Ideapad S205 has an internal mic where the right channel
is phase inverted.

BugLink: https://bugs.launchpad.net/bugs/884652
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21 17:16:25 +02:00
Takashi Iwai 8e5a050901 ALSA: hda - Fix ALC272X codec detection
The codec ALC272X is a special codec for some Dell machines, and its
detection got broken in the recent kernel because SSID check (required
by ALC272X check) was moved to the later point.  Now we need to move
this codec check to the right place, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21 15:52:57 +02:00
Takashi Iwai e9ea8e8f22 ALSA: hda - Correct info print in HDMI non-intrinsic unsol event
In the recent code, the value shown there is a tag number, and it's no
longer same as the pin nid.  Correct the message to avoid confusion.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21 11:42:23 +02:00
Takashi Iwai 9dd8cf125d ALSA: hda - Don't rely on event tag for simple_hdmi
VIA codecs seem not returning the event tag in the unsolicited events,
thus the current code relying on the tag value doesn't work.
Since simple_hdmi stuff has only a single pin, we can use simply
snd_hda_jack_set_dirty_all() to activate the pin-detection
independently from the tag value.

Tested-by: Annie Liu <AnnieLiu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21 11:39:45 +02:00
Takashi Iwai 8ceb332df4 ALSA: hda - Remove loop from simple_hdmi*()
The simple_hdmi stuff is designed only for a single pin and a single
converter (thus a single PCM stream), and no need for loops.
Let's flatten the code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21 08:23:27 +02:00
Takashi Iwai 8b8d654b55 ALSA: hda - Move one-time init codes from generic_hdmi_init()
The codes to initialize work struct or create a proc interface should
be called only once and never although it's called many times through
the init callback.  Move that stuff into patch_generic_hdmi() so that
it's called only once.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20 16:32:22 +02:00
Takashi Iwai 1ade819181 Merge branch 'fix/hda' into topic/hda
The fix for power sequence needs to be merged back to topic branch.
2012-06-20 14:43:20 +02:00
Takashi Iwai ccfcf7d151 ALSA: hda - Add missing snd_hda_jack_detect_enable() for simple_hdmi*()
Reported-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20 09:30:42 +02:00
Takashi Iwai 21cd683d31 ALSA: hda - Fix the pin nid assignment in patch_hdmi.c
This fixes the regression introduced by the commit d0b1252d for
refactoring simple_hdmi*().  The pin NID wasn't assigned correctly.

Reported-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20 09:21:45 +02:00
Markus Bollinger fdfbaf69e0 ALSA: pcxhr: Add LTC support
add LTC (linear timecode) read function via proc interface to the pcxhr driver

Signed-off-by: Markus Bollinger <bollinger@digigram.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20 08:35:37 +02:00
Markus Bollinger d7dc9e32ae ALSA: pcxhr: Fix a counter wrap
fix a counter wrap to avoid resynchronization of stream positions every several
minutes. The resynchronization may create stream position jitter

Signed-off-by: Markus Bollinger <bollinger@digigram.com>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20 08:35:28 +02:00
Ezequiel Garcia e0815f35cc ALSA: maestro3: Remove unused AC97 register definitions
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18 16:05:28 +02:00
Dylan Reid b4a91cf05c ALSA: hda - Handle open while transitioning to D3.
This addresses an issue encountered when a pcm is opened while
transitioning to low power state (codec->power_on == 1 &&
codec->power_transition == -1).  Add snd_pcm_power_up_d3wait to
hda_codec.  This function is used to power up from azx_open as opposed
to snd_hda_power_up used from codec_exec_verb. When powering up from
azx_open, wait for pending power downs to complete, avoiding the power
up continuing in parallel with the power down on the work queue.

The specific issue seen was with the CS4210 codec, it powers off the ADC
and DAC nid in its suspend handler.  If it is re-opened before the
~100ms power down process completes, the ADC and DAC nid are initialized
while powered down and audio is lost until another suspend/resume cycle.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18 09:35:21 +02:00
Takashi Iwai 250e41ac9f ALSA: hda - Enable unsol event for ATI and Nvidia HDMI codecs too
ATI and Nvidia HDMI codecs have also the pin-detection capability,
so let's enable the jack-detecion for them, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 14:42:06 +02:00
Takashi Iwai ceaa86ba2e ALSA: hda - Remove invalid init verbs for Nvidia 2ch codecs
Nvidia 2ch codecs have no NIDs greather than 0x05.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 14:41:59 +02:00
Takashi Iwai d0b1252dd1 ALSA: hda - Use common codes for ATI, Nvidia and VIA simple codecs
The code refactoring using the same helper functions for sharing the
codes among ATI, Nvidia and VIA simple_hdmi* stuff.  Except for that
spec->pcm_playback is no longer pointer, the functionality doesn't
change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 14:36:20 +02:00
Takashi Iwai 4f0110ced1 ALSA: hda - Merge ATI/VIA HDMI simple init functions
Just a minor code cleanup to use the same function for both AMD and VIA
simple_hdmi*().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 12:53:39 +02:00
Takashi Iwai 4b6ace9e71 ALSA: hda - Add the support for VIA HDMI pin detection
This patch adds the hotplug unsol event handling to simple_hdmi*().
It works on VIA VX900.  If AMD or Nvidia chips support the
pin-detection similarly, it can be added easily, too.

Reported-by: Annie Liu <annieliu@viatech.com.cn>
Tested-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 11:53:32 +02:00
Seth Heasley c20c5a841c ALSA: hda_intel: activate COMBO mode for Intel client chipsets
This patch activates the COMBO position_fix for recent Intel client chipsets.
COMBO mode is the recommended setting for Intel chipsets and eliminates HD
audio warnings in dmesg.  This patch has been tested on Lynx Point, Panther
Point, and Cougar Pont.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 10:28:16 +02:00
David Henningsson 80c8bfbe76 ALSA: HDA: Create phantom jacks for fixed inputs and outputs
PulseAudio sometimes have difficulties knowing that there is a
"Speaker" or "Internal Mic", if they have no individual volume
controls or selectors. As a result, only e g "Headphone" might
be created for a laptop, but no "Speaker".
To help out, create phantom jacks (that are always present,
at least for now) for "Speaker", "Internal Mic" etc, in case we
detect them.
The naming convention is e g "Speaker Phantom Jack".

In order not to pollute the /dev/input namespace with even more
devices, these are added to the kcontrols only, not the input devices.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-14 12:59:35 +02:00
Takashi Iwai 2e8b2b29d1 ALSA: hda - Don't forget to call init verbs added by fixup list
During the split to the auto-parser helper functions, the actual call
of init verbs was lost.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43366

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-13 16:47:32 +02:00
David Henningsson edfe3bfc1b ALSA: HDA: Pin fixup for Zotac Z68 motherboard
Pin 0x1b was connected to the front panel connector, which according to
the HDA standard should contain a mic and a headphone. In this case,
the headphone was listed as "line out" by BIOS.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/993162
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-12 17:55:46 +02:00
Hans de Goede 5daf53a6eb [media] snd_tea575x: Make the module using snd_tea575x the fops owner
Before this patch the owner field of the /dev/radio# device fops was set to
the snd-tea575x-tuner module itself. Meaning that the module which was using
it could be rmmod-ed while the device is open, and then BAD things happen.

I know, as I found out the hard way :)

Note that there is no need to also somehow increase the refcount of the
snd-tea575x-tuner module itself, since any drivers using it will have
symbolic references to it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
CC: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-11 16:02:54 -03:00
Takashi Iwai f2a8ecaf6d ALSA: hda - Fix detection of Creative SoundCore3D controllers
The PCI ID entries of Creative SoundCore3D HD-audio controllers should
be before the wildcard for vendor = Creative.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11 15:51:54 +02:00
Annie Liu 3de5ff8877 ALSA: hda - add support for HD-Audio CODECes of VIA HDMI GFX Cards
This is patch supporting the CODECes of HD-Audio function of VIA GFX
cards which support HDMI.
For CODECes 0x9f80/0x9f81, which belong to VX900, since the hardware
is not fully compliant to HD-Audio 1.3, simple_i*() is adopted
temporarily.

Signed-off-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11 12:47:31 +02:00
Annie Liu 754fdff86f ALSA: hda - add support for HD-Audio of VIA HDMI GFX Cards
This is patch supporting HD-Audio function of VIA GFX cards which
support HDMI.
Those are integrated graphics of chipsets VX900 and VX11 separately.

Signed-off-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11 12:47:15 +02:00
Steven Newbury 8393ec4a13 ALSA: hda - HDMI Audio init all connectors when VGA-switcheroo is off
When VGA_SWITCHEROO support is enabled hda_intel initialises the HDMI
audio device on the current VGA device.  When it's not enabled it only
initialises the HDMI device on the default VGA adaptor, this means
secondary cards get no audio support which is very unhelpful for
multi-seat!

With this patch, when SUPPORT_VGA_SWITCHEROO is disabled hda_intel
initialises all HDMI audio devices, not just the default VGA.

[minor optimizations by tiwai]

Signed-off-by: Steven Newbury <steve@snewbury.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08 13:07:41 +02:00
Takashi Iwai 12b78a7f67 ALSA: hda - Fix uninitialized HDMI controllers with VGA-switcheroo
When VGA-switcheroo is built in but unused on systems with multiple
graphics cards, the initializations of non-default graphics cards are
skipped and never enabled (because the switcheroo is activated only
when the controller supports).  The current behavior is for avoiding
the system lockup by accessing the disabled GPU, but due to the recent
change in VGA-switcheroo, it determines the state simply by checking
with the default VGA device.  This is the culprit.

Now with the new vga_switcheroo_get_client_state(), we can know the
initial state of the bound GPU, thus can determine the initial audio
client state more correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08 11:24:19 +02:00
Wang Xingchao 09617ce477 ALSA: hda - power setting error check
codec may reject power state transition requests(reporting PS-ERROR set),
in that case we re-issue a power state setting and check error bit again.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08 09:00:37 +02:00
Wang Xingchao e076eb5c95 ALSA: hda - check proper return value
snd_hda_param_read() return value -1 means error, others are responses

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-07 11:40:58 +02:00
Wang Xingchao 0f4ccbb025 ALSA: hda - reduce msleep time if EPSS power states supported
if EPSS supported, transition from D3 state to D0 state in less
than 10ms

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-07 11:40:33 +02:00
Wang Xingchao 0c7f46ad92 ALSA: hda - check supported power states
Add function to check whether power states supported by specific
codec node.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-07 11:39:52 +02:00
Takashi Iwai 167d2d55bf ALSA: hda - Show D3cold state in proc files
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-06 12:17:45 +02:00
Wang Xingchao ce63f3ba25 ALSA: hda - add power states information in proc
add more power states information:
- reset status
- clock stop ok
- power states error

Output like:
Power: setting=D0, actual=D0, Error, Clock-stop-OK, Setting-reset

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-06 12:12:49 +02:00