STRUCT BH1770_PLATFORM_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 / 100 means attenuation factor of 3.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