include/linux/hid-sensor-hub.h
Source file repositories/reference/linux-study-clean/include/linux/hid-sensor-hub.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/hid-sensor-hub.h- Extension
.h- Size
- 9221 bytes
- Lines
- 285
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hid.hlinux/hid-sensor-ids.hlinux/iio/iio.hlinux/iio/trigger.h
Detected Declarations
struct hid_sensor_hub_attribute_infostruct sensor_hub_pendingstruct hid_sensor_hub_devicestruct hid_sensor_hub_callbacksstruct hid_sensor_commonenum sensor_hub_read_flagsfunction hid_sensor_convert_exponent
Annotated Snippet
struct hid_sensor_hub_attribute_info {
u32 usage_id;
u32 attrib_id;
s32 report_id;
s32 index;
s32 units;
s32 unit_expo;
s32 size;
s32 logical_minimum;
s32 logical_maximum;
};
/**
* struct sensor_hub_pending - Synchronous read pending information
* @status: Pending status true/false.
* @ready: Completion synchronization data.
* @usage_id: Usage id for physical device, e.g. gyro usage id.
* @attr_usage_id: Usage Id of a field, e.g. X-axis for a gyro.
* @raw_size: Response size for a read request.
* @raw_data: Place holder for received response.
*/
struct sensor_hub_pending {
bool status;
struct completion ready;
u32 usage_id;
u32 attr_usage_id;
int raw_size;
u8 *raw_data;
};
/**
* struct hid_sensor_hub_device - Stores the hub instance data
* @hdev: Stores the hid instance.
* @vendor_id: Vendor id of hub device.
* @product_id: Product id of hub device.
* @usage: Usage id for this hub device instance.
* @start_collection_index: Starting index for a phy type collection
* @end_collection_index: Last index for a phy type collection
* @mutex_ptr: synchronizing mutex pointer.
* @pending: Holds information of pending sync read request.
*/
struct hid_sensor_hub_device {
struct hid_device *hdev;
u32 vendor_id;
u32 product_id;
u32 usage;
int start_collection_index;
int end_collection_index;
struct mutex *mutex_ptr;
struct sensor_hub_pending pending;
};
/**
* struct hid_sensor_hub_callbacks - Client callback functions
* @pdev: Platform device instance of the client driver.
* @suspend: Suspend callback.
* @resume: Resume callback.
* @capture_sample: Callback to get a sample.
* @send_event: Send notification to indicate all samples are
* captured, process and send event
*/
struct hid_sensor_hub_callbacks {
struct platform_device *pdev;
int (*suspend)(struct hid_sensor_hub_device *hsdev, void *priv);
int (*resume)(struct hid_sensor_hub_device *hsdev, void *priv);
int (*capture_sample)(struct hid_sensor_hub_device *hsdev,
u32 usage_id, size_t raw_len, char *raw_data,
void *priv);
int (*send_event)(struct hid_sensor_hub_device *hsdev, u32 usage_id,
void *priv);
};
/**
* sensor_hub_device_open() - Open hub device
* @hsdev: Hub device instance.
*
* Used to open hid device for sensor hub.
*/
int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev);
/**
* sensor_hub_device_close() - Close hub device
* @hsdev: Hub device instance.
*
* Used to close hid device for sensor hub.
*/
void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev);
/* Registration functions */
Annotation
- Immediate include surface: `linux/hid.h`, `linux/hid-sensor-ids.h`, `linux/iio/iio.h`, `linux/iio/trigger.h`.
- Detected declarations: `struct hid_sensor_hub_attribute_info`, `struct sensor_hub_pending`, `struct hid_sensor_hub_device`, `struct hid_sensor_hub_callbacks`, `struct hid_sensor_common`, `enum sensor_hub_read_flags`, `function hid_sensor_convert_exponent`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.