drivers/platform/cznic/turris-omnia-mcu.h
Source file repositories/reference/linux-study-clean/drivers/platform/cznic/turris-omnia-mcu.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/cznic/turris-omnia-mcu.h- Extension
.h- Size
- 5087 bytes
- Lines
- 164
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/gpio/driver.hlinux/hw_random.hlinux/if_ether.hlinux/interrupt.hlinux/mutex.hlinux/types.hlinux/watchdog.hlinux/workqueue.h
Detected Declarations
struct i2c_clientstruct rtc_devicestruct omnia_mcufunction omnia_mcu_register_gpiochipfunction omnia_mcu_register_keyctlfunction omnia_mcu_register_sys_off_and_wakeupfunction omnia_mcu_register_trngfunction omnia_mcu_register_watchdog
Annotated Snippet
struct omnia_mcu {
struct i2c_client *client;
const char *type;
u32 features;
u64 board_serial_number;
u8 board_first_mac[ETH_ALEN];
u8 board_revision;
#ifdef CONFIG_TURRIS_OMNIA_MCU_GPIO
struct gpio_chip gc;
struct mutex lock;
unsigned long mask, rising, falling, both, cached, is_cached;
struct delayed_work button_release_emul_work;
unsigned long last_status;
bool button_pressed_emul;
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_SYSOFF_WAKEUP
struct rtc_device *rtcdev;
u32 rtc_alarm;
bool front_button_poweron;
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_WATCHDOG
struct watchdog_device wdt;
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_TRNG
struct hwrng trng;
struct completion trng_entropy_ready;
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_KEYCTL
struct completion msg_signed;
struct mutex sign_lock;
bool sign_requested;
int sign_err;
u8 signature[OMNIA_MCU_CRYPTO_SIGNATURE_LEN];
u8 board_public_key[OMNIA_MCU_CRYPTO_PUBLIC_KEY_LEN];
#endif
};
#ifdef CONFIG_TURRIS_OMNIA_MCU_GPIO
extern const struct attribute_group omnia_mcu_gpio_group;
int omnia_mcu_register_gpiochip(struct omnia_mcu *mcu);
int omnia_mcu_request_irq(struct omnia_mcu *mcu, u32 spec,
irq_handler_t thread_fn, const char *devname);
#else
static inline int omnia_mcu_register_gpiochip(struct omnia_mcu *mcu)
{
return 0;
}
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_KEYCTL
int omnia_mcu_register_keyctl(struct omnia_mcu *mcu);
#else
static inline int omnia_mcu_register_keyctl(struct omnia_mcu *mcu)
{
return 0;
}
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_SYSOFF_WAKEUP
extern const struct attribute_group omnia_mcu_poweroff_group;
int omnia_mcu_register_sys_off_and_wakeup(struct omnia_mcu *mcu);
#else
static inline int omnia_mcu_register_sys_off_and_wakeup(struct omnia_mcu *mcu)
{
return 0;
}
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_TRNG
int omnia_mcu_register_trng(struct omnia_mcu *mcu);
#else
static inline int omnia_mcu_register_trng(struct omnia_mcu *mcu)
{
return 0;
}
#endif
#ifdef CONFIG_TURRIS_OMNIA_MCU_WATCHDOG
int omnia_mcu_register_watchdog(struct omnia_mcu *mcu);
#else
static inline int omnia_mcu_register_watchdog(struct omnia_mcu *mcu)
{
return 0;
}
Annotation
- Immediate include surface: `linux/completion.h`, `linux/gpio/driver.h`, `linux/hw_random.h`, `linux/if_ether.h`, `linux/interrupt.h`, `linux/mutex.h`, `linux/types.h`, `linux/watchdog.h`.
- Detected declarations: `struct i2c_client`, `struct rtc_device`, `struct omnia_mcu`, `function omnia_mcu_register_gpiochip`, `function omnia_mcu_register_keyctl`, `function omnia_mcu_register_sys_off_and_wakeup`, `function omnia_mcu_register_trng`, `function omnia_mcu_register_watchdog`.
- Atlas domain: Driver Families / drivers/platform.
- 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.