drivers/hid/hid-uclogic-core.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-uclogic-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-uclogic-core.c- Extension
.c- Size
- 17785 bytes
- Lines
- 653
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/hid.hlinux/module.hlinux/timer.husbhid/usbhid.hhid-uclogic-params.hhid-ids.hhid-uclogic-core-test.c
Detected Declarations
function uclogic_inrange_timeoutfunction uclogic_input_mappingfunction uclogic_input_configuredfunction uclogic_probefunction uclogic_resumefunction uclogic_exec_event_hookfunction list_for_each_entryfunction errorfunction errorfunction uclogic_raw_eventfunction uclogic_remove
Annotated Snippet
if (key < ARRAY_SIZE(uclogic_extra_input_mapping)) {
hid_map_usage(hi,
usage,
bit,
max,
EV_KEY,
uclogic_extra_input_mapping[key]);
return 1;
}
} else if (field->application == HID_DG_PEN) {
/* Discard invalid pen usages */
if (params->pen.usage_invalid)
return -1;
}
/* Let hid-core decide what to do */
return 0;
}
static int uclogic_input_configured(struct hid_device *hdev,
struct hid_input *hi)
{
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
struct uclogic_params *params = &drvdata->params;
const char *suffix = NULL;
struct hid_field *field;
size_t i;
const struct uclogic_params_frame *frame;
/* no report associated (HID_QUIRK_MULTI_INPUT not set) */
if (!hi->report)
return 0;
/*
* If this is the input corresponding to the pen report
* in need of tweaking.
*/
if (hi->report->id == params->pen.id) {
/* Remember the input device so we can simulate events */
drvdata->pen_input = hi->input;
}
/* If it's one of the frame devices */
for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) {
frame = ¶ms->frame_list[i];
if (hi->report->id == frame->id) {
/* Assign custom suffix, if any */
suffix = frame->suffix;
/*
* Disable EV_MSC reports for touch ring interfaces to
* make the Wacom driver pickup touch ring extents
*/
if (frame->touch_byte > 0)
__clear_bit(EV_MSC, hi->input->evbit);
}
}
if (!suffix) {
field = hi->report->field[0];
switch (field->application) {
case HID_GD_KEYBOARD:
suffix = "Keyboard";
break;
case HID_GD_MOUSE:
suffix = "Mouse";
break;
case HID_GD_KEYPAD:
suffix = "Pad";
break;
case HID_DG_PEN:
case HID_DG_DIGITIZER:
suffix = "Pen";
break;
case HID_CP_CONSUMER_CONTROL:
suffix = "Consumer Control";
break;
case HID_GD_SYSTEM_CONTROL:
suffix = "System Control";
break;
}
}
if (suffix) {
hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
"%s %s", hdev->name, suffix);
if (!hi->input->name)
return -ENOMEM;
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/hid.h`, `linux/module.h`, `linux/timer.h`, `usbhid/usbhid.h`, `hid-uclogic-params.h`, `hid-ids.h`, `hid-uclogic-core-test.c`.
- Detected declarations: `function uclogic_inrange_timeout`, `function uclogic_input_mapping`, `function uclogic_input_configured`, `function uclogic_probe`, `function uclogic_resume`, `function uclogic_exec_event_hook`, `function list_for_each_entry`, `function error`, `function error`, `function uclogic_raw_event`.
- 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.