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.
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct hpi_formatstruct hpi_anc_framestruct hpi_async_eventenum HPI_FORMATSenum HPI_STREAM_STATESenum HPI_SOURCENODESenum HPI_DESTNODESenum HPI_CONTROLSenum HPI_ADAPTER_PROPERTIESenum HPI_ADAPTER_MODE_CMDSenum HPI_ADAPTER_MODESenum HPI_MPEG_ANC_MODESenum HPI_ISTREAM_MPEG_ANC_ALIGNSenum HPI_MPEG_MODESenum HPI_MIXER_STORE_COMMANDenum HPI_SWITCH_STATESenum HPI_VOLUME_AUTOFADESenum HPI_AESEBU_FORMATSenum HPI_AESEBU_ERRORSenum eHPI_RDS_typeenum HPI_TUNER_BANDenum HPI_TUNER_MODESenum HPI_TUNER_MODE_VALUESenum HPI_TUNER_STATUS_BITSenum HPI_CHANNEL_MODESenum HPI_SAMPLECLOCK_SOURCESenum HPI_FILTER_TYPEenum ASYNC_EVENT_SOURCESenum HPI_ERROR_CODES
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
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct hpi_format`, `struct hpi_anc_frame`, `struct hpi_async_event`, `enum HPI_FORMATS`, `enum HPI_STREAM_STATES`, `enum HPI_SOURCENODES`, `enum HPI_DESTNODES`, `enum HPI_CONTROLS`, `enum HPI_ADAPTER_PROPERTIES`, `enum HPI_ADAPTER_MODE_CMDS`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.