i2c_new_smbus_alert_device(9)
β¨ i2c_new_smbus_alert_device(9) β¨
okay so this is from the Kernel API Manual bestie, and it's literally all about getting an ara client so your SMBus alert support can actually happen π
πΈ NAME πΈ
i2c_new_smbus_alert_device β get ara client for SMBus alert support
π SYNOPSIS π
struct i2c_client * i2c_new_smbus_alert_device (struct i2c_adapter
*adapter , struct i2c_smbus_alert_setup *setup );
like, it hands you back a struct i2c_client *, no big deal π«Ά
π¦ ARGUMENTS π¦
adapterβ the target adapter π this is the bus you're doing the thing onsetupβ setup data for the SMBus alert handler π the configuration vibes
β CONTEXT β
can sleep π΄ β yes bestie, this one's allowed to nap, so don't go calling it from somewhere rude like an atomic context
π DESCRIPTION π
So the whole point: this sets up handling of the SMBus alert protocol on a given I2C bus segment. that's the assignment and it ate π₯
The handling itself lowkey has options β it can be done either through our IRQ handler, or by the adapter (from its handler, periodic polling, or whatever). adapter's choice, main character energy π
This returns the ara client, which you should absolutely save for later use with i2c_handle_smbus_alert and ultimately i2c_unregister_device β do not lose track of it, that's the whole plot π
Or, alternatively, it returns an ERRPTR to indicate an error π (iykyk β check it, don't just vibe with it).
π§ SEE ALSO π§
Kernel file ./drivers/i2c/i2c-core-smbus.c plus these iconic friends:
i2c_smbus_pec(9)i2c_smbus_read_byte(9)i2c_smbus_write_byte(9)i2c_smbus_read_byte_data(9)i2c_smbus_write_byte_data(9)i2c_smbus_read_word_data(9)i2c_smbus_write_word_data(9)i2c_smbus_read_block_data(9)i2c_smbus_write_block_data(9)i2c_smbus_xfer(9)i2c_smbus_read_i2c_block_data_or_emulated(9)
ngl the only thing you really need to remember: save that returned client, and always check for the ERRPTR before you use it π
that's the whole page bestie, mwah π β sourced from ./drivers/i2c, the Kernel API Manual, dated October 2026, filed under i2c_new_smbus_alert_device(9) ππ
π¦ 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