diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-01-10 16:59:35 +0100 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-01-12 13:12:20 +0100 |
| commit | b8fefed73a952a33521ad416fb39683abd87454b (patch) | |
| tree | 3ba450b0ff4258b033f335f1861b08d764dec252 /include | |
| parent | ALSA: rawmidi: Expose the tied device number in info ioctl (diff) | |
| download | linux-b8fefed73a952a33521ad416fb39683abd87454b.tar.gz linux-b8fefed73a952a33521ad416fb39683abd87454b.zip | |
ALSA: rawmidi: Show substream activity in info ioctl
The UMP legacy rawmidi may turn on/off the substream dynamically
depending on the UMP Function Block information. So far, there was no
direct way to know whether the substream is disabled (inactive) or
not; at most one can take a look at the substream name string or try
to open and get -ENODEV.
This patch extends the rawmidi info ioctl to show the current inactive
state of the given substream. When the selected substream is
inactive, info flags field contains the new bit flag
SNDRV_RAWMIDI_INFO_STREAM_INACTIVE.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-3-tiwai@suse.de
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/rawmidi.h | 1 | ||||
| -rw-r--r-- | include/uapi/sound/asound.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 7f1fec786b72..6f2e95298fc7 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h @@ -89,6 +89,7 @@ struct snd_rawmidi_substream { unsigned int framing; /* whether to frame input data */ unsigned int clock_type; /* clock source to use for input framing */ int use_count; /* use counter (for output) */ + bool inactive; /* inactive substream (for UMP legacy) */ size_t bytes; spinlock_t lock; struct snd_rawmidi *rmidi; diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 1fcff031b5e3..9f3b32602ac1 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -728,6 +728,7 @@ enum { #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 #define SNDRV_RAWMIDI_INFO_UMP 0x00000008 +#define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010 #define SNDRV_RAWMIDI_DEVICE_UNKNOWN -1 |
