STRUCT HTC_EGPIO_CHIP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct htc_egpio_chip(9) β€” from the Kernel API Manual, bestie

okay so picture this: it's struct htc_egpio_chip, and it's literally just a lil descriptor babe whose whole job is to help create a gpio_chip for a register range. that's the name section, we ate that ✨


🌸 SYNOPSIS 🌸

here's the whole vibe, character for character, no notes:

struct htc_egpio_chip {
    int reg_start;
    int gpio_base;
    int num_gpios;
    unsigned long direction;
    unsigned long initial_values;
 };

(note the closing brace indented by one space β€” that's canon, that's the original, leave her alone πŸŽ€)


πŸ¦‹ Members πŸ¦‹

so like, one by one, here's who's who in this struct:

  • reg_start β€” the index of the first register. like the front door of the register range πŸšͺ
  • gpio_base β€” the gpio number of the first pin in this register range. the origin story of your pins ✨
  • num_gpios β€” how many gpios live in this register range, max BITS_PER_LONG β€” and lowkey the important math: number of registers = DIV_ROUND_UP(num_gpios, reg_width). do NOT forget the formula, it's giving main character energy πŸ”₯
  • direction β€” a bitfield, where '0' = input and '1' = output, πŸ’«
side note bestie: initial_values is right there in the struct too β€” the Members list in this page just doesn't say anything more about it, so i'm not gonna make stuff up πŸ™ˆ

✨ SEE ALSO ✨

  • Kernel file ./include/linux/platform_data/gpio-htc-egpio.h
  • struct htc_egpio_platform_data(9) β€” go read that one next, iykyk 🫢

and that's the whole page, no cap πŸ’– huge shoutout to the source ./include/linux/platform_data and the date stamp October 2026 β€” this page is brought to you by the kernel, the letter struct, and the number BITS_PER_LONG. mwah πŸ’‹ periodt πŸŽ€

πŸ“¦ where this page comes from