STRUCT NVEC_CHIP(9)
π struct nvec_chip(9) π
okay so bestie, welcome to the Kernel API Manual β yes we're reading kernel docs together, this is our era now π
β¨ NAME β¨
struct nvec_chip β literally a single connection to an NVIDIA Embedded controller. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
struct nvec_chip {
struct device *dev;
struct gpio_desc *gpiod;
int irq;
u32 i2c_addr;
void __iomem *base;
struct clk *i2c_clk;
struct reset_control *rst;
struct atomic_notifier_head notifier_list;
struct list_head rx_data, tx_data;
struct notifier_block nvec_status_notifier;
struct work_struct rx_work, tx_work;
struct workqueue_struct *wq;
struct nvec_msg msg_pool[NVEC_POOL_SIZE];
struct nvec_msg *rx;
struct nvec_msg *tx;
struct nvec_msg tx_scratch;
struct completion ec_transfer;
spinlock_t tx_lock, rx_lock;
struct mutex sync_write_mutex;
struct completion sync_write;
u16 sync_write_pending;
struct nvec_msg *last_sync_msg;
int state;
};
no cap, that's the whole struct. we love a comprehensive field list π
π«Ά Members π«Ά
okay so here's the field-by-field tea, and every single one matters:
devβ The device. main character energy, honestly πirqβ The IRQ of the I2C device. that's the interrupt line, she's always ringing π₯i2c_addrβ The address of the I2C slave. where you gotta talk to reach her β¨baseβ The base of the memory mapped region of the I2C device.i2c_clkβ The clock of the I2C device. keep her ticking πrstβ The reset of the I2C device. sometimes you gotta start over, and that's okay πnotifier_listβ Notifiers to be called on received messages, seenvec_register_notifier. it's giving group chat notification settings π¦rx_dataβ Received messages that have to be processed. the inbox, basically π₯tx_dataβ Messages waiting to be sent to the controller. the outbox, and yes they're waiting patiently π₯Ίnvec_status_notifierβ Internal notifier (seenvec_status_notifier). an internal notifier! iykyk πΈrx_workβ A work structure for the RX workernvec_dispatch.tx_workβ A work structure for the TX workernvec_request_master.wqβ The work queue in whichrx_workandtx_workare executed. the stage where both workers perform βmsg_poolβ A pool of messages for allocation. grab one, it's free real estate πrxβ The message currently being retrieved orNULL. could be a message, could be nothing, she's mysterious πtxβ The message currently being transferred.tx_scratchβ Used for building pseudo messages. arts and crafts but for the kernel π¨ec_transferβ A completion that will be completed once a message has been received (seenvec_rx_completed). we wait, then we slay π§tx_lockβ Spinlock for modifications ontx_data.rx_lockβ Spinlock for modifications onrx_data. two separate locks, no sharing, we respect boundaries β¨sync_write_mutexβ A mutex fornvec_write_sync.sync_writeβ A completion to signal that a synchronous message is complete.sync_write_pendingβ The first two bytes of the request (type and subtype). just the first two bytes, that's all she needs πlast_sync_msgβ The last synchronous message. keeping receipts πstateβ State of our finite state machine used innvec_interrupt. yes we have states, yes we're a whole machine π₯
π¦ SEE ALSO π¦
like please go read these too, they're all in the Kernel file ./drivers/staging/nvec/nvec.h:
enum nvec_event_size(9)enum nvec_msg_type(9)struct nvec_msg(9)
bestie reminder: the actual source lives at ./drivers/staging/nvec, version date October 2026 β go peek at the real thing whenever, the docs will still be here π«Ά
and that's the page!! struct nvec_chip(9), documented, iconique, periodt πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms