STRUCT INTEL_TH_DRIVER(9)
π struct intel_th_driver β the manual page, but make it make sense
okay so bestie, this is struct intel_th_driver(9) straight out of the Kernel API Manual, section 9, and it's genuinely the blueprint for "driver for an intel_th_device device". Think of it as the personality sheet a driver fills out so the intel_th core knows how to talk to it. Obsessed. Let's go π
β¨ SYNOPSIS β¨
here's the whole struct, character for character, no edits from me fr fr:
struct intel_th_driver {
struct device_driver driver;
int (*probe)(struct intel_th_device *thdev);
void (*remove)(struct intel_th_device *thdev);
int (*assign)(struct intel_th_device *thdev, struct intel_th_device *othdev);
void (*unassign)(struct intel_th_device *thdev, struct intel_th_device *othdev);
void (*prepare)(struct intel_th_device *thdev, struct intel_th_output *output);
void (*enable)(struct intel_th_device *thdev, struct intel_th_output *output);
void (*trig_switch)(struct intel_th_device *thdev, struct intel_th_output *output);
void (*disable)(struct intel_th_device *thdev, struct intel_th_output *output);
irqreturn_t (*irq)(struct intel_th_device *thdev);
void (*wait_empty)(struct intel_th_device *thdev);
int (*activate)(struct intel_th_device *thdev);
void (*deactivate)(struct intel_th_device *thdev);
const struct file_operations *fops;
const struct attribute_group *attr_group;
int (*set_output)(struct intel_th_device *thdev, unsigned int master);
};
πΈ MEMBERS πΈ
okay so every single member, with the exact vibes the page gives it β including the ones the page literally doesn't describe (not me inventing lore π):
driverβ the generic driver. that's it, that's the whole description πprobeβ probe method β¨removeβ remove method β¨assignβ match a given output type device against available outputsunassignβ deassociate an output type device from an output portprepareβ prepare output port for tracingenableβ enable tracing for a given output devicedisableβ disable tracing for a given output deviceirqβ interrupt callbackactivateβ enable tracing on the output's sidedeactivateβ disable tracing on the output's sidefopsβ file operations for device nodesattr_groupβ attributes provided by the drivertrig_switchβ bestie, the page gives this one no description at all, so I'm not gonna make one up π€·wait_emptyβ same situation, no description on the page πΈset_outputβ also undescribed on this page, takingstruct intel_th_device *thdevandunsigned int master. no cap, that's all we get π«Ά
real talk:trig_switch,wait_emptyandset_outputare in the struct but the Members section doesn't spell them out. I'm telling you exactly as much as the page tells you, nothing more π
π¦ DESCRIPTION π¦
so like, here's the actual rules of the game:
Callbacks probe and remove are required for all device types. literally all of them, no skipping π
A switch device driver needs to fill in the assign, enable and disable callbacks. those three, specifically. main character requirements only π
π SEE ALSO π
go read these next, iykyk:
- Kernel file
./drivers/hwtracing/intel_th/intel_th.h struct intel_th_output(9)struct intel_th_drvdata(9)struct intel_th_device(9)intel_th_device_get_resource(9)intel_th_output_assigned(9)struct intel_th(9)
and that's the page!! π this one lives down in ./drivers/hwtracing/intel_th, dated October 2026 β so like, future-core of it. slay, go write a driver bestie ππ¦β
π¦ 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