History log of /linux-master/sound/pci/hda/hda_sysfs.c
Revision Date Author Comments
# 21b3d4f5 18-Aug-2022 Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

ALSA: hda: Remove unused MAX_PIN_CONFIGS constant

Since it was introduced around v2.6.30 it was never used. Also HDA
specification does not mention any limitation on number of PIN
configurations.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20220818141517.109280-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 17daae7a 01-Aug-2022 Takashi Iwai <tiwai@suse.de>

ALSA: hda: Replace sprintf() with sysfs_emit()

For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
instead of the raw sprintf() & co. This patch replaces those usages
straightforwardly with new helpers, sysfs_emit() and sysfs_emit_at().

Link: https://lore.kernel.org/r/20220801165639.26030-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 2506318e 09-Dec-2020 Takashi Iwai <tiwai@suse.de>

ALSA: hda: Fix regressions on clear and reconfig sysfs

It seems that the HD-audio clear and reconfig sysfs don't work any
longer after the recent driver core change. There are multiple issues
around that: the linked list corruption and the dead device handling.
The former issue is fixed by another patch for the driver core itself,
while the latter patch needs to be addressed in HD-audio side.

This patch corresponds to the latter, it recovers those broken
functions by replacing the device detach and attach actions with the
standard core API functions, which are almost equivalent with unbind
and bind actions.

Fixes: 654888327e9f ("driver core: Avoid binding drivers to dead devices")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209207
Link: https://lore.kernel.org/r/20201209150119.7705-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 44eeb081 18-Feb-2020 Takashi Iwai <tiwai@suse.de>

ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs

Some code in HD-audio driver calls snprintf() in a loop and still
expects that the return value were actually written size, while
snprintf() returns the expected would-be length instead. When the
given buffer limit were small, this leads to a buffer overflow.

Use scnprintf() for addressing those issues. It returns the actually
written size unlike snprintf().

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200218091409.27162-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# bf82326f 05-Jan-2020 Takashi Iwai <tiwai@suse.de>

ALSA: hda: More constifications

Apply const prefix to the remaining possible places: the string
tables, the rate tables, the verb tables, the index tables, etc.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 457c8996 19-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Add SPDX license identifier for missed files

Add SPDX license identifiers to all files which:

- Have no license information of any form

- Have EXPORT_.*_SYMBOL_GPL inside which was used in the
initial scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# be57bfff 22-Aug-2018 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: hda: move hda_codec.h to include/sound

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>


# b4af16d6 22-Aug-2018 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: hda: move hda_codec.h to include/sound

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>


# a9c2dfc8 23-Apr-2018 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Use a macro for snd_array iteration loops

Introduce a new helper macro, snd_array_for_each(), to iterate for
each snd_array element. It slightly improves the readability than
lengthy open codes at each place.

Along with it, add const prefix to some obvious places.

There should be no functional changes by this.

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


# a5a041b6 29-Jun-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

ALSA: hda: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/device.h> work with const
attribute_group. So mark the non-const structs as const.

File size before:
text data bss dec hex filename
995 608 0 1603 643 sound/pci/hda/hda_sysfs.o

File size After adding 'const':
text data bss dec hex filename
1035 544 0 1579 62b sound/pci/hda/hda_sysfs.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# addacd80 10-May-2016 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Fix broken reconfig

The HD-audio reconfig function got broken in the recent kernels,
typically resulting in a failure like:
snd_hda_intel 0000:00:1b.0: control 3:0:0:Playback Channel Map:0 is already present

This is because of the code restructuring to move the PCM and control
instantiation into the codec drive probe, by the commit [bcd96557bd0a:
ALSA: hda - Build PCMs and controls at codec driver probe]. Although
the commit above removed the calls of snd_hda_codec_build_pcms() and
*_build_controls() at the controller driver probe, the similar calls
in the reconfig were still left forgotten. This caused the
conflicting and duplicated PCMs and controls.

The fix is trivial: just remove these superfluous calls from
reconfig_codec().

Fixes: bcd96557bd0a ('ALSA: hda - Build PCMs and controls at codec driver probe')
Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ded255be 01-Oct-2015 Takashi Iwai <tiwai@suse.de>

ALSA: hda - consolidate chip rename functions

A few multiple codec drivers do renaming the chip_name string but all
these are open-coded and some of them have even no error check. Let's
make common helpers to do it properly.

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


# 7639a06c 03-Mar-2015 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Move a part of hda_codec stuff into hdac_device

Now some codes and functionalities of hda_codec struct are moved to
hdac_device struct. A few basic attributes like the codec address,
vendor ID number, FG numbers, etc are moved to hdac_device, and they
are accessed like codec->core.addr. The basic verb exec functions are
moved, too.

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


# d068ebc2 02-Mar-2015 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Move some codes up to hdac_bus struct

A few basic codes for communicating over HD-audio bus are moved to
struct hdac_bus now. It has only command and get_response ops in
addition to the unsolicited event handling.

Note that the codec-side tracing support is disabled temporarily
during this transition due to the code shuffling. It will be
re-enabled later once when all pieces are settled down.

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


# 6efdd851 27-Feb-2015 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Add card field to hda_codec struct

Allow the codec object to have an individual card pointer. Not only
this simplifies the redirections in many places, also this will allow
us to make each codec assigned to a different card object.

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


# c10b11f6 15-Dec-2014 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Fix typos in snd_hda_get_int_hint() kerneldoc comments

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


# 95a962c3 29-Oct-2014 Takashi Iwai <tiwai@suse.de>

ALSA: hda - More kerneldoc comments

Put more kerneldoc comments to the exported functions.
Still the generic parser code and the HD-audio controller code aren't
covered yet, though.

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


# 8bb1ffdf 16-Sep-2014 Rasmus Villemoes <linux@rasmusvillemoes.dk>

ALSA: hda - Replace strnicmp with strncasecmp

The kernel used to contain two functions for length-delimited,
case-insensitive string comparison, strnicmp with correct semantics
and a slightly buggy strncasecmp. The latter is the POSIX name, so
strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper
for the new strncasecmp to avoid breaking existing users.

To allow the compat wrapper strnicmp to be removed at some point in
the future, and to avoid the extra indirection cost, do
s/strnicmp/strncasecmp/g.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4e76a883 24-Feb-2014 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Replace with standard printk

Use dev_err() and co for messages from HD-audio controller and codec
drivers. The codec drivers are mostly bound with codec objects, so
some helper macros, codec_err(), codec_info(), etc, are provided.
They merely wrap the corresponding dev_xxx().

There are a few places still calling snd_printk() and its variants
as they are called without the codec or device context.

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


# b989d044 25-Feb-2014 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Enable sysfs attributes without CONFIG_SND_HDA_RECONFIG

Some sysfs attributes like init_pin_configs or vendor_name are really
basic and should be available no matter whether the codec driver is
re-configurable or not. Put them out of #ifdef
CONFIG_SND_HDA_RECONFIG and allow the read-only accesses.

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


# 648a8d27 25-Feb-2014 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Add sysfs to codec object, too

We have currently sysfs attributes for each hwdep, but basically these
should belong to the codec itself, per se. Let's add them to the
codec object while keeping them for hwdep as is for compatibility.

While we are at it, split the sysfs-related stuff into a separate
source file, hda_sysfs.c, and keep only the stuff necessary for hwdep
in hda_hwdep.c.

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