History log of /linux-master/sound/drivers/serial-u16550.c
Revision Date Author Comments
# 60d03de8 15-Jul-2021 Takashi Iwai <tiwai@suse.de>

ALSA: serial-u16550: Allocate resources with device-managed APIs

This patch converts the resource management in serial u16550 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.

This should give no user-visible functional changes.

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


# d0ad13ef 08-Jun-2021 Takashi Iwai <tiwai@suse.de>

ALSA: serial: Fix assignment in if condition

A few ALSA serial drivers contain assignments in if condition, which
is a bad coding style that may confuse readers and occasionally lead
to bugs.

This patch is merely for coding-style fixes, no functional changes.

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


# 6417f031 16-Mar-2021 Leon Romanovsky <leon@kernel.org>

module: remove never implemented MODULE_SUPPORTED_DEVICE

MODULE_SUPPORTED_DEVICE was added in pre-git era and never was
implemented. We can safely remove it, because the kernel has grown
to have many more reliable mechanisms to determine if device is
supported or not.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


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

ALSA: serial-u16550: More constification

Apply const prefix to the string array.

Just for minor optimization and no functional changes.

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


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

ALSA: drivers: Constify snd_device_ops definitions

Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-6-tiwai@suse.de
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>


# bc47ba90 24-Oct-2017 Kees Cook <keescook@chromium.org>

ALSA: drivers: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b11ce420 04-Apr-2017 David Howells <dhowells@redhat.com>

Annotate hardware config module parameters in sound/drivers/

When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image. Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.

To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify. The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.

Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.

This patch annotates drivers in sound/drivers/.

Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
cc: Jaroslav Kysela <perex@perex.cz>
cc: alsa-devel@alsa-project.org


# c36f486d 05-Jan-2017 Takashi Iwai <tiwai@suse.de>

ALSA: drivers: Constify snd_rawmidi_ops

Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
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>


# d80d05fc 19-Jan-2015 Takashi Iwai <tiwai@suse.de>

ALSA: serial-u16550: Use setup_timer() and mod_timer()

No functional change, refactoring with the standard helpers.

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


# 5d5638af 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

ALSA: drivers: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 5872f3f6 28-Jan-2014 Takashi Iwai <tiwai@suse.de>

ALSA: drivers: Convert to snd_card_new() with a device pointer

Also remove superfluous snd_card_set_dev() calls.

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


# 45837cb2 20-May-2013 Sachin Kamat <sachin.kamat@linaro.org>

ALSA: serial-u16550: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: drivers: 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>


# 8bf01d8a 02-Jul-2012 Takashi Iwai <tiwai@suse.de>

ALSA: Add missing .owner=THIS_MODULE to platform_driver definitions

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


# a67ff6a5 14-Dec-2011 Rusty Russell <rusty@rustcorp.com.au>

ALSA: module_param: make bool parameters really bool

module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 65a77217 15-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sound: fix drivers needing module.h not moduleparam.h

The implicit presence of module.h lured several users into
incorrectly thinking that they only needed/used modparam.h
but once we clean up the module.h presence, these will show
up as build failures, so fix 'em now.

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


# 88e24c3a 22-Sep-2011 Yong Zhang <yong.zhang0@gmail.com>

sound: irq: Remove IRQF_DISABLED

Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# bd0185ce 05-May-2009 Clemens Ladisch <clemens@ladisch.de>

sound: serial-u16550: fix buffer overflow

Remove most of the serial port parameters from the card longname string
because it was way too long and overflowed into the mixername string.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 45203832 05-Feb-2009 Takashi Iwai <tiwai@suse.de>

ALSA: Add missing KERN_* prefix to printk in sound/drivers

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


# bd7dd77c 28-Dec-2008 Takashi Iwai <tiwai@alsa3.local>

ALSA: Convert to snd_card_create() in other sound/*

Convert from snd_card_new() to the new snd_card_create() function
in other sound subdirectories.

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>


# f11b7992 07-Jan-2008 Julia Lawall <julia@diku.dk>

[ALSA] sound: Use time_before, time_before_eq, etc.

The functions time_before, time_before_eq, time_after, and time_after_eq
are more robust for comparing jiffies against other values.
A simplified version of the semantic patch making this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@ change_compare_np @
expression E;
@@
(
- jiffies <= E
+ time_before_eq(jiffies,E)
|
- jiffies >= E
+ time_after_eq(jiffies,E)
|
- jiffies < E
+ time_before(jiffies,E)
|
- jiffies > E
+ time_after(jiffies,E)
)
@ include depends on change_compare_np @
@@
#include <linux/jiffies.h>
@ no_include depends on !include && change_compare_np @
@@
#include <linux/...>
+ #include <linux/jiffies.h>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 561de31a 18-Dec-2007 Joe Perches <joe@perches.com>

[ALSA] sound/: Spelling fixes


Signed-off-by: Joe Perches <joe@perches.com>
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>


# bdec0c72 24-Jun-2007 Randy Dunlap <randy.dunlap@oracle.com>

[ALSA] fix section mismatch

Fix shared init/exit function attributes:
WARNING: sound/built-in.o(.exit.text+0x4a1): Section mismatch: reference to .init.text: (between 'alsa_card_virmidi_exit' and 'alsa_card_serial_exit')
WARNING: sound/built-in.o(.exit.text+0x4c1): Section mismatch: reference to .init.text: (between 'alsa_card_serial_exit' and 'ac97_bus_exit')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 788c6043 13-Feb-2007 Prarit Bhargava <prarit@redhat.com>

[ALSA] Fix __devinit and __devexit issues with sound drivers

Fix __devinit and __devexit issues with sound drivers.
Resolves MODPOST warnings similar to:
WARNING: sound/drivers/snd-dummy.o - Section mismatch: reference to .init.text:snd_dummy_probe from .data.rel.local between 'snd_dummy_driver' (at offset 0x0) and 'snd_dummy_controls'
WARNING: sound/drivers/snd-mtpav.o - Section mismatch: reference to .init.text:snd_mtpav_probe from .data.rel.local between 'snd_mtpav_driver' (at offset 0x0) and 'snd_mtpav_input'
WARNING: sound/drivers/snd-virmidi.o - Section mismatch: reference to .init.text:snd_virmidi_probe from .data.rel.local after 'snd_virmidi_driver' (at offset 0x0)

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 0b830bac 24-Nov-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Clean up serial-u16500.c

Remove uesless typedefs and clean up the code a bit to follow
the standard coding style.

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


# 7d12e780 05-Oct-2006 David Howells <dhowells@redhat.com>

IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)


# 65ca68b3 01-Jul-2006 Thomas Gleixner <tglx@linutronix.de>

[PATCH] irq-flags: sound: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 7152447d 12-Apr-2006 Rene Herman <rene.herman@keyaccess.nl>

[ALSA] unregister platform device again if probe was unsuccessful

This second one unregisters the platform device again when the probe is
unsuccesful for sound/drivers, sound/arm/sa11xx-uda1341.c and
sound/ppc/powermac.c. This gets them all.

Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# a182ee98 12-Apr-2006 Rene Herman <rene.herman@keyaccess.nl>

[ALSA] continue on IS_ERR from platform device registration

I previously only concerned myself with sound/isa. When I now checked
for more platform_device_register_simple() usages in ALSA I found a
couple more drivers that needed the same patches as already submitted
for all the ISA drivers.
This first one is the continue-on-iserr patch for sound/drivers. This
gets them all.

Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 202728d7 14-Mar-2006 Adrian Bunk <bunk@stusta.de>

[ALSA] fix some memory leaks

Modules: Generic drivers,ES18xx driver,CS46xx driver

This patch fixes two memory leaks spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8278ca8f 20-Feb-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Fix check of enable module option

Fix the check of enable module option in probe of platform_device drivers.
It shouldn't break the loop but just ignore if enable[i] is false.

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


# 68b8bc05 23-Jan-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] serial-uart16550 - Fix a compile warning

Modules: Generic drivers

Fix a gcc-4.1 compile warning regarding uninitialized variables.

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


# f7a9275d 07-Dec-2005 Clemens Ladisch <clemens@ladisch.de>

[ALSA] unregister platform devices

Call platform_device_unregister() for all platform devices that we've
registered.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 9caf6b59 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] serial-u16550 - Use platform_device

Modules: Generic drivers

Rewrite the probe/remove code using platform_device.

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


# 4a4d2cfd 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove xxx_t typedefs: Generic drivers

Modules: Generic drivers

Remove xxx_t typedefs from the generic drivers
(dummy, mtpav, serial-u16550 and virmidi).

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


# b1d5776d 10-Oct-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove vmalloc wrapper, kfree_nocheck()

- Remove vmalloc wrapper
- Add release_and_free_resource() to remove kfree_nocheck() from each driver
and simplify the code

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


# 561b220a 09-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Replace with kzalloc() - others

Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3
OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers
AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver
SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth
USB generic driver,USB USX2Y
Replace kcalloc(1,..) with kzalloc().

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


# 16dab54b 05-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Add snd_card_set_generic_dev() call

ARM,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,MIPS
MIPS AU1x00 driver,PPC,PPC PowerMac driver,SPARC,SPARC AMD7930 driver
SPARC cs4231 driver,SPARC DBRI driver
- Added snd_card_set_generic_dev() call.
- Added SND_GENERIC_DRIVER to Kconfig.
- Clean up the error path in probe if necessary.

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


# 77933d72 27-Jul-2005 Jesper Juhl <juhl@dif.dk>

[PATCH] clean up inline static vs static inline

`gcc -W' likes to complain if the static keyword is not at the beginning of
the declaration. This patch fixes all remaining occurrences of "inline
static" up with "static inline" in the entire kernel tree (140 occurrences in
47 files).

While making this change I came across a few lines with trailing whitespace
that I also fixed up, I have also added or removed a blank line or two here
and there, but there are no functional changes in the patch.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


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