linux/sound/pci/asihpi/hpi.h

/* SPDX-License-Identifier: GPL-2.0-only */
/******************************************************************************

    AudioScience HPI driver
    Copyright (C) 1997-2011  AudioScience Inc. <[email protected]>


*/
/** \file hpi.h

 AudioScience Hardware Programming Interface (HPI)
 public API definition.

 The HPI is a low-level hardware abstraction layer to all
 AudioScience digital audio adapters

(C) Copyright AudioScience Inc. 1998-2010
*/

#ifndef _HPI_H_
#define _HPI_H_

#include <linux/types.h>
#define HPI_BUILD_KERNEL_MODE

/******************************************************************************/
/********       HPI API DEFINITIONS                                       *****/
/******************************************************************************/

/*******************************************/
/**  Audio format types
\ingroup stream
*/
enum HPI_FORMATS {};

/*******************************************/
/** Stream States
\ingroup stream
*/
enum HPI_STREAM_STATES {};
/*******************************************/
/** Source node types
\ingroup mixer
*/
enum HPI_SOURCENODES {};

/*******************************************/
/** Destination node types
\ingroup mixer
*/
enum HPI_DESTNODES {};

/*******************************************/
/** Mixer control types
\ingroup mixer
*/
enum HPI_CONTROLS {};

/*******************************************/
/** Adapter properties
These are used in HPI_AdapterSetProperty() and HPI_AdapterGetProperty()
\ingroup adapter
*/
enum HPI_ADAPTER_PROPERTIES {};

/** Adapter mode commands

Used in wQueryOrSet parameter of HPI_AdapterSetModeEx().
\ingroup adapter
*/
enum HPI_ADAPTER_MODE_CMDS {};

/** Adapter Modes
 These are used by HPI_AdapterSetModeEx()

\warning - more than 16 possible modes breaks
a bitmask in the Windows WAVE DLL
\ingroup adapter
*/
enum HPI_ADAPTER_MODES {};

/* Note, adapters can have more than one capability -
encoding as bitfield is recommended. */
#define HPI_CAPABILITY_NONE
#define HPI_CAPABILITY_MPEG_LAYER3

/* Set this equal to maximum capability index,
Must not be greater than 32 - see axnvdef.h */
#define HPI_CAPABILITY_MAX
/* #define HPI_CAPABILITY_AAC              2 */

/******************************************* STREAM ATTRIBUTES ****/

/** MPEG Ancillary Data modes

The mode for the ancillary data insertion or extraction to operate in.
\ingroup stream
*/
enum HPI_MPEG_ANC_MODES {};

/** Ancillary Data Alignment
\ingroup instream
*/
enum HPI_ISTREAM_MPEG_ANC_ALIGNS {};

/** MPEG modes
MPEG modes - can be used optionally for HPI_FormatCreate()
parameter dwAttributes.

Using any mode setting other than HPI_MPEG_MODE_DEFAULT
with single channel format will return an error.
\ingroup stream
*/
enum HPI_MPEG_MODES {};
/******************************************* MIXER ATTRIBUTES ****/

/* \defgroup mixer_flags Mixer flags for HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
{
*/
#define HPI_MIXER_GET_CONTROL_MULTIPLE_CHANGED
#define HPI_MIXER_GET_CONTROL_MULTIPLE_RESET
/*}*/

/** Commands used by HPI_MixerStore()
\ingroup mixer
*/
enum HPI_MIXER_STORE_COMMAND {};

/****************************/
/* CONTROL ATTRIBUTE VALUES */
/****************************/

/** Used by mixer plugin enable functions

E.g. HPI_ParametricEq_SetState()
\ingroup mixer
*/
enum HPI_SWITCH_STATES {};

/* Volume control special gain values */

/** volumes units are 100ths of a dB
\ingroup volume
*/
#define HPI_UNITS_PER_dB
/** turns volume control OFF or MUTE
\ingroup volume
*/
#define HPI_GAIN_OFF

/** channel mask specifying all channels
\ingroup volume
*/
#define HPI_BITMASK_ALL_CHANNELS

/** value returned for no signal
\ingroup meter
*/
#define HPI_METER_MINIMUM

/** autofade profiles
\ingroup volume
*/
enum HPI_VOLUME_AUTOFADES {};

/** The physical encoding format of the AESEBU I/O.

Used in HPI_Aesebu_Transmitter_SetFormat(), HPI_Aesebu_Receiver_SetFormat()
along with related Get and Query functions
\ingroup aestx
*/
enum HPI_AESEBU_FORMATS {};

/** AES/EBU error status bits

Returned by HPI_Aesebu_Receiver_GetErrorStatus()
\ingroup aesrx
*/
enum HPI_AESEBU_ERRORS {};

/** \addtogroup pad
\{
*/
/** The text string containing the station/channel combination. */
#define HPI_PAD_CHANNEL_NAME_LEN
/** The text string containing the artist. */
#define HPI_PAD_ARTIST_LEN
/** The text string containing the title. */
#define HPI_PAD_TITLE_LEN
/** The text string containing the comment. */
#define HPI_PAD_COMMENT_LEN
/** The PTY when the tuner has not received any PTY. */
#define HPI_PAD_PROGRAM_TYPE_INVALID
/** \} */

/** Data types for PTY string translation.
\ingroup rds
*/
enum eHPI_RDS_type {};

/** Tuner bands

Used for HPI_Tuner_SetBand(),HPI_Tuner_GetBand()
\ingroup tuner
*/
enum HPI_TUNER_BAND {};

/** Tuner mode attributes

Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
\ingroup tuner

*/
enum HPI_TUNER_MODES {};

/** Tuner mode attribute values

Used by HPI_Tuner_SetMode(), HPI_Tuner_GetMode()
\ingroup tuner
*/
enum HPI_TUNER_MODE_VALUES {};

/** Tuner Status Bits

These bitfield values are returned by a call to HPI_Tuner_GetStatus().
Multiple fields are returned from a single call.
\ingroup tuner
*/
enum HPI_TUNER_STATUS_BITS {};

/** Channel Modes
Used for HPI_ChannelModeSet/Get()
\ingroup channelmode
*/
enum HPI_CHANNEL_MODES {};

/** SampleClock source values
\ingroup sampleclock
*/
enum HPI_SAMPLECLOCK_SOURCES {};

/** Equalizer filter types. Used by HPI_ParametricEq_SetBand()
\ingroup parmeq
*/
enum HPI_FILTER_TYPE {};

/** Async Event sources
\ingroup async
*/
enum ASYNC_EVENT_SOURCES {};
/*******************************************/
/** HPI Error codes

Almost all HPI functions return an error code
A return value of zero means there was no error.
Otherwise one of these error codes is returned.
Error codes can be converted to a descriptive string using HPI_GetErrorText()

\note When a new error code is added HPI_GetErrorText() MUST be updated.
\note Codes 1-100 are reserved for driver use
\ingroup utility
*/
enum HPI_ERROR_CODES {};

/** \defgroup maximums HPI maximum values
\{
*/
/** Maximum number of PCI HPI adapters */
#define HPI_MAX_ADAPTERS
/** Maximum number of in or out streams per adapter */
#define HPI_MAX_STREAMS
#define HPI_MAX_CHANNELS
#define HPI_MAX_NODES
#define HPI_MAX_CONTROLS
/** maximum number of ancillary bytes per MPEG frame */
#define HPI_MAX_ANC_BYTES_PER_FRAME
#define HPI_STRING_LEN

/** Networked adapters have index >= 100 */
#define HPI_MIN_NETWORK_ADAPTER_IDX

/** Velocity units */
#define HPI_OSTREAM_VELOCITY_UNITS
/** OutStream timescale units */
#define HPI_OSTREAM_TIMESCALE_UNITS
/** OutStream timescale passthrough - turns timescaling on in passthough mode */
#define HPI_OSTREAM_TIMESCALE_PASSTHROUGH

/**\}*/

/**************/
/* STRUCTURES */
#ifndef DISABLE_PRAGMA_PACK1
#pragma pack(push, 1)
#endif

/** Structure containing sample format information.
    See also HPI_FormatCreate().
  */
struct hpi_format {};

struct hpi_anc_frame {};

/** An object for containing a single async event.
*/
struct hpi_async_event {};

#ifndef DISABLE_PRAGMA_PACK1
#pragma pack(pop)
#endif

/*****************/
/* HPI FUNCTIONS */
/*****************/

/* Stream */
u16 hpi_stream_estimate_buffer_size(struct hpi_format *pF,
	u32 host_polling_rate_in_milli_seconds, u32 *recommended_buffer_size);

/*************/
/* SubSystem */
/*************/

u16 hpi_subsys_get_version_ex(u32 *pversion_ex);

u16 hpi_subsys_get_num_adapters(int *pn_num_adapters);

u16 hpi_subsys_get_adapter(int iterator, u32 *padapter_index,
	u16 *pw_adapter_type);

/***********/
/* Adapter */
/***********/

u16 hpi_adapter_open(u16 adapter_index);

u16 hpi_adapter_close(u16 adapter_index);

u16 hpi_adapter_get_info(u16 adapter_index, u16 *pw_num_outstreams,
	u16 *pw_num_instreams, u16 *pw_version, u32 *pserial_number,
	u16 *pw_adapter_type);

u16 hpi_adapter_get_module_by_index(u16 adapter_index, u16 module_index,
	u16 *pw_num_outputs, u16 *pw_num_inputs, u16 *pw_version,
	u32 *pserial_number, u16 *pw_module_type, u32 *ph_module);

u16 hpi_adapter_set_mode(u16 adapter_index, u32 adapter_mode);

u16 hpi_adapter_set_mode_ex(u16 adapter_index, u32 adapter_mode,
	u16 query_or_set);

u16 hpi_adapter_get_mode(u16 adapter_index, u32 *padapter_mode);

u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 paramter1,
	u16 paramter2);

u16 hpi_adapter_get_property(u16 adapter_index, u16 property,
	u16 *pw_paramter1, u16 *pw_paramter2);

u16 hpi_adapter_enumerate_property(u16 adapter_index, u16 index,
	u16 what_to_enumerate, u16 property_index, u32 *psetting);
/*************/
/* OutStream */
/*************/
u16 hpi_outstream_open(u16 adapter_index, u16 outstream_index,
	u32 *ph_outstream);

u16 hpi_outstream_close(u32 h_outstream);

u16 hpi_outstream_get_info_ex(u32 h_outstream, u16 *pw_state,
	u32 *pbuffer_size, u32 *pdata_to_play, u32 *psamples_played,
	u32 *pauxiliary_data_to_play);

u16 hpi_outstream_write_buf(u32 h_outstream, const u8 *pb_write_buf,
	u32 bytes_to_write, const struct hpi_format *p_format);

u16 hpi_outstream_start(u32 h_outstream);

u16 hpi_outstream_wait_start(u32 h_outstream);

u16 hpi_outstream_stop(u32 h_outstream);

u16 hpi_outstream_sinegen(u32 h_outstream);

u16 hpi_outstream_reset(u32 h_outstream);

u16 hpi_outstream_query_format(u32 h_outstream, struct hpi_format *p_format);

u16 hpi_outstream_set_format(u32 h_outstream, struct hpi_format *p_format);

u16 hpi_outstream_set_punch_in_out(u32 h_outstream, u32 punch_in_sample,
	u32 punch_out_sample);

u16 hpi_outstream_set_velocity(u32 h_outstream, short velocity);

u16 hpi_outstream_ancillary_reset(u32 h_outstream, u16 mode);

u16 hpi_outstream_ancillary_get_info(u32 h_outstream, u32 *pframes_available);

u16 hpi_outstream_ancillary_read(u32 h_outstream,
	struct hpi_anc_frame *p_anc_frame_buffer,
	u32 anc_frame_buffer_size_in_bytes,
	u32 number_of_ancillary_frames_to_read);

u16 hpi_outstream_set_time_scale(u32 h_outstream, u32 time_scaleX10000);

u16 hpi_outstream_host_buffer_allocate(u32 h_outstream, u32 size_in_bytes);

u16 hpi_outstream_host_buffer_free(u32 h_outstream);

u16 hpi_outstream_group_add(u32 h_outstream, u32 h_stream);

u16 hpi_outstream_group_get_map(u32 h_outstream, u32 *poutstream_map,
	u32 *pinstream_map);

u16 hpi_outstream_group_reset(u32 h_outstream);

/************/
/* InStream */
/************/
u16 hpi_instream_open(u16 adapter_index, u16 instream_index,
	u32 *ph_instream);

u16 hpi_instream_close(u32 h_instream);

u16 hpi_instream_query_format(u32 h_instream,
	const struct hpi_format *p_format);

u16 hpi_instream_set_format(u32 h_instream,
	const struct hpi_format *p_format);

u16 hpi_instream_read_buf(u32 h_instream, u8 *pb_read_buf, u32 bytes_to_read);

u16 hpi_instream_start(u32 h_instream);

u16 hpi_instream_wait_start(u32 h_instream);

u16 hpi_instream_stop(u32 h_instream);

u16 hpi_instream_reset(u32 h_instream);

u16 hpi_instream_get_info_ex(u32 h_instream, u16 *pw_state, u32 *pbuffer_size,
	u32 *pdata_recorded, u32 *psamples_recorded,
	u32 *pauxiliary_data_recorded);

u16 hpi_instream_ancillary_reset(u32 h_instream, u16 bytes_per_frame,
	u16 mode, u16 alignment, u16 idle_bit);

u16 hpi_instream_ancillary_get_info(u32 h_instream, u32 *pframe_space);

u16 hpi_instream_ancillary_write(u32 h_instream,
	const struct hpi_anc_frame *p_anc_frame_buffer,
	u32 anc_frame_buffer_size_in_bytes,
	u32 number_of_ancillary_frames_to_write);

u16 hpi_instream_host_buffer_allocate(u32 h_instream, u32 size_in_bytes);

u16 hpi_instream_host_buffer_free(u32 h_instream);

u16 hpi_instream_group_add(u32 h_instream, u32 h_stream);

u16 hpi_instream_group_get_map(u32 h_instream, u32 *poutstream_map,
	u32 *pinstream_map);

u16 hpi_instream_group_reset(u32 h_instream);

/*********/
/* Mixer */
/*********/
u16 hpi_mixer_open(u16 adapter_index, u32 *ph_mixer);

u16 hpi_mixer_close(u32 h_mixer);

u16 hpi_mixer_get_control(u32 h_mixer, u16 src_node_type,
	u16 src_node_type_index, u16 dst_node_type, u16 dst_node_type_index,
	u16 control_type, u32 *ph_control);

u16 hpi_mixer_get_control_by_index(u32 h_mixer, u16 control_index,
	u16 *pw_src_node_type, u16 *pw_src_node_index, u16 *pw_dst_node_type,
	u16 *pw_dst_node_index, u16 *pw_control_type, u32 *ph_control);

u16 hpi_mixer_store(u32 h_mixer, enum HPI_MIXER_STORE_COMMAND command,
	u16 index);
/************/
/* Controls */
/************/
/******************/
/* Volume control */
/******************/
u16 hpi_volume_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
	);

u16 hpi_volume_get_gain(u32 h_control,
	short an_gain0_01dB_out[HPI_MAX_CHANNELS]
	);

u16 hpi_volume_set_mute(u32 h_control, u32 mute);

u16 hpi_volume_get_mute(u32 h_control, u32 *mute);

#define hpi_volume_get_range
u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB,
	short *max_gain_01dB, short *step_gain_01dB);

u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels);

u16 hpi_volume_auto_fade(u32 h_control,
	short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms);

u16 hpi_volume_auto_fade_profile(u32 h_control,
	short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms,
	u16 profile);

u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i,
	u16 *profile);

/*****************/
/* Level control */
/*****************/
u16 hpi_level_query_range(u32 h_control, short *min_gain_01dB,
	short *max_gain_01dB, short *step_gain_01dB);

u16 hpi_level_set_gain(u32 h_control, short an_gain0_01dB[HPI_MAX_CHANNELS]
	);

u16 hpi_level_get_gain(u32 h_control,
	short an_gain0_01dB_out[HPI_MAX_CHANNELS]
	);

/*****************/
/* Meter control */
/*****************/
u16 hpi_meter_query_channels(const u32 h_meter, u32 *p_channels);

u16 hpi_meter_get_peak(u32 h_control,
	short an_peak0_01dB_out[HPI_MAX_CHANNELS]
	);

u16 hpi_meter_get_rms(u32 h_control, short an_peak0_01dB_out[HPI_MAX_CHANNELS]
	);

u16 hpi_meter_set_peak_ballistics(u32 h_control, u16 attack, u16 decay);

u16 hpi_meter_set_rms_ballistics(u32 h_control, u16 attack, u16 decay);

u16 hpi_meter_get_peak_ballistics(u32 h_control, u16 *attack, u16 *decay);

u16 hpi_meter_get_rms_ballistics(u32 h_control, u16 *attack, u16 *decay);

/************************/
/* ChannelMode control */
/************************/
u16 hpi_channel_mode_query_mode(const u32 h_mode, const u32 index,
	u16 *pw_mode);

u16 hpi_channel_mode_set(u32 h_control, u16 mode);

u16 hpi_channel_mode_get(u32 h_control, u16 *mode);

/*****************/
/* Tuner control */
/*****************/
u16 hpi_tuner_query_band(const u32 h_tuner, const u32 index, u16 *pw_band);

u16 hpi_tuner_set_band(u32 h_control, u16 band);

u16 hpi_tuner_get_band(u32 h_control, u16 *pw_band);

u16 hpi_tuner_query_frequency(const u32 h_tuner, const u32 index,
	const u16 band, u32 *pfreq);

u16 hpi_tuner_set_frequency(u32 h_control, u32 freq_ink_hz);

u16 hpi_tuner_get_frequency(u32 h_control, u32 *pw_freq_ink_hz);

u16 hpi_tuner_get_rf_level(u32 h_control, short *pw_level);

u16 hpi_tuner_get_raw_rf_level(u32 h_control, short *pw_level);

u16 hpi_tuner_query_gain(const u32 h_tuner, const u32 index, u16 *pw_gain);

u16 hpi_tuner_set_gain(u32 h_control, short gain);

u16 hpi_tuner_get_gain(u32 h_control, short *pn_gain);

u16 hpi_tuner_get_status(u32 h_control, u16 *pw_status_mask, u16 *pw_status);

u16 hpi_tuner_set_mode(u32 h_control, u32 mode, u32 value);

u16 hpi_tuner_get_mode(u32 h_control, u32 mode, u32 *pn_value);

u16 hpi_tuner_get_rds(u32 h_control, char *p_rds_data);

u16 hpi_tuner_query_deemphasis(const u32 h_tuner, const u32 index,
	const u16 band, u32 *pdeemphasis);

u16 hpi_tuner_set_deemphasis(u32 h_control, u32 deemphasis);
u16 hpi_tuner_get_deemphasis(u32 h_control, u32 *pdeemphasis);

u16 hpi_tuner_query_program(const u32 h_tuner, u32 *pbitmap_program);

u16 hpi_tuner_set_program(u32 h_control, u32 program);

u16 hpi_tuner_get_program(u32 h_control, u32 *pprogram);

u16 hpi_tuner_get_hd_radio_dsp_version(u32 h_control, char *psz_dsp_version,
	const u32 string_size);

u16 hpi_tuner_get_hd_radio_sdk_version(u32 h_control, char *psz_sdk_version,
	const u32 string_size);

u16 hpi_tuner_get_hd_radio_signal_quality(u32 h_control, u32 *pquality);

u16 hpi_tuner_get_hd_radio_signal_blend(u32 h_control, u32 *pblend);

u16 hpi_tuner_set_hd_radio_signal_blend(u32 h_control, const u32 blend);

/***************/
/* PAD control */
/***************/

u16 hpi_pad_get_channel_name(u32 h_control, char *psz_string,
	const u32 string_length);

u16 hpi_pad_get_artist(u32 h_control, char *psz_string,
	const u32 string_length);

u16 hpi_pad_get_title(u32 h_control, char *psz_string,
	const u32 string_length);

u16 hpi_pad_get_comment(u32 h_control, char *psz_string,
	const u32 string_length);

u16 hpi_pad_get_program_type(u32 h_control, u32 *ppTY);

u16 hpi_pad_get_rdsPI(u32 h_control, u32 *ppI);

/****************************/
/* AES/EBU Receiver control */
/****************************/
u16 hpi_aesebu_receiver_query_format(const u32 h_aes_rx, const u32 index,
	u16 *pw_format);

u16 hpi_aesebu_receiver_set_format(u32 h_control, u16 source);

u16 hpi_aesebu_receiver_get_format(u32 h_control, u16 *pw_source);

u16 hpi_aesebu_receiver_get_sample_rate(u32 h_control, u32 *psample_rate);

u16 hpi_aesebu_receiver_get_user_data(u32 h_control, u16 index, u16 *pw_data);

u16 hpi_aesebu_receiver_get_channel_status(u32 h_control, u16 index,
	u16 *pw_data);

u16 hpi_aesebu_receiver_get_error_status(u32 h_control, u16 *pw_error_data);

/*******************************/
/* AES/EBU Transmitter control */
/*******************************/
u16 hpi_aesebu_transmitter_set_sample_rate(u32 h_control, u32 sample_rate);

u16 hpi_aesebu_transmitter_set_user_data(u32 h_control, u16 index, u16 data);

u16 hpi_aesebu_transmitter_set_channel_status(u32 h_control, u16 index,
	u16 data);

u16 hpi_aesebu_transmitter_get_channel_status(u32 h_control, u16 index,
	u16 *pw_data);

u16 hpi_aesebu_transmitter_query_format(const u32 h_aes_tx, const u32 index,
	u16 *pw_format);

u16 hpi_aesebu_transmitter_set_format(u32 h_control, u16 output_format);

u16 hpi_aesebu_transmitter_get_format(u32 h_control, u16 *pw_output_format);

/***********************/
/* Multiplexer control */
/***********************/
u16 hpi_multiplexer_set_source(u32 h_control, u16 source_node_type,
	u16 source_node_index);

u16 hpi_multiplexer_get_source(u32 h_control, u16 *source_node_type,
	u16 *source_node_index);

u16 hpi_multiplexer_query_source(u32 h_control, u16 index,
	u16 *source_node_type, u16 *source_node_index);

/***************/
/* Vox control */
/***************/
u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB);

u16 hpi_vox_get_threshold(u32 h_control, short *an_gain0_01dB);

/*********************/
/* Bitstream control */
/*********************/
u16 hpi_bitstream_set_clock_edge(u32 h_control, u16 edge_type);

u16 hpi_bitstream_set_data_polarity(u32 h_control, u16 polarity);

u16 hpi_bitstream_get_activity(u32 h_control, u16 *pw_clk_activity,
	u16 *pw_data_activity);

/***********************/
/* SampleClock control */
/***********************/

u16 hpi_sample_clock_query_source(const u32 h_clock, const u32 index,
	u16 *pw_source);

u16 hpi_sample_clock_set_source(u32 h_control, u16 source);

u16 hpi_sample_clock_get_source(u32 h_control, u16 *pw_source);

u16 hpi_sample_clock_query_source_index(const u32 h_clock, const u32 index,
	const u32 source, u16 *pw_source_index);

u16 hpi_sample_clock_set_source_index(u32 h_control, u16 source_index);

u16 hpi_sample_clock_get_source_index(u32 h_control, u16 *pw_source_index);

u16 hpi_sample_clock_get_sample_rate(u32 h_control, u32 *psample_rate);

u16 hpi_sample_clock_query_local_rate(const u32 h_clock, const u32 index,
	u32 *psource);

u16 hpi_sample_clock_set_local_rate(u32 h_control, u32 sample_rate);

u16 hpi_sample_clock_get_local_rate(u32 h_control, u32 *psample_rate);

u16 hpi_sample_clock_set_auto(u32 h_control, u32 enable);

u16 hpi_sample_clock_get_auto(u32 h_control, u32 *penable);

u16 hpi_sample_clock_set_local_rate_lock(u32 h_control, u32 lock);

u16 hpi_sample_clock_get_local_rate_lock(u32 h_control, u32 *plock);

/***********************/
/* Microphone control */
/***********************/
u16 hpi_microphone_set_phantom_power(u32 h_control, u16 on_off);

u16 hpi_microphone_get_phantom_power(u32 h_control, u16 *pw_on_off);

/********************************/
/* Parametric Equalizer control */
/********************************/
u16 hpi_parametric_eq_get_info(u32 h_control, u16 *pw_number_of_bands,
	u16 *pw_enabled);

u16 hpi_parametric_eq_set_state(u32 h_control, u16 on_off);

u16 hpi_parametric_eq_set_band(u32 h_control, u16 index, u16 type,
	u32 frequency_hz, short q100, short gain0_01dB);

u16 hpi_parametric_eq_get_band(u32 h_control, u16 index, u16 *pn_type,
	u32 *pfrequency_hz, short *pnQ100, short *pn_gain0_01dB);

u16 hpi_parametric_eq_get_coeffs(u32 h_control, u16 index, short coeffs[5]
	);

/*******************************/
/* Compressor Expander control */
/*******************************/

u16 hpi_compander_set_enable(u32 h_control, u32 on);

u16 hpi_compander_get_enable(u32 h_control, u32 *pon);

u16 hpi_compander_set_makeup_gain(u32 h_control, short makeup_gain0_01dB);

u16 hpi_compander_get_makeup_gain(u32 h_control, short *pn_makeup_gain0_01dB);

u16 hpi_compander_set_attack_time_constant(u32 h_control, u32 index,
	u32 attack);

u16 hpi_compander_get_attack_time_constant(u32 h_control, u32 index,
	u32 *pw_attack);

u16 hpi_compander_set_decay_time_constant(u32 h_control, u32 index,
	u32 decay);

u16 hpi_compander_get_decay_time_constant(u32 h_control, u32 index,
	u32 *pw_decay);

u16 hpi_compander_set_threshold(u32 h_control, u32 index,
	short threshold0_01dB);

u16 hpi_compander_get_threshold(u32 h_control, u32 index,
	short *pn_threshold0_01dB);

u16 hpi_compander_set_ratio(u32 h_control, u32 index, u32 ratio100);

u16 hpi_compander_get_ratio(u32 h_control, u32 index, u32 *pw_ratio100);

/********************/
/* Cobranet control */
/********************/
u16 hpi_cobranet_hmi_write(u32 h_control, u32 hmi_address, u32 byte_count,
	u8 *pb_data);

u16 hpi_cobranet_hmi_read(u32 h_control, u32 hmi_address, u32 max_byte_count,
	u32 *pbyte_count, u8 *pb_data);

u16 hpi_cobranet_hmi_get_status(u32 h_control, u32 *pstatus,
	u32 *preadable_size, u32 *pwriteable_size);

u16 hpi_cobranet_get_ip_address(u32 h_control, u32 *pdw_ip_address);

u16 hpi_cobranet_set_ip_address(u32 h_control, u32 dw_ip_address);

u16 hpi_cobranet_get_static_ip_address(u32 h_control, u32 *pdw_ip_address);

u16 hpi_cobranet_set_static_ip_address(u32 h_control, u32 dw_ip_address);

u16 hpi_cobranet_get_macaddress(u32 h_control, u32 *p_mac_msbs,
	u32 *p_mac_lsbs);

/*************************/
/* Tone Detector control */
/*************************/
u16 hpi_tone_detector_get_state(u32 hC, u32 *state);

u16 hpi_tone_detector_set_enable(u32 hC, u32 enable);

u16 hpi_tone_detector_get_enable(u32 hC, u32 *enable);

u16 hpi_tone_detector_set_event_enable(u32 hC, u32 event_enable);

u16 hpi_tone_detector_get_event_enable(u32 hC, u32 *event_enable);

u16 hpi_tone_detector_set_threshold(u32 hC, int threshold);

u16 hpi_tone_detector_get_threshold(u32 hC, int *threshold);

u16 hpi_tone_detector_get_frequency(u32 hC, u32 index, u32 *frequency);

/****************************/
/* Silence Detector control */
/****************************/
u16 hpi_silence_detector_get_state(u32 hC, u32 *state);

u16 hpi_silence_detector_set_enable(u32 hC, u32 enable);

u16 hpi_silence_detector_get_enable(u32 hC, u32 *enable);

u16 hpi_silence_detector_set_event_enable(u32 hC, u32 event_enable);

u16 hpi_silence_detector_get_event_enable(u32 hC, u32 *event_enable);

u16 hpi_silence_detector_set_delay(u32 hC, u32 delay);

u16 hpi_silence_detector_get_delay(u32 hC, u32 *delay);

u16 hpi_silence_detector_set_threshold(u32 hC, int threshold);

u16 hpi_silence_detector_get_threshold(u32 hC, int *threshold);
/*********************/
/* Utility functions */
/*********************/

u16 hpi_format_create(struct hpi_format *p_format, u16 channels, u16 format,
	u32 sample_rate, u32 bit_rate, u32 attributes);

#endif	 /*_HPI_H_ */