STRUCT SVS_BANK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct svs_bank β€” the svs bank representation, bestie πŸ’–

(also hi, this page is part of the Kernel API Manual, section 9 β€” we love a credentialed icon πŸ‘‘)


🌸 SYNOPSIS 🌸

okay so here's the whole struct, literally the entire vibe, copy-pasted exactly because we do NOT fumble the details:

struct svs_bank {
    const struct svs_bank_pdata pdata;
    struct device *dev;
    struct device *opp_dev;
    struct completion init_completion;
    struct regulator *buck;
    struct thermal_zone_device *tzd;
    struct mutex lock;
    int pm_runtime_enabled_count;
    short int volt_od;
    char *name;
    enum svsb_phase phase;
    u32 reg_data[SVSB_PHASE_MAX][SVS_REG_MAX];
    u8 mode_support;
    u32 opp_dfreq[MAX_OPP_ENTRIES];
    u32 opp_dvolt[MAX_OPP_ENTRIES];
    u32 freq_pct[MAX_OPP_ENTRIES];
    u32 volt[MAX_OPP_ENTRIES];
    u32 volt_flags;
    u32 freq_base;
    u32 turn_pt;
    u32 vbin_turn_pt;
    u32 core_sel;
    u32 temp;
    u16 age_voffset_in;
    u16 dc_voffset_in;
    u8 dvt_fixed;
    u8 vmax;
    u8 vmin;
    u16 bts;
    u16 mts;
    u16 bdes;
    u16 mdes;
    u8 mtdes;
    u8 dcbdet;
    u8 dcmdet;
 };

πŸ¦‹ Members πŸ¦‹

like a roll call but make it slay πŸ’… β€” every single field, no skips, periodt:

  • pdata β€” SVS Bank immutable config parameters (immutable = do not touch, she is who she is πŸ”’)
  • dev β€” bank device
  • opp_dev β€” device for opp table/buck control
  • init_completion β€” the timeout completion for bank init
  • buck β€” regulator used by opp_dev
  • tzd β€” thermal zone device for getting temperature 🌑️
  • lock β€” mutex lock to protect voltage update process (no cutting in line!!)
  • pm_runtime_enabled_count β€” bank pm runtime enabled count
  • volt_od β€” bank voltage overdrive
  • name β€” bank name 🏷️
  • phase β€” bank current phase
  • reg_data β€” bank register data in different phase for debug purpose
  • mode_support β€” bank mode support
  • opp_dfreq β€” default opp frequency table
  • opp_dvolt β€” default opp voltage table
  • freq_pct β€” frequency percent table for bank init
  • volt β€” bank voltage table
  • volt_flags β€” bank voltage flags 🚩
  • freq_base β€” reference frequency for bank init
  • turn_pt β€” 2-line turn point tells which opp_volt calculated by high/low bank
  • vbin_turn_pt β€” voltage bin turn point helps know which svsb_volt should be overridden
  • core_sel β€” bank selection
  • temp β€” bank temperature
  • age_voffset_in β€” bank age voltage offset
  • dc_voffset_in β€” bank dc voltage offset
  • dvt_fixed β€” bank dvt fixed value
  • vmax β€” bank voltage maximum ⬆️
  • vmin β€” bank voltage minimum ⬇️
  • bts β€” svs efuse data
  • mts β€” svs efuse data
  • bdes β€” svs efuse data
  • mdes β€” svs efuse data
  • mtdes β€” svs efuse data
  • dcbdet β€” svs efuse data
  • dcmdet β€” svs efuse data

(and yes, bts, mts, bdes, mdes, mtdes, dcbdet and dcmdet all get the exact same description β€” the manpage said it, so I said it, fr fr πŸ™ˆ)


πŸ’œ Description πŸ’œ

okay so THE lore 🫢 β€” the svs bank generates suitable voltages using this general math equation down below, and then it hands those voltages over to the opp voltage table:

opp_volt[i] = (volt[i] * volt_step) + volt_base;

that's it, that's the whole bit β€” bank makes voltages, opp voltage table receives voltages, everyone claps πŸ‘βœ¨


🌈 SEE ALSO 🌈

go be nosy, the receipts are all here πŸ”₯:

  • Kernel file ./drivers/soc/mediatek/mtk-svs.c
  • enum svsb_sw_id(9)
  • enum svsb_type(9)
  • enum svsb_phase(9)
  • struct svs_platform(9)
  • struct svs_bank_pdata(9)

k bye bestie, go read the source, drink water, and remember: ./drivers/soc/mediatek, October 2026 β€” that's the version + date tea πŸ“πŸ’… mwah πŸŽ€
πŸ“¦ where this page comes from