summaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthw20k2.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bitsColin Ian King2021-02-281-1/+1
| | | | | | | | | | | | | | | | | | | Currently the mask operation on variable conf is just 3 bits so the switch statement case value of 8 is unreachable dead code. The function daio_mgr_dao_init can be passed a 4 bit value, function dao_rsc_init calls it with conf set to: conf = (desc->msr & 0x7) | (desc->passthru << 3); so clearly when desc->passthru is set to 1 then conf can be at least 8. Fix this by changing the mask to 0xf. Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210227001527.1077484-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pci: Simplify with dma_set_mask_and_coherent()Takashi Iwai2021-01-151-6/+2
| | | | | | | | | | Many PCI drivers still have two explicit calls of dma_set_mask() and dma_set_coherent_mask(). Let's simplify with dma_set_mask_and_coherent(). Link: https://lore.kernel.org/r/20210114125412.993-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pci/ctxfi: fix kernel-doc warningsPierre-Louis Bossart2020-07-071-1/+1
| | | | | | | | Fix W=1 warnings. The files contain formatting that isn't kernel-doc. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200702193604.169059-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: Support PCM sync_stopTakashi Iwai2019-12-111-0/+1
| | | | | | | | | | The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-15-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 364Thomas Gleixner2019-06-051-5/+1
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this source file is released under gpl v2 license no other versions see the copying file included in the main directory of this source distribution for the license terms and conditions extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 28 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531081035.780831265@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ALSA: ctxfi: cthw20k2: Replace mdelay() with msleep() and usleep_range()Jia-Ju Bai2018-07-271-6/+6
| | | | | | | | | | | | hw_pll_init(), hw_dac_stop(), hw_dac_start() and hw_adc_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: make hw structures constBhumika Goyal2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make these const as they are only used in a copy operation. Done using Coccinelle: @match disable optional_qualifier@ identifier s; @@ static struct hw s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ position ref.p; identifier match.s,f,c; expression e; @@ ( e = s@p | e = s@p.f | c(...,s@p.f,...) | c(...,s@p,...) ) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct hw s; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: Fallback DMA mask to 32bitTakashi Iwai2017-02-281-13/+6
| | | | | | | | | | | Currently ctxfi driver tries to set only the 64bit DMA mask on 64bit architectures, and bails out if it fails. This causes a problem on some platforms since the 64bit DMA isn't always guaranteed. We should fall back to the default 32bit DMA when 64bit DMA fails. Fixes: 6d74b86d3c0f ("ALSA: ctxfi - Allow 64bit DMA") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: Change structure initialisation to C99 styleAmitoj Kaur Chawla2016-06-171-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For readability and to allow for structure randomisation, replace the in order struct initialisation style with explicit field style. The Coccinelle semantic patch used to make this change is as follows: @decl@ identifier i1,fld; type T; field list[n] fs; @@ struct i1 { fs T fld; ...}; @@ identifier decl.i1,i2,decl.fld; expression e; position bad.p, bad.fix; @@ struct i1 i2@p = { ..., + .fld = e - e@fix ,...}; Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: remove deprecated use of pci apiQuentin Lambert2015-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace occurences of the pci api by appropriate call to the dma api. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @bad1@ idexpression id; position deprecated.p; @@ ...when != &id->dev when != pci_get_drvdata ( id ) when != pci_enable_device ( id ) ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @depends on !bad1@ idexpression id; expression direction; position deprecated.p; @@ ( - pci_dma_supported@p ( id, + dma_supported ( &id->dev, ... + , GFP_ATOMIC ) | - pci_alloc_consistent@p ( id, + dma_alloc_coherent ( &id->dev, ... + , GFP_ATOMIC ) ) Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/pci-cleanup' into for-nextTakashi Iwai2015-01-111-12/+0
|\
| * ALSA: ctxfi: Simplify PM callbacksTakashi Iwai2015-01-091-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801: PCI core handles power state for us]. Since pci_set_power_state(), pci_save_state() and pci_restore_state() are already done in the PCI core side, so we don't need to it doubly. Also, pci_enable_device(), pci_disable_device() and pci_set_master() calls in PM callbacks are superfluous nowadays, too, so get rid of them as well. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: Deletion of checks before the function call "iounmap"Markus Elfring2015-01-041-4/+1
|/ | | | | | | | | | The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: pr_* replaced with dev_*Sudip Mukherjee2014-09-301-9/+15
| | | | | | | | | | | | | | | | | pr_* macros replaced with dev_* as they are more preffered over pr_*. each file which had pr_* was reviewed manually and replaced with dev_*. here we have actually used the various snd_card which was added to some structures of ctxfi via a previous patch of this series. in the ctvmem.c file we have passed a reference of ct_atc as an argument to get_vm_block function so that it can be used from dev_*. since dev_* will print the device information , so the prefix of "ctxfi" from the various pr_* were also removed. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: sparse warningSudip Mukherjee2014-09-231-6/+6
| | | | | | | | | | | | | | | | fixed sparse warning of incorrect type (different address spaces) in cthw20k1.c and cthw20k2.c which was being actually caused as mem_base was of the type unsigned long. Again as mem_base was previously unsigned long , so it required many typecasts in the code to convert interger to pointer. Now after giving the correct type of mem_base as void __iomem * we can also remove those typecasts maintaining the same functionality and logic of the code. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: fix broken user-visible stringSudip Mukherjee2014-08-261-6/+5
| | | | | | | as broken user-visible strings breaks the ability to grep for them , so this patch fixes the broken user-visible strings Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi: prink replacementSudip Mukherjee2014-08-261-8/+8
| | | | | | | | as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_err and pr_alert this patch will generate a warning from checkpatch for an unnecessary space before new line and has not been fixed as this patch is only for printk replacement. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pci: remove __dev* attributesBill Pemberton2012-12-071-2/+2
| | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEPTakashi Iwai2012-08-141-2/+2
| | | | | | Otherwise we may get compile warnings due to unused functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Convert to new pm_ops for PCI driversTakashi Iwai2012-07-031-2/+2
| | | | | | | | | | 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>
* ALSA: ctxfi: Change PLL initialization codeHarry Butterworth2011-06-161-10/+7
| | | | | | | | This is a reworked patch from Creative to change the PLL code to address unreliable 44100Hz initialization. Signed-off-by: Harry Butterworth <heb1001@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'test/pci-rename' into topic/miscTakashi Iwai2011-06-141-1/+1
|\
| * ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*Takashi Iwai2011-06-101-1/+1
| | | | | | | | | | | | | | | | | | The name argument of request_irq() appears in /proc/interrupts, and it's quite ugly when the name entry contains a space or special letters. In general, it's simpler and more readable when the module name appears there, so let's replace all entries with KBUILD_MODNAME. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: ctxfi: Implement a combined capabilities query method to replace ↵Harry Butterworth2011-06-141-19/+8
| | | | | | | | | | | | | | multiple have_x query methods. Signed-off-by: Harry Butterworth <heb1001@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: ctxfi: Add support for Creative Titanium HDHarry Butterworth2011-06-141-83/+240
|/ | | | | | | | | | | | | | | | Initialise model-specific DAC and ADC parts. Add controls for output and mic source selection. Rename some mixer controls according to ControlNames.txt. Remove Playback switches for Line-in and IEC958-in - these were controlling the input mute/unmute which affected capture too. Use the capture switches to control the input mute/unmute instead - it's less confusing. Initialise the WM8775 to invert the left-right clock to swap the left and right channels of the mic and aux input. Signed-off-by: Harry Butterworth <heb1001@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Fix microphone boost codes/commentsPrzemyslaw Bruski2011-03-141-10/+18
| | | | | | | | microphone boost was set at +12dB, not +20dB (like in Windows driver and in adc_conf structure declaration), some comments added. Signed-off-by: Przemyslaw Bruski <pbruskispam@op.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Simple code clean upTakashi Iwai2009-07-221-9/+9
| | | | | | | | - replace NULL == xxx with !xxx - replace NULL != xxx with xxx - similar trivial cleanups Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Native timer support for emu20k2Takashi Iwai2009-07-201-6/+49
| | | | | | | Added the native timer support for emu20k2, which gives much more accurate update timing than the system timer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Add PM supportWai Yew CHAY2009-06-221-13/+52
| | | | | | | | | | | | Added the suspend/resume support to ctxfi driver. The team tested on the following seems ok: AMD Athlon 64 3500+ / ASUS A8N-E / 512MB DDR ATI / Radeon X1300 20k1 & 20k2 cards Signed-off-by: Wai Yew CHAY <wychay@ctl.creative.com> Singed-off-by: Ryan RICHARDS <ryan_richards@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Fix / clean up hw20k2 chip codeTakashi Iwai2009-06-081-169/+177
| | | | | | | | - Clean up Hungarian coding style - Don't use static variables for I2C information; this unables to use multiple instances. Now they are stored in struct hw20k2 fields. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Remove useless initializations and castTakashi Iwai2009-06-081-26/+26
| | | | | | | Remove useless variable initializations and cast at the beginning of functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Fix DMA mask for emu20k2 chipTakashi Iwai2009-06-081-6/+8
| | | | | | Allow 64bit DMA mask for emu20k2 chip, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Clean up / optimizeTakashi Iwai2009-06-051-97/+98
| | | | | | | | | | - Use static tables instead of assigining each funciton pointer - Add __devinit* to appropriate places; pcm, mixer and timer cannot be marked because they are kept in the function table that lives long - Move create_alsa_devs function out of struct ct_atc to mark it __devinit Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Remove PAGE_SIZE limitationTakashi Iwai2009-06-021-13/+4
| | | | | | | | | | Remove the limitation of PAGE_SIZE to be 4k by defining the own page size and macros for 4k. 8kb page size could be natively supported, but it's disabled right now for simplicity. Also, clean up using upper_32_bits() macro. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Add prefix to debug printsTakashi Iwai2009-05-141-8/+9
| | | | | | Added ctxfi: prefix to each debug print. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: ctxfi - Add missing inclusion of linux/delay.hTakashi Iwai2009-05-141-0/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: SB X-Fi driver mergeWai Yew CHAY2009-05-141-0/+2133
The Sound Blaster X-Fi driver supports Creative solutions based on 20K1 and 20K2 chipsets. Supported hardware : Creative Sound Blaster X-Fi Titanium Fatal1ty® Champion Series Creative Sound Blaster X-Fi Titanium Fatal1ty Professional Series Creative Sound Blaster X-Fi Titanium Professional Audio Creative Sound Blaster X-Fi Titanium Creative Sound Blaster X-Fi Elite Pro Creative Sound Blaster X-Fi Platinum Creative Sound Blaster X-Fi Fatal1ty Creative Sound Blaster X-Fi XtremeGamer Creative Sound Blaster X-Fi XtremeMusic Current release features: * ALSA PCM Playback * ALSA Record * ALSA Mixer Note: * External I/O modules detection not included. Signed-off-by: Wai Yew CHAY <wychay@ctl.creative.com> Singed-off-by: Ryan RICHARDS <ryan_richards@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>