mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
This commit is contained in:
commit
51f57fb784
@ -293,6 +293,17 @@ Rawmidi API Extensions
|
||||
status 0x05). When UMP core receives such a message, it updates the
|
||||
UMP EP info and the corresponding sequencer clients as well.
|
||||
|
||||
* The legacy rawmidi device number is found in the new `tied_device`
|
||||
field of the rawmidi info.
|
||||
On the other hand, the UMP rawmidi device number is found in
|
||||
`tied_device` field of the legacy rawmidi info, too.
|
||||
|
||||
* Each substream of the legacy rawmidi may be enabled / disabled
|
||||
dynamically depending on the UMP FB state.
|
||||
When the selected substream is inactive, it's indicated by the bit
|
||||
0x10 (`SNDRV_RAWMIDI_INFO_STREAM_INACTIVE`) in the `flags` field of
|
||||
the legacy rawmidi info.
|
||||
|
||||
|
||||
Control API Extensions
|
||||
======================
|
||||
@ -377,6 +388,13 @@ Sequencer API Extensions
|
||||
announcement to the ALSA sequencer system port, similarly like the
|
||||
normal port change notification.
|
||||
|
||||
* There are two extended event types for notifying the UMP Endpoint and
|
||||
Function Block changes via the system announcement port:
|
||||
type 68 (`SNDRV_SEQ_EVENT_UMP_EP_CHANGE`) and type 69
|
||||
(`SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE`). They take the new type,
|
||||
`snd_seq_ev_ump_notify` in the payload, indicating the client number
|
||||
and the FB number that are changed.
|
||||
|
||||
|
||||
MIDI2 USB Gadget Function Driver
|
||||
================================
|
||||
|
@ -2,8 +2,6 @@
|
||||
#ifndef __SOUND_HDAUDIO_EXT_H
|
||||
#define __SOUND_HDAUDIO_EXT_H
|
||||
|
||||
#include <linux/io-64-nonatomic-lo-hi.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <sound/hdaudio.h>
|
||||
|
||||
int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
|
||||
@ -119,49 +117,6 @@ int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *hlink)
|
||||
|
||||
void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable);
|
||||
|
||||
#define snd_hdac_adsp_writeb(chip, reg, value) \
|
||||
snd_hdac_reg_writeb(chip, (chip)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readb(chip, reg) \
|
||||
snd_hdac_reg_readb(chip, (chip)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writew(chip, reg, value) \
|
||||
snd_hdac_reg_writew(chip, (chip)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readw(chip, reg) \
|
||||
snd_hdac_reg_readw(chip, (chip)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writel(chip, reg, value) \
|
||||
snd_hdac_reg_writel(chip, (chip)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readl(chip, reg) \
|
||||
snd_hdac_reg_readl(chip, (chip)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writeq(chip, reg, value) \
|
||||
snd_hdac_reg_writeq(chip, (chip)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readq(chip, reg) \
|
||||
snd_hdac_reg_readq(chip, (chip)->dsp_ba + (reg))
|
||||
|
||||
#define snd_hdac_adsp_updateb(chip, reg, mask, val) \
|
||||
snd_hdac_adsp_writeb(chip, reg, \
|
||||
(snd_hdac_adsp_readb(chip, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updatew(chip, reg, mask, val) \
|
||||
snd_hdac_adsp_writew(chip, reg, \
|
||||
(snd_hdac_adsp_readw(chip, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updatel(chip, reg, mask, val) \
|
||||
snd_hdac_adsp_writel(chip, reg, \
|
||||
(snd_hdac_adsp_readl(chip, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updateq(chip, reg, mask, val) \
|
||||
snd_hdac_adsp_writeq(chip, reg, \
|
||||
(snd_hdac_adsp_readq(chip, reg) & ~(mask)) | (val))
|
||||
|
||||
#define snd_hdac_adsp_readb_poll(chip, reg, val, cond, delay_us, timeout_us) \
|
||||
readb_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readw_poll(chip, reg, val, cond, delay_us, timeout_us) \
|
||||
readw_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readl_poll(chip, reg, val, cond, delay_us, timeout_us) \
|
||||
readl_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readq_poll(chip, reg, val, cond, delay_us, timeout_us) \
|
||||
readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
|
||||
struct hdac_ext_device;
|
||||
|
||||
/* ops common to all codec drivers */
|
||||
|
@ -1532,9 +1532,10 @@ static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format)
|
||||
dev_dbg((pcm)->card->dev, fmt, ##args)
|
||||
|
||||
/* helpers for copying between iov_iter and iomem */
|
||||
int copy_to_iter_fromio(struct iov_iter *itert, const void __iomem *src,
|
||||
size_t count);
|
||||
int copy_from_iter_toio(void __iomem *dst, struct iov_iter *iter, size_t count);
|
||||
size_t copy_to_iter_fromio(const void __iomem *src, size_t bytes,
|
||||
struct iov_iter *iter) __must_check;
|
||||
size_t copy_from_iter_toio(void __iomem *dst, size_t bytes,
|
||||
struct iov_iter *iter) __must_check;
|
||||
|
||||
struct snd_pcm_status64 {
|
||||
snd_pcm_state_t state; /* stream state */
|
||||
|
@ -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;
|
||||
@ -118,6 +119,7 @@ struct snd_rawmidi {
|
||||
struct list_head list;
|
||||
unsigned int device; /* device number */
|
||||
unsigned int info_flags; /* SNDRV_RAWMIDI_INFO_XXXX */
|
||||
unsigned int tied_device;
|
||||
char id[64];
|
||||
char name[80];
|
||||
|
||||
@ -189,4 +191,13 @@ long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
|
||||
long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
|
||||
const unsigned char *buf, long count);
|
||||
|
||||
/* set up the tied devices */
|
||||
static inline void snd_rawmidi_tie_devices(struct snd_rawmidi *r1,
|
||||
struct snd_rawmidi *r2)
|
||||
{
|
||||
/* tied_device field keeps the device+1 (so that 0 being unknown) */
|
||||
r1->tied_device = r2->device + 1;
|
||||
r2->tied_device = r1->device + 1;
|
||||
}
|
||||
|
||||
#endif /* __SOUND_RAWMIDI_H */
|
||||
|
@ -83,6 +83,7 @@ struct snd_ump_ops {
|
||||
struct snd_seq_ump_ops {
|
||||
void (*input_receive)(struct snd_ump_endpoint *ump,
|
||||
const u32 *data, int words);
|
||||
int (*notify_ep_change)(struct snd_ump_endpoint *ump);
|
||||
int (*notify_fb_change)(struct snd_ump_endpoint *ump,
|
||||
struct snd_ump_block *fb);
|
||||
int (*switch_protocol)(struct snd_ump_endpoint *ump);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <sound/asound.h>
|
||||
|
||||
/** version of the sequencer */
|
||||
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
|
||||
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 5)
|
||||
|
||||
/**
|
||||
* definition of sequencer event types
|
||||
@ -92,6 +92,9 @@
|
||||
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
|
||||
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
|
||||
|
||||
#define SNDRV_SEQ_EVENT_UMP_EP_CHANGE 68 /* UMP EP info has changed */
|
||||
#define SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE 69 /* UMP block info has changed */
|
||||
|
||||
/* 70-89: synthesizer events - obsoleted */
|
||||
|
||||
/** user-defined events with fixed length
|
||||
@ -253,6 +256,12 @@ struct snd_seq_ev_quote {
|
||||
struct snd_seq_event *event; /* quoted event */
|
||||
} __packed;
|
||||
|
||||
/* UMP info change notify */
|
||||
struct snd_seq_ev_ump_notify {
|
||||
unsigned char client; /**< Client number */
|
||||
unsigned char block; /**< Block number (optional) */
|
||||
};
|
||||
|
||||
union snd_seq_event_data { /* event data... */
|
||||
struct snd_seq_ev_note note;
|
||||
struct snd_seq_ev_ctrl control;
|
||||
@ -265,6 +274,7 @@ union snd_seq_event_data { /* event data... */
|
||||
struct snd_seq_connect connect;
|
||||
struct snd_seq_result result;
|
||||
struct snd_seq_ev_quote quote;
|
||||
struct snd_seq_ev_ump_notify ump_notify;
|
||||
};
|
||||
|
||||
/* sequencer event */
|
||||
|
@ -716,7 +716,7 @@ enum {
|
||||
* Raw MIDI section - /dev/snd/midi??
|
||||
*/
|
||||
|
||||
#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
|
||||
#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
|
||||
|
||||
enum {
|
||||
SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
|
||||
@ -728,6 +728,9 @@ 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 0
|
||||
|
||||
struct snd_rawmidi_info {
|
||||
unsigned int device; /* RO/WR (control): device number */
|
||||
@ -740,7 +743,8 @@ struct snd_rawmidi_info {
|
||||
unsigned char subname[32]; /* name of active or selected subdevice */
|
||||
unsigned int subdevices_count;
|
||||
unsigned int subdevices_avail;
|
||||
unsigned char reserved[64]; /* reserved for future use */
|
||||
int tied_device; /* R: tied rawmidi device (UMP/legacy) */
|
||||
unsigned char reserved[60]; /* reserved for future use */
|
||||
};
|
||||
|
||||
#define SNDRV_RAWMIDI_MODE_FRAMING_MASK (7<<0)
|
||||
|
@ -27,38 +27,43 @@ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size
|
||||
|
||||
if (import_ubuf(ITER_DEST, dst, count, &iter))
|
||||
return -EFAULT;
|
||||
return copy_to_iter_fromio(&iter, (const void __iomem *)src, count);
|
||||
if (copy_to_iter_fromio((const void __iomem *)src, count, &iter) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(copy_to_user_fromio);
|
||||
|
||||
/**
|
||||
* copy_to_iter_fromio - copy data from mmio-space to iov_iter
|
||||
* @dst: the destination iov_iter
|
||||
* @src: the source pointer on mmio
|
||||
* @count: the data size to copy in bytes
|
||||
* @dst: the destination iov_iter
|
||||
*
|
||||
* Copies the data from mmio-space to iov_iter.
|
||||
*
|
||||
* Return: Zero if successful, or non-zero on failure.
|
||||
* Return: number of bytes to be copied
|
||||
*/
|
||||
int copy_to_iter_fromio(struct iov_iter *dst, const void __iomem *src,
|
||||
size_t count)
|
||||
size_t copy_to_iter_fromio(const void __iomem *src, size_t count,
|
||||
struct iov_iter *dst)
|
||||
{
|
||||
#if defined(__i386__) || defined(CONFIG_SPARC32)
|
||||
return copy_to_iter((const void __force *)src, count, dst) == count ? 0 : -EFAULT;
|
||||
return copy_to_iter((const void __force *)src, count, dst);
|
||||
#else
|
||||
char buf[256];
|
||||
size_t res = 0;
|
||||
|
||||
while (count) {
|
||||
size_t c = count;
|
||||
if (c > sizeof(buf))
|
||||
c = sizeof(buf);
|
||||
memcpy_fromio(buf, (void __iomem *)src, c);
|
||||
if (copy_to_iter(buf, c, dst) != c)
|
||||
return -EFAULT;
|
||||
return res;
|
||||
count -= c;
|
||||
src += c;
|
||||
res += c;
|
||||
}
|
||||
return 0;
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(copy_to_iter_fromio);
|
||||
@ -79,37 +84,43 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size
|
||||
|
||||
if (import_ubuf(ITER_SOURCE, (void __user *)src, count, &iter))
|
||||
return -EFAULT;
|
||||
return copy_from_iter_toio((void __iomem *)dst, &iter, count);
|
||||
if (copy_from_iter_toio((void __iomem *)dst, count, &iter) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(copy_from_user_toio);
|
||||
|
||||
/**
|
||||
* copy_from_iter_toio - copy data from iov_iter to mmio-space
|
||||
* @dst: the destination pointer on mmio-space
|
||||
* @src: the source iov_iter
|
||||
* @count: the data size to copy in bytes
|
||||
* @src: the source iov_iter
|
||||
*
|
||||
* Copies the data from iov_iter to mmio-space.
|
||||
*
|
||||
* Return: Zero if successful, or non-zero on failure.
|
||||
* Return: number of bytes to be copied
|
||||
*/
|
||||
int copy_from_iter_toio(void __iomem *dst, struct iov_iter *src, size_t count)
|
||||
size_t copy_from_iter_toio(void __iomem *dst, size_t count,
|
||||
struct iov_iter *src)
|
||||
{
|
||||
#if defined(__i386__) || defined(CONFIG_SPARC32)
|
||||
return copy_from_iter((void __force *)dst, count, src) == count ? 0 : -EFAULT;
|
||||
return copy_from_iter((void __force *)dst, count, src);
|
||||
#else
|
||||
char buf[256];
|
||||
size_t res = 0;
|
||||
|
||||
while (count) {
|
||||
size_t c = count;
|
||||
if (c > sizeof(buf))
|
||||
c = sizeof(buf);
|
||||
if (copy_from_iter(buf, c, src) != c)
|
||||
return -EFAULT;
|
||||
return res;
|
||||
memcpy_toio(dst, buf, c);
|
||||
count -= c;
|
||||
dst += c;
|
||||
res += c;
|
||||
}
|
||||
return 0;
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(copy_from_iter_toio);
|
||||
|
@ -629,12 +629,15 @@ static int snd_rawmidi_info(struct snd_rawmidi_substream *substream,
|
||||
info->subdevice = substream->number;
|
||||
info->stream = substream->stream;
|
||||
info->flags = rmidi->info_flags;
|
||||
if (substream->inactive)
|
||||
info->flags |= SNDRV_RAWMIDI_INFO_STREAM_INACTIVE;
|
||||
strcpy(info->id, rmidi->id);
|
||||
strcpy(info->name, rmidi->name);
|
||||
strcpy(info->subname, substream->name);
|
||||
info->subdevices_count = substream->pstr->substream_count;
|
||||
info->subdevices_avail = (substream->pstr->substream_count -
|
||||
substream->pstr->substream_opened);
|
||||
info->tied_device = rmidi->tied_device;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ config SND_SEQ_VIRMIDI
|
||||
|
||||
config SND_SEQ_UMP
|
||||
bool "Support for UMP events"
|
||||
default y if SND_SEQ_UMP_CLIENT
|
||||
default SND_UMP
|
||||
help
|
||||
Say Y here to enable the support for handling UMP (Universal MIDI
|
||||
Packet) events via ALSA sequencer infrastructure, which is an
|
||||
@ -71,6 +71,6 @@ config SND_SEQ_UMP
|
||||
among legacy and UMP clients.
|
||||
|
||||
config SND_SEQ_UMP_CLIENT
|
||||
def_tristate SND_UMP
|
||||
def_tristate SND_UMP && SND_SEQ_UMP
|
||||
|
||||
endif # SND_SEQUENCER
|
||||
|
@ -55,7 +55,6 @@ struct seq_oss_chinfo {
|
||||
struct seq_oss_synthinfo {
|
||||
struct snd_seq_oss_arg arg;
|
||||
struct seq_oss_chinfo *ch;
|
||||
struct seq_oss_synth_sysex *sysex;
|
||||
int nr_voices;
|
||||
int opened;
|
||||
int is_midi;
|
||||
@ -157,8 +156,4 @@ snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event *ev,
|
||||
ev->dest.port = dest_port;
|
||||
}
|
||||
|
||||
|
||||
/* misc. functions for proc interface */
|
||||
char *enabled_str(bool b);
|
||||
|
||||
#endif /* __SEQ_OSS_DEVICE_H */
|
||||
|
@ -111,7 +111,7 @@ snd_seq_oss_create_client(void)
|
||||
|
||||
|
||||
/*
|
||||
* receive annoucement from system port, and check the midi device
|
||||
* receive announcement from system port, and check the midi device
|
||||
*/
|
||||
static int
|
||||
receive_announce(struct snd_seq_event *ev, int direct, void *private, int atomic, int hop)
|
||||
@ -449,12 +449,6 @@ snd_seq_oss_reset(struct seq_oss_devinfo *dp)
|
||||
/*
|
||||
* misc. functions for proc interface
|
||||
*/
|
||||
char *
|
||||
enabled_str(bool b)
|
||||
{
|
||||
return b ? "enabled" : "disabled";
|
||||
}
|
||||
|
||||
static const char *
|
||||
filemode_str(int val)
|
||||
{
|
||||
|
@ -26,13 +26,6 @@
|
||||
* definition of synth info records
|
||||
*/
|
||||
|
||||
/* sysex buffer */
|
||||
struct seq_oss_synth_sysex {
|
||||
int len;
|
||||
int skip;
|
||||
unsigned char buf[MAX_SYSEX_BUFLEN];
|
||||
};
|
||||
|
||||
/* synth info */
|
||||
struct seq_oss_synth {
|
||||
int seq_device;
|
||||
@ -66,7 +59,6 @@ static struct seq_oss_synth midi_synth_dev = {
|
||||
};
|
||||
|
||||
static DEFINE_SPINLOCK(register_lock);
|
||||
static DEFINE_MUTEX(sysex_mutex);
|
||||
|
||||
/*
|
||||
* prototypes
|
||||
@ -319,8 +311,6 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp)
|
||||
}
|
||||
snd_use_lock_free(&rec->use_lock);
|
||||
}
|
||||
kfree(info->sysex);
|
||||
info->sysex = NULL;
|
||||
kfree(info->ch);
|
||||
info->ch = NULL;
|
||||
}
|
||||
@ -396,8 +386,6 @@ snd_seq_oss_synth_reset(struct seq_oss_devinfo *dp, int dev)
|
||||
info = get_synthinfo_nospec(dp, dev);
|
||||
if (!info || !info->opened)
|
||||
return;
|
||||
if (info->sysex)
|
||||
info->sysex->len = 0; /* reset sysex */
|
||||
reset_channels(info);
|
||||
if (info->is_midi) {
|
||||
if (midi_synth_dev.opened <= 0)
|
||||
@ -409,8 +397,6 @@ snd_seq_oss_synth_reset(struct seq_oss_devinfo *dp, int dev)
|
||||
dp->file_mode) < 0) {
|
||||
midi_synth_dev.opened--;
|
||||
info->opened = 0;
|
||||
kfree(info->sysex);
|
||||
info->sysex = NULL;
|
||||
kfree(info->ch);
|
||||
info->ch = NULL;
|
||||
}
|
||||
@ -483,64 +469,26 @@ snd_seq_oss_synth_info(struct seq_oss_devinfo *dp, int dev)
|
||||
|
||||
/*
|
||||
* receive OSS 6 byte sysex packet:
|
||||
* the full sysex message will be sent if it reaches to the end of data
|
||||
* (0xff).
|
||||
* the event is filled and prepared for sending immediately
|
||||
* (i.e. sysex messages are fragmented)
|
||||
*/
|
||||
int
|
||||
snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev, unsigned char *buf, struct snd_seq_event *ev)
|
||||
{
|
||||
int i, send;
|
||||
unsigned char *dest;
|
||||
struct seq_oss_synth_sysex *sysex;
|
||||
struct seq_oss_synthinfo *info;
|
||||
unsigned char *p;
|
||||
int len = 6;
|
||||
|
||||
info = snd_seq_oss_synth_info(dp, dev);
|
||||
if (!info)
|
||||
return -ENXIO;
|
||||
p = memchr(buf, 0xff, 6);
|
||||
if (p)
|
||||
len = p - buf + 1;
|
||||
|
||||
guard(mutex)(&sysex_mutex);
|
||||
sysex = info->sysex;
|
||||
if (sysex == NULL) {
|
||||
sysex = kzalloc(sizeof(*sysex), GFP_KERNEL);
|
||||
if (sysex == NULL)
|
||||
return -ENOMEM;
|
||||
info->sysex = sysex;
|
||||
}
|
||||
|
||||
send = 0;
|
||||
dest = sysex->buf + sysex->len;
|
||||
/* copy 6 byte packet to the buffer */
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (buf[i] == 0xff) {
|
||||
send = 1;
|
||||
break;
|
||||
}
|
||||
dest[i] = buf[i];
|
||||
sysex->len++;
|
||||
if (sysex->len >= MAX_SYSEX_BUFLEN) {
|
||||
sysex->len = 0;
|
||||
sysex->skip = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sysex->len && send) {
|
||||
if (sysex->skip) {
|
||||
sysex->skip = 0;
|
||||
sysex->len = 0;
|
||||
return -EINVAL; /* skip */
|
||||
}
|
||||
/* copy the data to event record and send it */
|
||||
ev->flags = SNDRV_SEQ_EVENT_LENGTH_VARIABLE;
|
||||
if (snd_seq_oss_synth_addr(dp, dev, ev))
|
||||
return -EINVAL;
|
||||
ev->data.ext.len = sysex->len;
|
||||
ev->data.ext.ptr = sysex->buf;
|
||||
sysex->len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -EINVAL; /* skip */
|
||||
/* copy the data to event record and send it */
|
||||
if (snd_seq_oss_synth_addr(dp, dev, ev))
|
||||
return -EINVAL;
|
||||
ev->flags = SNDRV_SEQ_EVENT_LENGTH_VARIABLE;
|
||||
ev->data.ext.len = len;
|
||||
ev->data.ext.ptr = buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -660,8 +608,8 @@ snd_seq_oss_synth_info_read(struct snd_info_buffer *buf)
|
||||
rec->synth_type, rec->synth_subtype,
|
||||
rec->nr_voices);
|
||||
snd_iprintf(buf, " capabilities : ioctl %s / load_patch %s\n",
|
||||
enabled_str((long)rec->oper.ioctl),
|
||||
enabled_str((long)rec->oper.load_patch));
|
||||
str_enabled_disabled((long)rec->oper.ioctl),
|
||||
str_enabled_disabled((long)rec->oper.load_patch));
|
||||
snd_use_lock_free(&rec->use_lock);
|
||||
}
|
||||
}
|
||||
|
@ -1296,6 +1296,10 @@ static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
|
||||
client->midi_version = client_info->midi_version;
|
||||
memcpy(client->event_filter, client_info->event_filter, 32);
|
||||
client->group_filter = client_info->group_filter;
|
||||
|
||||
/* notify the change */
|
||||
snd_seq_system_client_ev_client_change(client->number);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1419,6 +1423,9 @@ static int snd_seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg)
|
||||
if (port) {
|
||||
snd_seq_set_port_info(port, info);
|
||||
snd_seq_port_unlock(port);
|
||||
/* notify the change */
|
||||
snd_seq_system_client_ev_port_change(info->addr.client,
|
||||
info->addr.port);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1475,7 +1482,7 @@ int snd_seq_client_notify_subscription(int client, int port,
|
||||
event.data.connect.dest = info->dest;
|
||||
event.data.connect.sender = info->sender;
|
||||
|
||||
return snd_seq_system_notify(client, port, &event); /* non-atomic */
|
||||
return snd_seq_system_notify(client, port, &event, false); /* non-atomic */
|
||||
}
|
||||
|
||||
|
||||
@ -2229,6 +2236,16 @@ static int snd_seq_ioctl_client_ump_info(struct snd_seq_client *caller,
|
||||
error:
|
||||
mutex_unlock(&cptr->ioctl_mutex);
|
||||
snd_seq_client_unlock(cptr);
|
||||
if (!err && cmd == SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO) {
|
||||
if (type == SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT)
|
||||
snd_seq_system_ump_notify(client, 0,
|
||||
SNDRV_SEQ_EVENT_UMP_EP_CHANGE,
|
||||
false);
|
||||
else
|
||||
snd_seq_system_ump_notify(client, type - 1,
|
||||
SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE,
|
||||
false);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
@ -49,12 +49,14 @@ static int sysclient = -1;
|
||||
/* port id numbers for this client */
|
||||
static int announce_port = -1;
|
||||
|
||||
/* number of subscriptions to announce port */
|
||||
static int announce_subscribed;
|
||||
|
||||
|
||||
/* fill standard header data, source port & channel are filled in */
|
||||
static int setheader(struct snd_seq_event * ev, int client, int port)
|
||||
{
|
||||
if (announce_port < 0)
|
||||
if (announce_port < 0 || !announce_subscribed)
|
||||
return -ENODEV;
|
||||
|
||||
memset(ev, 0, sizeof(struct snd_seq_event));
|
||||
@ -76,26 +78,27 @@ static int setheader(struct snd_seq_event * ev, int client, int port)
|
||||
|
||||
|
||||
/* entry points for broadcasting system events */
|
||||
void snd_seq_system_broadcast(int client, int port, int type)
|
||||
void snd_seq_system_broadcast(int client, int port, int type, bool atomic)
|
||||
{
|
||||
struct snd_seq_event ev;
|
||||
|
||||
if (setheader(&ev, client, port) < 0)
|
||||
return;
|
||||
ev.type = type;
|
||||
snd_seq_kernel_client_dispatch(sysclient, &ev, 0, 0);
|
||||
snd_seq_kernel_client_dispatch(sysclient, &ev, atomic, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_seq_system_broadcast);
|
||||
|
||||
/* entry points for broadcasting system events */
|
||||
int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev)
|
||||
int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev,
|
||||
bool atomic)
|
||||
{
|
||||
ev->flags = SNDRV_SEQ_EVENT_LENGTH_FIXED;
|
||||
ev->source.client = sysclient;
|
||||
ev->source.port = announce_port;
|
||||
ev->dest.client = client;
|
||||
ev->dest.port = port;
|
||||
return snd_seq_kernel_client_dispatch(sysclient, ev, 0, 0);
|
||||
return snd_seq_kernel_client_dispatch(sysclient, ev, atomic, 0);
|
||||
}
|
||||
|
||||
/* call-back handler for timer events */
|
||||
@ -104,6 +107,22 @@ static int event_input_timer(struct snd_seq_event * ev, int direct, void *privat
|
||||
return snd_seq_control_queue(ev, atomic, hop);
|
||||
}
|
||||
|
||||
static int sys_announce_subscribe(void *private_data,
|
||||
struct snd_seq_port_subscribe *info)
|
||||
{
|
||||
announce_subscribed++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sys_announce_unsubscribe(void *private_data,
|
||||
struct snd_seq_port_subscribe *info)
|
||||
{
|
||||
if (snd_BUG_ON(!announce_subscribed))
|
||||
return 0;
|
||||
announce_subscribed--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* register our internal client */
|
||||
int __init snd_seq_system_client_init(void)
|
||||
{
|
||||
@ -143,7 +162,10 @@ int __init snd_seq_system_client_init(void)
|
||||
/* register announcement port */
|
||||
strcpy(port->name, "Announce");
|
||||
port->capability = SNDRV_SEQ_PORT_CAP_READ|SNDRV_SEQ_PORT_CAP_SUBS_READ; /* for broadcast only */
|
||||
port->kernel = NULL;
|
||||
pcallbacks.event_input = NULL;
|
||||
pcallbacks.subscribe = sys_announce_subscribe;
|
||||
pcallbacks.unsubscribe = sys_announce_unsubscribe;
|
||||
port->kernel = &pcallbacks;
|
||||
port->type = 0;
|
||||
port->flags = SNDRV_SEQ_PORT_FLG_GIVEN_PORT;
|
||||
port->addr.client = sysclient;
|
||||
|
@ -10,16 +10,31 @@
|
||||
|
||||
|
||||
/* entry points for broadcasting system events */
|
||||
void snd_seq_system_broadcast(int client, int port, int type);
|
||||
void snd_seq_system_broadcast(int client, int port, int type, bool atomic);
|
||||
|
||||
#define snd_seq_system_client_ev_client_start(client) snd_seq_system_broadcast(client, 0, SNDRV_SEQ_EVENT_CLIENT_START)
|
||||
#define snd_seq_system_client_ev_client_exit(client) snd_seq_system_broadcast(client, 0, SNDRV_SEQ_EVENT_CLIENT_EXIT)
|
||||
#define snd_seq_system_client_ev_client_change(client) snd_seq_system_broadcast(client, 0, SNDRV_SEQ_EVENT_CLIENT_CHANGE)
|
||||
#define snd_seq_system_client_ev_port_start(client, port) snd_seq_system_broadcast(client, port, SNDRV_SEQ_EVENT_PORT_START)
|
||||
#define snd_seq_system_client_ev_port_exit(client, port) snd_seq_system_broadcast(client, port, SNDRV_SEQ_EVENT_PORT_EXIT)
|
||||
#define snd_seq_system_client_ev_port_change(client, port) snd_seq_system_broadcast(client, port, SNDRV_SEQ_EVENT_PORT_CHANGE)
|
||||
/* normal system notification event broadcast */
|
||||
#define notify_event(client, port, type) \
|
||||
snd_seq_system_broadcast(client, port, type, false)
|
||||
|
||||
int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev);
|
||||
/* notify UMP EP/FB change event */
|
||||
static inline void snd_seq_system_ump_notify(int client, int block, int type,
|
||||
bool atomic)
|
||||
{
|
||||
/* reuse the existing snd_seq_system_broadcast():
|
||||
* struct snd_seq_ev_ump_notify is compatible with struct snd_seq_addr
|
||||
*/
|
||||
snd_seq_system_broadcast(client, block, type, atomic);
|
||||
}
|
||||
|
||||
#define snd_seq_system_client_ev_client_start(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_START)
|
||||
#define snd_seq_system_client_ev_client_exit(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_EXIT)
|
||||
#define snd_seq_system_client_ev_client_change(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_CHANGE)
|
||||
#define snd_seq_system_client_ev_port_start(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_START)
|
||||
#define snd_seq_system_client_ev_port_exit(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_EXIT)
|
||||
#define snd_seq_system_client_ev_port_change(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_CHANGE)
|
||||
|
||||
int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev,
|
||||
bool atomic);
|
||||
|
||||
/* register our internal client */
|
||||
int snd_seq_system_client_init(void);
|
||||
|
@ -272,8 +272,6 @@ static void update_port_infos(struct seq_ump_client *client)
|
||||
new);
|
||||
if (err < 0)
|
||||
continue;
|
||||
/* notify to system port */
|
||||
snd_seq_system_client_ev_port_change(client->seq_client, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -390,6 +388,33 @@ static void handle_group_notify(struct work_struct *work)
|
||||
setup_client_group_filter(client);
|
||||
}
|
||||
|
||||
/* UMP EP change notification */
|
||||
static int seq_ump_notify_ep_change(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
struct seq_ump_client *client = ump->seq_client;
|
||||
struct snd_seq_client *cptr;
|
||||
int client_id;
|
||||
|
||||
if (!client)
|
||||
return -ENODEV;
|
||||
client_id = client->seq_client;
|
||||
cptr = snd_seq_kernel_client_get(client_id);
|
||||
if (!cptr)
|
||||
return -ENODEV;
|
||||
|
||||
snd_seq_system_ump_notify(client_id, 0, SNDRV_SEQ_EVENT_UMP_EP_CHANGE,
|
||||
true);
|
||||
|
||||
/* update sequencer client name if needed */
|
||||
if (*ump->core.name && strcmp(ump->core.name, cptr->name)) {
|
||||
strscpy(cptr->name, ump->core.name, sizeof(cptr->name));
|
||||
snd_seq_system_client_ev_client_change(client_id);
|
||||
}
|
||||
|
||||
snd_seq_kernel_client_put(cptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* UMP FB change notification */
|
||||
static int seq_ump_notify_fb_change(struct snd_ump_endpoint *ump,
|
||||
struct snd_ump_block *fb)
|
||||
@ -399,20 +424,29 @@ static int seq_ump_notify_fb_change(struct snd_ump_endpoint *ump,
|
||||
if (!client)
|
||||
return -ENODEV;
|
||||
schedule_work(&client->group_notify_work);
|
||||
snd_seq_system_ump_notify(client->seq_client, fb->info.block_id,
|
||||
SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE,
|
||||
true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* UMP protocol change notification; just update the midi_version field */
|
||||
static int seq_ump_switch_protocol(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
if (!ump->seq_client)
|
||||
struct seq_ump_client *client = ump->seq_client;
|
||||
|
||||
if (!client)
|
||||
return -ENODEV;
|
||||
setup_client_midi_version(ump->seq_client);
|
||||
setup_client_midi_version(client);
|
||||
snd_seq_system_ump_notify(client->seq_client, 0,
|
||||
SNDRV_SEQ_EVENT_UMP_EP_CHANGE,
|
||||
true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_seq_ump_ops seq_ump_ops = {
|
||||
.input_receive = seq_ump_input_receive,
|
||||
.notify_ep_change = seq_ump_notify_ep_change,
|
||||
.notify_fb_change = seq_ump_notify_fb_change,
|
||||
.switch_protocol = seq_ump_switch_protocol,
|
||||
};
|
||||
|
112
sound/core/ump.c
112
sound/core/ump.c
@ -37,6 +37,7 @@ static int process_legacy_output(struct snd_ump_endpoint *ump,
|
||||
u32 *buffer, int count);
|
||||
static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src,
|
||||
int words);
|
||||
static void ump_legacy_set_rawmidi_name(struct snd_ump_endpoint *ump);
|
||||
static void update_legacy_names(struct snd_ump_endpoint *ump);
|
||||
#else
|
||||
static inline int process_legacy_output(struct snd_ump_endpoint *ump,
|
||||
@ -48,11 +49,42 @@ static inline void process_legacy_input(struct snd_ump_endpoint *ump,
|
||||
const u32 *src, int words)
|
||||
{
|
||||
}
|
||||
static inline void ump_legacy_set_rawmidi_name(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
}
|
||||
static inline void update_legacy_names(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/* copy a string safely with stripping non-printable letters */
|
||||
static void safe_copy_string(void *dst, size_t max_dst_size,
|
||||
const void *src, size_t max_src_size)
|
||||
{
|
||||
const unsigned char *s = src;
|
||||
unsigned char *d = dst;
|
||||
|
||||
if (!max_dst_size--)
|
||||
return;
|
||||
for (s = src; max_dst_size && *s && max_src_size--; s++) {
|
||||
if (!isascii(*s) || !isprint(*s))
|
||||
continue;
|
||||
*d++ = *s;
|
||||
max_dst_size--;
|
||||
}
|
||||
*d = 0;
|
||||
}
|
||||
|
||||
/* append a string safely with stripping non-printable letters */
|
||||
static void safe_append_string(void *dst, size_t max_dst_size,
|
||||
const void *src, size_t max_src_size)
|
||||
{
|
||||
unsigned char *d = dst;
|
||||
size_t len = strlen(d);
|
||||
|
||||
safe_copy_string(d + len, max_dst_size - len, src, max_src_size);
|
||||
}
|
||||
|
||||
static const struct snd_rawmidi_global_ops snd_ump_rawmidi_ops = {
|
||||
.dev_register = snd_ump_dev_register,
|
||||
.dev_unregister = snd_ump_dev_unregister,
|
||||
@ -565,16 +597,10 @@ void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
|
||||
}
|
||||
if (!*fb->info.name)
|
||||
continue;
|
||||
if (!*group->name) {
|
||||
/* store the first matching name */
|
||||
strscpy(group->name, fb->info.name,
|
||||
sizeof(group->name));
|
||||
} else {
|
||||
/* when overlapping, concat names */
|
||||
if (*group->name)
|
||||
strlcat(group->name, ", ", sizeof(group->name));
|
||||
strlcat(group->name, fb->info.name,
|
||||
sizeof(group->name));
|
||||
}
|
||||
safe_append_string(group->name, sizeof(group->name),
|
||||
fb->info.name, sizeof(fb->info.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -669,6 +695,15 @@ static void choose_default_protocol(struct snd_ump_endpoint *ump)
|
||||
ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI1;
|
||||
}
|
||||
|
||||
/* notify the EP info/name change to sequencer */
|
||||
static void seq_notify_ep_change(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
|
||||
if (ump->parsed && ump->seq_ops && ump->seq_ops->notify_ep_change)
|
||||
ump->seq_ops->notify_ep_change(ump);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* handle EP info stream message; update the UMP attributes */
|
||||
static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump,
|
||||
const union snd_ump_stream_msg *buf)
|
||||
@ -693,6 +728,7 @@ static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump,
|
||||
|
||||
ump->info.protocol &= ump->info.protocol_caps;
|
||||
choose_default_protocol(ump);
|
||||
seq_notify_ep_change(ump);
|
||||
|
||||
return 1; /* finished */
|
||||
}
|
||||
@ -715,24 +751,46 @@ static int ump_handle_device_info_msg(struct snd_ump_endpoint *ump,
|
||||
ump->info.family_id,
|
||||
ump->info.model_id,
|
||||
ump->info.sw_revision);
|
||||
seq_notify_ep_change(ump);
|
||||
return 1; /* finished */
|
||||
}
|
||||
|
||||
/* set up the core rawmidi name from UMP EP name string */
|
||||
static void ump_set_rawmidi_name(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
safe_copy_string(ump->core.name, sizeof(ump->core.name),
|
||||
ump->info.name, sizeof(ump->info.name));
|
||||
}
|
||||
|
||||
/* handle EP name stream message; update the UMP name string */
|
||||
static int ump_handle_ep_name_msg(struct snd_ump_endpoint *ump,
|
||||
const union snd_ump_stream_msg *buf)
|
||||
{
|
||||
return ump_append_string(ump, ump->info.name, sizeof(ump->info.name),
|
||||
buf->raw, 2);
|
||||
int ret;
|
||||
|
||||
ret = ump_append_string(ump, ump->info.name, sizeof(ump->info.name),
|
||||
buf->raw, 2);
|
||||
if (ret && ump->parsed) {
|
||||
ump_set_rawmidi_name(ump);
|
||||
ump_legacy_set_rawmidi_name(ump);
|
||||
seq_notify_ep_change(ump);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* handle EP product id stream message; update the UMP product_id string */
|
||||
static int ump_handle_product_id_msg(struct snd_ump_endpoint *ump,
|
||||
const union snd_ump_stream_msg *buf)
|
||||
{
|
||||
return ump_append_string(ump, ump->info.product_id,
|
||||
sizeof(ump->info.product_id),
|
||||
buf->raw, 2);
|
||||
int ret;
|
||||
|
||||
ret = ump_append_string(ump, ump->info.product_id,
|
||||
sizeof(ump->info.product_id),
|
||||
buf->raw, 2);
|
||||
if (ret)
|
||||
seq_notify_ep_change(ump);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* notify the protocol change to sequencer */
|
||||
@ -1045,6 +1103,8 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
|
||||
if (err < 0)
|
||||
ump_dbg(ump, "Unable to get UMP EP name string\n");
|
||||
|
||||
ump_set_rawmidi_name(ump);
|
||||
|
||||
/* Request Endpoint Product ID */
|
||||
err = ump_req_msg(ump, msg, UMP_STREAM_MSG_REQUEST_PRODUCT_ID,
|
||||
UMP_STREAM_MSG_STATUS_PRODUCT_ID);
|
||||
@ -1250,8 +1310,8 @@ static int fill_legacy_mapping(struct snd_ump_endpoint *ump)
|
||||
return num;
|
||||
}
|
||||
|
||||
static void fill_substream_names(struct snd_ump_endpoint *ump,
|
||||
struct snd_rawmidi *rmidi, int dir)
|
||||
static void update_legacy_substreams(struct snd_ump_endpoint *ump,
|
||||
struct snd_rawmidi *rmidi, int dir)
|
||||
{
|
||||
struct snd_rawmidi_substream *s;
|
||||
const char *name;
|
||||
@ -1261,10 +1321,11 @@ static void fill_substream_names(struct snd_ump_endpoint *ump,
|
||||
idx = ump->legacy_mapping[s->number];
|
||||
name = ump->groups[idx].name;
|
||||
if (!*name)
|
||||
name = ump->info.name;
|
||||
name = ump->core.name;
|
||||
scnprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s",
|
||||
idx + 1, name,
|
||||
ump->groups[idx].active ? "" : " [Inactive]");
|
||||
s->inactive = !ump->groups[idx].active;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1272,8 +1333,16 @@ static void update_legacy_names(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
struct snd_rawmidi *rmidi = ump->legacy_rmidi;
|
||||
|
||||
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT);
|
||||
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT);
|
||||
update_legacy_substreams(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT);
|
||||
update_legacy_substreams(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT);
|
||||
}
|
||||
|
||||
static void ump_legacy_set_rawmidi_name(struct snd_ump_endpoint *ump)
|
||||
{
|
||||
struct snd_rawmidi *rmidi = ump->legacy_rmidi;
|
||||
|
||||
snprintf(rmidi->name, sizeof(rmidi->name), "%.68s (MIDI 1.0)",
|
||||
ump->core.name);
|
||||
}
|
||||
|
||||
int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
|
||||
@ -1306,14 +1375,15 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
|
||||
if (output)
|
||||
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
|
||||
&snd_ump_legacy_output_ops);
|
||||
snprintf(rmidi->name, sizeof(rmidi->name), "%.68s (MIDI 1.0)",
|
||||
ump->info.name);
|
||||
rmidi->info_flags = ump->core.info_flags & ~SNDRV_RAWMIDI_INFO_UMP;
|
||||
rmidi->ops = &snd_ump_legacy_ops;
|
||||
rmidi->private_data = ump;
|
||||
ump->legacy_rmidi = rmidi;
|
||||
ump_legacy_set_rawmidi_name(ump);
|
||||
update_legacy_names(ump);
|
||||
|
||||
snd_rawmidi_tie_devices(rmidi, &ump->core);
|
||||
|
||||
ump_dbg(ump, "Created a legacy rawmidi #%d (%s)\n", device, id);
|
||||
return 0;
|
||||
}
|
||||
|
@ -135,13 +135,13 @@ static void dump_clock_config(struct snd_ff *ff, struct snd_info_buffer *buffer)
|
||||
|
||||
snd_iprintf(buffer, "Output S/PDIF format: %s (Emphasis: %s)\n",
|
||||
(data & 0x00000020) ? "Professional" : "Consumer",
|
||||
(data & 0x00000040) ? "on" : "off");
|
||||
str_on_off(data & 0x00000040));
|
||||
|
||||
snd_iprintf(buffer, "Optical output interface format: %s\n",
|
||||
(data & 0x00000100) ? "S/PDIF" : "ADAT");
|
||||
|
||||
snd_iprintf(buffer, "Word output single speed: %s\n",
|
||||
(data & 0x00002000) ? "on" : "off");
|
||||
str_on_off(data & 0x00002000));
|
||||
|
||||
snd_iprintf(buffer, "S/PDIF input interface: %s\n",
|
||||
(data & 0x00000200) ? "Optical" : "Coaxial");
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/component.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/hdaudio.h>
|
||||
#include <sound/hda_component.h>
|
||||
@ -42,8 +43,7 @@ int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
|
||||
if (!acomp->ops->codec_wake_override)
|
||||
return 0;
|
||||
|
||||
dev_dbg(bus->dev, "%s codec wakeup\n",
|
||||
enable ? "enable" : "disable");
|
||||
dev_dbg(bus->dev, "%s codec wakeup\n", str_enable_disable(enable));
|
||||
|
||||
acomp->ops->codec_wake_override(acomp->dev, enable);
|
||||
|
||||
@ -67,8 +67,7 @@ void snd_hdac_display_power(struct hdac_bus *bus, unsigned int idx, bool enable)
|
||||
{
|
||||
struct drm_audio_component *acomp = bus->audio_component;
|
||||
|
||||
dev_dbg(bus->dev, "display power %s\n",
|
||||
enable ? "enable" : "disable");
|
||||
dev_dbg(bus->dev, "display power %s\n", str_enable_disable(enable));
|
||||
|
||||
mutex_lock(&bus->lock);
|
||||
if (enable)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/control.h>
|
||||
#include <sound/info.h>
|
||||
@ -1157,8 +1158,8 @@ static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
|
||||
((p->acc_rates & SNDRV_SB_CSP_RATE_44100) ? "44100Hz" : ""));
|
||||
}
|
||||
if (p->mode == SNDRV_SB_CSP_MODE_QSOUND) {
|
||||
snd_iprintf(buffer, "QSound decoder %sabled\n",
|
||||
p->q_enabled ? "en" : "dis");
|
||||
snd_iprintf(buffer, "QSound decoder %s\n",
|
||||
str_enabled_disabled(p->q_enabled));
|
||||
} else {
|
||||
snd_iprintf(buffer, "PCM format ID: 0x%x (%s/%s) [%s/%s] [%s/%s]\n",
|
||||
p->acc_format,
|
||||
|
@ -1864,7 +1864,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int m
|
||||
strcat(name, " ");
|
||||
strcat(name, pid->name);
|
||||
if (pid->mask != 0xffffffff)
|
||||
sprintf(name + strlen(name), " rev %d", id & ~pid->mask);
|
||||
sprintf(name + strlen(name), " rev %u", id & ~pid->mask);
|
||||
if (ac97 && pid->patch) {
|
||||
if ((modem && (pid->flags & AC97_MODEM_PATCH)) ||
|
||||
(! modem && ! (pid->flags & AC97_MODEM_PATCH)))
|
||||
|
@ -161,12 +161,12 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
|
||||
"Mic select : %s\n"
|
||||
"ADC/DAC loopback : %s\n",
|
||||
val & 0x8000 ? "post" : "pre",
|
||||
val & 0x4000 ? "on" : "off",
|
||||
val & 0x2000 ? "on" : "off",
|
||||
val & 0x1000 ? "on" : "off",
|
||||
str_on_off(val & 0x4000),
|
||||
str_on_off(val & 0x2000),
|
||||
str_on_off(val & 0x1000),
|
||||
val & 0x0200 ? "Mic" : "MIX",
|
||||
val & 0x0100 ? "Mic2" : "Mic1",
|
||||
val & 0x0080 ? "on" : "off");
|
||||
str_on_off(val & 0x0080));
|
||||
if (ac97->ext_id & AC97_EI_DRA)
|
||||
snd_iprintf(buffer, "Double rate slots: %s\n",
|
||||
double_rate_slots[(val >> 10) & 3]);
|
||||
|
@ -626,7 +626,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
|
||||
|
||||
reg = ad1889_readw(chip, AD_DS_WSMC);
|
||||
snd_iprintf(buffer, "Wave output: %s\n",
|
||||
(reg & AD_DS_WSMC_WAEN) ? "enabled" : "disabled");
|
||||
str_enabled_disabled(reg & AD_DS_WSMC_WAEN));
|
||||
snd_iprintf(buffer, "Wave Channels: %s\n",
|
||||
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
|
||||
snd_iprintf(buffer, "Wave Quality: %d-bit linear\n",
|
||||
@ -642,7 +642,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
|
||||
|
||||
|
||||
snd_iprintf(buffer, "Synthesis output: %s\n",
|
||||
reg & AD_DS_WSMC_SYEN ? "enabled" : "disabled");
|
||||
str_enabled_disabled(reg & AD_DS_WSMC_SYEN));
|
||||
|
||||
/* SYRQ is at offset 4 */
|
||||
tmp = (reg & AD_DS_WSMC_SYRQ) ?
|
||||
@ -654,7 +654,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
|
||||
|
||||
reg = ad1889_readw(chip, AD_DS_RAMC);
|
||||
snd_iprintf(buffer, "ADC input: %s\n",
|
||||
(reg & AD_DS_RAMC_ADEN) ? "enabled" : "disabled");
|
||||
str_enabled_disabled(reg & AD_DS_RAMC_ADEN));
|
||||
snd_iprintf(buffer, "ADC Channels: %s\n",
|
||||
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
|
||||
snd_iprintf(buffer, "ADC Quality: %d-bit linear\n",
|
||||
@ -669,7 +669,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
|
||||
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
|
||||
|
||||
snd_iprintf(buffer, "Resampler input: %s\n",
|
||||
reg & AD_DS_RAMC_REEN ? "enabled" : "disabled");
|
||||
str_enabled_disabled(reg & AD_DS_RAMC_REEN));
|
||||
|
||||
/* RERQ is at offset 12 */
|
||||
tmp = (reg & AD_DS_RAMC_RERQ) ?
|
||||
|
@ -3084,7 +3084,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
|
||||
}
|
||||
}
|
||||
}
|
||||
sprintf(card->shortname, "C-Media CMI%d", val);
|
||||
sprintf(card->shortname, "C-Media CMI%u", val);
|
||||
if (cm->chip_version < 68)
|
||||
scnprintf(modelstr, sizeof(modelstr),
|
||||
" (model %d)", cm->chip_version);
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/emu10k1.h>
|
||||
#include "p16v.h"
|
||||
@ -32,9 +33,9 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
|
||||
snd_iprintf(buffer, "\n%s\n", title);
|
||||
|
||||
if (status != 0xffffffff) {
|
||||
snd_iprintf(buffer, "Professional Mode : %s\n", (status & SPCS_PROFESSIONAL) ? "yes" : "no");
|
||||
snd_iprintf(buffer, "Not Audio Data : %s\n", (status & SPCS_NOTAUDIODATA) ? "yes" : "no");
|
||||
snd_iprintf(buffer, "Copyright : %s\n", (status & SPCS_COPYRIGHT) ? "yes" : "no");
|
||||
snd_iprintf(buffer, "Professional Mode : %s\n", str_yes_no(status & SPCS_PROFESSIONAL));
|
||||
snd_iprintf(buffer, "Not Audio Data : %s\n", str_yes_no(status & SPCS_NOTAUDIODATA));
|
||||
snd_iprintf(buffer, "Copyright : %s\n", str_yes_no(status & SPCS_COPYRIGHT));
|
||||
snd_iprintf(buffer, "Emphasis : %s\n", emphasis[(status & SPCS_EMPHASISMASK) >> 3]);
|
||||
snd_iprintf(buffer, "Mode : %i\n", (status & SPCS_MODEMASK) >> 6);
|
||||
snd_iprintf(buffer, "Category Code : 0x%x\n", (status & SPCS_CATEGORYCODEMASK) >> 8);
|
||||
@ -46,9 +47,9 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
|
||||
|
||||
if (rate_reg > 0) {
|
||||
rate = snd_emu10k1_ptr_read(emu, rate_reg, 0);
|
||||
snd_iprintf(buffer, "S/PDIF Valid : %s\n", rate & SRCS_SPDIFVALID ? "on" : "off");
|
||||
snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
|
||||
snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
|
||||
snd_iprintf(buffer, "S/PDIF Valid : %s\n", str_on_off(rate & SRCS_SPDIFVALID));
|
||||
snd_iprintf(buffer, "S/PDIF Locked : %s\n", str_on_off(rate & SRCS_SPDIFLOCKED));
|
||||
snd_iprintf(buffer, "Rate Locked : %s\n", str_on_off(rate & SRCS_RATELOCKED));
|
||||
/* From ((Rate * 48000 ) / 262144); */
|
||||
snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
|
||||
}
|
||||
@ -208,7 +209,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
|
||||
#if 0
|
||||
val = snd_emu10k1_ptr_read(emu, ZVSRCS, 0);
|
||||
snd_iprintf(buffer, "\nZoomed Video\n");
|
||||
snd_iprintf(buffer, "Rate Locked : %s\n", val & SRCS_RATELOCKED ? "on" : "off");
|
||||
snd_iprintf(buffer, "Rate Locked : %s\n", str_on_off(val & SRCS_RATELOCKED));
|
||||
snd_iprintf(buffer, "Estimated Sample Rate : 0x%x\n", val & SRCS_ESTSAMPLERATE);
|
||||
#endif
|
||||
}
|
||||
|
@ -1850,12 +1850,12 @@ static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
|
||||
|
||||
snd_iprintf(buffer, "Ensoniq AudioPCI " CHIP_NAME "\n\n");
|
||||
snd_iprintf(buffer, "Joystick enable : %s\n",
|
||||
ensoniq->ctrl & ES_JYSTK_EN ? "on" : "off");
|
||||
str_on_off(ensoniq->ctrl & ES_JYSTK_EN));
|
||||
#ifdef CHIP1370
|
||||
snd_iprintf(buffer, "MIC +5V bias : %s\n",
|
||||
ensoniq->ctrl & ES_1370_XCTL1 ? "on" : "off");
|
||||
str_on_off(ensoniq->ctrl & ES_1370_XCTL1));
|
||||
snd_iprintf(buffer, "Line In to AOUT : %s\n",
|
||||
ensoniq->ctrl & ES_1370_XCTL0 ? "on" : "off");
|
||||
str_on_off(ensoniq->ctrl & ES_1370_XCTL0));
|
||||
#else
|
||||
snd_iprintf(buffer, "Joystick port : 0x%x\n",
|
||||
(ES_1371_JOY_ASELI(ensoniq->ctrl) * 8) + 0x200);
|
||||
|
@ -84,10 +84,8 @@ static int hda_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
|
||||
|
||||
static int hda_hwdep_open(struct snd_hwdep *hw, struct file *file)
|
||||
{
|
||||
#ifndef CONFIG_SND_DEBUG_VERBOSE
|
||||
if (!capable(CAP_SYS_RAWIO))
|
||||
return -EACCES;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2738,9 +2738,9 @@ static const struct pci_device_id azx_ids[] = {
|
||||
{ PCI_VDEVICE(ZHAOXIN, 0x3288), .driver_data = AZX_DRIVER_ZHAOXIN },
|
||||
/* Loongson HDAudio*/
|
||||
{ PCI_VDEVICE(LOONGSON, PCI_DEVICE_ID_LOONGSON_HDA),
|
||||
.driver_data = AZX_DRIVER_LOONGSON },
|
||||
.driver_data = AZX_DRIVER_LOONGSON | AZX_DCAPS_NO_TCSEL },
|
||||
{ PCI_VDEVICE(LOONGSON, PCI_DEVICE_ID_LOONGSON_HDMI),
|
||||
.driver_data = AZX_DRIVER_LOONGSON },
|
||||
.driver_data = AZX_DRIVER_LOONGSON | AZX_DCAPS_NO_TCSEL },
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, azx_ids);
|
||||
|
@ -648,7 +648,7 @@ static const struct hda_patch_item patch_items[NUM_LINE_MODES] = {
|
||||
},
|
||||
};
|
||||
|
||||
/* check the line starting with '[' -- change the parser mode accodingly */
|
||||
/* check the line starting with '[' -- change the parser mode accordingly */
|
||||
static int parse_line_mode(char *buf, struct hda_bus *bus)
|
||||
{
|
||||
int i;
|
||||
|
@ -890,9 +890,7 @@ static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
/* inverted digital-mic */
|
||||
static void alc_fixup_inv_dmic(struct hda_codec *codec,
|
||||
const struct hda_fixup *fix, int action)
|
||||
{
|
||||
@ -5902,7 +5900,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
|
||||
}
|
||||
|
||||
codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
|
||||
is_ctia ? "yes" : "no");
|
||||
str_yes_no(is_ctia));
|
||||
spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ unsigned int lola_sample_rate_convert(unsigned int coded)
|
||||
default: return 0; /* error */
|
||||
}
|
||||
|
||||
/* ajustement */
|
||||
/* adjustement */
|
||||
switch (coded & 0x60) {
|
||||
case (0 << 5): break;
|
||||
case (1 << 5): freq = (freq * 999) / 1000; break;
|
||||
|
@ -696,7 +696,9 @@ snd_nm256_playback_copy(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct nm256_stream *s = runtime->private_data;
|
||||
|
||||
return copy_from_iter_toio(s->bufptr + pos, src, count);
|
||||
if (copy_from_iter_toio(s->bufptr + pos, count, src) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -710,7 +712,9 @@ snd_nm256_capture_copy(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct nm256_stream *s = runtime->private_data;
|
||||
|
||||
return copy_to_iter_fromio(dst, s->bufptr + pos, count);
|
||||
if (copy_to_iter_fromio(s->bufptr + pos, count, dst) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !__i386__ */
|
||||
|
@ -256,8 +256,10 @@ static int snd_rme32_playback_copy(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
|
||||
|
||||
return copy_from_iter_toio(rme32->iobase + RME32_IO_DATA_BUFFER + pos,
|
||||
src, count);
|
||||
if (copy_from_iter_toio(rme32->iobase + RME32_IO_DATA_BUFFER + pos,
|
||||
count, src) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* copy callback for halfduplex mode */
|
||||
@ -267,9 +269,10 @@ static int snd_rme32_capture_copy(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
|
||||
|
||||
return copy_to_iter_fromio(dst,
|
||||
rme32->iobase + RME32_IO_DATA_BUFFER + pos,
|
||||
count);
|
||||
if (copy_to_iter_fromio(rme32->iobase + RME32_IO_DATA_BUFFER + pos,
|
||||
count, dst) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -322,8 +322,10 @@ snd_rme96_playback_copy(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
|
||||
|
||||
return copy_from_iter_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos,
|
||||
src, count);
|
||||
if (copy_from_iter_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos,
|
||||
count, src) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -333,9 +335,10 @@ snd_rme96_capture_copy(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
|
||||
|
||||
return copy_to_iter_fromio(dst,
|
||||
rme96->iobase + RME96_IO_REC_BUFFER + pos,
|
||||
count);
|
||||
if (copy_to_iter_fromio(rme96->iobase + RME96_IO_REC_BUFFER + pos,
|
||||
count, dst) != count)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3444,7 +3444,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
|
||||
snd_iprintf(buffer, "MIDI1 Input status: 0x%x\n", hdsp_read(hdsp, HDSP_midiStatusIn0));
|
||||
snd_iprintf(buffer, "MIDI2 Output status: 0x%x\n", hdsp_read(hdsp, HDSP_midiStatusOut1));
|
||||
snd_iprintf(buffer, "MIDI2 Input status: 0x%x\n", hdsp_read(hdsp, HDSP_midiStatusIn1));
|
||||
snd_iprintf(buffer, "Use Midi Tasklet: %s\n", hdsp->use_midi_work ? "on" : "off");
|
||||
snd_iprintf(buffer, "Use Midi Tasklet: %s\n", str_on_off(hdsp->use_midi_work));
|
||||
|
||||
snd_iprintf(buffer, "\n");
|
||||
|
||||
@ -3452,8 +3452,8 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
|
||||
|
||||
snd_iprintf(buffer, "Buffer Size (Latency): %d samples (2 periods of %lu bytes)\n", x, (unsigned long) hdsp->period_bytes);
|
||||
snd_iprintf(buffer, "Hardware pointer (frames): %ld\n", hdsp_hw_pointer(hdsp));
|
||||
snd_iprintf(buffer, "Precise pointer: %s\n", hdsp->precise_ptr ? "on" : "off");
|
||||
snd_iprintf(buffer, "Line out: %s\n", (hdsp->control_register & HDSP_LineOut) ? "on" : "off");
|
||||
snd_iprintf(buffer, "Precise pointer: %s\n", str_on_off(hdsp->precise_ptr));
|
||||
snd_iprintf(buffer, "Line out: %s\n", str_on_off(hdsp->control_register & HDSP_LineOut));
|
||||
|
||||
snd_iprintf(buffer, "Firmware version: %d\n", (status2&HDSP_version0)|(status2&HDSP_version1)<<1|(status2&HDSP_version2)<<2);
|
||||
|
||||
@ -3750,8 +3750,8 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
|
||||
snd_iprintf(buffer, "Phones Gain : %s\n", tmp);
|
||||
|
||||
snd_iprintf(buffer, "XLR Breakout Cable : %s\n",
|
||||
hdsp_toggle_setting(hdsp, HDSP_XLRBreakoutCable) ?
|
||||
"yes" : "no");
|
||||
str_yes_no(hdsp_toggle_setting(hdsp,
|
||||
HDSP_XLRBreakoutCable)));
|
||||
|
||||
if (hdsp->control_register & HDSP_AnalogExtensionBoard)
|
||||
snd_iprintf(buffer, "AEB : on (ADAT1 internal)\n");
|
||||
|
@ -4927,14 +4927,14 @@ snd_hdspm_proc_read_madi(struct snd_info_entry *entry,
|
||||
x, (unsigned long) hdspm->period_bytes);
|
||||
|
||||
snd_iprintf(buffer, "Line out: %s\n",
|
||||
(hdspm->control_register & HDSPM_LineOut) ? "on " : "off");
|
||||
str_on_off(hdspm->control_register & HDSPM_LineOut));
|
||||
|
||||
snd_iprintf(buffer,
|
||||
"ClearTrackMarker = %s, Transmit in %s Channel Mode, "
|
||||
"Auto Input %s\n",
|
||||
(hdspm->control_register & HDSPM_clr_tms) ? "on" : "off",
|
||||
str_on_off(hdspm->control_register & HDSPM_clr_tms),
|
||||
(hdspm->control_register & HDSPM_TX_64ch) ? "64" : "56",
|
||||
(hdspm->control_register & HDSPM_AutoInp) ? "on" : "off");
|
||||
str_on_off(hdspm->control_register & HDSPM_AutoInp));
|
||||
|
||||
|
||||
if (!(hdspm->control_register & HDSPM_ClockModeMaster))
|
||||
@ -5088,12 +5088,9 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry,
|
||||
|
||||
snd_iprintf(buffer,
|
||||
"ClearTrackMarker %s, Emphasis %s, Dolby %s\n",
|
||||
(hdspm->
|
||||
control_register & HDSPM_clr_tms) ? "on" : "off",
|
||||
(hdspm->
|
||||
control_register & HDSPM_Emphasis) ? "on" : "off",
|
||||
(hdspm->
|
||||
control_register & HDSPM_Dolby) ? "on" : "off");
|
||||
str_on_off(hdspm->control_register & HDSPM_clr_tms),
|
||||
str_on_off(hdspm->control_register & HDSPM_Emphasis),
|
||||
str_on_off(hdspm->control_register & HDSPM_Dolby));
|
||||
|
||||
|
||||
pref_syncref = hdspm_pref_sync_ref(hdspm);
|
||||
|
@ -1561,8 +1561,7 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
|
||||
x, (unsigned long) rme9652->period_bytes);
|
||||
snd_iprintf(buffer, "Hardware pointer (frames): %ld\n",
|
||||
rme9652_hw_pointer(rme9652));
|
||||
snd_iprintf(buffer, "Passthru: %s\n",
|
||||
rme9652->passthru ? "yes" : "no");
|
||||
snd_iprintf(buffer, "Passthru: %s\n", str_yes_no(rme9652->passthru));
|
||||
|
||||
if ((rme9652->control_register & (RME9652_Master | RME9652_wsel)) == 0) {
|
||||
snd_iprintf(buffer, "Clock mode: autosync\n");
|
||||
@ -1685,7 +1684,7 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
|
||||
snd_iprintf(buffer, "\n");
|
||||
|
||||
snd_iprintf(buffer, "Timecode signal: %s\n",
|
||||
(status & RME9652_tc_valid) ? "yes" : "no");
|
||||
str_yes_no(status & RME9652_tc_valid));
|
||||
|
||||
/* thru modes */
|
||||
|
||||
|
@ -1118,7 +1118,7 @@ static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
|
||||
|
||||
tmp = sonic->srs_space & 0x0f;
|
||||
snd_iprintf(buffer, "SRS 3D : %s\n",
|
||||
sonic->srs_space & 0x80 ? "off" : "on");
|
||||
str_off_on(sonic->srs_space & 0x80));
|
||||
snd_iprintf(buffer, "SRS Space : %s\n",
|
||||
tmp == 0x00 ? "100%" :
|
||||
tmp == 0x01 ? "75%" :
|
||||
@ -1135,9 +1135,9 @@ static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
|
||||
tmp == 0x00 ? "on-board ROM" :
|
||||
tmp == 0x01 ? "PCI bus" : "on-board ROM + PCI bus");
|
||||
tmp = sonic->mpu_switch;
|
||||
snd_iprintf(buffer, "Onboard synth : %s\n", tmp & 0x01 ? "on" : "off");
|
||||
snd_iprintf(buffer, "Ext. Rx to synth : %s\n", tmp & 0x02 ? "on" : "off");
|
||||
snd_iprintf(buffer, "MIDI to ext. Tx : %s\n", tmp & 0x04 ? "on" : "off");
|
||||
snd_iprintf(buffer, "Onboard synth : %s\n", str_on_off(tmp & 0x01));
|
||||
snd_iprintf(buffer, "Ext. Rx to synth : %s\n", str_on_off(tmp & 0x02));
|
||||
snd_iprintf(buffer, "MIDI to ext. Tx : %s\n", str_on_off(tmp & 0x04));
|
||||
}
|
||||
|
||||
static void snd_sonicvibes_proc_init(struct sonicvibes *sonic)
|
||||
|
@ -3278,9 +3278,9 @@ static void snd_trident_proc_read(struct snd_info_entry *entry,
|
||||
snd_iprintf(buffer, "Spurious IRQs : %d\n", trident->spurious_irq_count);
|
||||
snd_iprintf(buffer, "Spurious IRQ dlta: %d\n", trident->spurious_irq_max_delta);
|
||||
if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018)
|
||||
snd_iprintf(buffer, "IEC958 Mixer Out : %s\n", trident->spdif_ctrl == 0x28 ? "on" : "off");
|
||||
snd_iprintf(buffer, "IEC958 Mixer Out : %s\n", str_on_off(trident->spdif_ctrl == 0x28));
|
||||
if (trident->device == TRIDENT_DEVICE_ID_NX) {
|
||||
snd_iprintf(buffer, "Rear Speakers : %s\n", trident->ac97_ctrl & 0x00000010 ? "on" : "off");
|
||||
snd_iprintf(buffer, "Rear Speakers : %s\n", str_on_off(trident->ac97_ctrl & 0x00000010));
|
||||
if (trident->tlb.entries) {
|
||||
snd_iprintf(buffer,"\nVirtual Memory\n");
|
||||
snd_iprintf(buffer, "Memory Maximum : %d\n", trident->tlb.memhdr->size);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "avs.h"
|
||||
#include "messages.h"
|
||||
#include "path.h"
|
||||
#include "registers.h"
|
||||
#include "topology.h"
|
||||
|
||||
static irqreturn_t avs_apl_dsp_interrupt(struct avs_dev *adev)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <sound/hdaudio_ext.h>
|
||||
#include "avs.h"
|
||||
#include "messages.h"
|
||||
#include "registers.h"
|
||||
|
||||
static void avs_cnl_ipc_interrupt(struct avs_dev *adev)
|
||||
{
|
||||
|
@ -9,6 +9,8 @@
|
||||
#ifndef __SOUND_SOC_INTEL_AVS_REGS_H
|
||||
#define __SOUND_SOC_INTEL_AVS_REGS_H
|
||||
|
||||
#include <linux/io-64-nonatomic-lo-hi.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/sizes.h>
|
||||
|
||||
#define AZX_PCIREG_PGCTL 0x44
|
||||
@ -98,4 +100,47 @@
|
||||
#define avs_downlink_addr(adev) \
|
||||
avs_sram_addr(adev, AVS_DOWNLINK_WINDOW)
|
||||
|
||||
#define snd_hdac_adsp_writeb(adev, reg, value) \
|
||||
snd_hdac_reg_writeb(&(adev)->base.core, (adev)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readb(adev, reg) \
|
||||
snd_hdac_reg_readb(&(adev)->base.core, (adev)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writew(adev, reg, value) \
|
||||
snd_hdac_reg_writew(&(adev)->base.core, (adev)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readw(adev, reg) \
|
||||
snd_hdac_reg_readw(&(adev)->base.core, (adev)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writel(adev, reg, value) \
|
||||
snd_hdac_reg_writel(&(adev)->base.core, (adev)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readl(adev, reg) \
|
||||
snd_hdac_reg_readl(&(adev)->base.core, (adev)->dsp_ba + (reg))
|
||||
#define snd_hdac_adsp_writeq(adev, reg, value) \
|
||||
snd_hdac_reg_writeq(&(adev)->base.core, (adev)->dsp_ba + (reg), value)
|
||||
#define snd_hdac_adsp_readq(adev, reg) \
|
||||
snd_hdac_reg_readq(&(adev)->base.core, (adev)->dsp_ba + (reg))
|
||||
|
||||
#define snd_hdac_adsp_updateb(adev, reg, mask, val) \
|
||||
snd_hdac_adsp_writeb(adev, reg, \
|
||||
(snd_hdac_adsp_readb(adev, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updatew(adev, reg, mask, val) \
|
||||
snd_hdac_adsp_writew(adev, reg, \
|
||||
(snd_hdac_adsp_readw(adev, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updatel(adev, reg, mask, val) \
|
||||
snd_hdac_adsp_writel(adev, reg, \
|
||||
(snd_hdac_adsp_readl(adev, reg) & ~(mask)) | (val))
|
||||
#define snd_hdac_adsp_updateq(adev, reg, mask, val) \
|
||||
snd_hdac_adsp_writeq(adev, reg, \
|
||||
(snd_hdac_adsp_readq(adev, reg) & ~(mask)) | (val))
|
||||
|
||||
#define snd_hdac_adsp_readb_poll(adev, reg, val, cond, delay_us, timeout_us) \
|
||||
readb_poll_timeout((adev)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readw_poll(adev, reg, val, cond, delay_us, timeout_us) \
|
||||
readw_poll_timeout((adev)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readl_poll(adev, reg, val, cond, delay_us, timeout_us) \
|
||||
readl_poll_timeout((adev)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
#define snd_hdac_adsp_readq_poll(adev, reg, val, cond, delay_us, timeout_us) \
|
||||
readq_poll_timeout((adev)->dsp_ba + (reg), val, cond, \
|
||||
delay_us, timeout_us)
|
||||
|
||||
#endif /* __SOUND_SOC_INTEL_AVS_REGS_H */
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "avs.h"
|
||||
#include "cldma.h"
|
||||
#include "messages.h"
|
||||
#include "registers.h"
|
||||
|
||||
void avs_skl_ipc_interrupt(struct avs_dev *adev)
|
||||
{
|
||||
|
@ -1232,14 +1232,16 @@ static int lpass_platform_copy(struct snd_soc_component *component,
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
if (is_cdc_dma_port(dai_id)) {
|
||||
ret = copy_from_iter_toio(dma_buf, buf, bytes);
|
||||
if (copy_from_iter_toio(dma_buf, bytes, buf) != bytes)
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
if (copy_from_iter((void __force *)dma_buf, bytes, buf) != bytes)
|
||||
ret = -EFAULT;
|
||||
}
|
||||
} else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
|
||||
if (is_cdc_dma_port(dai_id)) {
|
||||
ret = copy_to_iter_fromio(buf, dma_buf, bytes);
|
||||
if (copy_to_iter_fromio(dma_buf, bytes, buf) != bytes)
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
if (copy_to_iter((void __force *)dma_buf, bytes, buf) != bytes)
|
||||
ret = -EFAULT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user