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)  * bebob.h - a part of driver for BeBoB based devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2013-2014 Takashi Sakamoto
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #ifndef SOUND_BEBOB_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #define SOUND_BEBOB_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/compat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/firewire.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/firewire-constants.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/mod_devicetable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/sched/signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <sound/core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <sound/initval.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <sound/info.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <sound/rawmidi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <sound/pcm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <sound/pcm_params.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <sound/firewire.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <sound/hwdep.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include "../lib.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include "../fcp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include "../packets-buffer.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include "../iso-resources.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include "../amdtp-am824.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include "../cmp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) /* basic register addresses on DM1000/DM1100/DM1500 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define BEBOB_ADDR_REG_INFO	0xffffc8020000ULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define BEBOB_ADDR_REG_REQ	0xffffc8021000ULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) struct snd_bebob;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define SND_BEBOB_STRM_FMT_ENTRIES	7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) struct snd_bebob_stream_formation {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	unsigned int pcm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	unsigned int midi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) /* this is a lookup table for index of stream formations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) extern const unsigned int snd_bebob_rate_table[SND_BEBOB_STRM_FMT_ENTRIES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /* device specific operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) enum snd_bebob_clock_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	SND_BEBOB_CLOCK_TYPE_INTERNAL = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	SND_BEBOB_CLOCK_TYPE_EXTERNAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	SND_BEBOB_CLOCK_TYPE_SYT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) struct snd_bebob_clock_spec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	unsigned int num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	const char *const *labels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	const enum snd_bebob_clock_type *types;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	int (*get)(struct snd_bebob *bebob, unsigned int *id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) struct snd_bebob_rate_spec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	int (*get)(struct snd_bebob *bebob, unsigned int *rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	int (*set)(struct snd_bebob *bebob, unsigned int rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) struct snd_bebob_meter_spec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	unsigned int num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	const char *const *labels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	int (*get)(struct snd_bebob *bebob, u32 *target, unsigned int size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) struct snd_bebob_spec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	const struct snd_bebob_clock_spec *clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	const struct snd_bebob_rate_spec *rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	const struct snd_bebob_meter_spec *meter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) struct snd_bebob {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	struct snd_card *card;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	struct fw_unit *unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	int card_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	spinlock_t lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	bool registered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	struct delayed_work dwork;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	const struct ieee1394_device_id *entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	const struct snd_bebob_spec *spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	unsigned int midi_input_ports;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	unsigned int midi_output_ports;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	struct amdtp_stream tx_stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	struct amdtp_stream rx_stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	struct cmp_connection out_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct cmp_connection in_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	unsigned int substreams_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	struct snd_bebob_stream_formation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		tx_stream_formations[SND_BEBOB_STRM_FMT_ENTRIES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	struct snd_bebob_stream_formation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		rx_stream_formations[SND_BEBOB_STRM_FMT_ENTRIES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	int sync_input_plug;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	/* for uapi */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	int dev_lock_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	bool dev_lock_changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	wait_queue_head_t hwdep_wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	/* for M-Audio special devices */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	void *maudio_special_quirk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	/* For BeBoB version quirk. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	unsigned int version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	struct amdtp_domain domain;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) snd_bebob_read_block(struct fw_unit *unit, u64 addr, void *buf, int size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	return snd_fw_transaction(unit, TCODE_READ_BLOCK_REQUEST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 				  BEBOB_ADDR_REG_INFO + addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 				  buf, size, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) snd_bebob_read_quad(struct fw_unit *unit, u64 addr, u32 *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	return snd_fw_transaction(unit, TCODE_READ_QUADLET_REQUEST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 				  BEBOB_ADDR_REG_INFO + addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 				  (void *)buf, sizeof(u32), 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) /* AV/C Audio Subunit Specification 1.0 (Oct 2000, 1394TA) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) int avc_audio_set_selector(struct fw_unit *unit, unsigned int subunit_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 			   unsigned int fb_id, unsigned int num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) int avc_audio_get_selector(struct fw_unit *unit, unsigned  int subunit_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			   unsigned int fb_id, unsigned int *num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * AVC command extensions, AV/C Unit and Subunit, Revision 17
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * (Nov 2003, BridgeCo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) #define	AVC_BRIDGECO_ADDR_BYTES	6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) enum avc_bridgeco_plug_dir {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	AVC_BRIDGECO_PLUG_DIR_IN	= 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	AVC_BRIDGECO_PLUG_DIR_OUT	= 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) enum avc_bridgeco_plug_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	AVC_BRIDGECO_PLUG_MODE_UNIT		= 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	AVC_BRIDGECO_PLUG_MODE_SUBUNIT		= 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	AVC_BRIDGECO_PLUG_MODE_FUNCTION_BLOCK	= 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) enum avc_bridgeco_plug_unit {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	AVC_BRIDGECO_PLUG_UNIT_ISOC	= 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	AVC_BRIDGECO_PLUG_UNIT_EXT	= 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	AVC_BRIDGECO_PLUG_UNIT_ASYNC	= 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) enum avc_bridgeco_plug_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	AVC_BRIDGECO_PLUG_TYPE_ISOC	= 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	AVC_BRIDGECO_PLUG_TYPE_ASYNC	= 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	AVC_BRIDGECO_PLUG_TYPE_MIDI	= 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	AVC_BRIDGECO_PLUG_TYPE_SYNC	= 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	AVC_BRIDGECO_PLUG_TYPE_ANA	= 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	AVC_BRIDGECO_PLUG_TYPE_DIG	= 0x05,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	AVC_BRIDGECO_PLUG_TYPE_ADDITION	= 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) avc_bridgeco_fill_unit_addr(u8 buf[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			    enum avc_bridgeco_plug_dir dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 			    enum avc_bridgeco_plug_unit unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 			    unsigned int pid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	buf[0] = 0xff;	/* Unit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	buf[1] = dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	buf[2] = AVC_BRIDGECO_PLUG_MODE_UNIT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	buf[3] = unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	buf[4] = 0xff & pid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	buf[5] = 0xff;	/* reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) avc_bridgeco_fill_msu_addr(u8 buf[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 			   enum avc_bridgeco_plug_dir dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			   unsigned int pid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	buf[0] = 0x60;	/* Music subunit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	buf[1] = dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	buf[2] = AVC_BRIDGECO_PLUG_MODE_SUBUNIT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	buf[3] = 0xff & pid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	buf[4] = 0xff;	/* reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	buf[5] = 0xff;	/* reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) int avc_bridgeco_get_plug_ch_pos(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 				 u8 addr[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 				 u8 *buf, unsigned int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) int avc_bridgeco_get_plug_type(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 			       u8 addr[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 			       enum avc_bridgeco_plug_type *type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) int avc_bridgeco_get_plug_section_type(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 				       u8 addr[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 				       unsigned int id, u8 *type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) int avc_bridgeco_get_plug_input(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 				u8 addr[AVC_BRIDGECO_ADDR_BYTES],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 				u8 input[7]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) int avc_bridgeco_get_plug_strm_fmt(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 				   u8 addr[AVC_BRIDGECO_ADDR_BYTES], u8 *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 				   unsigned int *len, unsigned int eid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) /* for AMDTP streaming */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) int snd_bebob_stream_get_rate(struct snd_bebob *bebob, unsigned int *rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) int snd_bebob_stream_set_rate(struct snd_bebob *bebob, unsigned int rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) int snd_bebob_stream_get_clock_src(struct snd_bebob *bebob,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 				   enum snd_bebob_clock_type *src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) int snd_bebob_stream_discover(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) int snd_bebob_stream_init_duplex(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 				    unsigned int frames_per_period,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 				    unsigned int frames_per_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) int snd_bebob_stream_start_duplex(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) void snd_bebob_stream_destroy_duplex(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) void snd_bebob_stream_lock_changed(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) int snd_bebob_stream_lock_try(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) void snd_bebob_stream_lock_release(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) void snd_bebob_proc_init(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) int snd_bebob_create_midi_devices(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) int snd_bebob_create_pcm_devices(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) int snd_bebob_create_hwdep_device(struct snd_bebob *bebob);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) /* model specific operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) extern const struct snd_bebob_spec phase88_rack_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) extern const struct snd_bebob_spec yamaha_terratec_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) extern const struct snd_bebob_spec saffirepro_26_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) extern const struct snd_bebob_spec saffirepro_10_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) extern const struct snd_bebob_spec saffire_le_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) extern const struct snd_bebob_spec saffire_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) extern const struct snd_bebob_spec maudio_fw410_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) extern const struct snd_bebob_spec maudio_audiophile_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) extern const struct snd_bebob_spec maudio_solo_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) extern const struct snd_bebob_spec maudio_ozonic_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) extern const struct snd_bebob_spec maudio_nrv10_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) extern const struct snd_bebob_spec maudio_special_spec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) int snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) int snd_bebob_maudio_load_firmware(struct fw_unit *unit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) #define SND_BEBOB_DEV_ENTRY(vendor, model, data) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	.match_flags	= IEEE1394_MATCH_VENDOR_ID | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 			  IEEE1394_MATCH_MODEL_ID, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	.vendor_id	= vendor, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	.model_id	= model, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	.driver_data	= (kernel_ulong_t)data \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #endif