STRUCT LPG(9)
πΈ struct lpg(9) β LPG device context πΈ
okay bestie, so this is a page from the Kernel API Manual (that's the 9 in struct lpg(9), iykyk) and it's literally just the β¨ anatomy β¨ of struct lpg β the LPG device context. no cap, it's a whole vibe check of a struct, so let's get into it π
β¨ NAME β¨
struct lpg β the LPG device context π«Ά
π¦ SYNOPSIS π¦
here's the whole thing, character for character, don't touch it, she's perfect:
struct lpg {
struct device *dev;
struct regmap *map;
struct mutex lock;
struct pwm_chip *pwm;
const struct lpg_data *data;
u32 lut_base;
u32 lut_size;
unsigned long *lut_bitmap;
struct pbs_dev *pbs_dev;
struct nvmem_device *lpg_chan_sdam;
struct nvmem_device *lut_sdam;
unsigned long pbs_en_bitmap;
u32 triled_base;
u32 triled_src;
bool triled_has_atc_ctl;
bool triled_has_src_sel;
unsigned int num_channels;
struct lpg_channel channels[];
};
π Members π
okay so each of these fields is kind of a main character in her own right, so let's introduce them one by one, no skips, no cuts π
π the basics
devβ pointer to the LPG device πmapβ the regmap used for register access, so she can actually talk to the hardwarelockβ used to synchronize LED and pwm callback requests π (yes, you need it, don't skip it)pwmβ the PWM-chip object β but only if she's operating in PWM mode β¨dataβ a reference to the version specific data (every version's got her own lore, fr fr)
π the LUT block (optional, but iconic)
lut_baseβ base address of the LUT block β and yes it's optional πlut_sizeβ number of entries in the LUT blocklut_bitmapβ the allocation bitmap for LUT entries
π the SDAM + PBS corner
pbs_devβ the PBS devicelpg_chan_sdamβ the LPG SDAM peripheral devicelut_sdamβ the LUT SDAM peripheral devicepbs_en_bitmapβ a bitmap for tracking PBS triggers π
π§ the TRILED block (also optional, also iconic)
triled_baseβ base address of the TRILED block β optional, just like LUT πtriled_srcβ the power-source for the TRILEDtriled_has_atc_ctlβtrueif there's aTRI_LED_ATC_CTLregistertriled_has_src_selβtrueif there's aTRI_LED_SRC_SELregister
β the channels
num_channelsβ number of channelschannelsβ the list of PWM channels π« (she's a flexible array member, she grows, she's literally that girl)
π₯ SEE ALSO π₯
Kernel file ./drivers/leds/rgb/leds-qcom-lpg.c, struct lpg_channel(9), struct lpg_led(9), struct lpg_channel_data(9), struct lpg_data(9)
okay that's the whole page, bestie, you ate that π«Ά go forth and read the source (it lives in ./drivers/leds/rgb, naur literally) β this drop is dated October 2026, so like, future knowledge, 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