Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/drivers/mtpav.c

    r598 r679  
     1// SPDX-License-Identifier: GPL-2.0-or-later
    12/*
    23 *      MOTU Midi Timepiece ALSA Main routines
     
    45 *      mail: michael@tweakoz.com
    56 *      Thanks to John Galbraith
    6  *
    7  *      This program is free software; you can redistribute it and/or modify
    8  *      it under the terms of the GNU General Public License as published by
    9  *      the Free Software Foundation; either version 2 of the License, or
    10  *      (at your option) any later version.
    11  *
    12  *      This program is distributed in the hope that it will be useful,
    13  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  *      GNU General Public License for more details.
    16  *
    17  *      You should have received a copy of the GNU General Public License
    18  *      along with this program; if not, write to the Free Software
    19  *      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    20  *
    217 *
    228 *      This driver is for the 'Mark Of The Unicorn' (MOTU)
     
    4026 *      128 'scene' memories, recallable from MIDI program change
    4127 *
    42  *
    4328 * ChangeLog
    4429 * Jun 11 2001  Takashi Iwai <tiwai@suse.de>
     
    4833 *        The three global ports, computer, adat and broadcast ports, are created
    4934 *        always after h/w and remote ports.
    50  *
    5135 */
    5236
    5337#include <linux/init.h>
    5438#include <linux/interrupt.h>
     39#include <linux/module.h>
    5540#include <linux/err.h>
    5641#include <linux/platform_device.h>
    5742#include <linux/ioport.h>
     43#include <linux/io.h>
    5844#include <linux/moduleparam.h>
    5945#include <sound/core.h>
     
    6248#include <linux/delay.h>
    6349
    64 #include <asm/io.h>
    65 
    6650/*
    6751 *      globals
     
    8771module_param(id, charp, 0444);
    8872MODULE_PARM_DESC(id, "ID string for MotuMTPAV MIDI.");
    89 module_param(port, long, 0444);
     73module_param_hw(port, long, ioport, 0444);
    9074MODULE_PARM_DESC(port, "Parallel port # for MotuMTPAV MIDI.");
    91 module_param(irq, int, 0444);
     75module_param_hw(irq, int, irq, 0444);
    9276MODULE_PARM_DESC(irq, "Parallel IRQ # for MotuMTPAV MIDI.");
    9377module_param(hwports, int, 0444);
     
    407391 */
    408392
    409 static void snd_mtpav_output_timer(unsigned long data)
    410 {
    411         unsigned long flags;
    412         struct mtpav *chip = (struct mtpav *)data;
     393static void snd_mtpav_output_timer(struct timer_list *t)
     394{
     395        unsigned long flags;
     396        struct mtpav *chip = from_timer(chip, t, timer);
    413397        int p;
    414398
    415399        spin_lock_irqsave(&chip->spinlock, flags);
    416400        /* reprogram timer */
    417         chip->timer.expires = 1 + jiffies;
    418         add_timer(&chip->timer);
     401        mod_timer(&chip->timer, 1 + jiffies);
    419402        /* process each port */
    420403        for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) {
     
    429412static void snd_mtpav_add_output_timer(struct mtpav *chip)
    430413{
    431         chip->timer.expires = 1 + jiffies;
    432         add_timer(&chip->timer);
     414        mod_timer(&chip->timer, 1 + jiffies);
    433415}
    434416
     
    584566 * get ISA resources
    585567 */
    586 static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard)
     568static int snd_mtpav_get_ISA(struct mtpav *mcard)
    587569{
    588570        if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
     
    591573        }
    592574        mcard->port = port;
    593         if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) {
     575        if (request_irq(irq, snd_mtpav_irqh, 0, "MOTU MTPAV", mcard)) {
    594576                snd_printk(KERN_ERR "MTVAP IRQ %d busy\n", irq);
    595577                return -EBUSY;
     
    603585 */
    604586
    605 static struct snd_rawmidi_ops snd_mtpav_output = {
     587static const struct snd_rawmidi_ops snd_mtpav_output = {
    606588        .open =         snd_mtpav_output_open,
    607589        .close =        snd_mtpav_output_close,
     
    609591};
    610592
    611 static struct snd_rawmidi_ops snd_mtpav_input = {
     593static const struct snd_rawmidi_ops snd_mtpav_input = {
    612594        .open =         snd_mtpav_input_open,
    613595        .close =        snd_mtpav_input_close,
     
    620602 */
    621603
    622 static void __devinit snd_mtpav_set_name(struct mtpav *chip,
    623                                       struct snd_rawmidi_substream *substream)
     604static void snd_mtpav_set_name(struct mtpav *chip,
     605                               struct snd_rawmidi_substream *substream)
    624606{
    625607        if (substream->number >= 0 && substream->number < chip->num_ports)
     
    635617}
    636618
    637 static int __devinit snd_mtpav_get_RAWMIDI(struct mtpav *mcard)
     619static int snd_mtpav_get_RAWMIDI(struct mtpav *mcard)
    638620{
    639621        int rval;
     
    692674/*
    693675 */
    694 static int __devinit snd_mtpav_probe(struct platform_device *dev)
     676static int snd_mtpav_probe(struct platform_device *dev)
    695677{
    696678        struct snd_card *card;
     
    698680        struct mtpav *mtp_card;
    699681
    700         err = snd_card_create(index, id, THIS_MODULE, sizeof(*mtp_card), &card);
     682        err = snd_card_new(&dev->dev, index, id, THIS_MODULE,
     683                           sizeof(*mtp_card), &card);
    701684        if (err < 0)
    702685                return err;
     
    704687        mtp_card = card->private_data;
    705688        spin_lock_init(&mtp_card->spinlock);
    706         init_timer(&mtp_card->timer);
    707689        mtp_card->card = card;
    708690        mtp_card->irq = -1;
     
    710692        mtp_card->inmidistate = 0;
    711693        mtp_card->outmidihwport = 0xffffffff;
    712         init_timer(&mtp_card->timer);
    713         mtp_card->timer.function = snd_mtpav_output_timer;
    714         mtp_card->timer.data = (unsigned long) mtp_card;
     694        timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0);
    715695
    716696        card->private_free = snd_mtpav_free;
     
    733713        snd_mtpav_portscan(mtp_card);
    734714
    735         snd_card_set_dev(card, &dev->dev);
    736715        err = snd_card_register(mtp_card->card);
    737716        if (err < 0)
     
    747726}
    748727
    749 static int __devexit snd_mtpav_remove(struct platform_device *devptr)
     728static int snd_mtpav_remove(struct platform_device *devptr)
    750729{
    751730        snd_card_free(platform_get_drvdata(devptr));
    752         platform_set_drvdata(devptr, NULL);
    753731        return 0;
    754732}
     
    758736static struct platform_driver snd_mtpav_driver = {
    759737        .probe          = snd_mtpav_probe,
    760         .remove         = __devexit_p(snd_mtpav_remove),
     738        .remove         = snd_mtpav_remove,
    761739        .driver         = {
    762                 .name   = SND_MTPAV_DRIVER
     740                .name   = SND_MTPAV_DRIVER,
    763741        },
    764742};
Note: See TracChangeset for help on using the changeset viewer.