sound/pci/asihpi/hpi.h

Source file repositories/reference/linux-study-clean/sound/pci/asihpi/hpi.h

File Facts

System
Linux kernel
Corpus path
sound/pci/asihpi/hpi.h
Extension
.h
Size
56288 bytes
Lines
1709
Domain
Driver Families
Bucket
sound/pci
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hpi_format {
	u32 sample_rate;
				/**< 11025, 32000, 44100 ... */
	u32 bit_rate;		  /**< for MPEG */
	u32 attributes;
				/**< Stereo/JointStereo/Mono */
	u16 mode_legacy;
				/**< Legacy ancillary mode or idle bit  */
	u16 unused;		  /**< Unused */
	u16 channels;	  /**< 1,2..., (or ancillary mode or idle bit */
	u16 format;	  /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */
};

struct hpi_anc_frame {
	u32 valid_bits_in_this_frame;
	u8 b_data[HPI_MAX_ANC_BYTES_PER_FRAME];
};

/** An object for containing a single async event.
*/
struct hpi_async_event {
	u16 event_type;	/**< type of event. \sa async_event  */
	u16 sequence; /**< Sequence number, allows lost event detection */
	u32 state; /**< New state */
	u32 h_object; /**< handle to the object returning the event. */
	union {
		struct {
			u16 index; /**< GPIO bit index. */
		} gpio;
		struct {
			u16 node_index;	/**< what node is the control on ? */
			u16 node_type; /**< what type of node is the control on ? */
		} control;
	} u;
};

#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);

Annotation

Implementation Notes