summaryrefslogtreecommitdiffstats
path: root/sound/pci
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: hda - fix headset mic detection problem for one more machineHui Wang2015-04-241-9/+15
| | | | | | | | | | We have two machines with alc256 codec in the pin quirk table, so moving the common pins to ALC256_STANDARD_PINS. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1447909 Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda/realtek - Fix Headphone Mic doesn't recording for ALC256Kailang Yang2015-04-231-0/+1
| | | | | | | | | Switch default pcbeep path to Line in path. Signed-off-by: Kailang Yang <kailang@realtek.com> Tested-by: Hui Wang <hui.wang@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - fix "num_steps = 0" error on ALC256David Henningsson2015-04-211-2/+3
| | | | | | | | | | | | | | | | The ALC256 does not have a mixer nid at 0x0b, and there's no loopback path (the output pins are directly connected to the DACs). This commit fixes an "num_steps = 0 for NID=0xb (ctl = Beep Playback Volume)" error (and as a result, problems with amixer/alsamixer). If there's pcbeep functionality, it certainly isn't controlled by setting an amp on 0x0b, so disable beep functionality (at least for now). Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1446517 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - add AZX_DCAPS_I915_POWERWELL to BaytrailMengdong Lin2015-04-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | This patch addes AZX_DCAPS_I915_POWERWELL to BYT (Baytrail). Like Braswell and Skylake, the HDMI codec on Bytrail is also in the shared power well with GPU. This power well must be turned on before we reset link to probe the codec, to avoid communication failure with the codec. The side effect is that this power is always ON in S0 because the BYT HDMI codec does not support EPSS or D3ClkStop and so the controller doesn't enter D3 at runtime, and the HDMI codec and analog codec share a single physical HD-A link and so we cannot reset the HD-A link freely when we re-enable the power to use the HDMI codec. Next step is to test if an AGP reset or double AGP reset on BYT HDMI codec is okay to bring the HDMI codec back to a functional state after restoring the power. If okay, we can bind the power on/off with the HDMI codec PM without interrupting the analog audio. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - only sync BCLK to the display clock for Haswell & BroadwellMengdong Lin2015-04-201-0/+6
| | | | | | | | | | | | | Only Intel Haswell and Broadwell have a separate HD-A controller (PCI device 3) for display audio, which needs to get 24MHz HD-A link BCLK from the variable display core clock through vendor specific registers EM4 & EM5. Other platforms (Baytrail, Braswell and Skylake) don't have this feature. So this patch checks the PCI device ID of the controller in haswell_set_bclk() and only sync BCLK for HSW and BDW. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Mute headphone pin on suspend on XPS13 9333Gabriele Mazzotta2015-04-201-10/+7
| | | | | | | | | | | | Muting the headphone output pin right before the codec suspension prevents pop noises when headphones are plugged in (except for a barely audible click noise). This solution allows to truly save some power when headphones are plugged in unlike the previous solution (033b0a7ca9c: "ALSA: hda - Pop noises fix for XPS13 9333") Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - potential (but unlikely) uninitialized variableDan Carpenter2015-04-171-2/+2
| | | | | | | | | | This function is a bit unusual because it accepts negative values as "conn_len". It's theoretically possible for both "cache_len" and "conn_len" to be -ENOSPC and in that case we would oops trying to run memcmp() on the uninitialized "list" pointer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Fix regression for slave SPDIF setupsTakashi Iwai2015-04-161-1/+1
| | | | | | | | | | | The commit [a551d91473e5: ALSA: hda - Use regmap for command verb caches, too] introduced a regression due to a typo in the conversion; the IEC958 status bits of slave digital devices aren't updated correctly. This patch corrects it. Fixes: a551d91473e5 ('ALSA: hda - Use regmap for command verb caches, too') Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: intel8x0: Check pci_iomap() success for DEVICE_ALIScott Wood2015-04-161-2/+2
| | | | | | | | DEVICE_ALI previously would jump to port_inited after calling pci_iomap(), bypassing the check for bmaddr being NULL. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - simplify azx_has_pm_runtimeDavid Henningsson2015-04-161-1/+1
| | | | | | | | Because AZX_DCAPS_PM_RUNTIME is always defined as non-zero, the initial part of the expression can be skipped. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450Jo-Philipp Wich2015-04-131-0/+1
| | | | | | | | | | | | The Lenovo Thinkpad T450 requires the ALC292_FIXUP_TPT440_DOCK as well in order to get working sound output on the docking stations headphone jack. Patch tested on a Thinkpad T450 (20BVCTO1WW) using kernel 4.0-rc7 in conjunction with a ThinkPad Ultradock. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'for-next' into for-linusTakashi Iwai2015-04-1352-4424/+2887
|\
| * ALSA: emu10k1: add toggles for E-mu 1010 optical portsMichael Gernoth2015-04-111-0/+118
| | | | | | | | | | | | | | | | | | | | The optical ports on the E-mu 1010 (and dock) can be configured for ADAT- or S/PDIF-mode, which is currently hardcoded to ADAT. Add two mixer elements to expose this setting. Tested on an E-mu 1010 PCIe with connected Micro Dock. Signed-off-by: Michael Gernoth <michael@gernoth.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: emu10k1: handle dock disconnectsMichael Gernoth2015-04-111-0/+9
| | | | | | | | | | | | | | | | When the dock on an E-mu 1010 card is disconnected, all outputs get muted by the hardware. Add logic to detect a disconnect and unmute. Signed-off-by: Michael Gernoth <michael@gernoth.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Fix a typoTakashi Iwai2015-04-101-1/+1
| | | | | | | | | | | | | | | | | | A comma was used instead of a semicolon, which may lead to a build error. Fixes: cffd39668177 ('ALSA: hda/realtek - Fix the regression by widget power-saving') Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/via - Add missing stream_pm ops setupTakashi Iwai2015-04-091-0/+1
| | | | | | | | | | | | | | Similar like the case for Realtek, VIA codec driver needs this ops as well for making the widget power-save working. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Fix the regression by widget power-savingTakashi Iwai2015-04-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | While enabling the widget power-saving for ALC269 & co, the important setup was forgotten -- stream_pm ops. Without this setup, the paths for PCM won't be powered up at all. Also, the power_filter callbacks used in ALC269 & co need to chain to the default snd_hda_gen_path_power_filter(). Tested-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/generic - Don't override power_filter when power_save_node is setTakashi Iwai2015-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | Currently the generic parser sets codec->power_filter when power_save_node flag is set. But this overrides the existing filter that has been already set by the codec driver, thus it looses some features. Instead, set the default power_filter only when it's not set yet. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/generic - Make snd_hda_gen_path_power_filter() always applicableTakashi Iwai2015-04-091-0/+4
| | | | | | | | | | | | | | | | | | Add the check of power_save_node flag at the beginning of the function so that it skips the rest if the flag isn't set. In this way, we can call this function safely no matter whether the widget power-saving is really used or not. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/generic - Fix wrong initial power state for fixed pinsTakashi Iwai2015-04-091-3/+11
| | | | | | | | | | | | | | | | | | | | | | When the widget power-saving is enabled, the first automute hook invocation checks through the whole pins and it also tries to synchronize the power state. However, this results in a wrong state because it calls unconditionally snd_hda_jack_detect_state(). This patch adds a check of jack detectability before the actual jack detection call. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/generic - Check power state cap at updating the widget powerTakashi Iwai2015-04-091-0/+2
| | | | | | | | | | | | | | | | | | The new widget power-saving tries to apply the power change no matter whether the node has a power cap or not. It's bad (although most of codecs chip just ignore it). Check the capability properly beforehand. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda - Work around races of power up/down with runtime PMTakashi Iwai2015-04-084-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, snd_hdac_power_up()/down() helpers checks whether the codec is being in pm (suspend/resume), and skips the call of runtime get/put during it. This is needed as there are lots of power up/down sequences called in the paths that are also used in the PM itself. An example is found in hda_codec.c::codec_exec_verb(), where this can power up the codec while it may be called again in its power up sequence, too. The above works in most cases, but sometimes we really want to wait for the real power up. For example, the control element get/put may want explicit power up so that the value change is assured to reach to the hardware. Using the current snd_hdac_power_up(), however, results in a race, e.g. when it's called during the runtime suspend is being performed. In the worst case, as found in patch_ca0132.c, it can even lead to the deadlock because the code assumes the power up while it was skipped due to the check above. For dealing with such cases, this patch makes snd_hdac_power_up() and _down() to two variants: with and without in_pm flag check. The version with pm flag check is named as snd_hdac_power_up_pm() while the version without pm flag check is still kept as snd_hdac_power_up(). (Just because the usage of the former is fewer.) Then finally, the patch replaces each call potentially done in PM with the new _pm() variant. In theory, we can implement a unified version -- if we can distinguish the current context whether it's in the pm path. But such an implementation is cumbersome, so leave the code like this a bit messy way for now... Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96271 Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Support Dell headset mode for ALC288Kailang Yang2015-04-081-0/+67
| | | | | | | | | | | | | | | | | | | | Dell create new platform with ALC288 codec. This patch will enable headset mode for Dino platform. [slight code refactoring and compile fix by tiwai] Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Support headset mode for ALC286/288Kailang Yang2015-04-081-0/+77
| | | | | | | | | | | | | | Support headset mode for ALC286 and ALC288 platforms. Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * Merge branch 'for-linus' into for-nextTakashi Iwai2015-04-082-2/+21
| |\ | | | | | | | | | | | | | | | | | | Back merge HD-audio quirks to for-next branch, so that we can apply a couple of more quirks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda_intel: add AZX_DCAPS_I915_POWERWELL for SKL and BSWLibin Yang2015-04-071-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HDMI/DP codec on SKL/BSW is in the power well. The power well must be turned on before probing the HDMI/DP codec. This is a temporary patch, which will power on the powerwell by adding AZX_DCAPS_I915_POWERWELL for SKL and BSW. After restructuring and new flag is added, this patch will be reverted. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: emu10k1: add Audigy 5/RxMichael Gernoth2015-04-051-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | The Audigy 5/Rx is essentially an Audigy 4 behind a PLX PCIe- bridge with an additional TOSLINK output. Signed-off-by: Michael Gernoth <michael@gernoth.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: Use const struct ac97_quirkJoe Perches2015-04-056-6/+7
| | | | | | | | | | | | | | | | | | | | | Use const to reduce data by ~3Kb. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda: fix possible null dereferenceSudip Mukherjee2015-04-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | we are dereferencing pcm first then checking pcm. instead now lets put them in same if condition so that pcm is checked first. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Enable widget power saving for Realtek codecsTakashi Iwai2015-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Recent Realtek codecs support the finer power state control on each widget. Let's enable the new feature. Tested-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Sync node attributes at resume from widget power savingTakashi Iwai2015-04-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we assumed that the node attributes like amp values remain during the power state transition of the node itself. While this is true for IDT/STAC codecs I've tested, but some other codecs don't seem behaving in that way. This patch implements a partial sync mechanism specific to the given widget node. Now we've merged the regmap support, and it can be easily written with regcache_sync_region(). Tested-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | Merge branch 'topic/hda-regmap' into for-nextTakashi Iwai2015-04-0412-739/+164
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merges the support of regmap in HD-audio infrastructure. Many in-house cache codes in HD-audio driver are relaced with the more standard regmap base now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Use regmap for command verb caches, tooTakashi Iwai2015-03-239-309/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the previous patches, this patch converts also to the regmap, at this time, the cached verb writes are the target. But this conversion needs a bit more caution than before. - In the old code, we just record any verbs as is, and restore them at resume. For the regmap scheme, this doesn't work, since a few verbs like AMP or DIGI_CONVERT are asymmetrical. Such verbs are converted either to the dedicated function (snd_hda_regmap_xxx_amp()) or changed to the unified verb. - Some verbs have to be declared as vendor-specific ones before accessing via regmap. Also, the minor optimization with codec->cached_write flag is dropped in a few places, as this would confuse the operation. Further optimizations will be brought in the later patches, if any. This conversion ends up with a drop of significant amount of codes, mostly the helper codes that are no longer used. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Use regmap for parameter caches, tooTakashi Iwai2015-03-233-141/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The amp hash table was used for recording the cached reads of some capability values like pin caps or amp caps. Now all these are moved to regmap as well. One addition to the regmap helper is codec->caps_overwriting flag. This is set in snd_hdac_override_parm(), and the regmap helper accepts any register while this flag is set, so that it can overwrite even the read-only verb like AC_VERB_PARAMETERS. The flag is cleared immediately in snd_hdac_override_parm(), as it's a once-off flag. Along with these changes, the no longer needed amp hash and relevant fields are removed from hda_codec struct now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Use regmap for amp accessesTakashi Iwai2015-03-234-199/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the amp access functions to the regmap helpers. The amp values were formerly cached in the own hash table. Now it's dropped by the regmap's cache. The only tricky conversion is snd_hda_codec_amp_init(). This function shouldn't do anything if the amp was already initialized. For achieving this behavior, a value is read once at first temporarily in the cache-only mode. Only if it returns an error, i.e. the item still doesn't exist in the cache, it proceeds to the update. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Implement uncached version of parameter readsTakashi Iwai2015-03-232-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we need the uncached reads, e.g. for refreshing the tree. This patch provides the helper function for that and uses it for refreshing widgets, reading subtrees and the whole proc reads. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Use regmap for codec parameter readsTakashi Iwai2015-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's start converting the access functions to regmap. The first one is the simplest, just converting the codec parameter read helper function snd_hda_param_read(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Add regmap supportTakashi Iwai2015-03-233-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an infrastructure to support regmap-based verb accesses. Because o the asymmetric nature of HD-audio verbs, especially the amp verbs, we need to translate the verbs as a sort of pseudo registers to be mapped uniquely in regmap. In this patch, a pseudo register is built from the NID, the AC_VERB_GET_* and 8bit parameters, i.e. almost in the form to be sent to HD-audio bus but without codec address field. OTOH, for writing, the same pseudo register is translated to AC_VERB_SET_* automatically. The AC_VERB_SET_AMP_* verb is re-encoded from the corresponding AC_VERB_GET_AMP_* verb and parameter at writing. Some verbs has a single command for read but multiple for writes. A write for such a verb is split automatically to multiple verbs. The patch provides also a few handy helper functions. They are designed to be accessible even without regmap. When no regmap is set up (e.g. before the codec device instantiation), the direct hardware access is used. Also, it tries to avoid the unnecessary power-up. The power up/down sequence is performed only on demand. The codec driver needs to call snd_hdac_regmap_exit() and snd_hdac_regmap_exit() at probe and remove if it wants the regmap access. There is one flag added to hdac_device. When the flag lazy_cache is set, regmap helper ignores a write for a suspended device and returns as if it was actually written. It reduces the hardware access pretty much, e.g. when adjusting the mixer volume while in idle. This assumes that the driver will sync the cache later at resume properly, so use it carefully. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| | * | ALSA: hda - Move generic array helpers to core libTakashi Iwai2015-03-232-76/+0
| | | | | | | | | | | | | | | | | | | | | | | | This will be used by the regmap support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: hda/via - Add beep controls to VIA codecsW. Trevor King2015-03-251-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My codec has a beep-generating node: $ cat /proc/asound/card1/codec#0 Codec: VIA VT1802 ... Vendor Id: 0x11068446 Subsystem Id: 0x15587410 Revision Id: 0x100000 ... Node 0x22 [Beep Generator Widget] wcaps 0x70040c: Mono Amp-Out Amp-Out caps: ofs=0x0a, nsteps=0x12, stepsize=0x05, mute=1 Amp-Out vals: [0x0a] Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0 ... But I was missing the: Control: name=... entries that I need to manage this widget from alsamixer. With this patch (based on the similar Mono Amp-Out handling in patch_conexant.c), I get a new: input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/sound/card1/hdaudioC1D0/input15 entry in dmesg and controls to manage that beep: $ cat /proc/asound/card1/codec#0 | grep -A5 Beep Node 0x22 [Beep Generator Widget] wcaps 0x70040c: Mono Amp-Out Control: name="Beep Playback Volume", index=0, device=0 ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Control: name="Beep Playback Switch", index=0, device=0 ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x0a, nsteps=0x12, stepsize=0x05, mute=1 Amp-Out vals: [0x12] Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0 [rebased and modified for the latest tree by tiwai] Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: hda - Remove superfluous hda_nid_t definition in hda_codec.hTakashi Iwai2015-03-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Just forgotten to remove. It's now in sound/hdaudio.h. Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: asihpi: Fix duplicate const for clock sourcesKrzysztof Kozlowski2015-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace duplicated const keyword for 'sampleclock_sources' with proper array of const pointers to const strings. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: echoaudio: read past end of arrayDan Carpenter2015-03-231-6/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to cap "ucontrol->id.index / num_busses_in(chip)" so the we don't read beyond the end of the array. I also adding a check on "in" and changing the type in snd_echo_mixer_put() from short to unsigned int. Those changes are done for symmetry and are cosmetic. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Re-add tracepoints to HD-audio core driverTakashi Iwai2015-03-232-120/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now let's take the basic tracepoints back to the HD-audio driver. The three bus tracepoints, hda_send_cmd, hda_get_response and hda_unsol_event are revived but in a slightly different form. Since we don't assign the card number there, print the bus device name instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Fix possible runtime PM refcount unbalanceTakashi Iwai2015-03-234-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the driver is unloaded before the codec is bound, it still keeps the runtime PM refcount up, and results in the unbalance. This patch covers these cases by introducing a flag indicating the runtime PM initialization and handling the codec registration procedure more properly. It also fixes the missing input beep device as a gratis, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Support indirect execution of verbsTakashi Iwai2015-03-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an overriding exec_verb op to struct hdac_device so that the call via snd_hdac_exec_verb() can switch to a different route depending on the setup. The codec driver sets this field so that it can handle the errors or applying quirks appropriately. Furthermore, this mechanism will be used for smooth transition for the regmap support in later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Add widget sysfs treeTakashi Iwai2015-03-232-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the sysfs files assigned to the codec device on the bus which were formerly identical with hwdep sysfs files. Now it shows only a few core parameter, vendor_id, subsystem_id, revision_id, afg, mfg, vendor_name and chip_name. In addition, now a widget tree is added to the bus device sysfs directory for showing the widget topology and attributes. It's just a flat tree consisting of subdirectories named as the widget NID including various attributes like widget capability bits. The AFG (usually NID 0x01) is always found there, and it contains always amp_in_caps, amp_out_caps and power_caps files. Each of these attributes show a single value. The rest are the widget nodes belonging to that AFG. Note that the child node might not start from 0x02 but from another value like 0x0a. Each child node may contain caps, pin_caps, amp_in_caps, amp_out_caps, power_caps and connections files. The caps (representing the widget capability bits) always contain a value. The rest may contain value(s) if the attribute exists on the node. Only connections file show multiple values while other attributes have zero or one single value. An example of ls -R output is like below: % ls -R /sys/bus/hdaudio/devices/hdaudioC0D0/ /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/: 01/ 04/ 07/ 0a/ 0d/ 10/ 13/ 16/ 19/ 1c/ 1f/ 22/ 02/ 05/ 08/ 0b/ 0e/ 11/ 14/ 17/ 1a/ 1d/ 20/ 23/ 03/ 06/ 09/ 0c/ 0f/ 12/ 15/ 18/ 1b/ 1e/ 21/ /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/01: amp_in_caps amp_out_caps power_caps /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/02: amp_in_caps amp_out_caps caps connections pin_caps pin_cfg power_caps /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/03: ..... Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Move a part of hda_codec stuff into hdac_deviceTakashi Iwai2015-03-2319-664/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now some codes and functionalities of hda_codec struct are moved to hdac_device struct. A few basic attributes like the codec address, vendor ID number, FG numbers, etc are moved to hdac_device, and they are accessed like codec->core.addr. The basic verb exec functions are moved, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Move some codes up to hdac_bus structTakashi Iwai2015-03-237-161/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few basic codes for communicating over HD-audio bus are moved to struct hdac_bus now. It has only command and get_response ops in addition to the unsolicited event handling. Note that the codec-side tracing support is disabled temporarily during this transition due to the code shuffling. It will be re-enabled later once when all pieces are settled down. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Make snd_hda_bus_type publicTakashi Iwai2015-03-234-39/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define the common hd-audio driver and device types to bind over snd_hda_bus_type publicly. This allows to implement other type of device and driver code over hd-audio bus. Now both struct hda_codec and struct hda_codec_driver inherit these new struct hdac_device and struct hdac_driver, respectively. The bus registration is done in subsys_initcall() to assure it before any other driver registrations. Signed-off-by: Takashi Iwai <tiwai@suse.de>