// SPDX-License-Identifier: GPL-2.0-only /* * fireworks_command.c - a part of driver for Fireworks based devices * * Copyright (c) 2013-2014 Takashi Sakamoto */ #include "./fireworks.h" /* * This driver uses transaction version 1 or later to use extended hardware * information. Then too old devices are not available. * * Each commands are not required to have continuous sequence numbers. This * number is just used to match command and response. * * This module support a part of commands. Please see FFADO if you want to see * whole commands. But there are some commands which FFADO don't implement. * * Fireworks also supports AV/C general commands and AV/C Stream Format * Information commands. But this module don't use them. */ #define KERNEL_SEQNUM_MIN … #define KERNEL_SEQNUM_MAX … /* for clock source and sampling rate */ struct efc_clock { … }; /* command categories */ enum efc_category { … }; /* hardware info category commands */ enum efc_cmd_hwinfo { … }; enum efc_cmd_transport { … }; /* hardware control category commands */ enum efc_cmd_hwctl { … }; /* return values in response */ enum efr_status { … }; static const char *const efr_status_names[] = …; static int efw_transaction(struct snd_efw *efw, unsigned int category, unsigned int command, const __be32 *params, unsigned int param_bytes, const __be32 *resp, unsigned int resp_bytes) { … } /* * The address in host system for transaction response is changable when the * device supports. struct hwinfo.flags includes its flag. The default is * MEMORY_SPACE_EFW_RESPONSE. */ int snd_efw_command_set_resp_addr(struct snd_efw *efw, u16 addr_high, u32 addr_low) { … } /* * This is for timestamp processing. In Windows mode, all 32bit fields of second * CIP header in AMDTP transmit packet is used for 'presentation timestamp'. In * 'no data' packet the value of this field is 0x90ffffff. */ int snd_efw_command_set_tx_mode(struct snd_efw *efw, enum snd_efw_transport_mode mode) { … } int snd_efw_command_get_hwinfo(struct snd_efw *efw, struct snd_efw_hwinfo *hwinfo) { … } int snd_efw_command_get_phys_meters(struct snd_efw *efw, struct snd_efw_phys_meters *meters, unsigned int len) { … } static int command_get_clock(struct snd_efw *efw, struct efc_clock *clock) { … } /* give UINT_MAX if set nothing */ static int command_set_clock(struct snd_efw *efw, unsigned int source, unsigned int rate) { … } int snd_efw_command_get_clock_source(struct snd_efw *efw, enum snd_efw_clock_source *source) { … } int snd_efw_command_get_sampling_rate(struct snd_efw *efw, unsigned int *rate) { … } int snd_efw_command_set_sampling_rate(struct snd_efw *efw, unsigned int rate) { … }