STRUCT OMAP_HWMOD_CLASS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct omap_hwmod_class(9) πŸ’–

Okay so this is from the Kernel API Manual, bestie β€” and it’s literally the blueprint for the type of an IP block. Let’s get into it 🫢✨

πŸŽ€ NAME πŸŽ€

struct omap_hwmod_class β€” the type of an IP block πŸ’…

✨ SYNOPSIS ✨

struct omap_hwmod_class {
    const char                              *name;
    struct omap_hwmod_class_sysconfig       *sysc;
    int (*pre_shutdown)(struct omap_hwmod *oh);
    int (*reset)(struct omap_hwmod *oh);
    void (*lock)(struct omap_hwmod *oh);
    void (*unlock)(struct omap_hwmod *oh);
};

πŸ’… Members πŸ’…

Here’s the cast of this struct, no cap πŸŽ€

  • name β€” name of the hwmod_class ✨
  • sysc β€” device SYSCONFIG/SYSSTATUS register data πŸŽ€
  • pre_shutdown β€” ptr to fn to be executed immediately prior to device shutdown 🫢
  • reset β€” ptr to fn to be executed in place of the standard hwmod reset fn πŸ”
  • lock β€” ptr to fn to be executed to lock IP registers πŸ”’
  • unlock β€” ptr to fn to be executed to unlock IP registers πŸ”“

🌈 Description 🌈

This represents the class of an OMAP hardware β€œmodules” situation β€” think timer, smartreflex, gpio, uart... πŸ‘‘ It’s giving β€œblueprint for a whole category of hardware blocks,” periodt.

pre_shutdown is a function that will be run immediately before hwmod clocks are disabled, etc. It’s intended for use for hwmods like the MPU watchdog, which cannot be disabled with the standard omap_hwmod_shutdown. The function should return 0 upon success, or some negative error upon failure. Returning an error will cause omap_hwmod_shutdown to abort the device shutdown and return an error πŸ’€

If reset is defined, then the function it points to will be executed in place of the standard hwmod _reset code in mach-omap2/omap_hwmod.c. This is needed for IP blocks which have unusual reset sequences β€” usually processor IP blocks like the IVA. So yeah, custom reset main character energy πŸ”βœ¨

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./arch/arm/mach-omap2/omap_hwmod.h
  • struct omap_hwmod_rst_info(9)
  • struct omap_hwmod_opt_clk(9)
  • struct omap_hwmod_omap2_firewall(9)
  • struct omap_hwmod_ocp_if(9)
  • struct omap_hwmod_class_sysconfig(9)
  • struct omap_hwmod_omap2_prcm(9)
  • struct omap_hwmod_omap4_prcm(9)
  • struct omap_hwmod(9)

Source check, bestie: ./arch/arm/mach-omap2 β€” date: October 2026 β€” manual page: struct omap_hwmod_class(9). That’s the whole thing, mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from