Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (5 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/include/sound/rawmidi.h

    r598 r679  
     1/* SPDX-License-Identifier: GPL-2.0-or-later */
    12#ifndef __SOUND_RAWMIDI_H
    23#define __SOUND_RAWMIDI_H
     
    56 *  Abstract layer for MIDI v1.0 stream
    67 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
    7  *
    8  *
    9  *   This program is free software; you can redistribute it and/or modify
    10  *   it under the terms of the GNU General Public License as published by
    11  *   the Free Software Foundation; either version 2 of the License, or
    12  *   (at your option) any later version.
    13  *
    14  *   This program is distributed in the hope that it will be useful,
    15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17  *   GNU General Public License for more details.
    18  *
    19  *   You should have received a copy of the GNU General Public License
    20  *   along with this program; if not, write to the Free Software
    21  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    22  *
    238 */
    249
     
    2813#include <linux/wait.h>
    2914#include <linux/mutex.h>
     15#include <linux/workqueue.h>
     16#include <linux/device.h>
    3017
    31 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
    32 #include "seq_device.h"
     18#if IS_ENABLED(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER)
     19#include <sound/seq_device.h>
    3320#endif
    3421
     
    6451
    6552struct snd_rawmidi_runtime {
     53        struct snd_rawmidi_substream *substream;
    6654        unsigned int drain: 1,  /* drain stage */
    6755                     oss: 1;    /* OSS compatible mode */
     
    7462        size_t avail;           /* max used buffer for wakeup */
    7563        size_t xruns;           /* over/underruns counter */
     64        int buffer_ref;         /* buffer reference count */
    7665        /* misc */
    7766        spinlock_t lock;
     
    8069        void (*event)(struct snd_rawmidi_substream *substream);
    8170        /* defers calls to event [input] or ops->trigger [output] */
    82         struct tasklet_struct tasklet;
     71        struct work_struct event_work;
    8372        /* private data */
    8473        void *private_data;
     
    9079        int stream;                     /* direction */
    9180        int number;                     /* substream number */
    92         unsigned int opened: 1,         /* open flag */
    93                      append: 1,         /* append flag (merge more streams) */
    94                      active_sensing: 1; /* send active sensing when close */
     81        bool opened;                    /* open flag */
     82        bool append;                    /* append flag (merge more streams) */
     83        bool active_sensing;            /* send active sensing when close */
    9584        int use_count;                  /* use counter (for output) */
    9685        size_t bytes;
     
    10190        struct pid *pid;
    10291        /* hardware layer */
    103         struct snd_rawmidi_ops *ops;
     92        const struct snd_rawmidi_ops *ops;
    10493};
    10594
     
    128117#endif
    129118
    130         struct snd_rawmidi_global_ops *ops;
     119        const struct snd_rawmidi_global_ops *ops;
    131120
    132121        struct snd_rawmidi_str streams[2];
     
    138127        wait_queue_head_t open_wait;
    139128
    140         struct snd_info_entry *dev;
     129        struct device dev;
     130
    141131        struct snd_info_entry *proc_entry;
    142132
    143 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
     133#if IS_ENABLED(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER)
    144134        struct snd_seq_device *seq_dev;
    145135#endif
     
    152142                    struct snd_rawmidi **rmidi);
    153143void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
    154                          struct snd_rawmidi_ops *ops);
     144                         const struct snd_rawmidi_ops *ops);
    155145
    156146/* callbacks */
    157147
    158 void snd_rawmidi_receive_reset(struct snd_rawmidi_substream *substream);
    159148int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
    160149                        const unsigned char *buffer, int count);
    161 void snd_rawmidi_transmit_reset(struct snd_rawmidi_substream *substream);
    162150int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
    163151int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
     
    166154int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
    167155                         unsigned char *buffer, int count);
     156int __snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
     157                              unsigned char *buffer, int count);
     158int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream,
     159                               int count);
     160int snd_rawmidi_proceed(struct snd_rawmidi_substream *substream);
    168161
    169162/* main midi functions */
Note: See TracChangeset for help on using the changeset viewer.