A computing device comprising: an operating system to: issue a sleep command to place the computing device in a sleep state in response to the computing device receiving a source command, the source command being either a power off command or a sleep command; write contents of memory of the computing device to non-volatile storage of the computing device; wherein the issuance of the sleep command includes writing a sleep state indicator to a first register, wherein the first register is a command register of the operating system where sleep commands are written; and invoke a prepare-to-sleep, PTS, method in response to the computing device receiving the source command if being a sleep command for the computing device, wherein the operating system does not invoke the PTS method in response to the computing device receiving the source command being a power off command for the computing device; a controller to: receive the sleep command from the operating system; in response to receipt of the sleep command from the operating system, issue a power off command to place the computing device in a power off state in response to determining that the source command having triggered the issuance of the sleep command from the operating system is a power off command for the computing device; wherein the controller comprises logic to determine whether the PTS method, which indicates whether the source command is a sleep command or a power off command, is invoked by the operating system, wherein the controller is to write a power off state indicator to a second register when the PTS method is not invoked, wherein the second register indicates the power state to be executed or implemented. an operating system to: issue a sleep command to place the computing device in a sleep state in response to the computing device receiving a source command, the source command being either a power off command or a sleep command; write contents of memory of the computing device to non-volatile storage of the computing device; wherein the issuance of the sleep command includes writing a sleep state indicator to a first register, wherein the first register is a command register of the operating system where sleep commands are written; and invoke a prepare-to-sleep, PTS, method in response to the computing device receiving the source command if being a sleep command for the computing device, wherein the operating system does not invoke the PTS method in response to the computing device receiving the source command being a power off command for the computing device; issue a sleep command to place the computing device in a sleep state in response to the computing device receiving a source command, the source command being either a power off command or a sleep command; write contents of memory of the computing device to non-volatile storage of the computing device; wherein the issuance of the sleep command includes writing a sleep state indicator to a first register, wherein the first register is a command register of the operating system where sleep commands are written; and invoke a prepare-to-sleep, PTS, method in response to the computing device receiving the source command if being a sleep command for the computing device, wherein the operating system does not invoke the PTS method in response to the computing device receiving the source command being a power off command for the computing device; a controller to: receive the sleep command from the operating system; in response to receipt of the sleep command from the operating system, issue a power off command to place the computing device in a power off state in response to determining that the source command having triggered the issuance of the sleep command from the operating system is a power off command for the computing device; wherein the controller comprises logic to determine whether the PTS method, which indicates whether the source command is a sleep command or a power off command, is invoked by the operating system, wherein the controller is to write a power off state indicator to a second register when the PTS method is not invoked, wherein the second register indicates the power state to be executed or implemented. receive the sleep command from the operating system; in response to receipt of the sleep command from the operating system, issue a power off command to place the computing device in a power off state in response to determining that the source command having triggered the issuance of the sleep command from the operating system is a power off command for the computing device; wherein the controller comprises logic to determine whether the PTS method, which indicates whether the source command is a sleep command or a power off command, is invoked by the operating system, wherein the controller is to write a power off state indicator to a second register when the PTS method is not invoked, wherein the second register indicates the power state to be executed or implemented.