STRUCT SMB347_CHARGER(9)
NAME π
okay so this page is literally about struct smb347_charger β the smb347 charger instance β and we're deep in the Kernel API Manual rn. bestie this is the struct that holds all the charger's main-character data, and every field is below, no cap. π
SYNOPSIS β¨
bestie here's the whole struct, exact vibes, do not come for the semicolons:
struct smb347_charger {
struct device *dev;
struct regmap *regmap;
struct power_supply *mains;
struct power_supply *usb;
struct regulator_dev *usb_rdev;
unsigned int id;
bool mains_online;
bool usb_online;
bool irq_unsupported;
bool usb_vbus_enabled;
unsigned int max_charge_current;
unsigned int max_charge_voltage;
unsigned int pre_charge_current;
unsigned int termination_current;
unsigned int pre_to_fast_voltage;
unsigned int mains_current_limit;
unsigned int usb_hc_current_limit;
unsigned int chip_temp_threshold;
int soft_cold_temp_limit;
int soft_hot_temp_limit;
int hard_cold_temp_limit;
int hard_hot_temp_limit;
bool suspend_on_hard_temp_limit;
unsigned int soft_temp_limit_compensation;
unsigned int charge_current_compensation;
bool use_mains;
bool use_usb;
bool use_usb_otg;
unsigned int enable_control;
unsigned int inok_polarity;
};
Members π«Ά
okay so every member gets its moment, periodt:
devβ pointer to device, aka the device this charger situation belongs to.regmapβ pointer to driver regmap, the register-map hookup.mainsβpower_supplyinstance for AC/DC power.usbβpower_supplyinstance for USB power.usb_rdevβ USB VBUS regulator device, iconic.idβ SMB charger ID.mains_onlineβ is AC/DC input connected.usb_onlineβ is USB input connected.irq_unsupportedβ is interrupt unsupported by SMB hardware.usb_vbus_enabledβ is USB VBUS powered by SMB charger.max_charge_currentβ maximum current (in uA) the battery can be charged.max_charge_voltageβ maximum voltage (in uV) the battery can be charged.pre_charge_currentβ current (in uA) to use in pre-charging phase.termination_currentβ current (in uA) used to determine when the charging cycle terminates.pre_to_fast_voltageβ voltage (in uV)tresholdused for transitioning to pre-charge to fast charge mode.mains_current_limitβ maximum input current drawn from AC/DC input (in uA).usb_hc_current_limitβ maximum input high current (in uA) drawn from USB input.chip_temp_thresholdβ die temperature where device starts limiting charge current[100 - 130](in degree C).soft_cold_temp_limitβ soft cold temperature limit[0 - 15](in degree C), granularity is 5 deg C.soft_hot_temp_limitβ soft hot temperature limit[40 - 55](in degree C), granularity is 5 deg C.hard_cold_temp_limitβ hard cold temperature limit[-5 - 10](in degree C), granularity is 5 deg C.hard_hot_temp_limitβ hard hot temperature limit[50 - 65](in degree C), granularity is 5 deg C.suspend_on_hard_temp_limitβ suspend charging when hard limit is hit.soft_temp_limit_compensationβ compensation method when soft temperature limit is hit.charge_current_compensationβ current (in uA) for charging compensation current when temperature hits soft limits.use_mainsβ AC/DC input can be used.use_usbβ USB input can be used.use_usb_otgβ USB OTG output can be used (not implemented yet).enable_controlβ how charging enable/disable is controlled (driver/pin controls).inok_polarityβ polarity of INOK signal which denotes presence of external power supply.
Description πΈ
okay so use_main, use_usb, and use_usb_otg are means to enable/disable hardware support for these. This is useful when we want to have for example OTG charging controlled via OTG transceiver driver and not by the SMB347 hardware.
Hard and soft temperature limit values are given as described in the device data sheet and assuming NTC beta value is 3750. Even if this is not the case, these values should be used. They can be mapped to the corresponding NTC beta values with the help of table 2 in the data sheet. So for example if NTC beta is 3375 and we want to program hard hot limit to be 53 deg C, hard_hot_temp_limit should be set to 50.
bestie the temp-limit numbers are datasheet-coded like that on purpose β even when your NTC beta isn't 3750, you still use these values, fr fr. π«Ά
If zero value is given in any of the current and voltage values, the factory programmed default will be used. For soft/hard temperature values, pass in SMB3XX_TEMP_USE_DEFAULT instead.
SEE ALSO π¦
- Kernel file
./drivers/power/supply/smb347-charger.c smb347_update_ps_status(9)smb347_charging_status(9)
okay bestie that's the whole page π this one lives in ./drivers/power/supply, is dated October 2026, and is literally struct smb347_charger(9) β go forth and slay your charger config, mwah π
β¨
π¦ 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