drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
Source file repositories/reference/linux-study-clean/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c- Extension
.c- Size
- 4038 bytes
- Lines
- 175
- 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.hlinux/input.hlinux/pm_runtime.hquicki2c-dev.hquicki2c-hid.hquicki2c-protocol.h
Detected Declarations
function quicki2c_hid_parsefunction quicki2c_hid_startfunction quicki2c_hid_stopfunction quicki2c_hid_closefunction quicki2c_hid_powerfunction quicki2c_hid_output_reportfunction quicki2c_hid_probefunction quicki2c_hid_removefunction quicki2c_hid_send_report
Annotated Snippet
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/pm_runtime.h>
#include "quicki2c-dev.h"
#include "quicki2c-hid.h"
#include "quicki2c-protocol.h"
/**
* quicki2c_hid_parse() - HID core parse() callback
*
* @hid: HID device instance
*
* This function gets called during call to hid_add_device
*
* Return: 0 on success and non zero on error.
*/
static int quicki2c_hid_parse(struct hid_device *hid)
{
struct quicki2c_device *qcdev = hid->driver_data;
if (qcdev->report_descriptor)
return hid_parse_report(hid, qcdev->report_descriptor,
le16_to_cpu(qcdev->dev_desc.report_desc_len));
dev_err_once(qcdev->dev, "invalid report descriptor\n");
return -EINVAL;
}
static int quicki2c_hid_start(struct hid_device *hid)
{
return 0;
}
static void quicki2c_hid_stop(struct hid_device *hid)
{
}
static int quicki2c_hid_open(struct hid_device *hid)
{
return 0;
}
static void quicki2c_hid_close(struct hid_device *hid)
{
}
static int quicki2c_hid_raw_request(struct hid_device *hid,
unsigned char reportnum,
__u8 *buf, size_t len,
unsigned char rtype, int reqtype)
{
struct quicki2c_device *qcdev = hid->driver_data;
int ret = 0;
ret = pm_runtime_resume_and_get(qcdev->dev);
if (ret)
return ret;
switch (reqtype) {
case HID_REQ_GET_REPORT:
ret = quicki2c_get_report(qcdev, rtype, reportnum, buf, len);
break;
case HID_REQ_SET_REPORT:
ret = quicki2c_set_report(qcdev, rtype, reportnum, buf, len);
break;
default:
dev_err(qcdev->dev, "Not supported request type %d\n", reqtype);
break;
}
pm_runtime_put_autosuspend(qcdev->dev);
return ret;
}
static int quicki2c_hid_power(struct hid_device *hid, int lvl)
{
return 0;
}
static int quicki2c_hid_output_report(struct hid_device *hid, u8 *buf, size_t count)
{
struct quicki2c_device *qcdev = hid->driver_data;
return quicki2c_output_report(qcdev, buf, count);
}
static struct hid_ll_driver quicki2c_hid_ll_driver = {
.parse = quicki2c_hid_parse,
Annotation
- Immediate include surface: `linux/hid.h`, `linux/input.h`, `linux/pm_runtime.h`, `quicki2c-dev.h`, `quicki2c-hid.h`, `quicki2c-protocol.h`.
- Detected declarations: `function quicki2c_hid_parse`, `function quicki2c_hid_start`, `function quicki2c_hid_stop`, `function quicki2c_hid_close`, `function quicki2c_hid_power`, `function quicki2c_hid_output_report`, `function quicki2c_hid_probe`, `function quicki2c_hid_remove`, `function quicki2c_hid_send_report`.
- 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.