Where is the correct place in the kernel to add platform-specific halt and power-off

359 Views Asked by At

I'm writing a platform-specific multi-function device driver, which includes an i2c driver.

I want to send an i2c message to a custom power-management chip, when the Linux kernel is halted or powered-off.

I've tried pm_power_off = my_func to override the power off function, but it doesn't get called. (my_func does a printk and pr_emerg to try and get some text to the console during shutdown.)

What are the correct hooks to use to add functionality to kernel halt and power off? (I'd rather add code to my driver, rather than patch kernel/reboot.c etc.)

0

There are 0 best solutions below