drivers/hid/hid-haptic.h
Source file repositories/reference/linux-study-clean/drivers/hid/hid-haptic.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-haptic.h- Extension
.h- Size
- 3561 bytes
- Lines
- 128
- Domain
- Driver Families
- Bucket
- drivers/hid
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hid.h
Detected Declarations
struct hid_haptic_effectstruct hid_haptic_effect_nodestruct hid_haptic_devicefunction hid_haptic_feature_mappingfunction hid_haptic_input_mappingfunction hid_haptic_input_configuredfunction hid_haptic_resetfunction hid_haptic_handle_press_releasefunction hid_haptic_pressure_reset
Annotated Snippet
struct hid_haptic_effect {
u8 *report_buf;
struct input_dev *input_dev;
struct work_struct work;
struct list_head control;
struct mutex control_mutex;
};
struct hid_haptic_effect_node {
struct list_head node;
struct file *file;
};
struct hid_haptic_device {
struct input_dev *input_dev;
struct hid_device *hdev;
struct hid_report *auto_trigger_report;
struct mutex auto_trigger_mutex;
struct workqueue_struct *wq;
struct hid_report *manual_trigger_report;
struct mutex manual_trigger_mutex;
size_t manual_trigger_report_len;
int pressed_state;
s32 pressure_sum;
s32 force_logical_minimum;
s32 force_physical_minimum;
s32 force_resolution;
u32 mode;
u32 default_auto_trigger;
u32 vendor_page;
u32 vendor_id;
u32 max_waveform_id;
u32 max_duration_id;
u16 *hid_usage_map;
u32 *duration_map;
u16 press_ordinal;
u16 release_ordinal;
struct hid_haptic_effect *effect;
struct hid_haptic_effect stop_effect;
};
#if IS_ENABLED(CONFIG_HID_HAPTIC)
void hid_haptic_feature_mapping(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_field *field, struct hid_usage
*usage);
bool hid_haptic_check_pressure_unit(struct hid_haptic_device *haptic,
struct hid_input *hi, struct hid_field *field);
int hid_haptic_input_mapping(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max);
int hid_haptic_input_configured(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_input *hi);
int hid_haptic_init(struct hid_device *hdev, struct hid_haptic_device **haptic_ptr);
void hid_haptic_handle_press_release(struct hid_haptic_device *haptic);
void hid_haptic_pressure_reset(struct hid_haptic_device *haptic);
void hid_haptic_pressure_increase(struct hid_haptic_device *haptic,
__s32 pressure);
#else
static inline
void hid_haptic_feature_mapping(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_field *field, struct hid_usage
*usage)
{}
static inline
bool hid_haptic_check_pressure_unit(struct hid_haptic_device *haptic,
struct hid_input *hi, struct hid_field *field)
{
return false;
}
static inline
int hid_haptic_input_mapping(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
return 0;
}
static inline
int hid_haptic_input_configured(struct hid_device *hdev,
struct hid_haptic_device *haptic,
struct hid_input *hi)
{
return 0;
}
Annotation
- Immediate include surface: `linux/hid.h`.
- Detected declarations: `struct hid_haptic_effect`, `struct hid_haptic_effect_node`, `struct hid_haptic_device`, `function hid_haptic_feature_mapping`, `function hid_haptic_input_mapping`, `function hid_haptic_input_configured`, `function hid_haptic_reset`, `function hid_haptic_handle_press_release`, `function hid_haptic_pressure_reset`.
- Atlas domain: Driver Families / drivers/hid.
- Implementation status: source implementation candidate.
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.