History log of /linux-master/sound/pci/cs5535audio/cs5535audio_olpc.c
Revision Date Author Comments
# 5eba4c64 15-Jul-2021 Takashi Iwai <tiwai@suse.de>

ALSA: cs5535audio: Allocate resources with device-managed APIs

This patch converts the resource management in PCI cs5535audio driver
with devres as a clean up. Each manual resource management is
converted with the corresponding devres helper, and the card object
release is managed now via card->private_free instead of a lowlevel
snd_device. A slight uncertain change is the call of
olpc_quirks_cleanup() at removal: formerly this was called
unconditionally at remove, but this should be a conditionally call,
hence the machine_is_olpc() check is added here as well.

This should give no user-visible functional changes.

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


# 75b1a8f9 04-Jan-2021 Joe Perches <joe@perches.com>

ALSA: Convert strlcpy to strscpy when return value is unused

strlcpy is deprecated. see: Documentation/process/deprecated.rst

Change the calls that do not use the strlcpy return value to the
preferred strscpy.

Done with cocci script:

@@
expression e1, e2, e3;
@@

- strlcpy(
+ strscpy(
e1, e2, e3);

This cocci script leaves the instances where the return value is
used unchanged.

After this patch, sound/ has 3 uses of strlcpy() that need to be
manually inspected for conversion and changed one day.

$ git grep -w strlcpy sound/
sound/usb/card.c: len = strlcpy(card->longname, s, sizeof(card->longname));
sound/usb/mixer.c: return strlcpy(buf, p->name, buflen);
sound/usb/mixer.c: return strlcpy(buf, p->names[index], buflen);

Miscellenea:

o Remove trailing whitespace in conversion of sound/core/hwdep.c

Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b4e5e707 03-Jan-2020 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Constify snd_kcontrol_new items

Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.

There should be no functional changes by this patch.

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


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

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

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

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


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

ALSA: cs5535audio: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.

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>


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


# 3c554946 14-Dec-2009 Andres Salomon <dilinger@collabora.co.uk>

ALSA: cs5535audio: free OLPC quirks from reliance on MGEODE_LX cpu optimization

Previously, OLPC support for the mic extensions was only enabled in the
ALSA driver if CONFIG_OLPC and CONFIG_MGEODE_LX were both set. This was
because the old geode GPIO code was written in a manner that assumed
CONFIG_MGEODE_LX. With the new cs553x-gpio driver, this is no longer the
case; as such, we can drop the requirement on CONFIG_MGEODE_LX and instead
include a requirement on GPIOLIB.

We use the generic GPIO API rather than the cs553x-specific API.

Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0fb497f5 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: ensure MIC Bias/Analog Input bail if not on an OLPC machine

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b5ccc57b 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: clean up OLPC code

- add copyright info to _olpc.c
- minor layout fixes
- make Makefile more concise
- silence a warning

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# c8f0eeeb 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: turn off mic bias on OLPCs by default

Always turn off mic bias; the MIC LED should never come on when the
driver is first loaded.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# bf1e5278 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: rename V_REFOUT control to MIC Bias

This drops the AD1888 V_REFOUT control, and replaces it with a MIC Bias
Enable control. It also moves the MIC bias enabling into a separate
function.

Signed-off-by: Andres Salomon <dilinger@debian.org>


# 189d34e7 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: check OLPC's Analog Input status vis GPIO

Checking the HPF register is irrelevant; HPF is secondary to the AI mode.
Instead, check for Analog Input mode via GPIO.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 466ae3055 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: rename OLPC's analog input control && drop AD1888's HPF

Previously, we had two separate controls; there's no need to have AD1888's
HPF control, so drop it if we're on an OLPC machine. Also, as per Arjun's
request, rename OLPC's Analog Input Switch control to "DC Mode Enable".

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d6276b78 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: create function for setting OLPC's Analog Input mode

Clean this stuff up a bit..

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1e2232bc 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: decouple HPF from V_REFOUT in OLPC code

We shouldn't be touching V_REFOUT when we toggle HPF/analog input, so just
drop that code.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b91254e7 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: drop ec_analog_input flag for OLPC stuff

This is no longer necessary, as we're no longer doing indexed i/o commands.

Signed-off-by: Andres Salomon <dilinger@debian.org>


# 3556d184 06-Nov-2008 Andres Salomon <dilinger@queued.net>

ALSA: cs5535audio: invert EAPD for OLPC (newer than B3)

Fix an audible pop described in <http://dev.laptop.org/ticket/977>. Originally
based upon fixes by Mitch Bradley and Chris Ball.

Signed-off-by: Andres Salomon <dilinger@debian.org>


# c8974be5 06-Nov-2008 Jordan Crouse <jordan.crouse@amd.com>

ALSA: cs5535audio: Use OLPC/Geode basic infrastructure

Use basic infrastructure code; geode_gpio* (rather than indexed i/o
EC access), and do an OLPC machine check in olpc_quirk.

[dilinger@debian.org: don't return failure in olpc_quirks if !OLPC]
[dilinger@debian.org: drop the <B2 workarounds; those machines are EOL'd]

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Andres Salomon <dilinger@debian.org>


# 57d4bf6d 06-Nov-2008 Jaya Kumar <jayakumar.lkml@gmail.com>

ALSA: cs5535audio: OLPC analog input support

This is a 2nd cut at adding support for OLPC analog input.

Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Andres Salomon <dilinger@debian.org>