drivers/mfd/rave-sp.c
Source file repositories/reference/linux-study-clean/drivers/mfd/rave-sp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/rave-sp.c- Extension
.c- Size
- 21494 bytes
- Lines
- 844
- Domain
- Driver Families
- Bucket
- drivers/mfd
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/atomic.hlinux/crc-itu-t.hlinux/delay.hlinux/export.hlinux/init.hlinux/slab.hlinux/kernel.hlinux/mfd/rave-sp.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/sched.hlinux/serdev.hlinux/unaligned.h
Detected Declarations
struct rave_sp_deframerstruct rave_sp_replystruct rave_sp_checksumstruct rave_sp_versionstruct rave_sp_statusstruct rave_sp_variant_cmdsstruct rave_sp_variantstruct rave_spenum rave_sp_deframer_statefunction rave_sp_id_is_eventfunction rave_sp_unregister_event_notifierfunction devm_rave_sp_register_event_notifierfunction csum_8b2cfunction csum_ccittfunction rave_sp_writefunction rave_sp_reply_codefunction rave_sp_execfunction rave_sp_receive_eventfunction rave_sp_receive_replyfunction rave_sp_receive_framefunction rave_sp_receive_buffunction rave_sp_rdu1_cmd_translatefunction rave_sp_rdu2_cmd_translatefunction rave_sp_default_cmd_translatefunction rave_sp_rdu1_get_statusfunction rave_sp_emulated_get_statusfunction rave_sp_get_statusfunction rave_sp_probeexport devm_rave_sp_register_event_notifierexport rave_sp_exec
Annotated Snippet
struct rave_sp_deframer {
enum rave_sp_deframer_state state;
unsigned char data[RAVE_SP_RX_BUFFER_SIZE];
size_t length;
};
/**
* struct rave_sp_reply - Reply as per RAVE device protocol
*
* @length: Expected reply length
* @data: Buffer to store reply payload in
* @code: Expected reply code
* @ackid: Expected reply ACK ID
* @received: Successful reply reception completion
*/
struct rave_sp_reply {
size_t length;
void *data;
u8 code;
u8 ackid;
struct completion received;
};
/**
* struct rave_sp_checksum - Variant specific checksum implementation details
*
* @length: Calculated checksum length
* @subroutine: Utilized checksum algorithm implementation
*/
struct rave_sp_checksum {
size_t length;
void (*subroutine)(const u8 *, size_t, u8 *);
};
struct rave_sp_version {
u8 hardware;
__le16 major;
u8 minor;
u8 letter[2];
} __packed;
struct rave_sp_status {
struct rave_sp_version bootloader_version;
struct rave_sp_version firmware_version;
u16 rdu_eeprom_flag;
u16 dds_eeprom_flag;
u8 pic_flag;
u8 orientation;
u32 etc;
s16 temp[2];
u8 backlight_current[3];
u8 dip_switch;
u8 host_interrupt;
u16 voltage_28;
u8 i2c_device_status;
u8 power_status;
u8 general_status;
u8 deprecated1;
u8 power_led_status;
u8 deprecated2;
u8 periph_power_shutoff;
} __packed;
/**
* struct rave_sp_variant_cmds - Variant specific command routines
*
* @translate: Generic to variant specific command mapping routine
* @get_status: Variant specific implementation of CMD_GET_STATUS
*/
struct rave_sp_variant_cmds {
int (*translate)(enum rave_sp_command);
int (*get_status)(struct rave_sp *sp, struct rave_sp_status *);
};
/**
* struct rave_sp_variant - RAVE supervisory processor core variant
*
* @checksum: Variant specific checksum implementation
* @cmd: Variant specific command pointer table
*
*/
struct rave_sp_variant {
const struct rave_sp_checksum *checksum;
struct rave_sp_variant_cmds cmd;
};
/**
* struct rave_sp - RAVE supervisory processor core
*
* @serdev: Pointer to underlying serdev
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/crc-itu-t.h`, `linux/delay.h`, `linux/export.h`, `linux/init.h`, `linux/slab.h`, `linux/kernel.h`, `linux/mfd/rave-sp.h`.
- Detected declarations: `struct rave_sp_deframer`, `struct rave_sp_reply`, `struct rave_sp_checksum`, `struct rave_sp_version`, `struct rave_sp_status`, `struct rave_sp_variant_cmds`, `struct rave_sp_variant`, `struct rave_sp`, `enum rave_sp_deframer_state`, `function rave_sp_id_is_event`.
- Atlas domain: Driver Families / drivers/mfd.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.