History log of /linux-master/sound/pci/ctxfi/cthw20k1.c
Revision Date Author Comments
# 1693e265 21-May-2022 Julia Lawall <Julia.Lawall@inria.fr>

ALSA: ctxfi: fix typo in comment

Spelling mistake (triple letters) in comment.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20220521111145.81697-44-Julia.Lawall@inria.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 669f65ea 14-Jan-2021 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Simplify with dma_set_mask_and_coherent()

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>


# fe372850 02-Jul-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: pci/ctxfi: fix kernel-doc warnings

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>


# 4df93325 09-Apr-2020 Xu Wang <vulab@iscas.ac.cn>

ALSA: ctxfi: Remove unnecessary cast in kfree

Remove unnecassary casts in the argument to kfree.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20200409112052.13402-1-vulab@iscas.ac.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5e0890c1 09-Dec-2019 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi: Support PCM sync_stop

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>


# 5765e78e 31-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 364

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>


# 08fd8325 27-Jul-2018 Jia-Ju Bai <baijiaju1990@gmail.com>

ALSA:: ctxfi: cthw20k1: Replace mdelay() with msleep()

hw_pll_init(), hw_reset_dac() and hw_card_init() are never
called in atomic context.
They calls 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>


# faa11909 23-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ALSA: ctxfi: make hw structures const

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>


# f363a066 20-Mar-2017 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call

In the commit [15c75b09f8d1: ALSA: ctxfi: Fallback DMA mask to 32bit],
I forgot to put "!" at dam_set_mask() call check in cthw20k1.c (while
cthw20k2.c is OK). This patch fixes that obvious bug.

(As a side note: although the original commit was completely wrong,
it's still working for most of machines, as it sets to 32bit DMA mask
in the end. So the bug severity is low.)

Fixes: 15c75b09f8d1 ("ALSA: ctxfi: Fallback DMA mask to 32bit")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 15c75b09 28-Feb-2017 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi: Fallback DMA mask to 32bit

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>


# 412b979c 15-Apr-2015 Quentin Lambert <lambert.quentin@gmail.com>

ALSA: remove deprecated use of pci api

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>


# 7247aabd 07-Jan-2015 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi: Simplify PM callbacks

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>


# ff6defa6 03-Jan-2015 Markus Elfring <elfring@users.sourceforge.net>

ALSA: Deletion of checks before the function call "iounmap"

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>


# 0cae90a9 29-Sep-2014 Sudip Mukherjee <sudipm.mukherjee@gmail.com>

ALSA: ctxfi: pr_* replaced with dev_*

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>


# 7a7686bd 23-Sep-2014 Sudip Mukherjee <sudipm.mukherjee@gmail.com>

ALSA: ctxfi: sparse warning

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>


# 62afa853 26-Aug-2014 Sudip Mukherjee <sudipm.mukherjee@gmail.com>

ALSA: ctxfi: fix broken user-visible string

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>


# e720b820 26-Aug-2014 Sudip Mukherjee <sudipm.mukherjee@gmail.com>

ALSA: ctxfi: prink replacement

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>


# e23e7a14 05-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ALSA: pci: remove __dev* attributes

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>


# c7561cd8 14-Aug-2012 Takashi Iwai <tiwai@suse.de>

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>


# 68cb2b55 02-Jul-2012 Takashi Iwai <tiwai@suse.de>

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>


# b028b818 11-Jun-2011 Harry Butterworth <heb1001@gmail.com>

ALSA: ctxfi: Implement a combined capabilities query method to replace multiple have_x query methods.

Signed-off-by: Harry Butterworth <heb1001@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 55309216 11-Jun-2011 Harry Butterworth <heb1001@gmail.com>

ALSA: ctxfi: Add support for Creative Titanium HD

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>


# 934c2b6d 10-Jun-2011 Takashi Iwai <tiwai@suse.de>

ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*

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>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 35ebf6e7 22-Jul-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Simple code clean up

- replace NULL == xxx with !xxx
- replace NULL != xxx with xxx
- similar trivial cleanups

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 29959a09 22-Jun-2009 Wai Yew CHAY <wychay@ctl.creative.com>

ALSA: ctxfi - Add PM support

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>


# 09521d2e 08-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Fix wrong model id for UAA

CTUAA should be checked instead of CTHENDRIX. The latter is for 20k2 chip.
Also, fixed the detection of UAA/HENDRIX models by fixing the mask bits.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9470195a 08-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Clean up probe routines

Clean up probe routines and model detection routines so that the driver
won't call and check the PCI subsystem id at each time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 514eef9c 08-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Remove useless initializations and cast

Remove useless variable initializations and cast at the beginning of
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 54de6bc8 08-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Optimize the native timer handling using wc counter

Optimize the timer update routine to look up wall clock once instead of
checking the position of each stream at each timer update.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 2a36f67f 05-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Clean up / optimize

- 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>


# b7bbf876 05-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Use native timer interrupt on emu20k1

emu20k1 has a native timer interrupt based on the audio clock, which
is more accurate than the system timer (from the synchronization POV).
This patch adds the code to handle this with multiple streams.

The system timer is still used on emu20k2, and can be used also for
emu20k1 easily by changing USE_SYSTEM_TIMER to 1 in cttimer.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 6bc5874a 04-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Fix previous fix for 64bit DMA

Remove unneeded substitution to 32bit int to make it really working.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 42a0b318 05-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Fix endian-dependent codes

The UAA-mode check in hwct20k1.c is implemented with the endian-dependent
codes. Fix to be more portable (and readable).

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 6d74b86d 05-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Allow 64bit DMA

emu20kx chips support 64bit address PTE. Allow the DMA bit mask to
accept 64bit address, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# cd391e20 02-Jun-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Remove PAGE_SIZE limitation

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>


# d0da727e 14-May-2009 Takashi Iwai <tiwai@suse.de>

ALSA: ctxfi - Add missing inclusion of linux/delay.h

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8cc72361 14-May-2009 Wai Yew CHAY <wychay@ctl.creative.com>

ALSA: SB X-Fi driver merge

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>