History log of /linux-master/sound/i2c/other/ak4xxx-adda.c
Revision Date Author Comments
# 2127c01b 25-Jul-2019 Jia-Ju Bai <baijiaju1990@gmail.com>

ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls()

In build_adc_controls(), there is an if statement on line 773 to check
whether ak->adc_info is NULL:
if (! ak->adc_info ||
! ak->adc_info[mixer_ch].switch_name)

When ak->adc_info is NULL, it is used on line 792:
knew.name = ak->adc_info[mixer_ch].selector_name;

Thus, a possible null-pointer dereference may occur.

To fix this bug, referring to lines 773 and 774, ak->adc_info
and ak->adc_info[mixer_ch].selector_name are checked before being used.

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 1 normalized pattern(s):

this program 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 program 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 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5a170e9e 04-Feb-2019 Takashi Iwai <tiwai@suse.de>

ALSA: i2c: Clean up with new procfs helpers

Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3b23dc52 03-Aug-2018 Takashi Iwai <tiwai@suse.de>

ALSA: i2c: Remove empty init and exit

For a sake of code simplification, remove the init and the exit
entries that do nothing.

Notes for readers: actually it's OK to remove *both* init and exit,
but not OK to remove the exit entry. By removing only the exit while
keeping init, the module becomes permanently loaded; i.e. you cannot
unload it any longer!

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


# 4bce6fce 28-May-2015 Takashi Iwai <tiwai@suse.de>

ALSA: ak4xxx-adda: Drop unnecessary ifdef CONFIG_PROC_FS

The compiler can optimize it away if not needed.

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


# 6cbbfe1c 28-Jan-2015 Takashi Iwai <tiwai@suse.de>

ALSA: Include linux/io.h instead of asm/io.h

Nowadays it's recommended. Replace all in a shot.

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


# 609e478b 20-Oct-2014 Takashi Iwai <tiwai@suse.de>

ALSA: ak4xxx-adda: Use snd_ctl_enum_info()

... and reduce the open codes. Also add missing const to the text array.

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


# 57a4451d 29-Oct-2013 Takashi Iwai <tiwai@suse.de>

ALSA: Use strlcpy() instead of strncpy()

We tend to make stupid mistakes with strncpy(). Let's take a safer
one, strlcpy().

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


# bd5fe738 26-Jun-2013 Dan Carpenter <dan.carpenter@oracle.com>

ALSA: ak4xx-adda: info leak in ak4xxx_capture_source_info()

"idx" is controled by the user and can be a negative offset into the
input_names[] array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# da155d5b 14-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sound: Add module.h to the previously silent sound users

Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up. So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# e913b146 30-Sep-2010 Takashi Iwai <tiwai@suse.de>

ALSA: i2c/other/ak4xx-adda: Fix a compile warning with CONFIG_PROCFS=n

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


# 9fe856e4 04-Sep-2010 Joe Perches <joe@perches.com>

sound: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8f34692f 16-Sep-2009 Pavel Hofman <pavel.hofman@ivitera.com>

ALSA: ak4620 support, codec regs listed in proc

* complete support for ak4620
* codec regs listed in proc for all codecs/chips
* adding total regs for each codec
* fixing nb. of steps in input attenuation controls

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 46480b3a 20-Aug-2008 Alexander Beregalov <a.beregalov@gmail.com>

ALSA: revo51: add headphone output

It is ALSA bug #1754.
D6 bit in 02 register is PW4.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 841b23d4 17-Mar-2008 Pavel Hofman <dustin@seznam.cz>

[ALSA] some fixes and cleanup for ICE1724 cards

* removing the hack with NON_AKM ak4xxx type
* support for card-specific flags in ak4114_stats
* definition of the flags for corresponding cards

Signed-off-by: Pavel Hofman <dustin@seznam.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9004acc7 08-Jan-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove sound/driver.h

This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 6632d64b 02-Dec-2007 Pavel Hofman <dustin@seznam.cz>

[ALSA] switching rate in STAC9460 codec of Prodigy192

* support for switching rate in STAC9460 - using set_rate_val of the akm
infrastructure
* listing all STAC9460 registers in proc
* disabling mpu401 device for Prodigy192 - otherwise the currently
flawed mpu401 code hangs kernel when opening the midi device
* removing old unused commented-out code

Signed-off-by: Pavel Hofman <dustin@seznam.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 02ff1324 15-Nov-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] ak4xxx - Check value ranges in ctl callbacks

Check the value ranges in ctl put callbacks properly in ak4xxx-adda driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# c1017a4c 15-Oct-2007 Jaroslav Kysela <perex@perex.cz>

[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz


Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# a5ce8890 23-Jul-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] Clean up with common snd_ctl_boolean_*_info callbacks

Clean up codes using the new common snd_ctl_boolean_*_info() callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# ea7cfcdf 19-May-2007 Pavel Hofman <dustin@seznam.cz>

[ALSA] ice1724 - Add PCM Playback Switch to Revo 7.1

This patch adds the support of mute for front channels of M-Audio
Revolution 7.1 (the DAC AK4381 features a mute bit).

Signed-off-by: Pavel Hofman <dustin@seznam.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 0cb29ea0 29-Jan-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] Add even more 'const' to everything related to TLV

Mark TLV data as 'const'
Signed-of-by: Philipp Matthias Hahn <pmhahn@pmhahn.de>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 517400cb 29-Jan-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] Add some more 'const', but needs changes in i2c/other/ak4*

Make data passed to ak4xxx_create 'const'.
Signed-of-by: Philipp Matthias Hahn <pmhahn@pmhahn.de>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# a58e7cb1 04-Oct-2006 Jochen Voss <voss@seehuhn.de>

[ALSA] Enable capture from line-in and CD on Revolution 5.1

Enable capture from line-in and CD on the Revolution 5.1 card.
This patch adds support for switching between the 5 input channels of
the AK5365 ADC and modifies the Revolution 5.1 driver to make use of
this facility. Previously the capture channel was fixed to channel 0
(microphone on the Revolution 5.1 card).

Signed-off-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 854b66e4 07-Sep-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] ak4xxx - Remove bogus IPGA controls

Remove IPGA volume controls and merge the IPGA range to ADC volume
controls. These two volumes are not really independent but connected
simply in different ranges 0-0x7f and 0x80-max. It doesn't make sense
to provide two controls.
Since both 0x7f and 0x80 specify 0dB, a hack is needed for IPGA range
to skip 0x80 (increment one) for such controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 723b2b0d 30-Aug-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Clean up and add TLV support to AK4xxx i2c driver

- Clean up the code in AK4xxx-ADDA i2c code.
- Fix capture gain controls for AK5365
- Changed the static table for DAC/ADC mixer labels to use
structs
- Implemented TLV entries for each AK codec
The volumes in AK4524, AK4528 and AK5365 are corrected with
a table to be suitable for dB conversion.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 3479307f 23-Aug-2006 Jochen Voss <voss@seehuhn.de>

[ALSA] Fix volume control for the AK4358 DAC

Fix volume control for the AK4358 DAC.
The attenuation control registers of the AK4358 use only 7bit for the
volume, the msb is used to enable attenuation output. Without this
patch there are 256 volume levels the lower 128 of which are mute.

Signed-off-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# cf93907b 09-Aug-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Fix compile warnings in ak4xxx-adda.c

Fixed compile warnings in ak4xxx-adda.c reagarding missing
enum cases in switch.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 30ba6e20 09-Aug-2006 Jochen Voss <voss@seehuhn.de>

[ALSA] Revolution 5.1 - complete the AK5365 support

Complete the AK5365 support.
This adds a boolean control to toggle the soft mute feature of the
AK5365 chip.

Signed-off-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 683fe153 08-Aug-2006 Jochen Voss <voss@seehuhn.de>

[ALSA] Revolution 5.1 - add AK5365 ADC support

Add support for the AK5365 ADC.

Signed-off-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# cb9d24e4 27-Jun-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] ak4xxx-adda - Code clean-up

Fix spaces, fold lines to fit 80 columns in ak4xxx-adda driver codes.
Split a long reset function to each codec routine just for better
readability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# c83c0c47 27-Jun-2006 Jani Alinikula <janialinikula@gmail.com>

[ALSA] Stereo controls for M-Audio Revolution cards

This patch adds stereo controls to revo cards by making the ak4xxx
driver mixers configurable from the card driver.

Signed-off-by: Jani Alinikula <janialinikula@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 97f02e05 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove xxx_t typedefs: I2C drivers

Remove xxx_t typedefs from the i2c drivers.

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


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!