drivers/input/rmi4/rmi_f01.c
Source file repositories/reference/linux-study-clean/drivers/input/rmi4/rmi_f01.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/rmi4/rmi_f01.c- Extension
.c- Size
- 19257 bytes
- Lines
- 729
- Domain
- Driver Families
- Bucket
- drivers/input
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/kernel.hlinux/rmi.hlinux/slab.hlinux/uaccess.hlinux/of.hlinux/unaligned.hrmi_driver.h
Detected Declarations
struct f01_basic_propertiesstruct f01_device_controlstruct f01_datafunction rmi_f01_read_propertiesfunction rmi_driver_manufacturer_id_showfunction rmi_driver_dom_showfunction rmi_driver_product_id_showfunction rmi_driver_firmware_id_showfunction rmi_driver_package_id_showfunction rmi_f01_of_probefunction rmi_f01_of_probefunction rmi_f01_probefunction rmi_f01_removefunction rmi_f01_configfunction rmi_f01_suspendfunction rmi_f01_resumefunction rmi_f01_attention
Annotated Snippet
struct f01_basic_properties {
u8 manufacturer_id;
bool has_lts;
bool has_adjustable_doze;
bool has_adjustable_doze_holdoff;
char dom[11]; /* YYYY/MM/DD + '\0' */
u8 product_id[RMI_PRODUCT_ID_LENGTH + 1];
u16 productinfo;
u32 firmware_id;
u32 package_id;
};
/* F01 device status bits */
/* Most recent device status event */
#define RMI_F01_STATUS_CODE(status) ((status) & 0x0f)
/* The device has lost its configuration for some reason. */
#define RMI_F01_STATUS_UNCONFIGURED(status) (!!((status) & 0x80))
/* The device is in bootloader mode */
#define RMI_F01_STATUS_BOOTLOADER(status) ((status) & 0x40)
/* Control register bits */
/*
* Sleep mode controls power management on the device and affects all
* functions of the device.
*/
#define RMI_F01_CTRL0_SLEEP_MODE_MASK 0x03
#define RMI_SLEEP_MODE_NORMAL 0x00
#define RMI_SLEEP_MODE_SENSOR_SLEEP 0x01
#define RMI_SLEEP_MODE_RESERVED0 0x02
#define RMI_SLEEP_MODE_RESERVED1 0x03
/*
* This bit disables whatever sleep mode may be selected by the sleep_mode
* field and forces the device to run at full power without sleeping.
*/
#define RMI_F01_CTRL0_NOSLEEP_BIT BIT(2)
/*
* When this bit is set, the touch controller employs a noise-filtering
* algorithm designed for use with a connected battery charger.
*/
#define RMI_F01_CTRL0_CHARGER_BIT BIT(5)
/*
* Sets the report rate for the device. The effect of this setting is
* highly product dependent. Check the spec sheet for your particular
* touch sensor.
*/
#define RMI_F01_CTRL0_REPORTRATE_BIT BIT(6)
/*
* Written by the host as an indicator that the device has been
* successfully configured.
*/
#define RMI_F01_CTRL0_CONFIGURED_BIT BIT(7)
/**
* struct f01_device_control - controls basic sensor functions
*
* @ctrl0: see the bit definitions above.
* @doze_interval: controls the interval between checks for finger presence
* when the touch sensor is in doze mode, in units of 10ms.
* @wakeup_threshold: controls the capacitance threshold at which the touch
* sensor will decide to wake up from that low power state.
* @doze_holdoff: controls how long the touch sensor waits after the last
* finger lifts before entering the doze state, in units of 100ms.
*/
struct f01_device_control {
u8 ctrl0;
u8 doze_interval;
u8 wakeup_threshold;
u8 doze_holdoff;
};
struct f01_data {
struct f01_basic_properties properties;
struct f01_device_control device_control;
u16 doze_interval_addr;
u16 wakeup_threshold_addr;
u16 doze_holdoff_addr;
bool suspended;
bool old_nosleep;
unsigned int num_of_irq_regs;
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/rmi.h`, `linux/slab.h`, `linux/uaccess.h`, `linux/of.h`, `linux/unaligned.h`, `rmi_driver.h`.
- Detected declarations: `struct f01_basic_properties`, `struct f01_device_control`, `struct f01_data`, `function rmi_f01_read_properties`, `function rmi_driver_manufacturer_id_show`, `function rmi_driver_dom_show`, `function rmi_driver_product_id_show`, `function rmi_driver_firmware_id_show`, `function rmi_driver_package_id_show`, `function rmi_f01_of_probe`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.