Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * dice.h - a part of driver for Dice based devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) Clemens Ladisch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (c) 2014 Takashi Sakamoto
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #ifndef SOUND_DICE_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #define SOUND_DICE_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/compat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/completion.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/firewire.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/firewire-constants.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/jiffies.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/mod_devicetable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/wait.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/sched/signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <sound/control.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <sound/core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <sound/firewire.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include <sound/hwdep.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <sound/info.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <sound/initval.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include <sound/pcm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <sound/pcm_params.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <sound/rawmidi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #include "../amdtp-am824.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include "../iso-resources.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #include "../lib.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #include "dice-interface.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * This module support maximum 2 pairs of tx/rx isochronous streams for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * our convinience.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * In documents for ASICs called with a name of 'DICE':
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  *  - ASIC for DICE II:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  *   - Maximum 2 tx and 4 rx are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  *   - A packet supports maximum 16 data channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  *  - TCD2210/2210-E (so-called 'Dice Mini'):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  *   - Maximum 2 tx and 2 rx are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  *   - A packet supports maximum 16 data channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  *  - TCD2220/2220-E (so-called 'Dice Jr.')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  *   - 2 tx and 2 rx are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  *   - A packet supports maximum 16 data channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  *  - TCD3070-CH (so-called 'Dice III')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  *   - Maximum 2 tx and 2 rx are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  *   - A packet supports maximum 32 data channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  * For the above, MIDI conformant data channel is just on the first isochronous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  * stream.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define MAX_STREAMS	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) enum snd_dice_rate_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	SND_DICE_RATE_MODE_LOW = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	SND_DICE_RATE_MODE_MIDDLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	SND_DICE_RATE_MODE_HIGH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	SND_DICE_RATE_MODE_COUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) struct snd_dice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) typedef int (*snd_dice_detect_formats_t)(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) struct snd_dice {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	struct snd_card *card;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	struct fw_unit *unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	spinlock_t lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	bool registered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	struct delayed_work dwork;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	/* Offsets for sub-addresses */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	unsigned int global_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	unsigned int rx_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	unsigned int tx_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	unsigned int sync_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	unsigned int rsrv_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	unsigned int clock_caps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	unsigned int tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	unsigned int rx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	unsigned int tx_midi_ports[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	unsigned int rx_midi_ports[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	snd_dice_detect_formats_t detect_formats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct fw_address_handler notification_handler;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	int owner_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	u32 notification_bits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	/* For uapi */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	int dev_lock_count; /* > 0 driver, < 0 userspace */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	bool dev_lock_changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	wait_queue_head_t hwdep_wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	/* For streaming */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	struct fw_iso_resources tx_resources[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	struct fw_iso_resources rx_resources[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	struct amdtp_stream tx_stream[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	struct amdtp_stream rx_stream[MAX_STREAMS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	bool global_enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	struct completion clock_accepted;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	unsigned int substreams_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	struct amdtp_domain domain;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) enum snd_dice_addr_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	SND_DICE_ADDR_TYPE_PRIVATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	SND_DICE_ADDR_TYPE_GLOBAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	SND_DICE_ADDR_TYPE_TX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	SND_DICE_ADDR_TYPE_RX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	SND_DICE_ADDR_TYPE_SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	SND_DICE_ADDR_TYPE_RSRV,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) int snd_dice_transaction_write(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 			       enum snd_dice_addr_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 			       unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			       void *buf, unsigned int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) int snd_dice_transaction_read(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			      enum snd_dice_addr_type type, unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			      void *buf, unsigned int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static inline int snd_dice_transaction_write_global(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 						    unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 						    void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	return snd_dice_transaction_write(dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 					  SND_DICE_ADDR_TYPE_GLOBAL, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 					  buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) static inline int snd_dice_transaction_read_global(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 						   unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 						   void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	return snd_dice_transaction_read(dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 					 SND_DICE_ADDR_TYPE_GLOBAL, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 					 buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) static inline int snd_dice_transaction_write_tx(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 						unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 						void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	return snd_dice_transaction_write(dice, SND_DICE_ADDR_TYPE_TX, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 					  buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) static inline int snd_dice_transaction_read_tx(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 					       unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 					       void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	return snd_dice_transaction_read(dice, SND_DICE_ADDR_TYPE_TX, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 					 buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) static inline int snd_dice_transaction_write_rx(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 						unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 						void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	return snd_dice_transaction_write(dice, SND_DICE_ADDR_TYPE_RX, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 					  buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) static inline int snd_dice_transaction_read_rx(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 					       unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 					       void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	return snd_dice_transaction_read(dice, SND_DICE_ADDR_TYPE_RX, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 					 buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) static inline int snd_dice_transaction_write_sync(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 						  unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 						  void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	return snd_dice_transaction_write(dice, SND_DICE_ADDR_TYPE_SYNC, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 					  buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static inline int snd_dice_transaction_read_sync(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 						 unsigned int offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 						 void *buf, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	return snd_dice_transaction_read(dice, SND_DICE_ADDR_TYPE_SYNC, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 					 buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) int snd_dice_transaction_get_clock_source(struct snd_dice *dice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 					  unsigned int *source);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) int snd_dice_transaction_get_rate(struct snd_dice *dice, unsigned int *rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) int snd_dice_transaction_set_enable(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) void snd_dice_transaction_clear_enable(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) int snd_dice_transaction_init(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) int snd_dice_transaction_reinit(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) void snd_dice_transaction_destroy(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #define SND_DICE_RATES_COUNT	7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) extern const unsigned int snd_dice_rates[SND_DICE_RATES_COUNT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) int snd_dice_stream_get_rate_mode(struct snd_dice *dice, unsigned int rate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 				  enum snd_dice_rate_mode *mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) int snd_dice_stream_start_duplex(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) void snd_dice_stream_stop_duplex(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) int snd_dice_stream_init_duplex(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) void snd_dice_stream_destroy_duplex(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) int snd_dice_stream_reserve_duplex(struct snd_dice *dice, unsigned int rate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 				   unsigned int events_per_period,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 				   unsigned int events_per_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) void snd_dice_stream_update_duplex(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) int snd_dice_stream_detect_current_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) int snd_dice_stream_lock_try(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) void snd_dice_stream_lock_release(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) int snd_dice_create_pcm(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) int snd_dice_create_hwdep(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) void snd_dice_create_proc(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) int snd_dice_create_midi(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) int snd_dice_detect_tcelectronic_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) int snd_dice_detect_alesis_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) int snd_dice_detect_alesis_mastercontrol_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) int snd_dice_detect_extension_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) int snd_dice_detect_mytek_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) int snd_dice_detect_presonus_formats(struct snd_dice *dice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) #endif