drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
Source file repositories/reference/linux-study-clean/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c- Extension
.c- Size
- 3760 bytes
- Lines
- 166
- 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.hquickspi-dev.hquickspi-hid.h
Detected Declarations
function quickspi_hid_parsefunction quickspi_hid_startfunction quickspi_hid_stopfunction quickspi_hid_closefunction quickspi_hid_powerfunction quickspi_hid_probefunction quickspi_hid_removefunction quickspi_hid_send_report
Annotated Snippet
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/pm_runtime.h>
#include "quickspi-dev.h"
#include "quickspi-hid.h"
/**
* quickspi_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 quickspi_hid_parse(struct hid_device *hid)
{
struct quickspi_device *qsdev = hid->driver_data;
if (qsdev->report_descriptor)
return hid_parse_report(hid, qsdev->report_descriptor,
le16_to_cpu(qsdev->dev_desc.rep_desc_len));
dev_err(qsdev->dev, "invalid report descriptor\n");
return -EINVAL;
}
static int quickspi_hid_start(struct hid_device *hid)
{
return 0;
}
static void quickspi_hid_stop(struct hid_device *hid)
{
}
static int quickspi_hid_open(struct hid_device *hid)
{
return 0;
}
static void quickspi_hid_close(struct hid_device *hid)
{
}
static int quickspi_hid_raw_request(struct hid_device *hid,
unsigned char reportnum,
__u8 *buf, size_t len,
unsigned char rtype, int reqtype)
{
struct quickspi_device *qsdev = hid->driver_data;
int ret = 0;
ret = pm_runtime_resume_and_get(qsdev->dev);
if (ret)
return ret;
switch (reqtype) {
case HID_REQ_GET_REPORT:
ret = quickspi_get_report(qsdev, rtype, reportnum, buf);
break;
case HID_REQ_SET_REPORT:
ret = quickspi_set_report(qsdev, rtype, reportnum, buf, len);
break;
default:
dev_err_once(qsdev->dev, "Not supported request type %d\n", reqtype);
break;
}
pm_runtime_put_autosuspend(qsdev->dev);
return ret;
}
static int quickspi_hid_power(struct hid_device *hid, int lvl)
{
return 0;
}
static struct hid_ll_driver quickspi_hid_ll_driver = {
.parse = quickspi_hid_parse,
.start = quickspi_hid_start,
.stop = quickspi_hid_stop,
.open = quickspi_hid_open,
.close = quickspi_hid_close,
.power = quickspi_hid_power,
.raw_request = quickspi_hid_raw_request,
};
Annotation
- Immediate include surface: `linux/hid.h`, `linux/input.h`, `linux/pm_runtime.h`, `quickspi-dev.h`, `quickspi-hid.h`.
- Detected declarations: `function quickspi_hid_parse`, `function quickspi_hid_start`, `function quickspi_hid_stop`, `function quickspi_hid_close`, `function quickspi_hid_power`, `function quickspi_hid_probe`, `function quickspi_hid_remove`, `function quickspi_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.