linux/sound/firewire/bebob/bebob_focusrite.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * bebob_focusrite.c - a part of driver for BeBoB based devices
 *
 * Copyright (c) 2013-2014 Takashi Sakamoto
 */

#include "./bebob.h"

#define ANA_IN
#define DIG_IN
#define ANA_OUT
#define DIG_OUT
#define STM_IN

#define SAFFIRE_ADDRESS_BASE

#define SAFFIRE_OFFSET_CLOCK_SOURCE
#define SAFFIREPRO_OFFSET_CLOCK_SOURCE

/* whether sync to external device or not */
#define SAFFIRE_OFFSET_CLOCK_SYNC_EXT
#define SAFFIRE_LE_OFFSET_CLOCK_SYNC_EXT
#define SAFFIREPRO_OFFSET_CLOCK_SYNC_EXT

#define SAFFIRE_CLOCK_SOURCE_INTERNAL
#define SAFFIRE_CLOCK_SOURCE_SPDIF

/* clock sources as returned from register of Saffire Pro 10 and 26 */
#define SAFFIREPRO_CLOCK_SOURCE_SELECT_MASK
#define SAFFIREPRO_CLOCK_SOURCE_DETECT_MASK
#define SAFFIREPRO_CLOCK_SOURCE_INTERNAL
#define SAFFIREPRO_CLOCK_SOURCE_SKIP
#define SAFFIREPRO_CLOCK_SOURCE_SPDIF
#define SAFFIREPRO_CLOCK_SOURCE_ADAT1
#define SAFFIREPRO_CLOCK_SOURCE_ADAT2
#define SAFFIREPRO_CLOCK_SOURCE_WORDCLOCK
#define SAFFIREPRO_CLOCK_SOURCE_COUNT

/* S/PDIF, ADAT1, ADAT2 is enabled or not. three quadlets */
#define SAFFIREPRO_ENABLE_DIG_IFACES

/* saffirepro has its own parameter for sampling frequency */
#define SAFFIREPRO_RATE_NOREBOOT
/* index is the value for this register */
static const unsigned int rates[] =;

/* saffire(no label)/saffire LE has metering */
#define SAFFIRE_OFFSET_METER
#define SAFFIRE_LE_OFFSET_METER

static inline int
saffire_read_block(struct snd_bebob *bebob, u64 offset,
		   u32 *buf, unsigned int size)
{}

static inline int
saffire_read_quad(struct snd_bebob *bebob, u64 offset, u32 *value)
{}

static inline int
saffire_write_quad(struct snd_bebob *bebob, u64 offset, u32 value)
{}

static const enum snd_bebob_clock_type saffirepro_10_clk_src_types[] =;
static const enum snd_bebob_clock_type saffirepro_26_clk_src_types[] =;
/* Value maps between registers and labels for SaffirePro 10/26. */
static const signed char saffirepro_clk_maps[][SAFFIREPRO_CLOCK_SOURCE_COUNT] =;

static int
saffirepro_both_clk_freq_get(struct snd_bebob *bebob, unsigned int *rate)
{}
static int
saffirepro_both_clk_freq_set(struct snd_bebob *bebob, unsigned int rate)
{}

/*
 * query hardware for current clock source, return our internally
 * used clock index in *id, depending on hardware.
 */
static int
saffirepro_both_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
{}

const struct snd_bebob_spec saffire_le_spec;
static const enum snd_bebob_clock_type saffire_both_clk_src_types[] =;
static int
saffire_both_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
{
	int err;
	u32 value;

	err = saffire_read_quad(bebob, SAFFIRE_OFFSET_CLOCK_SOURCE, &value);
	if (err >= 0)
		*id = 0xff & value;

	return err;
};
static const char *const saffire_le_meter_labels[] =;
static const char *const saffire_meter_labels[] =;
static int
saffire_meter_get(struct snd_bebob *bebob, u32 *buf, unsigned int size)
{}

static const struct snd_bebob_rate_spec saffirepro_both_rate_spec =;
/* Saffire Pro 26 I/O  */
static const struct snd_bebob_clock_spec saffirepro_26_clk_spec =;
const struct snd_bebob_spec saffirepro_26_spec =;
/* Saffire Pro 10 I/O */
static const struct snd_bebob_clock_spec saffirepro_10_clk_spec =;
const struct snd_bebob_spec saffirepro_10_spec =;

static const struct snd_bebob_rate_spec saffire_both_rate_spec =;
static const struct snd_bebob_clock_spec saffire_both_clk_spec =;
/* Saffire LE */
static const struct snd_bebob_meter_spec saffire_le_meter_spec =;
const struct snd_bebob_spec saffire_le_spec =;
/* Saffire */
static const struct snd_bebob_meter_spec saffire_meter_spec =;
const struct snd_bebob_spec saffire_spec =;