summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_ca0132.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this driver is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this driver is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 18 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190520170857.186505395@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22ALSA: hda/ca0132 - Simplify alt firmware loading codeTakashi Iwai1-14/+6
ca0132 codec driver loads the firmware selectively depending on the model in addition to the fallback of the default firmware. The code works good, but a minor problem is that the current code seems confusing for Clang where it spews a warning about uninitialized variable. This patch simplifies the code flow for such a false-positive warning. After this refactoring, the ca0132_spec.alt_firmware_present field is no longer used, hence it's eliminated as well. Reported-and-tested-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-06ALSA: hda/ca0132 - Fix build error without CONFIG_PCITakashi Iwai1-1/+3
A call of pci_iounmap() call without CONFIG_PCI leads to a build error on some architectures. We tried to address this and add a check of IS_ENABLED(CONFIG_PCI), but this still doesn't seem enough for sh. Ideally we should fix it globally, it's really a corner case, so let's paper over it with a simpler ifdef. Fixes: 1e73359a24fa ("ALSA: hda/ca0132 - make pci_iounmap() call conditional") Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-12-11ALSA: hda/ca0132 - make pci_iounmap() call conditionalArnd Bergmann1-1/+1
When building without CONFIG_PCI, we can (depending on the architecture) get a link failure: ERROR: "pci_iounmap" [sound/pci/hda/snd-hda-codec-ca0132.ko] undefined! Adding a compile-time check for PCI gets it to work correctly on 32-bit ARM. Fixes: d99501b8575d ("ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-19Merge branch 'for-linus' into for-nextTakashi Iwai1-2/+3
Backporting for further works on ca0132 codec driver Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-19ALSA: hda/ca0132 - fix AE-5 pincfgConnor McAdams1-1/+1
This patch fixes the pincfg assignment for the AE-5, which was previously using the Recon3D pincfg's by mistake. Fixes: d06feaf02fe6 ("ALSA: hda/ca0132 - Add pincfg for AE-5") Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-19ALSA: hda/ca0132 - Add new ZxR quirkConnor McAdams1-0/+1
This patch adds a new PCI subsys ID for the ZxR, as found and tested by other users. Without a way to know if any Z's use it as well, it keeps the quirk of QUIRK_SBZ and goes through the HDA subsys test function. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-12ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()Takashi Iwai1-1/+1
We need to call pci_iounmap() instead of iounmap() for the regions obtained via pci_iomap() call for some archs that need special treatment. Fixes: aa31704fd81c ("ALSA: hda/ca0132: Add PCI region2 iomap for SBZ") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-12ALSA: hda/ca0132 - Optimize for non-PCI configurationTakashi Iwai1-82/+123
All the recent support of Creative boards and onboard audio depend on PCI, but they can't be trimmed easily even if you build without CONFIG_PCI, since the quirk is detected dynamically and the code has many branches with the flag check like spec->quirk type or spec->use_alt_functions. This patch makes these checks static for CONFIG_PCI=n case so that the compiler optimizes out. The access to flags are replaced with macros that are replaced with a static value for CONFIG_PCI=n. The macros look slightly ugly for avoiding compiler warnings wrt unused variables, and some additional default-case handlings for another compiler warnings, but the rest are very straightforward changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-22Merge tag 'asoc-v5.0' of ↵Takashi Iwai1-0/+1
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.0/v4.20 As ever there's a lot of small and driver specific changes going on here, but we do also have some relatively large changes in the core thanks to the hard work of Charles and Morimoto-san: - More component transitions from Morimoto-san, I think we're about finished with this. Thanks for all the hard work! - Morimoto-san also added a bunch of for_each_foo macros - A bunch of cleanups and fixes for DAPM from Charles. - MCLK support for several different devices, including CS42L51, STM32 SAI, and MAX98373. - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and TI PCM3060.
2018-10-22ALSA: hda/ca0132 - Actually fix microphone issueConnor McAdams1-36/+37
This patch fixes the microphone issue for all cards. The previous fix worked on the ZxR, but not on the AE-5 or Z. This patch has been tested to work for all cards. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-09ALSA: hda/ca0132 - Fix input effect controls for desktop cardsConnor McAdams1-4/+4
This patch removes the echo cancellation control for desktop cards, and makes use of the special 0x47 SCP command for noise reduction. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-09ALSA: hda/ca0132 - Add error checking in ca0132_build_controls()Connor McAdams1-12/+35
This patch adds error checking to functions creating controls inside of ca0132_build_controls(). Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-09ALSA: hda/ca0132 - Clean up patch_ca0132()Connor McAdams1-5/+9
This patch cleans up the patch_ca0132() function with suggestions from Takashi Sakamoto. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-09ALSA: hda/ca0132 - Fix microphone inconsistency issuesConnor McAdams1-0/+6
This patch fixes microphone inconsistency issues by adding a delay to each setup_defaults function. Without this, the microphone only works intermittently. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR exit commandsConnor McAdams1-0/+33
This patch adds exit operations for the Sound Blaster ZxR. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR 600 ohm gain controlConnor McAdams1-2/+42
This patch adds a control for 600 ohm gain on the Sound Blaster ZxR. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Remove input select enum for ZxRConnor McAdams1-1/+14
This patch removes the input select control for the ZxR, as it only has one input option, rear microphone. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR input/output select commandsConnor McAdams1-0/+25
This patch adds commands for selecting input and output on the Sound Blaster ZxR. The ZxR has no front panel header, and has line-in on the separate daughter board, so it only does rear-mic. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR DSP post-download commandsConnor McAdams1-13/+24
This patch adds commands for setting up the ZxR after the DSP is downloaded. The ZxR already shares most of the post-download commands from the regular Sound Blaster Z. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR init commandsConnor McAdams1-1/+13
This patch adds init commands for the main Sound Blaster ZxR card. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add DBpro hda_codec_opsConnor McAdams1-0/+100
This patch adds separate hda_codec_ops for the DBPro daughter board, as it behaves more like a generic HDA codec than the other ca0132 cards, despite having a ca0132 on board. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR pincfgConnor McAdams1-0/+50
This patch adds a pincfg for the ZxR, and defines which pins are used for both. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Add ZxR quirks + new quirk check functionConnor McAdams1-0/+28
This patch adds quirk ID's for the ZxR and it's daughter board, the DBPro. It also adds a function for determining the quirk for each board through HDA subsytem ID's instead of PCI subsystem ID's. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Fix surround sound with output effectsConnor McAdams1-5/+14
This patch fixes an issue where if surround sound was the selected output and output effects were enabled, the sound wasn't sent to all channels correctly. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02ALSA: hda/ca0132 - Fix AE-5 control typeConnor McAdams1-2/+2
This patch corrects the control type of the additional AE-5 controls added in a previous patch from HDA_INPUT to HDA_OUTPUT. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add AE-5 exit functionConnor McAdams1-0/+28
This patch adds exit commands for the AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add AE-5 specific controlsConnor McAdams1-1/+238
This patch adds controls for the AE-5's headphone gain setting, and the DAC's interpolation filter setting. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add input selection commands for AE-5Connor McAdams1-6/+29
This patch adds the input selection commands for the Sound BlasterX AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add output set commands for AE-5Connor McAdams1-10/+70
This patch adds output selection commands for the AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Clean up ca0132_alt_out_selectConnor McAdams1-51/+69
This patch cleans up ca0132_alt_out_select by moving the card specific output commands into a separate function. As more cards are added, the function ca0132_alt_out_select is going to get more bloated with these, so moving into a separate function tries to keep that from happening. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add DSP setup functions for AE-5Connor McAdams1-0/+215
This patch adds DSP setup functions for the AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Merge post-dsp functions + cleanupConnor McAdams1-96/+75
This patch cleans up some of the formatting of the post-dsp load setup functions, and also merges some of the sub functions into individual ones. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Change firmware name and usageConnor McAdams1-5/+7
The Recon3D, AE-5, Z and ZxR all share the same firmware file. Rename this from the specific "ctefx-sbz.bin" to "ctefx-desktop.bin" and set the AE-5 and Recon3D to use it as well. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add AE-5 regular init setupConnor McAdams1-0/+12
This patch adds AE-5 specific stuff to the ca0132_alt_init function. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add AE-5 pre-init and ca0113 functionsConnor McAdams1-23/+134
This patch adds AE-5 pre-init functions that happen before the main ca0132_alt_init, and gives functions related to the ca0113 a ca0113 prefix instead of ca0132. It also adds functions to write to the 8051's SFRs, and to write the special ca0113 commands for the AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Change ca0132_mmio_init for AE-5Connor McAdams1-6/+55
This patch adds the unique writes for the AE-5 on startup to ca0132_mmio_init. The other cards share some addresses written to, but use different values. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Set AE-5 bools and select mixerConnor McAdams1-1/+10
This patch sets the bool values for the AE-5, as well as selects the mixer it will use. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add pincfg for AE-5Connor McAdams1-13/+60
This patch adds the pincfg for the Sound BlasterX AE-5, and cleans up the function it's assigned in. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Add quirk for Sound BlasterX AE-5Connor McAdams1-0/+2
This patch adds the PCI subsys ID quirk for the Sound BlasterX AE-5. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20ALSA: hda/ca0132 - Define new verbs and control paramsConnor McAdams1-11/+12
This patch defines some new verbs found from reverse engineering of the onboard 8051 CPU, and a control param found there as well. This clears up usage of these verbs in other parts of the driver, and removes their usage where they're now known to be unnecessary. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-12ALSA: hda: Fix implicit definition of pci_iomap() on SHMark Brown1-0/+1
Include asm/io.h directly so we've got a definition of pci_iomap(), the current set of includes do this implicitly on most architectures but not on SH. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-30ALSA: hda: move hda_codec.h to include/soundPierre-Louis Bossart1-1/+1
As suggested by Takashi, move this header file to make it easier to include from e.g. the Intel Skylake driver in follow-up patches Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28ALSA: hda: move hda_codec.h to include/soundPierre-Louis Bossart1-1/+1
As suggested by Takashi, move this header file to make it easier to include from e.g. the Intel Skylake driver in follow-up patches Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-08ALSA: hda/ca0132 - Add exit commands for Recon3DConnor McAdams1-14/+16
This patch adds exit functions for the Recon3D, and cleans up the current exit function. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08ALSA: hda/ca0132 - Change mixer controls for Recon3DConnor McAdams1-7/+11
This patch adds changes to setup the Recon3D's mixer controls. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08ALSA: hda/ca0132 - Add Recon3D input and output select commandsConnor McAdams1-0/+15
This patch adds commands to the alternative input and output select commands to support the Recon3D. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08ALSA: hda/ca0132 - Add DSP setup defaults for Recon3DConnor McAdams1-10/+11
The Recon3D can use many of the same functions as the Recon3Di, so many of the r3di prefix function remain the same, but change their names to the more generic r3d prefix. This patch does this, and adds quirk checks for things specific to the Recon3Di. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08ALSA: hda/ca0132 - Add Recon3D startup functions and setupConnor McAdams1-13/+36
This patch adds functions for Recon3D startup, and sets values for things such as use_pci_mmio. It also renames some functions and tables from the sbz prefix into ca0132, as the Recon3D uses them as well. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08ALSA: hda/ca0132 - Add bool variable to enable/disable pci region2 mmioConnor McAdams1-13/+19
This patch adds the ability to choose whether or not to map the pci region2, which is used for things such as GPIO on the Recon3D and Sound Blaster Z. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>