summaryrefslogtreecommitdiff
path: root/sound/pci
AgeCommit message (Collapse)Author
2013-01-18ALSA: hda/sigmatel - Add bass speaker support for HP ENVY Spectre XTTakashi Iwai
The pin configuration for the bass speaker needs to be corrected in a fixup. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Consolidate cap_sync_hook and capture_switch_hookTakashi Iwai
Two hooks in hda_gen_spec, cap_sync_hook and capture_switch_hook, play very similar roles. The only differences are that the former is called more often (e.g. at init or switching capsrc) while the latter can take an on/off argument. As a more generic implementation, consolidate these two hooks, and pass snd_ctl_elem_value pointer as the second argument. If the secondary argument is non-NULL, it can take the on/off value, so the caller handles it like the former capture_switch_hook. If it's NULL, it's called in the init or capsrc switch case. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Fix missing call of capture_switch_hookTakashi Iwai
When a standard capture switch without multiple binding is used, the call for capture_switch_hook isn't called properly. Replace the put ops to add the hook call in that case. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Fix mute led for another HP machineDavid Henningsson
This machine also has the "HP_Mute_LED_0_A" string in DMI information. Cc: <stable@vger.kernel.org> BugLink: https://bugs.launchpad.net/bugs/1096789 Tested-by: Tammy Yang <tammy.yang@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Look for boost controls more deeplyTakashi Iwai
In the current generic parser code, we look for the (mic) boost controls only on input pins. But many codecs assign the boost volume to a widget connected to each input pin instead of the input amp of the pin itself. In this patch, the parser tries to look through more widgets connected to the pin and find a boost amp. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Fix invalid mute in path activationTakashi Iwai
When an amp in the activation path is associated with mixer controls, activate_amp() tries to skip the initialization. It's good, but only if the mixer really initializes both mute and volume. Otherwise, either the mute of the volume is left uninitialized. This patch adds this missing check and properly initialize the partially controlled amps in an activation path. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Unify input label creations in generic parserTakashi Iwai
There are a few places creating the labels and indices of kctls for each input pin in the current generic parser code. This is redundant and makes harder to maintain. Let's create the labels and indices at once and keep them in hda_gen_spec. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Keep autocfg.input idx value in imux tableTakashi Iwai
Since the imux table entries can be a subset of autocfg.input table, the indices of these aren't always same. For passing the proper index value of autocfg.input at creating input ctl labels (via snd_hda_autocfg_input_label()), keep the corresponding autocfg.input idx value in the index field of each imux item, which isn't used in the generic driver. Also, this makes easier to check the invalid imux pin for stereo mix. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Fix missing unsol event handler in some codec driversTakashi Iwai
This resulted in non-working auto-mute behavior, of course... Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Use generic parser for STAC/IDT codec driverTakashi Iwai
Finally we reached here. All codecs driver (except for CA0132, which has really device-specific requirements) have been converted to use the generic parser. This patch appears bigger than others since it also involves with the code shuffling, but mostly the cut-off of parser codes and adapt to the generic parser flags. Most of fixup codecs haven't been changed but just removed a few unnecessary codes. The only missing stuff is the SPDIF mux control. It'll be added again later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17Merge branch 'test/hda-gen-parser' into test/hda-migrateTakashi Iwai
* test/hda-gen-parser: ALSA: hda - Improve naming rule for primary output ALSA: hda - Add PCM capture hook to hda_gen_spec ALSA: hda - Record all detected ADCs in hda_gen_spec ALSA: hda - Move vmaster TLV parsing to snd_hda_gen_parse_auto_config() ALSA: hda - Add input jack mode enum controls to generic parser ALSA: hda - Give more comments to hda_gen_spec flags ALSA: hda - Add suppress_auto_mute flag to hda_gen_spec ALSA: hda - Record the current speaker / LO mute status in hda_gen_spec ALSA: hda - Properly call automute/switch hooks at init
2013-01-17ALSA: hda - Improve naming rule for primary outputTakashi Iwai
When the volume or mute control of the primary output is shared with other (headphone or speaker) outputs, we shouldn't name it as a specific output type but rather name it with the channel name or a generic name like "PCM". Also, this check should be performed individually for the volume and the mute controls because some codecs may have shared volumes but separate mute controls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Add PCM capture hook to hda_gen_specTakashi Iwai
Not only PCM playback, a hook for PCM capture would be required for power controls in codec drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Record all detected ADCs in hda_gen_specTakashi Iwai
Since the generic parser reduces the ADC list, copy the list of the all detected ADCs and keep it. This list can be later referred by the codec driver for finer power controls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Move vmaster TLV parsing to snd_hda_gen_parse_auto_config()Takashi Iwai
Add vmaster_tlv[] to hda_gen_spec and store the suggested TLV data in snd_hda_gen_parse_auto_config(). This allows the codec driver to correct the TLV data (e.g. mute capability) before actually creating vmaster instance. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Add input jack mode enum controls to generic parserTakashi Iwai
Just like the jack mode enum ctls for output jacks, add the support for similar enum ctls for input pins to control the bias Vref. The new controls will be added when spec->add_in_jack_modes is set either by the codec driver or by a hint string. Note that ground and 100% vrefs are excluded from the list for simplicity, currently. We may add a new flag to allow them, too. But I guess it's easier to put a value override in the pinfix in such a case. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-17ALSA: hda - Minor cleanup/fixes for patch_sigmatel.c fixup transitionTakashi Iwai
- spec->hp_detect has to be overridden in HDA_FIXUP_ACT_PARSE, not in PRE_PARSE. - Remove err == 0 check but return directly -EINVAL from stac92xx_parse_auto_config() - Set spec->default_polarity for 92HD71bxx - Some code shuffles Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - Give more comments to hda_gen_spec flagsTakashi Iwai
Since we have many bit flags in hda_gen_spec, rearrange in sections and give more comments there. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - Add suppress_auto_mute flag to hda_gen_specTakashi Iwai
A new flag to skip the auto-mute handling in the generic parser, just like suppress_auto_mic flag. It has to be set before calling snd_hda_gen_parse_auto_config(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - Record the current speaker / LO mute status in hda_gen_specTakashi Iwai
... to be referred by the codec driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - Properly call automute/switch hooks at initTakashi Iwai
... and a little bit of code refactoring. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16Merge branch 'test/hda-gen-parser' into test/hda-migrateTakashi Iwai
* test/hda-gen-parser: ALSA: hda - Make sure fill_all_dac_nids is called for digital only codecs ALSA: hda - force different capture controls if amp caps differ ALSA: hda - do not add non-existing Mic boost controls ALSA: hda - initialize channel counts correctly ALSA: hda - fix wrong adc_idx in generic parser ALSA: hda - Check array bounds in get_input_path ALSA: hda - Add prefer_hp_amp flag to hda_gen_spec ALSA: hda - fix OOPS in hda_mark_cmd_cache_dirty ALSA: hda - Check pincap while parsing the configuration
2013-01-16ALSA: hda - Make sure fill_all_dac_nids is called for digital only codecsDavid Henningsson
Otherwise no PCM will be built for codecs without analog I/O. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - force different capture controls if amp caps differDavid Henningsson
Otherwise setting the capture volume for amps will be weird and inconsistent (it will try to set values outside the range of the second amp based on capabilities of the first amp). Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - do not add non-existing Mic boost controlsDavid Henningsson
If the input node does not have any volume capable input amp, don't add such a control. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - initialize channel counts correctlyDavid Henningsson
Even a single DAC can output two channels, so the channel count is twice the number of DACs. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - fix wrong adc_idx in generic parserDavid Henningsson
We use knew->index for adc_idx when we create "Capture Volume" and "Capture Switch", so use the same to retrieve adc_idx. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda - Check array bounds in get_input_pathDavid Henningsson
This gives us some additional safety. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hda/ca0132 - Make some symbols staticTakashi Iwai
sound/pci/hda/patch_ca0132.c:387:19: sparse: symbol 'ca0132_voicefx' was not declared. Should it be static? Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Remove obsolete settings functionsAdrian Knoth
With HDSP_TOGGLE_SETTING in place, these functions are no longer required. Removing them makes the code DRY and considerably shorter. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Use HDSP_TOGGLE_SETTING to alter settingsAdrian Knoth
HDSP_TOGGLE_SETTING and its corresponding functions allow to change settings in the control register. Instead of using the specialised functions, use the generic code to make the code DRY. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Implement generic function to toggle settingsAdrian Knoth
The driver contains multiple similar functions that change only a single bit in the control register, only the bit position varies. This patch implements a generic function to toggle a certain bit position that will be used to replace the old code. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-16ALSA: hdsp - Fix detection for RME RPM/Multiface/Digiface ioboxesAdrian Knoth
The current iobox detection code reportedly fails for various users, so simply do what the Win32 driver does instead. Patch originally by Karl Grill <kgrill@chello.at> and then modified to comply with kernel coding guidelines + current HEAD. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda - Add prefer_hp_amp flag to hda_gen_specTakashi Iwai
Add a new flag to indicate whether HP amp is turned on as default for speaker or line-outs, and enable this for ALC260 codec, as many machines with this codec require the HP amp even for speakers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Fix a wrong comma in snd_printdd() callTakashi Iwai
sound/pci/hda/patch_ca0132.c: In function ‘ca0132_effects_set’: sound/pci/hda/patch_ca0132.c:3391:2: warning: too many arguments for format [-Wformat-extra-args] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Declare firmware only when really builtTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Fix possible invalid DMA channel deallocationTakashi Iwai
... in the error path in dspxfr_image(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Fix possible NULL dereferenceTakashi Iwai
Spotted by smatch, sound/pci/hda/patch_ca0132.c:1950 dspxfr_image() error: potential null dereference 'dma_engine'. (kzalloc returns null) sound/pci/hda/patch_ca0132.c:1950 dspxfr_image() error: we previously assumed 'dma_engine' could be null (see line 1857) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Fix another smatch warningTakashi Iwai
sound/pci/hda/patch_ca0132.c:1781 dspxfr_one_seg() info: why not propagate 'status' from dsp_dma_stop() instead of (-5)? Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Fix superfluous unsigned checkTakashi Iwai
Fix a warning by smatch, sound/pci/hda/patch_ca0132.c:714 dspio_send() warn: always true condition '(res >= 0) => (0-u32max >= 0)' Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132 - Use snd_hda_set_pin_ctl() helper againTakashi Iwai
The recent update of ca0132 driver replaced the pinctl setup to the direct write via snd_hda_codec_write() again. This should be covered by snd_hda_set_pin_ctl() to be safer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15Revert "ALSA: hda - Add firmware caching to CA0132 codec"Takashi Iwai
This reverts commit c3b4eea26208b8e247ece9d3a9ec8b2eab48c464. Since the recent firmware loader code supports caching at S3/S4 by itself, we don't have to handle f/w caching in the driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Fix potential init errors and update module descriptionIan Minett
Handle a potential dma_engine alloc error and fix the possible use of an uninitialized status variable in dspxfr_one_seg(). Also correct the initial sampling rate for Mic 1. Update the module description. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Shuffle to group together related codeIan Minett
Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Code shuffle to group similar functions.Ian Minett
Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Add tuning controlsIan Minett
This patch adds the controls used for tuning the DSP effects. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Add unsol handler for DSP and jack detectionIan Minett
This patch adds the unsolicited response handler for incoming DSP responses and jack detection reporting, and routines for reading the incoming DSP response. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Add PCM enhancementsIan Minett
Remove the playback PCM open callback. PCM stream setup and cleanup functions are added for use by PCM callbacks. Delay stream cleanup if effects are on, to allow time for any effects tail to finish. Add the analog capture PCM callbacks. Change the max channels of analog playback to 6. Add two new PCMs: AMic2 and What-U-Hear. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Add DSP mixer controls and helpersIan Minett
This patch adds the kcontrols for the DSP effects, playback and recording source selection. ca0132_is_vnode_effective() checks whether virtual node settings have taken effect. The control change helpers ca0132_pe_switch_set(), ca0132_voicefx_set() and ca0132_cvoice_switch_set() are added to toggle playback / capture DSP effects, ca0132_voicefx_info(), _get() and _put() are added for input path DSP effect value access. The volume helpers are updated to volume_info(), _get() and _set() to use the virtual nodes. The redundant headphone and speaker switches and ct_extension function are removed. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/ca0132: Init chip, DSP effects and mixer settingsIan Minett
This patch adds the framework to set effect parameters: ca0132_effects_set() and ca0132_setup_defaults() are general functions for parameter setting and initializing to default values. dspio_set_param() and dspio_set_uint_param() are lower-level fns to simplify setting individual DSP parameters via an SCP buffer transfer to the firmware. The CA0132 chip parameter init code is added in ca0132_init_params(). In chipio_[write,read]_data(), the current chip address is auto-incremented if no error has occurred. ca0132_select_out() selects the current output. If autodetect is enabled, use headphones (if jack detected) or speakers (if no jack). ca0132_select_mic() selects the current mic in. If autodetect is enabled, use exterior mic (if jack detected) or built-in mic (if no jack). Init digital mic and switch between dmic and amic with ca0132_init_dmic(), ca0132_set_dmic(). amic2 is initialized in ca0132_init_analog_mic2(). Finally, add verb tables for configuring DSP firmware. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>