STRUCT BH1770_PLATFORM_DATA(9)
π struct bh1770_platform_data(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page for struct bh1770_platform_data, and it's literally the platform data for the bh1770glc driver π¦ pull up a chair, this one's short and sweet.
β¨ NAME β¨
struct bh1770_platform_data β platform data for bh1770glc driver
πΈ SYNOPSIS πΈ
struct bh1770_platform_data {
#define BH1770_LED_5mA 0;
#define BH1770_LED_10mA 1;
#define BH1770_LED_20mA 2;
#define BH1770_LED_50mA 3;
#define BH1770_LED_100mA 4;
#define BH1770_LED_150mA 5;
#define BH1770_LED_200mA 6;
__u8 led_def_curr;
#define BH1770_NEUTRAL_GA 16384 ;
__u32 glass_attenuation;
int (*setup_resources)(void);
int (*release_resources)(void);
};
like yes, the #defines are inside the struct body in this listing β that's exactly how it's written here, don't come for me, I'm just the messenger π
π Members π
led_def_currβ the IR led driving current. that's it, that's the whole vibe. π₯glass_attenuationβ the attenuation factor for the covering window. iykyk, glass in front of your sensor changes the numbers πsetup_resourcesβ call back for interrupt line setup function π«Άrelease_resourcesβ call back for interrupte line release function π (yes, "interrupte" β that's genuinely what the page says, I'm not fixing it, lowkey iconic)
β Description β
here's the example for glass_attenuation, and ngl it's the only example so pay attention bestie:
16384 * 385 / 100means attenuation factor of3.85.
i.e.
light_above_sensor = light_above_cover_window / 3.85
so the light reading above the sensor is the light above the cover window divided by 3.85 β fr fr, that's the whole point of the factor. β¨
π SEE ALSO π
- Kernel file
./include/linux/platform_data/bh1770glc.h
and that's the page, bestie, you ate that ππΈ
cute little sign-off: this one lives in ./include/linux/platform_data, dated October 2026, and it's struct bh1770_platform_data(9) all the way down ππ
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